Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Automating post equilibrium operations #40

Open
marjanalbooyeh opened this issue Feb 17, 2023 · 4 comments
Open

Automating post equilibrium operations #40

marjanalbooyeh opened this issue Feb 17, 2023 · 4 comments
Assignees

Comments

@marjanalbooyeh
Copy link
Contributor

marjanalbooyeh commented Feb 17, 2023

This issue is devoted to discussions and ideas around post-run operations.
Here is a detailed description of what needs to be done.

Let's discuss the details in this thread and put our suggestions. I will mark some discussion points that I think are worth discussing here.

Once a Signac's job run is finished, we need to perform a few steps automatically:

Step 1: Check Equilibrium

Check whether equilibrium is achieved at the end of the simulation. If not, restart the simulation from the last state point and resume. This cycle will be repeated until the equilibrium is reached.

  • For checking equilibrium condition, probably need to use is_equilibrated method in cmeutils's repo.. (we need to check this function first to make sure it is the right function for our usecase)
  • If not equilibrated, the simulation object must be recreated with restart=True. This will resume the system from last snapshot. Call sim.run(...) to resume the run.

Implementation details:

  • Equilibrium check step can be done somewhere in signac's sample() method in project.py. We can discuss the implementation details (discussion number 1). My suggestion is either using a while loop conditioned on the equilibrium state or a for loop with a cap on the number of run attempts.
  • To track the equilibration process, we can define equilibrium_state in job.doc. Setting it False by default during job initiation (inside the init.py file) , and setting it to True when equilibrated.
  • Log number of run attempts in job.doc.
  • Making sure saved simulation files are updating according to equilibration process. For example, for each attempt, we can create a new trajectory.gsd file or append to the previous once. (discussion num. 2)
  • Making sure logged values in job.doc are updating accordingly. Do we want values such as job.doc["tps"], job.doc["accepted_moves"], job.doc["acceptance_ratio"] to represent the whole process or only the last run attempt? (discussion num. 3)

Step 2: Post Equilibrium

After equilibration, save information such as decorrelation step and starting index in job.doc.

Implementation details:

  • equil_sample() method in cmeutils seems to be a good option. It uses pymbar timeseries module to find the start index for sampling. It returns the independent samples as well.
  • We can use Signac's pre/post operations to perform this step automatically. An operation in signac is triggered once its pre-conditions are met or at least one of its post-conditions is not met. This is a great opportunity to learn more about Signac. Here is some clues to start: signac tutorial, simple signac project with pre and post conditions.

Step 3: Save structural/analytical data

logging information that will be used later to draw phase diagrams or to analyze the trajectory :

  • Potential energy mean and standard deviation (Save in job.doc)
  • RDF, RDF peaks, ... (save in a txt file)
  • Average nearest neighbors (save in job.doc). We can take a step further and use the first minimum in RDF as the r_max.
  • [Add more if I missed something here]

Implementation details:
Same as previous step, this step can be automated using Signac's post/pre conditions.

@gwenwhite
Copy link
Collaborator

I like this!
One question: In Step 1, how does the simulation know to resume? I thought sim.run just restarted a simulation over from scratch. Does it also have resume functionalities?

@chrisjonesBSU
Copy link
Member

In the Simulation class there is a parameter called restart that will start the simulation from whatever state point is passed to restart. Right now, restart is an array of positions, but Marjan has a PR #41 that let's us pass in a .gsd. file to restart from. In this case, the difference between this and restarting a simulation from scratch is the initial positions of the spheres.

@gwenwhite
Copy link
Collaborator

What is the "standard" PE?

@marjanalbooyeh
Copy link
Contributor Author

What is the "standard" PE?

Sorry, I meant standard deviation. Typo :D

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants