Giter VIP home page Giter VIP logo

Comments (4)

lohedges avatar lohedges commented on July 22, 2024

Hi there,

Can you let me know how you ran your restart simulation? Was this re-running the script in exactly the same working directory? There are some checks to determine the current simulation step/state from the openmm.xml file that would be written be a previous simulation, e.g:

# Check for a restart file.
if os.path.isfile('openmm.xml'):
    is_restart = True
    simulation.loadState('openmm.xml')
    if not os.path.isfile('openmm.log'):
        raise IOError('Missing log file: openmm.log')
    with open('openmm.log', 'r') as f:
        lines = f.readlines()                                                                                                                         last_line = lines[-1].split()
        try:
            step = int(last_line[0])
        except:
            raise IOError('Failed to read current integration step from openmm.log')
        simulation.currentStep = step
else:
    is_restart = False

If the xml file is found, then the HILLS file will be appended to, i.e.:

# Create PLUMED compatible HILLS file.
if is_restart:
    file = open('HILLS','a')
else:
    file = open('HILLS','w')
    file.write('#! FIELDS time pp.proj pp.ext sigma_pp.proj sigma_pp.ext height biasf\n')
    file.write('#! SET multivariate false\n')
    file.write('#! SET kerneltype gaussian\n')

If you are just placing the existing HILLS file in new working directory, then it would be overwritten with a new simulation, since the openmm.xml file wouldn't exist. For the Plumed interface using GROMACS as the engine, then the simulation will just pick up where things left off if COLVAR and HILLS files are in the directory. (Plumed has built in logic to work out the current step and append to the file, etc.)

Cheers.

from biosimspace.

rubinanoor9 avatar rubinanoor9 commented on July 22, 2024

I am restarting the simulation in the same working directory where all files exist. For a running job, I ran the "openmm.py" script for 1ns. It generates "openmm.xml" and other files too. Then in the same working directory, I ran the script "openmm_1.py". The HILLS file continues from the bottom of the existing HILLS file, but the problem is that the information is the same as it gave for the first simulation.

Like: If we look at the HILLS files that were printed from the first run,

          0   1.0941329002380371   0.1046111956238747          0.025           0.05   1.6666666666666667            10.0
          2   1.1390472650527954   0.0913796052336693          0.025           0.05   1.5589845958868218            10.0
          4   1.1193915605545044   0.1342792809009552          0.025           0.05   1.5102629025743106            10.0
          6   1.1330074071884155   0.1134344562888145          0.025           0.05   1.4066981973160551            10.0

and the information from the restarting simulation is:

          2   1.1390472650527954   0.0913796052336693          0.025           0.05   1.5589845958868218            10.0
          4   1.1193915605545044   0.1342792809009552          0.025           0.05   1.5102629025743106            10.0
          6   1.1330074071884155   0.1134344562888145          0.025           0.05   1.4066981973160551            10.0

script.zip

from biosimspace.

lohedges avatar lohedges commented on July 22, 2024

Thank you, I'll debug using your script when I next get a chance.

from biosimspace.

lohedges avatar lohedges commented on July 22, 2024

I see the issue. The problem is that the restart functionality assumes that you are continuing from an unfinished simulation. In this case, the calculation of the starting cycle works. However, if you re-run a simulation that has finished then the starting cycle is zeroed, hence what you are seeing in your log file. I'll fix this and push a new commit.

Note that during debugging I've found a few other minor issues, so it appears that you aren't using the latest development version of the code. Also, although the HILLS indices are repeated, I do see different values in the other columns, unlike what you've pasted above. (Perhaps this was a copy/paste issue.)

from biosimspace.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.