Warning
Experimental code, use at your own risk.
The Manager encapsulates knowledge of how to run a job on a remote system. This basically means the host name, where are the scratch directories, what queuing system is running, etc. It simply uses ssh to communicate with the remote system and thus it is necessary to set up ssh with public key authentication to make this work smoothly.
remote scratch directories back and forth (using scp).
The remote directory name is constructed in the following way:
get_manager() creates a Manager from a configuration file.
See Manager for how the values in the configuration file are used.
Example:
[DEFAULT]
name = leviathan
[local]
topdir = ~
[remote]
hostname = leviathan.petagrid.org
scratchdir = /scratch/username/Projects
[queuing_system]
name = PBS
qscript = leviathan.pbs
walltime = 24.0
start_cwd = True
All entries except walltime and start_cwd are required; walltime can be omitted or set to None.
name
identifier of the configuration; should also be the name of the configuration file, i.e. name.cfg
hostname
fully qualified domain name of the host; used for running ssh hostname or scp FILES hostname:DIR
scratchdir
top level directory on the remote host udner which the working directories are constructed; see below for how this is done
name
identifier for the queuing system (should be a valid python identifier)
qscript
default queuing system script template; store it in ~/.gromacswrapper/qscripts
walltime
maximum allowed run time on the system; job files are written in such a way that Gromacs stops run at 0.99 or walltime. If ommitted then the job runs until it is done (provided the queuing system policy allows that)
start_cwd
Set to True means that the queuing system requires the queuing system script to cd into the job directory; this seems to be a bug in some versions of PBS, which we can work-around in Manager.qsub()
The Manager class must be customized for each system such as a cluster or a super computer. It then allows submission and control of jobs remotely (using ssh).
Base class to launch simulations remotely on computers with queuing systems.
Basically, ssh into machine and run job.
Derive a class from Manager and override the attributes
- Manager._hostname (hostname of the machine)
- Manager._scratchdir (all files and directories will be created under this scratch directory; it must be a path on the remote host)
- Manager._qscript (the default queuing system script template)
- Manager._walltime (if there is a limit to the run time of a job; in hours)
and implement a specialized Manager.qsub() method if needed.
ssh must be set up (via ~/.ssh/config) to allow access via a commandline such as
ssh <hostname> <command> ...
Typically you want something such as
host <hostname>
hostname <hostname>.fqdn.org
user <remote_user>
in ~/.ssh/config and also set up public-key authentication in order to avoid typing your password all the time.
Set up the manager.
Arguments : |
|
---|
alias for get_status()
alias for get_status()
Concatenate parts of a run in dirname.
Always uses gromacs.cbook.cat() with resolve_multi = ‘guess’.
Note
The default is to immediately delete the original files (cleanup = True).
Keywords : |
|
---|
scp -r dirname from host into targetdir
Arguments : |
|
---|---|
Returns : | return code from scp |
Directory on the remote machine.
Check status of remote job by looking into the logfile.
Report on the status of the job and extracts the performance in ns/d if available (which is saved in Manager.performance).
Arguments : |
|
---|---|
Returns : | True is job is done, False if still running None if no log file found to look at |
Note
Also returns False if the connection failed.
Warning
This is an important but somewhat fragile method. It needs to be improved to be more robust.
Find checkfile locally if possible.
If checkfile is not found in dirname then it is transferred from the remote host.
If needed, the trajectories are concatenated using Manager.cat().
Returns : | local path of checkfile |
---|
Regular expression used by Manager.get_status() to parse the logfile from mdrun.
Calculate how many dependent (chained) jobs are required.
Uses performance in ns/d (gathered from get_status()) and job max walltime (in hours) from the class unless provided as keywords.
n = ceil(runtime/(performance*0.99*walltime)
Keywords : |
|
---|---|
Returns : | n or 1 if walltime is unlimited |
scp dirname to host.
Arguments : | dirname to be transferred |
---|---|
Returns : | return code from scp |
scp filename to host in dirname.
Arguments : | filename and dirname to be transferred to |
---|---|
Returns : | return code from scp |
Submit job remotely on host.
This is the most primitive implementation: it just runs the commands
cd remotedir && qsub qscript
on Manager._hostname. remotedir is dirname under Manager._scratchdir and qscript is the name of the queuing system script in remotedir.
Arguments : |
|
---|
Directory on the remote machine.
URI of the directory on the remote machine.
Set up production and transfer to host.
Arguments : |
|
---|
Set up position restraints run and transfer to host.
kwargs are passed to gromacs.setup.MD_restrained()
Wait until the job associated with dirname is done.
Super-primitive, uses a simple while ... sleep for seconds delay
Arguments : |
|
---|