Beispiel #1
0
    def __init__(self):
        SimQueue.__init__(self)
        ProtocolInterface.__init__(self)
        self._arg(
            "datadir",
            "str",
            "The path in which to store completed trajectories.",
            None,
            val.String(),
        )
        self._arg(
            "trajext",
            "str",
            "Extension of trajectory files. This is needed to copy them to datadir.",
            "xtc",
            val.String(),
        )
        self._arg(
            "copy",
            "list",
            "A list of file names or globs for the files to copy to datadir",
            ("*.xtc", ),
            val.String(),
            nargs="*",
        )
        self._cmdDeprecated("trajext", "copy")

        self._states = dict()
        self._queue = None
        self._shutdown = False
Beispiel #2
0
    def __init__(self):
        from moleculekit.molecule import Molecule

        super().__init__()

        self._arg('molecule', ':class: `moleculekit.molecule.Molecule`', 'Molecule',
                  default=None, validator=val.Object(Molecule), required=True)
        self._arg('charge', 'int', 'Charge of the molecule in electron charges', default=None,
                  validator=val.Number(int, 'ANY'), required=True)
        self._arg('multiplicity', 'int', 'Multiplicity of the molecule',
                  default=1, validator=val.Number(int, 'POS'))
        self._arg('theory', 'str', 'Level of theory',
                  default='B3LYP', validator=val.String(), valid_values=self.THEORIES)
        self._arg('correction', 'str', 'Empirical dispersion correction',
                  default='none', validator=val.String(), valid_values=self.CORRECTIONS)
        self._arg('basis', 'str', 'Basis set',
                  default='6-31G*', validator=val.String(), valid_values=self.BASIS_SETS)
        self._arg('solvent', 'str', 'Implicit solvent',
                  default='vacuum', validator=val.String(), valid_values=self.SOLVENTS)
        self._arg('esp_points', ':class: `numpy.ndarray`', 'Point to calculate ESP',
                  default=None, nargs='*')  # TODO implement validator
        self._arg('optimize', 'boolean', 'Optimize geometry',
                  default=False, validator=val.Boolean())
        self._arg('restrained_dihedrals', ':class: `numpy.ndarray`',
                  'List of restrained dihedrals (0-based indices)',
                  default=None, nargs='*')  # TODO implement validator
        self._arg('queue', ':class:`SimQueue <htmd.queues.simqueue.SimQueue>` object',
                  'Queue object used to run simulations',
                  default=LocalCPUQueue())
        self._arg('directory', 'str', 'Working directory',
                  default='.', validator=val.String())
Beispiel #3
0
    def __init__(self):

        SimQueue.__init__(self)
        ProtocolInterface.__init__(self)
        self._arg(
            'groupname', 'str',
            'The name of the group of simulations you want to submit. If none is given, '
            'a randomly generated string will be used instead.', None,
            val.String())
        self._arg('datadir', 'str',
                  'The directory in which to retrieve your results.', None,
                  val.String())
        self._arg('instancetype',
                  'str',
                  'Instance type',
                  'p2.xlarge',
                  val.String(),
                  valid_values=('g2.2xlarge', 'r4.large', 'p2.xlarge'))
        self._arg(
            'hashnames', 'bool',
            'If True, each job will have a name created from the hash of its directory '
            'instead of using the directory name.', False, val.Boolean())
        self._arg('verbose', 'bool', 'Turn verbosity mode on or off.', False,
                  val.Boolean())
        self._arg('ngpu', 'int', 'Number of GPUs to use for a single job', 0,
                  val.Number(int, '0POS'))
        self._arg('ncpu', 'int', 'Number of CPUs to use for a single job', 1,
                  val.Number(int, '0POS'))
        self._arg('memory', 'int', 'Amount of memory per job (MB)', 8000,
                  val.Number(int, '0POS'))

        self._cloud = None
Beispiel #4
0
    def __init__(self):

        SimQueue.__init__(self)
        ProtocolInterface.__init__(self)
        self._arg(
            'groupname', 'str',
            'The name of the group of simulations you want to submit. If none is given, '
            'a randomly generated string will be used instead.', None,
            val.String())
        self._arg('datadir', 'str',
                  'The directory in which to retrieve your results.', None,
                  val.String())
        self._arg('verbose', 'bool', 'Turn verbosity mode on or off.', False,
                  val.Boolean())

        self._cloud = None
Beispiel #5
0
 def __init__(self):
     super().__init__()
     from htmd.apps.app import App
     from htmd.queues.simqueue import SimQueue
     self._arg(
         'app', ':class:`SimQueue <htmd.queues.simqueue.SimQueue>` object',
         'A SimQueue class object used to retrieve and submit simulations',
         None, val.Object((App, SimQueue)))
     self._arg('project', 'str', 'The name of the project', 'adaptive',
               val.String())
     self._arg('nmin', 'int', 'Minimum number of running simulations', 1,
               val.Number(int, 'POS'))
     self._arg('nmax', 'int', 'Maximum number of running simulations', 1,
               val.Number(int, 'POS'))
     self._arg('nepochs', 'int',
               'Stop adaptive once we have reached this number of epochs',
               1000, val.Number(int, 'POS'))
     self._arg(
         'nframes', 'int',
         'Stop adaptive once we have simulated this number of aggregate simulation frames.',
         0, val.Number(int, '0POS'))
     self._arg('inputpath', 'str',
               'The directory used to store input folders', 'input',
               val.String())
     self._arg('generatorspath', 'str',
               'The directory containing the generators', 'generators',
               val.String())
     self._arg(
         'dryrun', 'boolean',
         'A dry run means that the adaptive will retrieve and generate a new epoch but not submit the simulations',
         False, val.Boolean())
     self._arg(
         'updateperiod', 'float',
         'When set to a value other than 0, the adaptive will run synchronously every `updateperiod` seconds',
         0, val.Number(float, '0POS'))
     self._arg(
         'coorname', 'str',
         'Name of the file containing the starting coordinates for the new simulations',
         'input.coor', val.String())
     self._arg('lock', 'bool', 'Lock the folder while adaptive is ongoing',
               False, val.Boolean())
     self._running = None
Beispiel #6
0
    def __init__(self):
        SimQueue.__init__(self)
        ProtocolInterface.__init__(self)
        self._arg('datadir', 'str',
                  'The path in which to store completed trajectories.', None,
                  val.String())
        self._arg(
            'trajext', 'str',
            'Extension of trajectory files. This is needed to copy them to datadir.',
            'xtc', val.String())
        self._arg(
            'copy',
            'list',
            'A list of file names or globs for the files to copy to datadir',
            ('*.xtc', ),
            val.String(),
            nargs='*')
        self._cmdDeprecated('trajext', 'copy')

        self._states = dict()
        self._queue = None
        self._shutdown = False
Beispiel #7
0
    def __init__(self):
        super().__init__()
        self._arg('jobname', 'str', 'Job name (identifier)', None,
                  val.String())
        self._arg('queue', 'str', 'The queue to run on',
                  self._defaults[self._defaults['default_queue']],
                  val.String())
        self._arg('ngpu', 'int', 'Number of GPUs to use for a single job',
                  self._defaults['ngpu'], val.Number(int, '0POS'))
        self._arg('ncpu', 'int', 'Number of GPUs to use for a single job',
                  self._defaults['ncpu'], val.Number(int, '0POS'))
        self._arg('memory', 'int', 'Amount of memory per job (MB)',
                  self._defaults['memory'], val.Number(int, '0POS'))
        self._arg('walltime', 'int', 'Job timeout (hour:min or min)',
                  self._defaults['walltime'], val.Number(int, '0POS'))
        self._arg('resources',
                  'list',
                  'Resources of the queue',
                  self._defaults['resources'],
                  val.String(),
                  nargs='*')
        self._arg('environment',
                  'list',
                  'Things to run before the job (sourcing envs).',
                  self._defaults['environment'],
                  val.String(),
                  nargs='*')
        self._arg('outputstream', 'str', 'Output stream.', 'lsf.%J.out',
                  val.String())
        self._arg('errorstream', 'str', 'Error stream.', 'lsf.%J.err',
                  val.String())
        self._arg('datadir', 'str',
                  'The path in which to store completed trajectories.', None,
                  val.String())
        self._arg(
            'trajext', 'str',
            'Extension of trajectory files. This is needed to copy them to datadir.',
            'xtc', val.String())

        # Find executables
        self._qsubmit = LsfQueue._find_binary('bsub')
        self._qinfo = LsfQueue._find_binary('bqueues')
        self._qcancel = LsfQueue._find_binary('bkill')
        self._qstatus = LsfQueue._find_binary('bjobs')

        self._sentinel = 'htmd.queues.done'
        # For synchronous
        self._dirs = []
Beispiel #8
0
 def __init__(self):
     from sklearn.base import ClusterMixin
     from htmd.clustering.kcenters import KCenter
     from moleculekit.projections.projection import Projection
     super().__init__()
     self._arg('datapath', 'str', 'The directory in which the completed simulations are stored', 'data', val.String())
     self._arg('filter', 'bool', 'Enable or disable filtering of trajectories.', True, val.Boolean())
     self._arg('filtersel', 'str', 'Filtering atom selection', 'not water', val.String())
     self._arg('filteredpath', 'str', 'The directory in which the filtered simulations will be stored', 'filtered', val.String())
     self._arg('projection', ':class:`Projection <moleculekit.projections.projection.Projection>` object',
               'A Projection class object or a list of objects which will be used to project the simulation '
                'data before constructing a Markov model', None, val.Object(Projection), nargs='+')
     self._arg('truncation', 'str', 'Method for truncating the prob distribution (None, \'cumsum\', \'statecut\'', None, val.String())
     self._arg('statetype', 'str', 'What states (cluster, micro, macro) to use for calculations.', 'micro', val.String(), valid_values=('micro', 'cluster', 'macro'))
     self._arg('macronum', 'int', 'The number of macrostates to produce', 8, val.Number(int, 'POS'))
     self._arg('skip', 'int', 'Allows skipping of simulation frames to reduce data. i.e. skip=3 will only keep every third frame', 1, val.Number(int, 'POS'))
     self._arg('lag', 'int', 'The lagtime used to create the Markov model', 1, val.Number(int, 'POS'))
     self._arg('clustmethod', ':class:`ClusterMixin <sklearn.base.ClusterMixin>` class', 'Clustering algorithm used to cluster the contacts or distances', KCenter, val.Class(ClusterMixin))
     self._arg('method', 'str', 'Criteria used for choosing from which state to respawn from', '1/Mc', val.String())
     self._arg('ticalag', 'int', 'Lagtime to use for TICA in frames. When using `skip` remember to change this accordinly.', 20, val.Number(int, '0POS'))
     self._arg('ticadim', 'int', 'Number of TICA dimensions to use. When set to 0 it disables TICA', 3, val.Number(int, '0POS'))
     self._arg('contactsym', 'str', 'Contact symmetry', None, val.String())
     self._arg('save', 'bool', 'Save the model generated', False, val.Boolean())
Beispiel #9
0
 def __init__(self):
     from sklearn.base import ClusterMixin
     from moleculekit.projections.projection import Projection
     super().__init__()
     self._arg('datapath', 'str', 'The directory in which the completed simulations are stored', 'data', val.String())
     self._arg('filter', 'bool', 'Enable or disable filtering of trajectories.', True, val.Boolean())
     self._arg('filtersel', 'str', 'Filtering atom selection', 'not water', val.String())
     self._arg('filteredpath', 'str', 'The directory in which the filtered simulations will be stored', 'filtered', val.String())
     self._arg('projection', ':class:`Projection <moleculekit.projections.projection.Projection>` object',
               'A Projection class object or a list of objects which will be used to project the simulation '
                'data before constructing a Markov model', None, val.Object(Projection), nargs='+')
     self._arg('goalfunction', 'function',
               'This function will be used to convert the goal-projected simulation data to a ranking which'
               'can be used for the directed component of FAST.', None, val.Function(), nargs='any')
     self._arg('reward_method', 'str', 'The reward method', 'max', val.String())
     self._arg('skip', 'int', 'Allows skipping of simulation frames to reduce data. i.e. skip=3 will only keep every third frame', 1, val.Number(int, 'POS'))
     self._arg('lag', 'int', 'The lagtime used to create the Markov model. Units are in frames.', 1, val.Number(int, 'POS'))
     self._arg('exploration', 'float', 'Exploration is the coefficient used in UCB algorithm to weight the exploration value', 0.5, val.Number(float, 'OPOS'))
     self._arg('temperature', 'int', 'Temperature used to compute the free energy', 300, val.Number(int, 'POS'))
     self._arg('ticalag', 'int', 'Lagtime to use for TICA in frames. When using `skip` remember to change this accordinly.', 20, val.Number(int, '0POS'))
     self._arg('ticadim', 'int', 'Number of TICA dimensions to use. When set to 0 it disables TICA', 3, val.Number(int, '0POS'))
     self._arg('clustmethod', ':class:`ClusterMixin <sklearn.base.ClusterMixin>` class', 'Clustering algorithm used to cluster the contacts or distances', MiniBatchKMeans, val.Class(ClusterMixin))
     self._arg('macronum', 'int', 'The number of macrostates to produce', 8, val.Number(int, 'POS'))
     self._arg('save', 'bool', 'Save the model generated', False, val.Boolean())
     self._arg('save_qval', 'bool', 'Save the Q(a) and N values for every epoch', False, val.Boolean())
     self._arg('actionspace', 'str', 'The action space', 'metric', val.String())
     self._arg('recluster', 'bool', 'If to recluster the action space.', False, val.Boolean())
     self._arg('reclusterMethod', '', 'Clustering method for reclustering.', MiniBatchKMeans)
     self._arg('random', 'bool', 'Random decision mode for baseline.', False, val.Boolean())
     self._arg('reward_mode', 'str', '(parent, frame)', 'parent', val.String())
     self._arg('reward_window', 'int', 'The reward window', None, val.Number(int, 'POS'))
     self._arg('pucb', 'bool', 'If True, it uses PUCB algorithm using the provided goal function as a prior', False, val.Boolean())
     self._arg('goal_init', 'float', 'The proportional ratio of goal initialization compared to max frames set by nframes', 0.3, val.Number(float, 'POS'))
     self._arg('goal_preprocess', 'function',
               'This function will be used to preprocess goal data after it has been computed for all frames.', None, val.Function(), nargs='any')
     self._arg('actionpool', 'int', 'The number of top scoring actions used to randomly select respawning simulations', 0, val.Number(int, 'OPOS'))
Beispiel #10
0
    def __init__(self):
        super().__init__()
        self._arg('acemd', ':class:`MDEngine <htmd.apps.app.App>` object',
                  'MD engine', None, val.Object(Acemd3))
        self._arg('runtime', 'float', 'Running time of the simulation.', 0,
                  val.Number(float, '0POS'))
        self._arg('timeunits', 'str',
                  'Units for runtime. Can be \'steps\', \'ns\' etc.', 'steps',
                  val.String())
        self._arg('temperature', 'float',
                  'Temperature of the thermostat in Kelvin', 300,
                  val.Number(float, 'ANY'))
        self._arg('restraints',
                  'list',
                  'A list of restraint objects',
                  None,
                  val.Object(_Restraint),
                  nargs='*')
        self._arg(
            'useconstantratio', 'bool',
            'For membrane protein simulations set it to true so that the barostat does not modify the xy aspect ratio.',
            False, val.Boolean())
        self._arg(
            'constraintsteps', 'int',
            'Number of initial steps to apply constraints in units of 4fs. Defaults to half the simulation time.',
            None, val.Number(int, 'ANY'))

        self.acemd = Acemd3()
        self.acemd.coordinates = None
        self.acemd.structure = None
        self.acemd.parameters = None
        self.acemd.restart = 'on'
        self.acemd.trajectoryfile = 'output.xtc'
        self.acemd.trajectoryfreq = 25000
        self.acemd.timestep = 4
        self.acemd.switching = 'on'
        self.acemd.switchdist = 7.5
        self.acemd.cutoff = 9
        self.acemd.thermostat = 'on'
        self.acemd.thermostatdamping = 1
        self.acemd.pme = 'on'
        self.acemd.barostat = 'on'
        self.acemd.barostatpressure = 1.01325
        self.acemd.minimize = 500
Beispiel #11
0
    def __init__(self):
        super().__init__()
        self._arg('acemd', ':class:`MDEngine <htmd.apps.app.App>` object',
                  'MD engine', None, val.Object(Acemd3))
        self._arg('runtime', 'float', 'Running time of the simulation.', 0,
                  val.Number(float, '0POS'))
        self._arg('timeunits', 'str',
                  'Units for runtime. Can be \'steps\', \'ns\' etc.', 'steps',
                  val.String())
        self._arg('temperature', 'float',
                  'Temperature of the thermostat in Kelvin', 300,
                  val.Number(float, 'ANY'))
        self._arg('restraints',
                  'list',
                  'A list of restraint objects',
                  None,
                  val.Object(_Restraint),
                  nargs='*')
        self._arg(
            'useconstantratio', 'bool',
            'For membrane protein simulations set it to true so that the barostat does not modify the xy aspect ratio.',
            False, val.Boolean())
        self._arg(
            'adaptive', 'bool',
            'Set to True if making production runs for adaptive sampling.',
            False, val.Boolean())

        self.acemd = Acemd3()
        self.acemd.binvelocities = None
        self.acemd.bincoordinates = 'output.coor'
        self.acemd.extendedsystem = 'output.xsc'
        self.acemd.coordinates = None
        self.acemd.structure = None
        self.acemd.parameters = None
        self.acemd.restart = 'on'
        self.acemd.trajectoryfile = 'output.xtc'
        self.acemd.trajectoryfreq = 25000
        self.acemd.timestep = 4
        self.acemd.switching = 'on'
        self.acemd.switchdist = 7.5
        self.acemd.cutoff = 9
        self.acemd.thermostat = 'on'
        self.acemd.thermostatdamping = 0.1
        self.acemd.pme = 'on'
Beispiel #12
0
    def __init__(self):
        super().__init__()
        self._arg('jobname', 'str', 'Job name (identifier)', None,
                  val.String())
        self._arg('queue', 'str', 'The queue to run on', None, val.String())
        self._arg('ngpu', 'int', 'Number of GPUs to use for a single job', 0,
                  val.Number(int, '0POS'))
        self._arg('ncpu', 'int', 'Number of CPUs to use for a single job', 1,
                  val.Number(int, '0POS'))
        self._arg('memory', 'int', 'Amount of memory per job (MB)', 1000,
                  val.Number(int, '0POS'))
        self._arg('walltime', 'int', 'Job timeout (s)', 3600,
                  val.Number(int, 'POS'))
        self._arg('environment', 'str', 'Envvars to propagate to the job.',
                  'ACEMD_HOME,HTMD_LICENSE_FILE', val.String())
        self._arg('datadir', 'str',
                  'The path in which to store completed trajectories.', None,
                  val.String())
        self._arg(
            'trajext', 'str',
            'Extension of trajectory files. This is needed to copy them to datadir.',
            'xtc', val.String())
        self._arg('cluster', 'str',
                  'Select nodes from a single specified cluster', None,
                  val.String())
        self._arg('scratch_local', 'int', 'Local scratch in MB', None,
                  val.Number(int, '0POS'))

        # Find executables
        self._qsubmit = PBSQueue._find_binary('qsub')
        self._qinfo = PBSQueue._find_binary('qstat') + ' -a'
        self._qcancel = PBSQueue._find_binary('qdel')
        self._qstatus = PBSQueue._find_binary('qstat') + ' -Q'

        self._sentinel = 'htmd.queues.done'
        # For synchronous
        self._joblist = []
        self._dirs = []
Beispiel #13
0
    def __init__(self):
        super().__init__()
        self._arg('jobname', 'str', 'Job name (identifier)', None,
                  val.String())
        self._arg('partition', 'str', 'The queue (partition) to run on',
                  self._defaults[self._defaults['default_partition']],
                  val.String())
        self._arg('priority', 'str', 'Job priority',
                  self._defaults['priority'], val.String())
        self._arg('ngpu', 'int', 'Number of GPUs to use for a single job',
                  self._defaults['ngpu'], val.Number(int, '0POS'))
        self._arg('ncpu', 'int', 'Number of CPUs to use for a single job',
                  self._defaults['ncpu'], val.Number(int, 'POS'))
        self._arg('memory', 'int', 'Amount of memory per job (MB)',
                  self._defaults['memory'], val.Number(int, 'POS'))
        self._arg(
            'gpumemory', 'int',
            'Only run on GPUs with at least this much memory. Needs special setup of SLURM. '
            'Check how to define gpu_mem on SLURM.', None,
            val.Number(int, '0POS'))
        self._arg('walltime', 'int', 'Job timeout (s)',
                  self._defaults['walltime'], val.Number(int, 'POS'))
        self._arg('environment', 'str', 'Envvars to propagate to the job.',
                  self._defaults['environment'], val.String())
        self._arg(
            'mailtype', 'str',
            'When to send emails. Separate options with commas like \'END,FAIL\'.',
            None, val.String())
        self._arg('mailuser', 'str', 'User email address.', None, val.String())
        self._arg('outputstream', 'str', 'Output stream.', 'slurm.%N.%j.out',
                  val.String())
        self._arg(
            'errorstream', 'str', 'Error stream.',
            'slurm.%N.%j.err'), val.String()  # Maybe change these to job name
        self._arg('datadir', 'str',
                  'The path in which to store completed trajectories.', None,
                  val.String())
        self._arg(
            'trajext', 'str',
            'Extension of trajectory files. This is needed to copy them to datadir.',
            'xtc', val.String())
        self._arg(
            'nodelist',
            'list',
            'A list of nodes on which to run every job at the *same time*! Careful! The jobs will be duplicated!',
            None,
            val.String(),
            nargs='*')
        self._arg(
            'exclude',
            'list',
            'A list of nodes on which *not* to run the jobs. Use this to select nodes on which to allow the jobs to run on.',
            None,
            val.String(),
            nargs='*')

        # Find executables
        self._qsubmit = SlurmQueue._find_binary('sbatch')
        self._qinfo = SlurmQueue._find_binary('sinfo')
        self._qcancel = SlurmQueue._find_binary('scancel')
        self._qstatus = SlurmQueue._find_binary('squeue')

        self._sentinel = 'htmd.queues.done'
        # For synchronous
        self._dirs = []
Beispiel #14
0
    def __init__(
        self, _configapp=None, _configfile=None, _findExecutables=True, _logger=True
    ):
        SimQueue.__init__(self)
        ProtocolInterface.__init__(self)
        self._arg("jobname", "str", "Job name (identifier)", None, val.String())
        self._arg(
            "partition",
            "str",
            "The queue (partition) or list of queues to run on. If list, the one offering "
            "earliest initiation will be used.",
            self._defaults["partition"],
            val.String(),
            nargs="*",
        )
        self._arg(
            "priority", "str", "Job priority", self._defaults["priority"], val.String()
        )
        self._arg(
            "ngpu",
            "int",
            "Number of GPUs to use for a single job",
            self._defaults["ngpu"],
            val.Number(int, "0POS"),
        )
        self._arg(
            "ncpu",
            "int",
            "Number of CPUs to use for a single job",
            self._defaults["ncpu"],
            val.Number(int, "POS"),
        )
        self._arg(
            "memory",
            "int",
            "Amount of memory per job (MiB)",
            self._defaults["memory"],
            val.Number(int, "POS"),
        )
        self._arg(
            "gpumemory",
            "int",
            "Only run on GPUs with at least this much memory. Needs special setup of SLURM. "
            "Check how to define gpu_mem on SLURM.",
            None,
            val.Number(int, "0POS"),
        )
        self._arg(
            "walltime",
            "int",
            "Job timeout (minutes)",
            self._defaults["walltime"],
            val.Number(int, "POS"),
        )
        self._cmdDeprecated("environment", "envvars")
        self._arg(
            "mailtype",
            "str",
            "When to send emails. Separate options with commas like 'END,FAIL'.",
            None,
            val.String(),
        )
        self._arg("mailuser", "str", "User email address.", None, val.String())
        self._arg(
            "outputstream", "str", "Output stream.", "slurm.%N.%j.out", val.String()
        )
        self._arg(
            "errorstream", "str", "Error stream.", "slurm.%N.%j.err"
        ), val.String()
        self._arg(
            "datadir",
            "str",
            "The path in which to store completed trajectories.",
            None,
            val.String(),
        )
        self._arg(
            "trajext",
            "str",
            "Extension of trajectory files. This is needed to copy them to datadir.",
            "xtc",
            val.String(),
        )
        self._arg(
            "nodelist",
            "list",
            "A list of nodes on which to run every job at the *same time*! Careful! The jobs"
            " will be duplicated!",
            None,
            val.String(),
            nargs="*",
        )
        self._arg(
            "exclude",
            "list",
            "A list of nodes on which *not* to run the jobs. Use this to select nodes on "
            "which to allow the jobs to run on.",
            None,
            val.String(),
            nargs="*",
        )
        self._arg(
            "envvars",
            "str",
            "Envvars to propagate from submission node to the running node (comma-separated)",
            self._defaults["envvars"],
            val.String(),
        )
        self._arg(
            "prerun",
            "list",
            "Shell commands to execute on the running node before the job (e.g. "
            "loading modules)",
            self._defaults["prerun"],
            val.String(),
            nargs="*",
        )
        self._arg(
            "account",
            "str",
            "Charge resources used by the jobs to specified account.",
            None,
            val.String(),
        )
        self._arg(
            "user",
            "str",
            "The SLURM user submitting and managing jobs",
            getpass.getuser(),
            val.String(),
        )

        # Load Slurm configuration profile
        loadConfig(self, "slurm", _configfile, _configapp, _logger)

        # Find executables
        if _findExecutables:
            self._qsubmit = SlurmQueue._find_binary("sbatch")
            self._qinfo = SlurmQueue._find_binary("sinfo")
            self._qcancel = SlurmQueue._find_binary("scancel")
            self._qstatus = SlurmQueue._find_binary("squeue")
            self._qjobinfo = SlurmQueue._find_binary("sacct")
            self._checkQueue()
Beispiel #15
0
    def __init__(self):
        from moleculekit.molecule import Molecule

        super().__init__()

        self._arg(
            "molecule",
            ":class: `moleculekit.molecule.Molecule`",
            "Molecule",
            default=None,
            validator=val.Object(Molecule),
            required=True,
        )
        self._arg(
            "charge",
            "int",
            "Charge of the molecule in electron charges",
            default=None,
            validator=val.Number(int, "ANY"),
            required=True,
        )
        self._arg(
            "multiplicity",
            "int",
            "Multiplicity of the molecule",
            default=1,
            validator=val.Number(int, "POS"),
        )
        self._arg(
            "theory",
            "str",
            "Level of theory",
            default="B3LYP",
            validator=val.String(),
            valid_values=self.THEORIES,
        )
        self._arg(
            "correction",
            "str",
            "Empirical dispersion correction",
            default="none",
            validator=val.String(),
            valid_values=self.CORRECTIONS,
        )
        self._arg(
            "basis",
            "str",
            "Basis set",
            default="6-31G*",
            validator=val.String(),
            valid_values=self.BASIS_SETS,
        )
        self._arg(
            "solvent",
            "str",
            "Implicit solvent",
            default="vacuum",
            validator=val.String(),
            valid_values=self.SOLVENTS,
        )
        self._arg(
            "esp_points",
            ":class: `numpy.ndarray`",
            "Point to calculate ESP",
            default=None,
            nargs="*",
        )  # TODO implement validator
        self._arg(
            "optimize",
            "boolean",
            "Optimize geometry",
            default=False,
            validator=val.Boolean(),
        )
        self._arg(
            "restrained_dihedrals",
            ":class: `numpy.ndarray`",
            "List of restrained dihedrals (0-based indices)",
            default=None,
            nargs="*",
        )  # TODO implement validator
        self._arg(
            "queue",
            ":class:`SimQueue <jobqueues.simqueue.SimQueue>` object",
            "Queue object used to run simulations",
            default=LocalCPUQueue(),
        )
        self._arg("directory",
                  "str",
                  "Working directory",
                  default=".",
                  validator=val.String())
Beispiel #16
0
    def __init__(self,
                 _configapp=None,
                 _configfile=None,
                 _findExecutables=True,
                 _logger=True):
        from playmolecule import Session, Job

        SimQueue.__init__(self)
        ProtocolInterface.__init__(self)

        self._arg(
            "parentjob",
            "playmolecule.job.Job",
            "Spawn all jobs as children of this job",
            default=None,
            required=False,
            validator=val.Object(Job),
        )
        self._arg(
            "session",
            "playmolecule.session.Session",
            "The current PMWS Session object",
            required=True,
            validator=val.Object(Session),
        )
        self._arg("jobname", "str", "Job name (identifier)", None,
                  val.String())
        self._arg("group", "str", "Group name (identifier)", None,
                  val.String())
        self._arg(
            "ngpu",
            "int",
            "Number of GPUs",
            default=0,
            validator=val.Number(int, "0POS"),
        )
        self._arg(
            "ncpu",
            "int",
            "Number of CPUs",
            default=1,
            validator=val.Number(int, "0POS"),
        )
        self._arg(
            "memory",
            "int",
            "Amount of memory (MB)",
            default=1000,
            validator=val.Number(int, "POS"),
        )
        self._arg("app",
                  "str",
                  "App name",
                  required=True,
                  validator=val.String())
        self._arg(
            "configname",
            "str",
            "Name of the file containing the individual job configurations yaml or json. Not a filepath, just the name. All submitted folders must contain this file.",
            None,
            val.String(),
        )
        self._arg(
            "retrievedir",
            "str",
            "Directory in which to retrieve the results of jobs",
            None,
            val.String(),
        )
        self._arg(
            "datadir",
            "str",
            "Directory in which to copy or symlink the output directory.",
            None,
            val.String(),
        )
        self._arg(
            "symlink",
            "bool",
            "Set to False to copy instead of symlink the directories from the retrievedir to datadir",
            True,
            val.Boolean(),
        )
        self._arg(
            "copy",
            "list",
            "A list of file names or globs for the files to copy or symlink from retrievedir to datadir.",
            ("/", ),
            val.String(),
            nargs="*",
        )

        loadConfig(self, "playmolecule", _configfile, _configapp, _logger)
Beispiel #17
0
    def __init__(self, config=None):
        super().__init__(version=3)
        # ACEMD3 Options
        self._arg('temperature', 'float',
                  'Temperature of the thermostat in Kelvin.', None,
                  val.Number(float, 'ANY'))
        self._arg('restart', 'str', 'Restart simulation.', None, val.String())
        self._arg('trajectoryfile', 'str', 'Output file name.', None,
                  val.String())
        self._arg('trajectoryfreq', 'int',
                  'Trajectory sampling frequency in steps.', None,
                  val.Number(int, 'POS'))
        self._arg('timestep', 'int', 'Simulation timestep.', None,
                  val.Number(int, 'POS'))
        self._arg('pme', 'str', 'Particle-mesh Ewald summation.', None,
                  val.String())
        self._arg('switching', 'str',
                  'Apply switching function to the van der Waals potential.',
                  None, val.String())
        self._arg(
            'switchdist', 'float',
            'Distance in Angstrom at which to begin applying the switching function.',
            None, val.Number(float, '0POS'))
        self._arg(
            'cutoff', 'float',
            'Real-space cutoff in Angstroms for electrostatics and van der Waals.',
            None, val.Number(float, '0POS'))
        self._arg('thermostat', 'str', 'Enable thermostatic control', None,
                  val.String())
        self._arg('thermostattemp', 'float',
                  'Target temperature (K) for thermostatic control', None,
                  val.Number(float, '0POS'))
        self._arg('thermostatdamping', 'float',
                  'Damping constant for the Langevin thermostat in ps^-1',
                  None, val.Number(float, '0POS'))
        self._arg('restraints',
                  'str',
                  'Restraining potentials',
                  None,
                  val.Object(_Restraint),
                  nargs='*')
        self._arg('barostat', 'str', 'Enable pressure control', None,
                  val.String())
        self._arg('barostatpressure', 'float', 'The target pressure in bar',
                  None, val.Number(float, '0POS'))
        self._arg(
            'useflexiblecell', 'str',
            'Allow X, Y and Z unit cell dimensions to vary independently',
            None, val.String())
        self._arg(
            'useconstantarea', 'str',
            'Constrain the X,Y dimensions of the unit cell. Allow Z to vary '
            'independently.', None, val.String())
        self._arg(
            'useconstantratio', 'str',
            'Constrain the X:Y ratio of the unit cell dimensions. Allow Z to vary '
            'independently.', None, val.String())
        self._arg(
            'minimize', 'int',
            'The number of energy minimization steps to perform before commencing dynamics.',
            None, val.Number(int, '0POS'))
        self._arg(
            'run', 'str',
            'The length of simulation to run. May be specified as a number of steps or as a time '
            'if one of the suffices "us", "ns", "ps", "fs" is used.', None,
            val.String())
        self._arg(
            'celldimension', 'str',
            'The dimensions of the unit cell in Angstrom. Note that the unit cell must '
            'be cuboid. Overrides any dimension given in the "coordinates" PDB.',
            None, val.String())
        self._arg(
            'implicit', 'str',
            'Set to True to enable implicit solvent simulations in AMBER.',
            None, val.String())

        # Files
        self._arg(
            'bincoordinates',
            'str',
            'Optional initial system geometry in NAMD BINCOOR format. If specified, '
            'overrides "coordinates"',
            None,
            val.String(),
            nargs='*')
        self._arg(
            'binvelocities',
            'str',
            'Optional initial system velocity field in NAMD BINCOOR format. If '
            'specified, overrides field generated by "temperature" and "velocities"',
            None,
            val.String(),
            nargs='*')
        self._arg('structure',
                  'str',
                  'The filename of a CHARMM PSF file',
                  None,
                  val.String(),
                  nargs='*')
        self._arg('parameters',
                  'str',
                  'The filename of a CHARMM PAR file',
                  None,
                  val.String(),
                  nargs='*')
        self._arg('parmfile',
                  'str',
                  'The filename of an Amber PRMTOP file',
                  None,
                  val.String(),
                  nargs='*')
        self._arg(
            'extendedsystem',
            'str',
            'Filename of a NAMD XSC format file giving the periodic cell dimensions. '
            'Overrides "celldimension" and any dimensions in the "coordinates" PDB',
            None,
            val.String(),
            nargs='*')
        self._arg('coordinates',
                  'str',
                  'Mandatory initial system geometry in PDB format',
                  None,
                  val.String(),
                  nargs='*')
        self._arg(
            'velocities',
            'str',
            'Optional initial system velocity field in NAMD BINCOOR format. If specified, '
            'overrides field generated by "temperature"',
            None,
            val.String(),
            nargs='*')

        if config is not None:
            self.readConfig(config)
Beispiel #18
0
    def __init__(self):
        super().__init__(version=2)

        logger.warning(
            'This class is for legacy support of older versions of ACEMD. '
            'We recommend updating ACEMD to the latest version and using the Acemd class.'
        )
        # ACEMD2 Options
        self._arg('temperature', 'float',
                  'Temperature of the thermostat in Kelvin.', None,
                  val.Number(float, '0POS'))
        self._arg('restart',
                  'str',
                  'Restart simulation.',
                  None,
                  val.String(),
                  valid_values=('on', 'off'))
        self._arg('restartfreq', 'int', 'Restart file frequency.', None,
                  val.Number(int, '0POS'))
        self._arg('outputname', 'str', 'Output file name.', None, val.String())
        self._arg('xtcfile', 'str', 'Output XTC file name.', None,
                  val.String())
        self._arg('xtcfreq', 'int', 'XTC sampling frequency in steps.', None,
                  val.Number(int, '0POS'))
        self._arg('timestep', 'float', 'Simulation timestep.', None,
                  val.Number(float, '0POS'))
        self._arg(
            'rigidbonds',
            'str',
            'Enable holonomic constraints on all hydrogen-heavy atom bond terms',
            None,
            val.String(),
            valid_values=('none', 'all'))
        self._arg('hydrogenscale', 'float',
                  'Amount by which to scale the mass of H atoms', None,
                  val.Number(float, '0POS'))
        self._arg(
            'switching',
            'str',
            'Enable to apply smoothing and switching functions to electrostatic and VdW '
            'forces.',
            None,
            val.String(),
            valid_values=('on', 'off'))
        self._arg(
            'switchdist', 'float',
            'Range beyond which to begin to apply the switching functions.',
            None, val.Number(float, '0POS'))
        self._arg(
            'cutoff', 'str',
            'Cutoff distance for direct-space electrostatic interaction evaluation.',
            None, val.Number(float, '0POS'))
        self._arg(
            'exclude',
            'str',
            'Which pairs of bonded atoms should be excluded from non-bonded interactions',
            None,
            val.String(),
            valid_values=('none', '1-2', '1-3', '1-4', 'scaled1-4'))
        self._arg('scaling14', 'float',
                  'Scaling factor for 1-4 electrostatic interations.', None,
                  val.Number(float, '0POS'))
        self._arg('langevin',
                  'str',
                  'Enable the Langevin thermostat.',
                  None,
                  val.String(),
                  valid_values=('on', 'off'))
        self._arg('langevintemp', 'float',
                  'The set point in K for the Langevin thermostat.', None,
                  val.Number(float, '0POS'))
        self._arg('langevindamping', 'float',
                  'Langevin damping constant gamma (1/ps)', None,
                  val.Number(float, '0POS'))
        self._arg('pme',
                  'str',
                  'Enable the use of PME for long-range electrostatics.',
                  None,
                  val.String(),
                  valid_values=('on', 'off'))
        self._arg('pmegridspacing', 'float',
                  'The spacing of the PME mesh in 1/A.', None,
                  val.Number(float, '0POS'))
        self._arg(
            'fullelectfrequency', 'int',
            'The frequency in interations between successive calculations of '
            'long-range (PME) electrostatics.', None, val.Number(int, '0POS'))
        self._arg(
            'energyfreq', 'int',
            'The frequency with which ACEMD will calculate system energies.',
            None, val.Number(int, '0POS'))
        self._arg('constraints',
                  'str',
                  'Set to enable positional constraints on specified atoms.',
                  None,
                  val.String(),
                  valid_values=('on', 'off'))
        self._arg(
            'consref', 'str',
            'Specify a PDB file giving reference positions for constrained atoms.',
            None, val.String())
        self._arg(
            'constraintscaling', 'float',
            'The harmonic constraint energy function is multiplied by this '
            'parameter.', None, val.Number(float, 'ANY'))
        self._arg(
            'berendsenpressure',
            'str',
            'Set to enable the Berendsen pressure bath barostatic control.',
            None,
            val.String(),
            valid_values=('on', 'off'))
        self._arg('berendsenpressuretarget', 'float',
                  'The target pressure (Bar) for the barostat.', None,
                  val.Number(float, '0POS'))
        self._arg('berendsenpressurerelaxationtime', 'float',
                  'Relaxation time for the barostat (fs).', None,
                  val.Number(float, '0POS'))
        self._arg('tclforces',
                  'str',
                  'Enable TCL force scripting.',
                  None,
                  val.String(),
                  valid_values=('on', 'off'))
        self._arg(
            'minimize', 'int',
            'Number of steps of conjugate-gradient minimisation to perform.',
            None, val.Number(int, '0POS'))
        self._arg('run', 'str',
                  'The number of simulation iterations to perform.', None)
        self._arg('celldimension',
                  'str',
                  'Dimensions of the unit cell.',
                  None,
                  val.Number(float, 'ANY'),
                  nargs=3)
        self._arg(
            'useconstantratio',
            'str',
            'Keep the ratio of the X-Y dimensions constant while allowing Z to '
            'fluctuate independently.',
            None,
            val.String(),
            valid_values=('on', 'off'))
        self._arg('amber',
                  'str',
                  'Indicate that the Amber force field is to be used.',
                  None,
                  val.String(),
                  valid_values=('on', 'off'))
        self._arg('dielectric', 'float', 'Dielectric constant.', None,
                  val.Number(float, 'ANY'))
        self._arg('pairlistdist', 'str',
                  'Specify the buffer size for grid cells.', None,
                  val.Number(float, 'ANY'))
        self._arg('TCL',
                  'str',
                  'Extra TCL code to be prepended to the input file',
                  None,
                  val.String(),
                  nargs='*')

        # Files
        self._arg(
            'bincoordinates', 'str',
            'Filename for initial structure coordinates, in NAMD Bincoor format.',
            None, val.String())
        self._arg('binvelocities', 'str',
                  'Initial velocity field, in NAMD Bincoor format.', None,
                  val.String())
        self._arg(
            'binindex', 'str',
            'Filename for index file to set initial timestep (as made by a check-point)',
            None, val.String())
        self._arg('structure',
                  'str', 'CHARMM structure topology in PSF format', None,
                  val.String())
        self._arg('parameters',
                  'str', 'CHARMM force-field parameter file (PRM)', None,
                  val.String())
        self._arg(
            'extendedsystem', 'str',
            'If set, specifies an extended system .xsc file, from which a cell dimension'
            ' will be read.', None, val.String())
        self._arg(
            'coordinates', 'str',
            'Filename for initial structure coordinates, in PDB format.', None,
            val.String())
        self._arg('velocities', 'str',
                  'Initial velocity field, in PDB format.', None, val.String())
        self._arg('parmfile', 'str',
                  'The filename of the Amber PRMTOP parameter file.', None,
                  val.String())
Beispiel #19
0
    def __init__(self,
                 _configapp=None,
                 _configfile=None,
                 _findExecutables=True,
                 _logger=True):
        SimQueue.__init__(self)
        ProtocolInterface.__init__(self)
        self._arg(
            "version",
            "int",
            "LSF major version",
            self._defaults["version"],
            valid_values=[9, 10],
        )
        self._arg("jobname", "str", "Job name (identifier)", None,
                  val.String())
        self._arg(
            "queue",
            "list",
            "The queue or list of queues to run on. If list, it attempts to submit the job to "
            "the first queue listed",
            self._defaults["queue"],
            val.String(),
            nargs="*",
        )
        self._arg("app", "str", "The application profile",
                  self._defaults["app"], val.String())
        self._arg(
            "ngpu",
            "int",
            "Number of GPUs to use for a single job",
            self._defaults["ngpu"],
            val.Number(int, "0POS"),
        )
        self._arg(
            "gpu_options",
            "dict",
            "Number of GPUs to use for a single job",
            self._defaults["gpu_options"],
            val.Dictionary(
                key_type=str,
                valid_keys=["mode", "mps", "j_exclusive"],
                value_type={
                    "mode": str,
                    "mps": str,
                    "j_exclusive": str
                },
                valid_values={
                    "mode": ["shared", "exclusive_process"],
                    "mps": ["yes", "no"],
                    "j_exclusive": ["yes", "no"],
                },
            ),
        )
        self._arg(
            "ncpu",
            "int",
            "Number of CPUs to use for a single job",
            self._defaults["ncpu"],
            val.Number(int, "0POS"),
        )
        self._arg(
            "memory",
            "int",
            "Amount of memory per job (KB)",
            self._defaults["memory"],
            val.Number(int, "0POS"),
        )
        self._arg(
            "walltime",
            "int",
            "Job timeout (hour:min or min)",
            self._defaults["walltime"],
            val.Number(int, "0POS"),
        )
        self._arg(
            "resources",
            "list",
            "Resources of the queue",
            self._defaults["resources"],
            val.String(),
            nargs="*",
        )
        self._cmdDeprecated("environment", "prerun")
        self._arg("outputstream", "str", "Output stream.", "lsf.%J.out",
                  val.String())
        self._arg("errorstream", "str", "Error stream.", "lsf.%J.err",
                  val.String())
        self._arg(
            "datadir",
            "str",
            "The path in which to store completed trajectories.",
            None,
            val.String(),
        )
        self._arg(
            "trajext",
            "str",
            "Extension of trajectory files. This is needed to copy them to datadir.",
            "xtc",
            val.String(),
        )
        self._arg(
            "envvars",
            "str",
            "Envvars to propagate from submission node to the running node (comma-separated)",
            self._defaults["envvars"],
            val.String(),
        )
        self._arg(
            "prerun",
            "list",
            "Shell commands to execute on the running node before the job (e.g. "
            "loading modules)",
            self._defaults["prerun"],
            val.String(),
            nargs="*",
        )

        # Load LSF configuration profile
        loadConfig(self, "lsf", _configfile, _configapp, _logger)

        # Find executables
        if _findExecutables:
            self._qsubmit = LsfQueue._find_binary("bsub")
            self._qinfo = LsfQueue._find_binary("bqueues")
            self._qcancel = LsfQueue._find_binary("bkill")
            self._qstatus = LsfQueue._find_binary("bjobs")
Beispiel #20
0
    def __init__(self):
        super().__init__()
        self._arg('ngpu', 'int', 'Number of GPU devices that the queue will use. Each simulation will be run on '
                                  'a different GPU. The queue will use the first `ngpus` devices of the machine.',
                       None, val.Number(int, '0POS'))
        self._arg('devices', 'list', 'A list of GPU device indexes on which the queue is allowed to run '
                                     'simulations. Mutually exclusive with `ngpus`', None, val.Number(int, '0POS'), nargs='*')
        self._arg('datadir', 'str', 'The path in which to store completed trajectories.', None, val.String())
        self._arg('trajext', 'str', 'Extension of trajectory files. This is needed to copy them to datadir.', 'xtc', val.String())

        self._states = dict()
        self._queue = None
        self._shutdown = False
Beispiel #21
0
    def __init__(self,
                 _configapp=None,
                 _configfile=None,
                 _findExecutables=True,
                 _logger=True):
        SimQueue.__init__(self)
        ProtocolInterface.__init__(self)
        self._arg("jobname", "str", "Job name (identifier)", None,
                  val.String())
        self._arg(
            "queue",
            "list",
            "The queue or list of queues to run on. If list, it attempts to submit the job to "
            "the first queue listed",
            self._defaults["queue"],
            val.String(),
            nargs="*",
        )
        self._arg(
            "ngpu",
            "int",
            "Number of GPUs to use for a single job",
            self._defaults["ngpu"],
            val.Number(int, "0POS"),
        )
        self._arg(
            "ncpu",
            "int",
            "Number of CPUs to use for a single job",
            self._defaults["ncpu"],
            val.Number(int, "0POS"),
        )
        self._arg(
            "memory",
            "int",
            "Amount of memory per job (MiB)",
            self._defaults["memory"],
            val.Number(int, "0POS"),
        )
        self._arg(
            "walltime",
            "int",
            "Job timeout (hour:min or min)",
            self._defaults["walltime"],
            val.Number(int, "0POS"),
        )
        self._arg(
            "pe",
            "str",
            "SGE Parallel Environment",
            self._defaults["pe"],
            val.String(),
        )
        self._arg(
            "resources",
            "list",
            "Resources of the queue",
            self._defaults["resources"],
            val.String(),
            nargs="*",
        )
        self._cmdDeprecated("environment", "prerun")
        self._arg(
            "outputstream",
            "str",
            "Output stream.",
            "$REQUEST.oJID[.TASKID]",
            val.String(),
        )
        self._arg(
            "errorstream",
            "str",
            "Error stream.",
            "$REQUEST.eJID[.TASKID]",
            val.String(),
        )
        self._arg(
            "datadir",
            "str",
            "The path in which to store completed trajectories.",
            None,
            val.String(),
        )
        self._arg(
            "trajext",
            "str",
            "Extension of trajectory files. This is needed to copy them to datadir.",
            "xtc",
            val.String(),
        )
        self._arg(
            "envvars",
            "str",
            "Envvars to propagate from submission node to the running node (comma-separated)",
            self._defaults["envvars"],
            val.String(),
        )
        self._arg(
            "prerun",
            "list",
            "Shell commands to execute on the running node before the job (e.g. "
            "loading modules)",
            self._defaults["prerun"],
            val.String(),
            nargs="*",
        )

        # Load SGE configuration profile
        loadConfig(self, "sge", _configfile, _configapp, _logger)

        # Find executables
        if _findExecutables:
            self._qsubmit = SgeQueue._find_binary("qsub")
            self._qinfo = SgeQueue._find_binary("qhost")
            self._qcancel = SgeQueue._find_binary("qdel")
            self._qstatus = SgeQueue._find_binary("qstat")
            self._checkQueue()
Beispiel #22
0
    def __init__(self):
        """
        temperature : float, default=None
            Temperature of the thermostat in Kelvin.
        restart : str, default=None
            Restart simulation.
        trajectoryfile : str, default=None
            Output file name.
        trajectoryfreq : int, default=None
            Trajectory sampling frequency in steps.
        timestep : int, default=None
            Simulation timestep.
        pme : str, default=None
            Particle-mesh Ewald summation.
        switching : str, default=None
            Apply switching function to the van der Waals potential.
        switchdist : float, default=None
            Distance in Angstrom at which to begin applying the switching function.
        cutoff : float, default=None
            Real-space cutoff in Angstroms for electrostatics and van der Waals.
        thermostat : str, default=None
            Enable thermostatic control
        thermostattemp : float, default=None
            Target temperature (K) for thermostatic control
        thermostatdamping : float, default=None
            Damping constant for the Langevin thermostat in ps^-1
        restraints : str, default=None
            Restraining potentials
        barostat : str, default=None
            Enable pressure control
        barostatpressure : float, default=None
            The target pressure in bar
        useflexiblecell : str, default=None
            Allow X, Y and Z unit cell dimensions to vary independently
        useconstantarea : str, default=None
            Constrain the X,Y dimensions of the unit cell. Allow Z to vary independently.
        useconstantratio : str, default=None
            Constrain the X:Y ratio of the unit cell dimensions. Allow Z to vary independently.
        minimize : int, default=None
            The number of energy minimization steps to perform before commencing dynamics.
        run : str, default=None
            The length of simulation ro run. May be specified as a number of steps or as a time if one of the suffices "us", "ns", "ps", "fs" is used.
        celldimension : str, default=None
            The dimensions of the unit cell in Angstrom. Note that the unit cell must be cuboid. Overrides any dimension given in the "coordinates" PDB.
        bincoordinates : str, default=None
            Optional initial system geometry in NAMD BINCOOR format. If specified, overrides "coordinates"
        binvelocities : str, default=None
            Optional initial system velocity field in NAMD BINCOOR format. If specified, overrides field generated by "temperature" and "velocities"
        structure : str, default=None
            The filename of a CHARMM PSF file
        parameters : str, default=None
            The filename of a CHARMM PAR file
        parmfile : str, default=None
            The filename of an Amber PRMTOP file
        extendedsystem : str, default=None
            Filename of a NAMD XSC format file giving the periodic cell dimensions. Overrides "celldimension" and any dimensions in the "coordinates" PDB
        coordinates : str, default=None
            Mandatory initial system geometry in PDB format
        velocities : str, default=None
            Optional initial system velocity field in NAMD BINCOOR format. If specified, overrides field generated by "temperature"
        """
        super().__init__()
        self._files = {}
        self._outnames = {}

        # Options
        self._arg('temperature', 'float',
                  'Temperature of the thermostat in Kelvin.', None,
                  val.Number(float, 'ANY'))
        self._arg('restart', 'str', 'Restart simulation.', None, val.String())
        self._arg('trajectoryfile', 'str', 'Output file name.', None,
                  val.String())
        self._arg('trajectoryfreq', 'int',
                  'Trajectory sampling frequency in steps.', None,
                  val.Number(int, 'POS'))
        self._arg('timestep', 'int', 'Simulation timestep.', None,
                  val.Number(int, 'POS'))
        self._arg('pme', 'str', 'Particle-mesh Ewald summation.', None,
                  val.String())
        self._arg('switching', 'str',
                  'Apply switching function to the van der Waals potential.',
                  None, val.String())
        self._arg(
            'switchdist', 'float',
            'Distance in Angstrom at which to begin applying the switching function.',
            None, val.Number(float, '0POS'))
        self._arg(
            'cutoff', 'float',
            'Real-space cutoff in Angstroms for electrostatics and van der Waals.',
            None, val.Number(float, '0POS'))
        self._arg('thermostat', 'str', 'Enable thermostatic control', None,
                  val.String())
        self._arg('thermostattemp', 'float',
                  'Target temperature (K) for thermostatic control', None,
                  val.Number(float, '0POS'))
        self._arg('thermostatdamping', 'float',
                  'Damping constant for the Langevin thermostat in ps^-1',
                  None, val.Number(float, '0POS'))
        self._arg('restraints',
                  'str',
                  'Restraining potentials',
                  None,
                  val.Object(_Restraint),
                  nargs='*')
        self._arg('barostat', 'str', 'Enable pressure control', None,
                  val.String())
        self._arg('barostatpressure', 'float', 'The target pressure in bar',
                  None, val.Number(float, '0POS'))
        self._arg(
            'useflexiblecell', 'str',
            'Allow X, Y and Z unit cell dimensions to vary independently',
            None, val.String())
        self._arg(
            'useconstantarea', 'str',
            'Constrain the X,Y dimensions of the unit cell. Allow Z to vary independently.',
            None, val.String())
        self._arg(
            'useconstantratio', 'str',
            'Constrain the X:Y ratio of the unit cell dimensions. Allow Z to vary independently.',
            None, val.String())
        self._arg(
            'minimize', 'int',
            'The number of energy minimization steps to perform before commencing dynamics.',
            None, val.Number(int, '0POS'))
        self._arg(
            'run', 'str',
            'The length of simulation ro run. May be specified as a number of steps or as a time if one of the suffices "us", "ns", "ps", "fs" is used.',
            None, val.String())
        self._arg(
            'celldimension', 'str',
            'The dimensions of the unit cell in Angstrom. Note that the unit cell must be cuboid. Overrides any dimension given in the "coordinates" PDB.',
            None, val.String())

        # Files
        self._arg(
            'bincoordinates', 'str',
            'Optional initial system geometry in NAMD BINCOOR format. If specified, overrides "coordinates"',
            None, val.String())
        self._arg(
            'binvelocities', 'str',
            'Optional initial system velocity field in NAMD BINCOOR format. If specified, overrides field generated by "temperature" and "velocities"',
            None, val.String())
        self._arg('structure', 'str', 'The filename of a CHARMM PSF file',
                  None, val.String())
        self._arg('parameters', 'str', 'The filename of a CHARMM PAR file',
                  None, val.String())
        self._arg('parmfile', 'str', 'The filename of an Amber PRMTOP file',
                  None, val.String())
        self._arg(
            'extendedsystem', 'str',
            'Filename of a NAMD XSC format file giving the periodic cell dimensions. Overrides "celldimension" and any dimensions in the "coordinates" PDB',
            None, val.String())
        self._arg('coordinates', 'str',
                  'Mandatory initial system geometry in PDB format', None,
                  val.String())
        self._arg(
            'velocities', 'str',
            'Optional initial system velocity field in NAMD BINCOOR format. If specified, overrides field generated by "temperature"',
            None, val.String())
Beispiel #23
0
    def __init__(self, _version=_config["acemdversion"]):
        if _version == 2:
            raise RuntimeError("Equilibration v3 only supports _version=3")

        super().__init__()
        self._arg(
            "acemd",
            ":class:`Acemd <htmd.mdengine.acemd.acemd.Acemd>` object",
            "Acemd class object",
            None,
            val.Object([Acemd2, Acemd]),
        )
        self._arg(
            "runtime",
            "float",
            "Running time of the simulation.",
            25000,
            val.Number(float, "0POS"),
        )
        self._arg(
            "timeunits",
            "str",
            "Units for time arguments. Can be 'steps', 'ns' etc.",
            "steps",
            val.String(),
        )
        self._arg(
            "temperature",
            "float",
            "Temperature of the thermostat in Kelvin",
            300,
            val.Number(float, "ANY"),
        )
        self._arg(
            "useconstantratio",
            "bool",
            "For membrane protein simulations set it to true so that the barostat "
            "does not modify the xy aspect ratio.",
            False,
            val.Boolean(),
        )
        self._arg(
            "restraintsteps",
            "int",
            "Number of initial steps to apply restraints in units of 4fs. Defaults "
            "to half the simulation time.",
            None,
            val.Number(int, "ANY"),
        )
        self._arg(
            "restraints",
            "list",
            "A list of restraint objects. If None will apply defaultEquilRestraints decaying over half the runtime. If no restraints are required set to empty list []."
            "See :class:`AtomRestraint <htmd.mdengine.acemd.acemd.AtomRestraint>` and"
            ":class:`GroupRestraint <htmd.mdengine.acemd.acemd.GroupRestraint>`)",
            None,
            val.Object(_Restraint),
            nargs="*",
        )

        self.acemd = Acemd()
        self.acemd.coordinates = None
        self.acemd.structure = None
        self.acemd.parameters = None
        self.acemd.restart = "on"
        self.acemd.trajectoryfile = "output.xtc"
        self.acemd.trajectoryperiod = 25000
        self.acemd.timestep = 4
        self.acemd.switching = "on"
        self.acemd.switchdistance = 7.5
        self.acemd.cutoff = 9
        self.acemd.thermostat = "on"
        self.acemd.thermostatdamping = 1
        self.acemd.pme = "on"
        self.acemd.barostat = "on"
        self.acemd.barostatpressure = 1.01325
        self.acemd.minimize = 500
Beispiel #24
0
    def __init__(self):
        super().__init__()
        self._arg(
            "acemd",
            ":class:`Acemd <htmd.mdengine.acemd.acemd.Acemd>`"
            " object",
            "Acemd class object",
            None,
            val.Object(Acemd),
        )
        self._arg(
            "runtime",
            "float",
            "Running time of the simulation.",
            25000,
            val.Number(float, "0POS"),
        )
        self._arg(
            "timeunits",
            "str",
            "Units for runtime. Can be 'steps', 'ns' etc.",
            "steps",
            val.String(),
        )
        self._arg(
            "temperature",
            "float",
            "Temperature of the thermostat in Kelvin",
            300,
            val.Number(float, "ANY"),
        )
        self._arg(
            "fb_k",
            "float",
            "Force constant of the flatbottom potential in kcal/mol/A^2. E.g. 5",
            0,
            val.Number(float, "ANY"),
        )
        self._arg(
            "fb_reference",
            "str",
            "Reference selection to use as dynamic center of the flatbottom box.",
            "none",
            val.String(),
        )
        self._arg(
            "fb_selection",
            "str",
            "Selection of atoms to apply the flatbottom potential",
            "none",
            val.String(),
        )
        self._arg(
            "fb_box",
            "list",
            "Position of the flatbottom box in term of the reference center given as "
            "[xmin, xmax, ymin, ymax, zmin, zmax]",
            [0, 0, 0, 0, 0, 0],
            val.Number(float, "ANY"),
            nargs=6,
        )
        self._arg(
            "useconstantratio",
            "bool",
            "For membrane protein simulations set it to true so that the barostat "
            "does not modify the xy aspect ratio.",
            False,
            val.Boolean(),
        )
        self._arg(
            "useconstraints",
            "bool",
            "Apply constraints to the production simulation, defined by the "
            "constraints parameter",
            False,
            val.Boolean(),
        )
        self._arg(
            "constraints",
            "dict",
            "A dictionary of atomselections and values of the constraint to be "
            "applied (in kcal/mol/A^2). Atomselects must be mutually exclusive.",
            {},
            val.Dictionary(key_type=str),
        )
        self._arg(
            "adaptive",
            "bool",
            "Set to True if making production runs for adaptive sampling.",
            False,
            val.Boolean(),
        )
        self._arg(
            "restraints",
            "list",
            "A list of restraint objects."
            "See :class:`AtomRestraint <htmd.mdengine.acemd.acemd.AtomRestraint>` and"
            ":class:`GroupRestraint <htmd.mdengine.acemd.acemd.GroupRestraint>`"
            ")",
            None,
            val.Object(_Restraint),
            nargs="*",
        )

        self.acemd = Acemd()
        self.acemd.binvelocities = None
        self.acemd.bincoordinates = "output.coor"
        self.acemd.extendedsystem = "output.xsc"
        self.acemd.coordinates = None
        self.acemd.structure = None
        self.acemd.parameters = None
        self.acemd.restart = "on"
        self.acemd.trajectoryfile = "output.xtc"
        self.acemd.trajectoryperiod = 25000
        self.acemd.timestep = 4
        self.acemd.switching = "on"
        self.acemd.switchdistance = 7.5
        self.acemd.cutoff = 9
        self.acemd.thermostat = "on"
        self.acemd.thermostatdamping = 0.1
        self.acemd.pme = "on"
Beispiel #25
0
    def __init__(self,
                 _configapp=None,
                 _configfile=None,
                 _findExecutables=True,
                 _logger=True):
        super().__init__()
        self._arg("jobname", "str", "Job name (identifier)", None,
                  val.String())
        self._arg("queue", "str", "The queue to run on", None, val.String())
        self._arg(
            "ngpu",
            "int",
            "Number of GPUs to use for a single job",
            0,
            val.Number(int, "0POS"),
        )
        self._arg(
            "ncpu",
            "int",
            "Number of CPUs to use for a single job",
            1,
            val.Number(int, "0POS"),
        )
        self._arg(
            "memory",
            "int",
            "Amount of memory per job (MB)",
            1000,
            val.Number(int, "0POS"),
        )
        self._arg("walltime", "int", "Job timeout (s)", 3600,
                  val.Number(int, "POS"))
        self._arg(
            "environment",
            "str",
            "Envvars to propagate to the job.",
            "ACEMD_HOME,HTMD_LICENSE_FILE",
            val.String(),
        )
        self._arg(
            "datadir",
            "str",
            "The path in which to store completed trajectories.",
            None,
            val.String(),
        )
        self._arg(
            "trajext",
            "str",
            "Extension of trajectory files. This is needed to copy them to datadir.",
            "xtc",
            val.String(),
        )
        self._arg(
            "cluster",
            "str",
            "Select nodes from a single specified cluster",
            None,
            val.String(),
        )
        self._arg("scratch_local", "int", "Local scratch in MB", None,
                  val.Number(int, "0POS"))

        loadConfig(self, "pbs", _configfile, _configapp, _logger)

        # Find executables
        if _findExecutables:
            self._qsubmit = PBSQueue._find_binary("qsub")
            self._qinfo = PBSQueue._find_binary("qstat") + " -a"
            self._qcancel = PBSQueue._find_binary("qdel")
            self._qstatus = PBSQueue._find_binary("qstat") + " -Q"

        self._sentinel = "jobqueues.done"
        # For synchronous
        self._joblist = []
        self._dirs = []
Beispiel #26
0
    def __init__(self, _configapp=None):
        SimQueue.__init__(self)
        ProtocolInterface.__init__(self)
        self._arg('jobname', 'str', 'Job name (identifier)', None,
                  val.String())
        self._arg(
            'partition',
            'str',
            'The queue (partition) or list of queues to run on. If list, the one offering '
            'earliest initiation will be used.',
            self._defaults['partition'],
            val.String(),
            nargs='*')
        self._arg('priority', 'str', 'Job priority',
                  self._defaults['priority'], val.String())
        self._arg('ngpu', 'int', 'Number of GPUs to use for a single job',
                  self._defaults['ngpu'], val.Number(int, '0POS'))
        self._arg('ncpu', 'int', 'Number of CPUs to use for a single job',
                  self._defaults['ncpu'], val.Number(int, 'POS'))
        self._arg('memory', 'int', 'Amount of memory per job (MiB)',
                  self._defaults['memory'], val.Number(int, 'POS'))
        self._arg(
            'gpumemory', 'int',
            'Only run on GPUs with at least this much memory. Needs special setup of SLURM. '
            'Check how to define gpu_mem on SLURM.', None,
            val.Number(int, '0POS'))
        self._arg('walltime', 'int', 'Job timeout (minutes)',
                  self._defaults['walltime'], val.Number(int, 'POS'))
        self._cmdDeprecated('environment', 'envvars')
        self._arg(
            'mailtype', 'str',
            'When to send emails. Separate options with commas like \'END,FAIL\'.',
            None, val.String())
        self._arg('mailuser', 'str', 'User email address.', None, val.String())
        self._arg('outputstream', 'str', 'Output stream.', 'slurm.%N.%j.out',
                  val.String())
        self._arg('errorstream', 'str', 'Error stream.',
                  'slurm.%N.%j.err'), val.String()
        self._arg('datadir', 'str',
                  'The path in which to store completed trajectories.', None,
                  val.String())
        self._arg(
            'trajext', 'str',
            'Extension of trajectory files. This is needed to copy them to datadir.',
            'xtc', val.String())
        self._arg(
            'nodelist',
            'list',
            'A list of nodes on which to run every job at the *same time*! Careful! The jobs'
            ' will be duplicated!',
            None,
            val.String(),
            nargs='*')
        self._arg(
            'exclude',
            'list',
            'A list of nodes on which *not* to run the jobs. Use this to select nodes on '
            'which to allow the jobs to run on.',
            None,
            val.String(),
            nargs='*')
        self._arg(
            'envvars', 'str',
            'Envvars to propagate from submission node to the running node (comma-separated)',
            self._defaults['envvars'], val.String())
        self._arg(
            'prerun',
            'list',
            'Shell commands to execute on the running node before the job (e.g. '
            'loading modules)',
            self._defaults['prerun'],
            val.String(),
            nargs='*')
        self._arg('account', 'str',
                  'Charge resources used by the jobs to specified account.',
                  None, val.String())

        # Load Slurm configuration profile
        slurmconfig = _config['slurm']
        profile = None
        if _configapp is not None:
            if slurmconfig is not None:
                if os.path.isfile(slurmconfig) and slurmconfig.endswith(
                    ('.yml', '.yaml')):
                    try:
                        with open(slurmconfig, 'r') as f:
                            profile = yaml.load(f)
                        logger.info(
                            'Loaded Slurm configuration YAML file {}'.format(
                                slurmconfig))
                    except:
                        logger.warning(
                            'Could not load YAML file {}'.format(slurmconfig))
                else:
                    logger.warning(
                        '{} does not exist or it is not a YAML file.'.format(
                            slurmconfig))
                if profile:
                    try:
                        properties = profile[_configapp]
                    except:
                        raise RuntimeError(
                            'There is no profile in {} for configuration '
                            'app {}'.format(slurmconfig, _configapp))
                    for p in properties:
                        setattr(self, p, properties[p])
                        logger.info('Setting {} to {}'.format(
                            p, properties[p]))
            else:
                raise RuntimeError(
                    'No Slurm configuration YAML file defined for the configapp'
                )
        else:
            if slurmconfig is not None:
                logger.warning(
                    'Slurm configuration YAML file defined without configuration app'
                )

        # Find executables
        self._qsubmit = SlurmQueue._find_binary('sbatch')
        self._qinfo = SlurmQueue._find_binary('sinfo')
        self._qcancel = SlurmQueue._find_binary('scancel')
        self._qstatus = SlurmQueue._find_binary('squeue')
Beispiel #27
0
    def __init__(self, _version=2):
        super().__init__()
        self._version = _version
        self._arg(
            'acemd',
            ':class:`Acemd2 <htmd.apps.acemd.Acemd>` or :class:`Acemd <htmd.mdengine.acemd.acemd.Acemd>`'
            ' object', 'Acemd class object', None, val.Object([Acemd2, Acemd]))
        self._arg('runtime', 'float', 'Running time of the simulation.', 25000,
                  val.Number(float, '0POS'))
        self._arg('timeunits', 'str',
                  'Units for runtime. Can be \'steps\', \'ns\' etc.', 'steps',
                  val.String())
        self._arg('temperature', 'float',
                  'Temperature of the thermostat in Kelvin', 300,
                  val.Number(float, 'ANY'))
        self._arg(
            'fb_k', 'float',
            'Force constant of the flatbottom potential in kcal/mol/A^2. E.g. 5',
            0, val.Number(float, 'ANY'))
        self._arg(
            'fb_reference', 'str',
            'Reference selection to use as dynamic center of the flatbottom box.',
            'none', val.String())
        self._arg('fb_selection', 'str',
                  'Selection of atoms to apply the flatbottom potential',
                  'none', val.String())
        self._arg(
            'fb_box',
            'list',
            'Position of the flatbottom box in term of the reference center given as '
            '[xmin, xmax, ymin, ymax, zmin, zmax]', [0, 0, 0, 0, 0, 0],
            val.Number(float, 'ANY'),
            nargs=6)
        self._arg(
            'useconstantratio', 'bool',
            'For membrane protein simulations set it to true so that the barostat '
            'does not modify the xy aspect ratio.', False, val.Boolean())
        self._arg(
            'useconstraints', 'bool',
            'Apply constraints to the production simulation, defined by the '
            'constraints parameter', False, val.Boolean())
        self._arg(
            'constraints', 'dict',
            'A dictionary of atomselections and values of the constraint to be '
            'applied (in kcal/mol/A^2). Atomselects must be mutually exclusive.',
            {}, val.Dictionary(key_type=str))
        self._arg(
            'adaptive', 'bool',
            'Set to True if making production runs for adaptive sampling.',
            False, val.Boolean())
        self._arg(
            'restraints',
            'list',
            'A list of restraint objects. Only works with {}(_version=3),'
            'see :class:`AtomRestraint <htmd.mdengine.acemd.acemd.AtomRestraint>` and'
            ':class:`GroupRestraint <htmd.mdengine.acemd.acemd.GroupRestraint>`'
            ')'.format(self.__class__.__name__),
            None,
            val.Object(_Restraint),
            nargs='*')

        if self._version == 2:
            self.acemd = Acemd2()
            self.acemd.binindex = None
            self.acemd.binvelocities = None
            self.acemd.bincoordinates = 'output.coor'
            self.acemd.extendedsystem = 'output.xsc'
            self.acemd.coordinates = None
            self.acemd.structure = None
            self.acemd.parameters = None
            self.acemd.temperature = None
            self.acemd.restart = 'on'
            self.acemd.restartfreq = '5000'
            self.acemd.outputname = 'output'
            self.acemd.xtcfile = 'output.xtc'
            self.acemd.xtcfreq = '25000'
            self.acemd.timestep = '4'
            self.acemd.rigidbonds = 'all'
            self.acemd.hydrogenscale = '4'
            self.acemd.switching = 'on'
            self.acemd.switchdist = '7.5'
            self.acemd.cutoff = '9'
            self.acemd.exclude = 'scaled1-4'
            self.acemd.scaling14 = '1.0'
            self.acemd.langevin = 'on'
            self.acemd.langevintemp = None
            self.acemd.langevindamping = '0.1'
            self.acemd.pme = 'on'
            self.acemd.pmegridspacing = '1.0'
            self.acemd.fullelectfrequency = '2'
            self.acemd.energyfreq = '5000'
            self.acemd.consref = None
            self.acemd.run = '$numsteps'
            self.acemd.TCL = ('''
set numsteps {NUMSTEPS}
set fb_refindex {{ {REFINDEX} }}
set fb_selindex {{ {SELINDEX} }}
set fb_box {{ {BOX} }}
set fb_K {KCONST}
#
''', '''
proc flatbot1d {x xm xM fb_K} {
  set f 0
  if {$x < $xm} {
    set f [expr $fb_K*[expr $xm-$x]]
  }
  if {$x > $xM} {
    set f [expr $fb_K*[expr $xM-$x]]
  }
  return $f
}
proc calcforces_init {} {
  global ref sel fb_refindex fb_selindex
  berendsenpressure  off
  set ref [addgroup  $fb_refindex]
  set sel [addgroup  $fb_selindex]
}
proc calcforces {} {
  global ref sel fb_K fb_box
  loadcoords coords
##FLATBOTTOM
  if {$fb_K>0} {
    set r0 $coords($ref)
    set r1 $coords($sel)
    set dr  [vecsub $r1 $r0]
    set fx [flatbot1d [lindex $dr 0] [lindex $fb_box 0] [lindex $fb_box 1] $fb_K]
    set fy [flatbot1d [lindex $dr 1] [lindex $fb_box 2] [lindex $fb_box 3] $fb_K]
    set fz [flatbot1d [lindex $dr 2] [lindex $fb_box 4] [lindex $fb_box 5] $fb_K]
    #print "dr: $dr  fx: $fx fy: $fy fz: $fz"
    addforce $sel [list $fx $fy $fz]
  }
}
proc calcforces_endstep { } { }
''')
        elif self._version == 3:
            self.acemd = Acemd()
            self.acemd.binvelocities = None
            self.acemd.bincoordinates = 'output.coor'
            self.acemd.extendedsystem = 'output.xsc'
            self.acemd.coordinates = None
            self.acemd.structure = None
            self.acemd.parameters = None
            self.acemd.restart = 'on'
            self.acemd.trajectoryfile = 'output.xtc'
            self.acemd.trajectoryfreq = 25000
            self.acemd.timestep = 4
            self.acemd.switching = 'on'
            self.acemd.switchdist = 7.5
            self.acemd.cutoff = 9
            self.acemd.thermostat = 'on'
            self.acemd.thermostatdamping = 0.1
            self.acemd.pme = 'on'
        else:
            raise ValueError(
                '_version can not be {}. Choose either 2 or 3.'.format(
                    self._version))
Beispiel #28
0
    def __init__(self, config=None):
        super().__init__()
        self._arg(
            "temperature",
            "float",
            "Temperature of the thermostat in Kelvin.",
            None,
            val.Number(float, "ANY"),
        )
        self._arg("restart", "str", "Restart simulation.", None, val.String())
        self._arg("trajectoryfile", "str", "Output file name.", None,
                  val.String())
        self._arg(
            "trajectoryperiod",
            "int",
            "Trajectory sampling frequency in steps.",
            None,
            val.Number(int, "POS"),
        )
        self._arg("timestep", "int", "Simulation timestep.", None,
                  val.Number(int, "POS"))
        self._arg("pme", "str", "Particle-mesh Ewald summation.", None,
                  val.String())
        self._arg(
            "switching",
            "str",
            "Apply switching function to the van der Waals potential.",
            None,
            val.String(),
        )
        self._arg(
            "switchdistance",
            "float",
            "Distance in Angstrom at which to begin applying the switching function.",
            None,
            val.Number(float, "0POS"),
        )
        self._arg(
            "cutoff",
            "float",
            "Real-space cutoff in Angstroms for electrostatics and van der Waals.",
            None,
            val.Number(float, "0POS"),
        )
        self._arg("thermostat", "str", "Enable thermostatic control", None,
                  val.String())
        self._arg(
            "thermostattemperature",
            "float",
            "Target temperature (K) for thermostatic control",
            None,
            val.Number(float, "0POS"),
        )
        self._arg(
            "thermostatdamping",
            "float",
            "Damping constant for the Langevin thermostat in ps^-1",
            None,
            val.Number(float, "0POS"),
        )
        self._arg(
            "restraints",
            "str",
            "Restraining potentials",
            None,
            val.Object(_Restraint),
            nargs="*",
        )
        self._arg("barostat", "str", "Enable pressure control", None,
                  val.String())
        self._arg(
            "barostatpressure",
            "float",
            "The target pressure in bar",
            None,
            val.Number(float, "0POS"),
        )
        self._arg(
            "barostatanisotropic",
            "str",
            "Allow X, Y and Z unit cell dimensions to vary independently",
            None,
            val.String(),
        )
        self._arg(
            "barostatconstxy",
            "str",
            "Constrain the X,Y dimensions of the unit cell. Allow Z to vary "
            "independently.",
            None,
            val.String(),
        )
        self._arg(
            "barostatconstratio",
            "str",
            "Constrain the X:Y ratio of the unit cell dimensions. Allow Z to vary "
            "independently.",
            None,
            val.String(),
        )
        self._arg(
            "minimize",
            "int",
            "The number of energy minimization steps to perform before commencing dynamics.",
            None,
            val.Number(int, "0POS"),
        )
        self._arg(
            "run",
            "str",
            "The length of simulation to run. May be specified as a number of steps or as a time "
            'if one of the suffices "us", "ns", "ps", "fs" is used.',
            None,
            val.String(),
        )
        self._arg(
            "boxsize",
            "str",
            "The dimensions of the unit cell in Angstrom. Note that the unit cell must "
            'be cuboid. Overrides any dimension given in the "coordinates" PDB.',
            None,
            val.String(),
        )
        self._arg(
            "implicitsolvent",
            "str",
            "Set to True to enable implicit solvent simulations in AMBER.",
            None,
            val.String(),
        )

        # Files
        self._arg(
            "bincoordinates",
            "str",
            "Optional initial system geometry in NAMD BINCOOR format. If specified, "
            'overrides "coordinates"',
            None,
            val.String(),
            nargs="*",
        )
        self._arg(
            "binvelocities",
            "str",
            "Optional initial system velocity field in NAMD BINCOOR format. If "
            'specified, overrides field generated by "temperature" and "velocities"',
            None,
            val.String(),
            nargs="*",
        )
        self._arg(
            "structure",
            "str",
            "The filename of a CHARMM PSF file",
            None,
            val.String(),
            nargs="*",
        )
        self._arg(
            "parameters",
            "str",
            "The filename of a CHARMM PAR file",
            None,
            val.String(),
            nargs="*",
        )
        self._arg(
            "parmfile",
            "str",
            "The filename of an Amber PRMTOP file",
            None,
            val.String(),
            nargs="*",
        )
        self._arg(
            "extendedsystem",
            "str",
            "Filename of a NAMD XSC format file giving the periodic cell dimensions. "
            'Overrides "boxsize" and any dimensions in the "coordinates" PDB',
            None,
            val.String(),
            nargs="*",
        )
        self._arg(
            "coordinates",
            "str",
            "Mandatory initial system geometry in PDB format",
            None,
            val.String(),
            nargs="*",
        )
        self._arg(
            "velocities",
            "str",
            "Optional initial system velocity field in NAMD BINCOOR format. If specified, "
            'overrides field generated by "temperature"',
            None,
            val.String(),
            nargs="*",
        )
        self._arg(
            "slowperiod",
            "int",
            "Slow period",
            2,
            val.Number(int, "POS"),
        )

        if config is not None:
            self.readConfig(config)
Beispiel #29
0
    def __init__(self, _configapp=None):
        SimQueue.__init__(self)
        ProtocolInterface.__init__(self)
        self._arg('version',
                  'int',
                  'LSF major version',
                  self._defaults['version'],
                  valid_values=[9, 10])
        self._arg('jobname', 'str', 'Job name (identifier)', None,
                  val.String())
        self._arg(
            'queue',
            'list',
            'The queue or list of queues to run on. If list, it attempts to submit the job to '
            'the first queue listed',
            self._defaults['queue'],
            val.String(),
            nargs='*')
        self._arg('app', 'str', 'The application profile',
                  self._defaults['app'], val.String())
        self._arg('ngpu', 'int', 'Number of GPUs to use for a single job',
                  self._defaults['ngpu'], val.Number(int, '0POS'))
        self._arg(
            'gpu_options', 'dict', 'Number of GPUs to use for a single job',
            self._defaults['gpu_options'],
            val.Dictionary(key_type=str,
                           valid_keys=['mode', 'mps', 'j_exclusive'],
                           value_type={
                               'mode': str,
                               'mps': str,
                               'j_exclusive': str
                           },
                           valid_values={
                               'mode': ['shared', 'exclusive_process'],
                               'mps': ['yes', 'no'],
                               'j_exclusive': ['yes', 'no']
                           }))
        self._arg('ncpu', 'int', 'Number of CPUs to use for a single job',
                  self._defaults['ncpu'], val.Number(int, '0POS'))
        self._arg('memory', 'int', 'Amount of memory per job (MiB)',
                  self._defaults['memory'], val.Number(int, '0POS'))
        self._arg('walltime', 'int', 'Job timeout (hour:min or min)',
                  self._defaults['walltime'], val.Number(int, '0POS'))
        self._arg('resources',
                  'list',
                  'Resources of the queue',
                  self._defaults['resources'],
                  val.String(),
                  nargs='*')
        self._cmdDeprecated('environment', 'prerun')
        self._arg('outputstream', 'str', 'Output stream.', 'lsf.%J.out',
                  val.String())
        self._arg('errorstream', 'str', 'Error stream.', 'lsf.%J.err',
                  val.String())
        self._arg('datadir', 'str',
                  'The path in which to store completed trajectories.', None,
                  val.String())
        self._arg(
            'trajext', 'str',
            'Extension of trajectory files. This is needed to copy them to datadir.',
            'xtc', val.String())
        self._arg(
            'envvars', 'str',
            'Envvars to propagate from submission node to the running node (comma-separated)',
            self._defaults['envvars'], val.String())
        self._arg(
            'prerun',
            'list',
            'Shell commands to execute on the running node before the job (e.g. '
            'loading modules)',
            self._defaults['prerun'],
            val.String(),
            nargs='*')

        # Load LSF configuration profile
        lsfconfig = _config['lsf']
        profile = None
        if _configapp is not None:
            if lsfconfig is not None:
                if os.path.isfile(lsfconfig) and lsfconfig.endswith(
                    ('.yml', '.yaml')):
                    try:
                        with open(lsfconfig, 'r') as f:
                            profile = yaml.load(f)
                        logger.info(
                            'Loaded LSF configuration YAML file {}'.format(
                                lsfconfig))
                    except:
                        logger.warning(
                            'Could not load YAML file {}'.format(lsfconfig))
                else:
                    logger.warning(
                        '{} does not exist or it is not a YAML file.'.format(
                            lsfconfig))
                if profile:
                    try:
                        properties = profile[_configapp]
                    except:
                        raise RuntimeError(
                            'There is no profile in {} for configuration '
                            'app {}'.format(lsfconfig, _configapp))
                    for p in properties:
                        self.__dict__[p] = properties[p]
                        logger.info('Setting {} to {}'.format(
                            p, properties[p]))
            else:
                raise RuntimeError(
                    'No LSF configuration YAML file defined for the configapp')
        else:
            if lsfconfig is not None:
                logger.warning(
                    'LSF configuration YAML file defined without configuration app'
                )

        # Find executables
        self._qsubmit = LsfQueue._find_binary('bsub')
        self._qinfo = LsfQueue._find_binary('bqueues')
        self._qcancel = LsfQueue._find_binary('bkill')
        self._qstatus = LsfQueue._find_binary('bjobs')
Beispiel #30
0
    def __init__(self):
        super().__init__()
        from jobqueues.simqueue import SimQueue

        self._arg(
            "app",
            ":class:`SimQueue <jobqueues.simqueue.SimQueue>` object",
            "A SimQueue class object used to retrieve and submit simulations",
            None,
            val.Object((SimQueue, )),
        )
        self._arg("project", "str", "The name of the project", "adaptive",
                  val.String())
        self._arg(
            "nmin",
            "int",
            "Minimum number of running simulations",
            0,
            val.Number(int, "0POS"),
        )
        self._arg(
            "nmax",
            "int",
            "Maximum number of running simulations",
            1,
            val.Number(int, "POS"),
        )
        self._arg(
            "nepochs",
            "int",
            "Stop adaptive once we have reached this number of epochs",
            1000,
            val.Number(int, "POS"),
        )
        self._arg(
            "nframes",
            "int",
            "Stop adaptive once we have simulated this number of aggregate simulation frames.",
            0,
            val.Number(int, "0POS"),
        )
        self._arg(
            "inputpath",
            "str",
            "The directory used to store input folders",
            "input",
            val.String(),
        )
        self._arg(
            "generatorspath",
            "str",
            "The directory containing the generators",
            "generators",
            val.String(),
        )
        self._arg(
            "dryrun",
            "boolean",
            "A dry run means that the adaptive will retrieve and generate a new epoch but not submit the simulations",
            False,
            val.Boolean(),
        )
        self._arg(
            "updateperiod",
            "float",
            "When set to a value other than 0, the adaptive will run synchronously every `updateperiod` seconds",
            0,
            val.Number(float, "0POS"),
        )
        self._arg(
            "coorname",
            "str",
            "Name of the file containing the starting coordinates for the new simulations",
            "input.coor",
            val.String(),
        )
        self._arg(
            "lock",
            "bool",
            "Lock the folder while adaptive is ongoing",
            False,
            val.Boolean(),
        )
        self._running = None