Package schrodinger :: Package application :: Package desmond :: Module cmj
[hide private]
[frames] | no frames]

Module cmj

This module provides fundamental facilities for writing a multisim driver script, for writing multisim concrete stage classes, and for dealing with protocol files.

Copyright Schrodinger, LLC. All rights reserved.

Classes [hide private]
  AslValidator
  Engine
  Job
  JobAdapter
This adapts the `Job' class to the `que.BaseJob' class.
  JobErrorHandler
  JobInput
  JobOutput
  JobStatus
  ParseError
  Queue
  RetryTimer
  StageBase
  StopRequest
  _create_param_when_needed
  _get_jc_backend_when_needed
Functions [hide private]
 
_collect_inputfile_from_file_list(list_, fname_list)
 
_collect_inputfile_from_file_map(map, fname_list)
 
_collect_inputfile_from_list(list_, fname_list)
 
_collect_inputfile_from_map(map, fname_list)
 
_print(loglevel, msg)
 
_time_str_to_time(time_str, scale=1.0)
 
_time_to_time_str(inp_time)
 
append_stage(cmj_fname, stage_type, cfg_file=None, jobname=None, dir=None, compress=None, parameter={})
 
build_stagelinks(stage_list)
 
build_stages(stage_list, out_fname=None, stage_state=[])
 
collect_inputfile(stage_list)
Returns a list of file names.
sea.Map
concatenate_relaxation_stages(raw)
Attempts to concatenate relaxation stages by finding all adjacent non-production `simulate` stages.
 
escape_string(s)
 
get_concat_stages(stages, param_attr='')
Get a list of the stages that can be concatenated together, and the insertion point of the resulting concatenate stage.
 
is_restartable_build(engine)
 
is_restartable_version(version_string)
 
msj2sea(fname, msj_content=None)
Parses a file as specified by 'fname' or a string given by 'msj_content' (if both are given, the former will be ignored), and returns a 'sea.Map' object that represents the stage settings with a structure like the following: stage = [ { <stage 1 settings> } { <stage 2 settings> } { <stage 3 settings> } ...
 
msj2sea_full(fname, msj_content=None, pset='')
 
parse_msj(fname, msj_content=None, pset='')
`sea.macro_dict' must be set properly before calling this function.
 
print_debug(msg)
 
print_quiet(msg)
 
print_silent(msg)
 
print_tonull(msg)
 
print_verbose(msg)
 
probe_checkpoint(fname, indent='')
 
reg_checking(name, func)
 
restraints_compatible(restraints, initial_restraints)
Returns whether the restraints are compatible with switching during a concatenate stage.
 
validate_asl_expr(stage_list)
Validates all ASL expressions that start with the "asl:" prefix.
 
write_msj(stage_list, fname=None, to_str=True)
Given a list of stages, writes out a .msj file of the name `fname'.
 
write_sea2msj(stage_list, fname=None, to_str=True)
Variables [hide private]
  BUILD = 32112
  CHECKPOINT_FNAME = '$MASTERJOBNAME-multisim_checkpoint'
  CHECKPOINT_SUFFIX = '-multisim_checkpoint'
  ENGINE = None
hash(x)
  GENERAL_LOGLEVEL = 'quiet'
  LOGLEVEL = ['silent', 'quiet', 'verbose', 'debug']
  PACKAGE_SUFFIX = '.tgz'
  PARAM = None
hash(x)
  QUEUE = None
hash(x)
  VERSION = '3.8.5.19'
  _PRODUCTION_SIMULATION_STAGES = ['lambda_hopping', 'replica_ex...
  __package__ = 'schrodinger.application.desmond'
  _operator = {'has_dir': <function has_dir at 0x7f1a16623e60>, ...
  last_logtime = None
hash(x)
Function Details [hide private]

concatenate_relaxation_stages(raw)

 

Attempts to concatenate relaxation stages by finding all adjacent non-production `simulate` stages. If no concatenatable stages are found, None is returned. Otherwise, a new raw map with the relaxation `simulate` stages replaced with a single `concatenate` stage is returned.

Parameters:
  • raw (sea.Map) - the raw map representing the MSJ
Returns: sea.Map
a new raw map representing the updated msj, or None.

get_concat_stages(stages, param_attr='')

 

Get a list of the stages that can be concatenated together, and the insertion point of the resulting concatenate stage. Stages can be concatenated if they are adjacent simulate stages with the same restraints, excluding the final production stage, which can be lambda hopping, replica exchange, or otherwise the last simulate stage.

Parameters:
  • stages (list of (sea.Map or stage.Stage)) - A list of objects representing multisim stages. For flexibility, these can be either maps or stages. For stages, a param attribute must be passed that will give the location of the param on the stage.
  • param_attr (str) - optional name of the attribute of the objects param, in case of a stage.Stage object.

msj2sea(fname, msj_content=None)

 

Parses a file as specified by 'fname' or a string given by 'msj_content' (if both are given, the former will be ignored),
and returns a 'sea.Map' object that represents the stage settings with a structure like the following:
  stage = [
     { <stage 1 settings> }
     { <stage 2 settings> }
     { <stage 3 settings> }
     ...
  ]
Each stage's name can be accessed in this way: raw.stage[1].__NAME__, where 'raw' is the returned 'sea.Map' object.

restraints_compatible(restraints, initial_restraints)

 

Returns whether the restraints are compatible with switching during a concatenate stage. For compatibility, `restraints` has to differ from `initial_restraints` by only a scaling factor (which can include zero).

Parameters:
  • restraints (sea.Map) - the restraints for a given stage
  • initial_restraints (sea.Map) - the restraints for the first stage
Returns:
whether the restraints are compatible

write_msj(stage_list, fname=None, to_str=True)

 

Given a list of stages, writes out a .msj file of the name `fname'. If 'to_str' is True, a string will be returned. The returned string contains the contents of the .msj file. If 'to_str' is False and not file name is provided, then this function does nothing.


Variables Details [hide private]

_PRODUCTION_SIMULATION_STAGES

Value:
['lambda_hopping', 'replica_exchange']

_operator

Value:
{'has_dir': <function has_dir at 0x7f1a16623e60>,
 'has_file': <function has_file at 0x7f1a16623de8>,
 'is_debugging': <function is_debugging at 0x7f1a16623ed8>,
 'systrait_is': <function systrait_is at 0x7f1a16623cf8>}