Base module for the user-level scripting API. More...
|Commands that analyze the system and provide some output. |
|Commands that specify angle forces. |
|Commands for benchmarking the performance of HOOMD. |
|Commands that specify bond forces. |
|Commands that create forces between pairs of particles. |
|Commands to support automatic citation generation. |
|Commands to support MPI communication. |
|Commands that compute properties of the system. |
|Commands that create constraint forces on particles. |
|Gather information about the execution context. |
|Access particles, bonds, and other state information inside scripts. |
|Commands that specify dihedral forces. |
|Commands that dump particles to files. |
|Commands that create external forces on particles. |
|Other types of forces. |
|Global variables. |
|Commands for grouping particles. |
|Commands that specify improper forces. |
|Data initialization commands. |
|Commands that integrate the equations of motion. |
|Write out simulation and environment context metadata. |
|Wrapper for "global" nlist commands. |
|Commands set global options. |
|Commands that create forces between pairs of particles. |
|Wrapper for "global" sorter commands. |
|Commands for tuning the performance of HOOMD. |
|Commands that modify the system state in some way. |
|Commands for specifying values that vary over time. |
|Commands that specify wall forces. |
|Get the version information of hoomd_script. More...|
|Runs the simulation for a given number of time steps. More...|
|Runs the simulation up to a given time step number. More...|
|Get the current simulation time step. More...|
|Start CUDA profiling. More...|
|Stop CUDA profiling. More...|
Base module for the user-level scripting API.
hoomd_script provides a very high level user interface for executing simulations using HOOMD. This python module is designed to be imported into python with "from hoomd_script import *"
Start CUDA profiling.
When using nvvp to profile CUDA kernels in hoomd jobs, you usually don't care about all the initialization and startup. cuda_profile_start() allows you to not even record that. To use, uncheck the box "start profiling on application start" in your nvvp session configuration. Then, call cuda_profile_start() in your hoomd script when you want nvvp to start collecting information.
Stop CUDA profiling.
Get the version information of hoomd_script.
This version is the version number of hoomd_script , not HOOMD as a whole. It is intended for use by third party API plugins that interface with hoomd_script. When new features are added (i.e. a new command or a new option to an existing command), the minor version will be incremented. When major changes are implemented or changes that break backwards compatibility are made, then the major version is incremented and the minor reset to 0. Only one such increment of either type will occur per each tagged release of HOOMD.
Get the current simulation time step.
Runs the simulation for a given number of time steps.
|tsteps||Number of time steps to advance the simulation|
|profile||Set to True to enable detailed profiling|
|limit_hours||(if set) Limit the run to a given number of hours.|
|limit_multiple||When stopping the run() due to walltime limits, only stop when the time step is a multiple of limit_multiple .|
|callback||(if set) Sets a Python function to be called regularly during a run.|
|callback_period||Sets the period, in time steps, between calls made to callback|
|quiet||Set to True to eliminate the status information printed to the screen by the run|
Execute the run() command to advance the simulation forward in time. During the run, all previously specified analyzers, dumps, updaters and the integrators are executed at the specified regular periods.
After run() completes, you may change parameters of the simulation and continue the simulation by executing run() again. Time steps are added cumulatively, so calling run(1000) and then run(2000) would run the simulation up to time step 3000.
When profile is True, a detailed breakdown of how much time was spent in each portion of the calculation is printed at the end of the run. Collecting this timing information can slow the simulation significantly.
Wallclock limited runs
There are a number of mechanisms to limit the time of a running hoomd script. Use these in a job queuing environment to allow your script to cleanly exit before reaching the system enforced walltime limit.
Force run() to end only on time steps that are a multiple of limit_mulitple. Set this to the period at which you dump restart files so that you always end a run() cleanly at a point where you can restart from. Use phase=0 on logs, file dumps, and other periodic tasks. With phase=0, these tasks will continue on the same sequence regardless of the restart period.
Set the environment variable
HOOMD_WALLTIME_STOP prior to executing
hoomd to stop the run() at a given wall clock time. run() monitors performance and tries to ensure that it will end before
HOOMD_WALLTIME_STOP. This environment variable works even with multiple stages of runs in a script (use run_upto()). Set the variable to a unix epoch time. For example in a job script that should run 12 hours, set
HOOMD_WALLTIME_STOP to 12 hours from now, minus 10 minutes to allow for job cleanup.
HOOMD_WALLTIME_STOP, run() will throw the exception
WalltimeLimitReached if it exits due to the walltime limit. For more information on using this exception, see (TODO: page to be written).#
limit_hours is another way to limit the length of a run(). Set it to a number of hours (use fractional values for minutes) to limit this particular run() to that length of time. This is less useful than
HOOMD_WALLTIME_STOP in a job queuing environment.
If callback is set to a Python function then this function will be called regularly at callback_period intervals. The callback function must receive one integer as argument and can return an integer. The argument passed to the callback is the current time step number. If the callback function returns a negative number, the run is immediately aborted.
If callback_period is set to 0 (the default) then the callback is only called once at the end of the run. Otherwise the callback is executed whenever the current time step number is a multiple of callback_period.
Runs the simulation up to a given time step number.
|step||Final time step of the simulation which to run|
|keywords||(see below) Catch for all keyword arguments to pass on to run()|
run_upto() runs the simulation, but only until it reaches the given time step, step. If the simulation has already reached the specified step, a message is printed and no simulation steps are run.
It accepts all keyword options that run() does.