schrodinger.application.matsci.permittivity module

Permittivity module for permittivity workflow.

Copyright Schrodinger, LLC. All rights reserved.

schrodinger.application.matsci.permittivity.log_debug(msg)

Add a message to debug logger file.

Parameters

msg (str) – The message to debug logging

schrodinger.application.matsci.permittivity.elapsed_timer()

Handy way to print time consumption for the execution of a few python line codes.

example to print line number and time elapsed: from inspect import currentframe with elapsed_timer() as elapsed:

xxx
print(currentframe().f_lineno, elapsed())
xxx
print(currentframe().f_lineno, elapsed())
Returns

float

Return type

time elapsed in second

schrodinger.application.matsci.permittivity.path_join(paths, linux=True)

Wrapper around os.path.join to allow forced ‘/’ as the path separator.

Parameters

linux (bool) – Force using ‘/’ as the separator if True

Returns

The str paths

Return type

str

schrodinger.application.matsci.permittivity.permittivity_transform(tau0, beta, tau_max=20, tau_num=None, omega_range=(1000000.0, 100000000000000.0), omega_num=None, simpson_quadrature=True, angular_frequency=False)

Based on the parameters in the KWW equation, non-uniform grid in tau and omega are used to transform the time domain (tau) signal to frequency domain (omega).

Note: the KWW is the equation 1 and implemented transform is equation 7 in the following paper.

Further Considerations of Non Symmetrical Dielectric Relaxation Behaviour arising from a Simple Empirical Decay Function. BY G. WILLIAM AND D. C. WATT

Parameters
  • tau0 (float) – The tau0 in unit ps is the decay constant in KWW equation

  • beta (float) – The beta in KWW equation, which must be positive

  • tau_max (float) – Tau upper limit in tau (time) domain

  • tau_num (int or None) – Total number of data points in the tau (time) domain

  • omega_range (tuple of two floats) – Output frequency domain range

  • omega_num (int or None) – Total number of data points in the frequency domain

  • simpson_quadrature (bool) – If True, simpson rule with quadratic interpolation is used to reduce the oscillation

  • angular_frequency (bool) – If True, the first column is angular frequency else regular frequency

Raises
  • ValueError – Non-uniform fourier transform yields nan (e.g. beta is negative)

  • AssertionError – beta <= 0

Returns

Three columns are frequency, storage permittivity, and loss permittivity

Return type

3xn numpy.array

schrodinger.application.matsci.permittivity.get_properties_from_inputfiles(opts, input_required_properties, input_readers=None, startwith=False)

Get properties from the input files. If the requested doesn’t exist, a KeyError error is raised.

Parameters
  • opts (Named tuple) – The parsed command line options

  • input_required_properties (dict) – Keys are struct type and values are property keys.

  • input_readers (dict) – Keys are struct type and values are readers for different struct types.

  • startwith (bool) – If True, property keys starting with the requested string are considered matches.

Raises

KeyError – When the struct misses one required property

Returns

Requested property keys and obtained values

Return type

dict

schrodinger.application.matsci.permittivity.is_file_property(property_name)

Whether the property is related to a file.

Parameters

property_name (str) – A property

Returns

Whether the property should point to a file

Return type

bool

class schrodinger.application.matsci.permittivity.chdir(dirname, rm_created_dir=False, always_create=False)

Bases: schrodinger.utils.fileutils.chdir

Make dir, change, and exit. If this indeed creates a dir, it will remove the dir on exit with rm_created_dir=True.

__init__(dirname, rm_created_dir=False, always_create=False)
Parameters
  • dirname (str) – The directory name to make and cd to

  • rm_created_dir (bool) – If True and this class creates a directory, the directory will be removed on exit.

  • always_create (bool) – If True and the input dirname exists, creates a directory, with a different name. For example ‘my_dir’ exists, the newly created dir will be ‘my_dir.1’. If ‘my_dir.1’ exists, the newly create dir will be ‘my_dir.2’.

getNextDirname(midfix='.', zfill_width=0)

Get the next dirname based on the input path and current existing directories.

Parameters
  • path (str) – Path to a directory

  • midfix (str) – This string split the basename and number <root><midfix><number>

  • zfill_width (int) – Pad a numeric string S with zeros on the left, to fill a field of the specified width

Returns

The next dirname based on the input path and all dirs in the relevant folder.

Return type

str

schrodinger.application.matsci.permittivity.get_config(config_yaml)

Get the Config instance from the input yaml file.

Parameters

config_yaml (str) – The input configure yaml file

Returns

The Config instance with property processed.

Return type

Config

schrodinger.application.matsci.permittivity.get_config_from_options(options)

Get the Config instance from the command line options.

Parameters

options (argparse.Namespace) – Command line options

Returns

The Config instance with property processed.

Return type

Config

class schrodinger.application.matsci.permittivity.Config(config_yaml)

Bases: object

Class to store the config file, parse workflow, provide method to get fields.

__init__(config_yaml)
Parameters

config_yaml (str) – The config file

static get_file(filename=None, product_dir=None)

Get the permittivity config yaml from the mmshare data dir.

Parameters
  • filename (str) – The yaml filename

  • product_dir (str) – Subdir name inside the mmshare_data_dir

Returns

The full path and filename for the input yaml

Return type

str

classmethod get_file_from_options(options)

Return the permittivity config file based on command line inputs.

Parameters

options (argparse.Namespace) – The command parsered options

Returns

The path to a config yaml

Return type

str

load()

Load configure file, set the task protocols by name and type

NOTE: If no type found, name is used as the type

Note: If the task type have multiple stages and each stage has its own index field, the sequence of the stages is sorted according to the index field. task_name has higher priority than task_type type, as multiple task names can share the same task type.

setWorkflow()

workflow is a nested data structure of list, tuple, and dict. Itself looks like an unbalanced tree data type. list gives linear job dependency as desmond msj Tuple gives independence between each task, and all these subjobs can share parent from the same level or one level up list. Dict links additional parent jobs.

NOTE: dict is unhashable and cannot be used as the key of a dict. Each key or value is either a TASK NAME or TASK NAME (int,int,..) whose (int, int,..) defines the task id so that the same task name can be used multiple times, and the additional dependence by dict can indentify unique task. (This is not tested or may not be well implemented)

The same task name can appear several times in the workflow, which means that the same task (with the same settings) run multiple times in the workflow. However, the dict value must link to a single task ( either unique task name or with task id)

The workflow section describes the task sequence and dependence. Each string corresponds to a task name (may with task id), and each task name must have a top level section in configure file to define the settings.

The title of each task setting section describe the name and type. For example, TASK NAME (TASK TYPE): [flag1 : value1, flag2 : value2] The TASK TYPE is used to map for backend class

getTaskNames()

Get all the task names in the workflow block

Returns

tasknames in the workflow

Return type

set

sortStages(index_field='index')

Sort the stage order according to the index field.

Parameters

index_field (Use this index field to sort all the stages in a task protocol) – str of None

splitNameAndType(name_and_type)

Split the task section title into task name and task type. ‘task name (task type)’ or ‘task name’ alone in front of the task setting section.

Parameters

name_with_prop (str) – ‘task name (task type)’ or ‘task name’

Returns

(task name, take type) or (task name , None)

Return type

(str, str) or (str , None)

setNameToTypeMap()

Based on the config file, get a dict map from task name to task type. If ‘task name’ instead of ‘task name (task type)’ is found, task type is assumed to be the same as task name.

Parameters

config_yaml (str) – A configure filename with path

Returns

Map from task name to task type

Return type

dict

getTaskProtocol(task_name=None, task_type=None)

Get the protocol for selected task by name or type. If both provided, select by type.

Parameters
  • task_name (str or None) – The task name of a stage. the xxx as in the ‘xxx (task type)’ before the setting block.

  • task_type (str or None) – The task type of a stage. the xxx as in the ‘task type (xxx)’ before the setting block.

  • index_field (Use this index field to sort all the stages in a task protocol) – str of None

Returns

list of list for workflow block; list of list for desmond multiple stages; dict for regular single stage

Return type

dict, list of str, or list of list

class schrodinger.application.matsci.permittivity.TupleSafeLoader(*args, **kwargs)

Bases: ruamel.yaml.loader.SafeLoader

Yaml Loader that recognizes tuple tags.

__init__(*args, **kwargs)

Initialize the scanner.

DEFAULT_MAPPING_TAG = 'tag:yaml.org,2002:map'
DEFAULT_SCALAR_TAG = 'tag:yaml.org,2002:str'
DEFAULT_SEQUENCE_TAG = 'tag:yaml.org,2002:seq'
DEFAULT_TAGS = {'!': '!', '!!': 'tag:yaml.org,2002:'}
ESCAPE_CODES = {'U': 8, 'u': 4, 'x': 2}
ESCAPE_REPLACEMENTS = {'\t': '\t', ' ': ' ', '"': '"', '/': '/', '0': '\x00', 'L': '\u2028', 'N': '\x85', 'P': '\u2029', '\\': '\\', '_': '\xa0', 'a': '\x07', 'b': '\x08', 'e': '\x1b', 'f': '\x0c', 'n': '\n', 'r': '\r', 't': '\t', 'v': '\x0b'}
NON_PRINTABLE = <ruamel.yaml.util.LazyEval object>
classmethod add_constructor(tag: Any, constructor: Any) None
classmethod add_implicit_resolver(tag: Any, regexp: Any, first: Any) None
classmethod add_implicit_resolver_base(tag: Any, regexp: Any, first: Any) None
add_indent(column: int) bool
classmethod add_multi_constructor(tag_prefix: Any, multi_constructor: Any) None
classmethod add_path_resolver(tag: Any, path: Any, kind: Any = None) None
add_version_implicit_resolver(version: VersionType, tag: Any, regexp: Any, first: Any) None
ascend_resolver() None
bool_values = {'false': False, 'n': False, 'no': False, 'off': False, 'on': True, 'true': True, 'y': True, 'yes': True}
check_block_entry() Any
check_data() Any
check_directive() Any
check_document_end() Any
check_document_start() Any
check_end_doc_comment(end_event: Any, node: Any) None
check_event(*choices: Any) bool
check_key() Any
check_mapping_key(node: Any, key_node: Any, mapping: Any, key: Any, value: Any) bool

return True if key is unique

check_node() Any
check_plain() Any
check_printable(data: Any) None
check_resolver_prefix(depth: int, path: Text, kind: Any, current_node: Any, current_index: Any) bool
check_set_key(node: Any, key_node: Any, setting: Any, key: Any) None
check_token(*choices: Any) bool
check_value() Any
compose_document() Any
compose_mapping_node(anchor: Any) Any
compose_node(parent: Any, index: Any) Any
compose_scalar_node(anchor: Any) Any
compose_sequence_node(anchor: Any) Any
property composer
construct_document(node: Any) Any
construct_mapping(node: Any, deep: bool = False) Any

deep is True when creating an object/mapping recursively, in that case want the underlying elements available during construction

construct_non_recursive_object(node: Any, tag: Optional[str] = None) Any
construct_object(node: Any, deep: bool = False) Any

deep is True when creating an object/mapping recursively, in that case want the underlying elements available during construction

construct_pairs(node: Any, deep: bool = False) Any
construct_scalar(node: Any) Any
construct_sequence(node: Any, deep: bool = False) Any

deep is True when creating an object/mapping recursively, in that case want the underlying elements available during construction

construct_undefined(node: Any) None
construct_yaml_binary(node: Any) Any
construct_yaml_bool(node: Any) bool
construct_yaml_float(node: Any) float
construct_yaml_int(node: Any) int
construct_yaml_map(node: Any) Any
construct_yaml_null(node: Any) Any
construct_yaml_object(node: Any, cls: Any) Any
construct_yaml_omap(node: Any) Any
construct_yaml_pairs(node: Any) Any
construct_yaml_seq(node: Any) Any
construct_yaml_set(node: Any) Any
construct_yaml_str(node: Any) Any
construct_yaml_timestamp(node: Any, values: Any = None) Any
descend_resolver(current_node: Any, current_index: Any) None
determine_encoding() None
dispose() None
fetch_alias() None
fetch_anchor() None
fetch_block_entry() None
fetch_block_scalar(style: Any) None
fetch_comment(comment: Any) None
fetch_directive() None
fetch_document_end() None
fetch_document_indicator(TokenClass: Any) None
fetch_document_start() None
fetch_double() None
fetch_flow_collection_end(TokenClass: Any) None
fetch_flow_collection_start(TokenClass: Any, to_push: Text) None
fetch_flow_entry() None
fetch_flow_mapping_end() None
fetch_flow_mapping_start() None
fetch_flow_scalar(style: Any) None
fetch_flow_sequence_end() None
fetch_flow_sequence_start() None
fetch_folded() None
fetch_key() None
fetch_literal() None
fetch_more_tokens() Any
fetch_plain() None
fetch_single() None
fetch_stream_end() None
fetch_stream_start() None
fetch_tag() None
fetch_value() None
flatten_mapping(node: Any) Any

This implements the merge key feature http://yaml.org/type/merge.html by inserting keys from the merge dict/list of dicts if not yet available in this node

property flow_level
forward(length: int = 1) None
forward_1_1(length: int = 1) None
get_data() Any
get_event() Any
get_loader_version(version: Optional[VersionType]) Any
get_mark() Any
get_node() Any
get_single_data() Any
get_single_node() Any
get_token() Any
inf_value = inf
nan_value = nan
need_more_tokens() bool
next_possible_simple_key() Any
parse_block_mapping_first_key() Any
parse_block_mapping_key() Any
parse_block_mapping_value() Any
parse_block_node() Any
parse_block_node_or_indentless_sequence() Any
parse_block_sequence_entry() Any
parse_block_sequence_first_entry() Any
parse_document_content() Any
parse_document_end() Any
parse_document_start() Any
parse_flow_mapping_empty_value() Any
parse_flow_mapping_first_key() Any
parse_flow_mapping_key(first: Any = False) Any
parse_flow_mapping_value() Any
parse_flow_node() Any
parse_flow_sequence_entry(first: bool = False) Any
parse_flow_sequence_entry_mapping_end() Any
parse_flow_sequence_entry_mapping_key() Any
parse_flow_sequence_entry_mapping_value() Any
parse_flow_sequence_first_entry() Any
parse_implicit_document_start() Any
parse_indentless_sequence_entry() Any
parse_node(block: bool = False, indentless_sequence: bool = False) Any
parse_stream_start() Any
property parser
peek(index: int = 0) Text
peek_event() Any
peek_token() Any
prefix(length: int = 1) Any
process_directives() Any
process_empty_scalar(mark: Any, comment: Any = None) Any
property processing_version
property reader
remove_possible_simple_key() None
reset_parser() None
reset_reader() None
reset_scanner() None
resolve(kind: Any, value: Any, implicit: Any) Any
property resolver
save_possible_simple_key() None
scan_anchor(TokenClass: Any) Any
scan_block_scalar(style: Any, rt: Optional[bool] = False) Any
scan_block_scalar_breaks(indent: int) Any
scan_block_scalar_ignored_line(start_mark: Any) Any
scan_block_scalar_indentation() Any
scan_block_scalar_indicators(start_mark: Any) Any
scan_directive() Any
scan_directive_ignored_line(start_mark: Any) None
scan_directive_name(start_mark: Any) Any
scan_flow_scalar(style: Any) Any
scan_flow_scalar_breaks(double: Any, start_mark: Any) Any
scan_flow_scalar_non_spaces(double: Any, start_mark: Any) Any
scan_flow_scalar_spaces(double: Any, start_mark: Any) Any
scan_line_break() Any
scan_plain() Any
scan_plain_spaces(indent: Any, start_mark: Any) Any
scan_tag() Any
scan_tag_directive_handle(start_mark: Any) Any
scan_tag_directive_prefix(start_mark: Any) Any
scan_tag_directive_value(start_mark: Any) Any
scan_tag_handle(name: Any, start_mark: Any) Any
scan_tag_uri(name: Any, start_mark: Any) Any
scan_to_next_token() Any
scan_uri_escapes(name: Any, start_mark: Any) Any
scan_yaml_directive_number(start_mark: Any) Any
scan_yaml_directive_value(start_mark: Any) Any
property scanner
property scanner_processing_version
stale_possible_simple_keys() None
property stream
timestamp_regexp = <ruamel.yaml.util.LazyEval object>
transform_tag(handle: Any, suffix: Any) Any
unwind_indent(column: Any) None
update(length: int) None
update_raw(size: Optional[int] = None) None
property versioned_resolver

select the resolver based on the version we are parsing

yaml_constructors: Dict[Any, Any] = {'tag:yaml.org,2002:null': <function SafeConstructor.construct_yaml_null>, 'tag:yaml.org,2002:bool': <function SafeConstructor.construct_yaml_bool>, 'tag:yaml.org,2002:int': <function SafeConstructor.construct_yaml_int>, 'tag:yaml.org,2002:float': <function SafeConstructor.construct_yaml_float>, 'tag:yaml.org,2002:binary': <function SafeConstructor.construct_yaml_binary>, 'tag:yaml.org,2002:timestamp': <function SafeConstructor.construct_yaml_timestamp>, 'tag:yaml.org,2002:omap': <function SafeConstructor.construct_yaml_omap>, 'tag:yaml.org,2002:pairs': <function SafeConstructor.construct_yaml_pairs>, 'tag:yaml.org,2002:set': <function SafeConstructor.construct_yaml_set>, 'tag:yaml.org,2002:str': <function SafeConstructor.construct_yaml_str>, 'tag:yaml.org,2002:seq': <function SafeConstructor.construct_yaml_seq>, 'tag:yaml.org,2002:map': <function SafeConstructor.construct_yaml_map>, None: <function SafeConstructor.construct_undefined>}
yaml_implicit_resolvers: Dict[Any, Any] = {}
yaml_multi_constructors: Dict[Any, Any] = {}
yaml_path_resolvers: Dict[Any, Any] = {}
class schrodinger.application.matsci.permittivity.ConfigWriter(options, jobname)

Bases: object

__init__(options, jobname)

Class to write out config yaml.

Parameters
  • options (argparse.Namespace) – Commandline options

  • jobname (str or False) – The jobname based on which the yaml filename is set

run()

Main method to drive the functionality.

loadWorkflow()

Load the config yaml based on commandline options, and parse the file.

loadAndUpdateTaskProtocol()

Update the task protocols based command line input, and set task type and driver path.

validateGpuHosts()

Validate GPU availability against the type of protocols. (whether desmond tasks exist)

DEPRECATED due to MATSCI-9604

checkInputfileTasktypeDriverpaths()

Validate whether the restart flag for input file task type driver paths is followed by properly formatted values.

DEPRECATED as MATSCI-8523 is planned as the customer facing api

write()

Write out the updated config yaml to disk if users don’t specific their input config yaml.

class schrodinger.application.matsci.permittivity.Protocol(protocol)

Bases: object

__init__(protocol)

The protocol for the workflow or one task.

Parameters

protocol (dict or list) – dict for workflow and regular task protocol; list for multistage desmond protocol.

class schrodinger.application.matsci.permittivity.WorkflowProtocol(protocol)

Bases: schrodinger.application.matsci.permittivity.Protocol

__init__(protocol)

The protocol for the workflow.

Parameters

protocol (dict or list) – dict for workflow and regular task protocol; list for multistage desmond protocol.

indexUnbalancedWorkflow()

Generate an unique tuple of integers for each task (item) in the workflow. Return the map from tuple to task name.

Returns

The map from un unique tuple to task name

Return type

dict

getItemByIndex(index)

Get the item in the workflow protocol of this index.

Parameters

index (tuple or list of int) – The indexes of the item

Returns

The item saved in the workflow yaml with this index

Return type

str, list, or dict

getParentTasknames(index)

Get the parent task names for the current task pointed by this index.

Parents can be defined via three methods: parent / child by nested list or tuple: outer is parent; inner is child parent / child by list: former is the parent; later is the child parent / child by dict: key is the child; values are parents.

These methods are equivalent in setting the job dependency.

Parameters

index (tuple, list, or generator for integers) – The index of the current item

Returns

The task names of parent jobs

Return type

list of str

getParentTasknameByIndexFromDict(index)

Get the parent task names of the current task indicated by the dict format. (the key and value of the item in the workflow pointed by the index are child and parents). If str instead of dict, return empty.

Parameters

index (tuple or list of int) – The indexes of the item

Raises

TypeError – when it is not a str or dict, meaning this not a leaf item in the workflow tree data struct.

Returns

The task name for this item

Return type

str

flattenWithoutDict(an_iterable_item)

Robust function to flatten list recursively. If a dict presents as the value, use the key of the dict. The difference between the above flatten is that this function don’t return a dict as one value in the list. Instead, it uses the dict key to represent the dict.

Parameters

an_iterable_item (list, tuple or set) – The iterable item to be flatten. (an iterable that describes the whole or part of the workflow)

Returns

The flatten items in a list ([uniterable value 1, uniterable value 2, uniterable value 3 …])

Return type

list of str values

getFirstLevelTasknames(task_stages)

Get the first level tasknames without dict. For example, [a, [b, [c]], {d:f}, [e]] returns [a, d]

Parameters

task_stages (list, tuple, or set) – An iterable that describes the whole or part of the workflow.

Returns

The first level tasknames

Return type

list of string

getTaskNames()

A set of all task name in the workflow section.

Returns

set of task names

Return type

set

getTaskName(index)

Get the task name of this item in the workflow.

Parameters

index (list or tuple of int) – Index of an item containing a task name.

Raises

TypeError – When it is not a str or dict, meaning this not a leaf item in the workflow tree data struct.

Returns

The task name for this item

Return type

str

class schrodinger.application.matsci.permittivity.TaskProtocol(protocol)

Bases: schrodinger.application.matsci.permittivity.Protocol

Wrapper for task protocol: regular driver or desmond multi-stages.

__init__(protocol)

The protocol for the workflow or one task.

Parameters

protocol (dict or list) – The settings for a task: dict for task protocol; list for multistage desmond protocol.

getDriverPath(driver_path=None)

Return the driver path of the task

Parameters

driver_path (None or str) – The driver path of the task

Returns

The driver path of the task

Return type

str or None

getPreScript(pre_script=['$SCHRODINGER', 'run'])

Return the shell script before regular driver. For example, $SCHRODINGER/run

Parameters

pre_script (None or list) – The shell script before regular driver

Returns

The shell script before regular driver

Return type

None or str

getFlagBlock(label='cmd_flags')

Get the flag block with desired label.

Parameters

label (str) – The block header label to search

Returns

The flag block for a certain task in the config yaml

Return type

None or list

getInterpFlagBlock(label='cmd_flags')

Get the flag block with desired label and interpret the block into dict data type.

Parameters

label (str) – The block header label to search

Returns

Keys are flags without ‘-’, and values are None for positional flag, NONE for optional ‘store_true’ or ‘store_false’ flag, ‘none’ or ‘any_value’ for regular optional ‘store’ flag

Return type

dict

getReplicaKeywords()

Return the replica keyword list or None.

Returns

The replica keywords

Return type

None or list

Raises

ValueError – If more than one replica setting blocks are found.

rmReplicaKeywords()

Remove the replica keywords from xtra flag block.

getSeed(seed_flag)

Return the random seed for this task.

Returns

The random seed in the config or the default value

Return type

int

getCmdFromFlagBlock()

Return the command list from the cmd flag block.

Returns

The command list built from the task protocol cmd flag block

Return type

None or list

interpretFlagBlock(flag_block)

Interpret the flag block from yaml parsed values to a dict data type.

Parameters

flag_block (list of dict and str. In .yaml, {flag: NONE} means 'store_true' or 'store_false' optional arguments; [flag] means positional arguments; {flag: 'none'; flag: 'value'} means regular optional arguments.) – a list of dict and str contains flags and values

Returns

Keys are flags without ‘-’, and values are None for positional flag, NONE for optional ‘store_true’ or ‘store_false’ flag, ‘none’ or ‘any_value’ for regular optional ‘store’ flag

Return type

dict

Raises

ValueError – if the item in cmd block is not string or dict.

update(user_input, block_label='cmd_flags')

This function updates the task_protocol according to a user input dict. The update happens for optional arg: store, store_true and store_false. The flag to locate the optional block must be either CMD_FLAGS or XTRA_FLAGS. The logic is to put all subdriver recognizable optional flags in CMD_FLAGS, and put other flags in XTRA_FLAGS.

In short, flags in CMD_FLAGS are passed to subjob driver directly. Flags in XTRA_FLAGS can be used to control worflow (not used in subdriver) or be reformatted and passed to subdriver in a file format depending on specific implementation.

If user_input = {‘animal’: ‘cat’}, the ‘cat’ will be used for drivers. If user_input = {‘animal’: None}, auto set: drivers with animal key use their own defaults set by the driver or config yaml. If user_input = {‘is_rainy’: True}, drivers with is_rainy key adds -is_rainy to the cmd. If user_input = {‘is_rainy’: False}, drivers with is_rainy key remove -is_rainy in the cmd. If user_input = {‘is_rainy’: None}, auto set: drivers with is_rainy key check config yaml for whether to add -is_rainy in cmd.

Current implementation doesn’t support the positional argument substitution, as this is a replacements of certain list values and positional argument are input/output filenames that are changed by updateInfileAndCommand().

Parameters
  • user_input (dict) – dict for regular single stage

  • block_label (str) – The flag block in task_protocol defined by this flag is updated (either CMD_FLAGS or XTRA_FLAGS)

  • user_input – {flag: value}

parserUserInput(user_input)

Parse the user input dict data and return a dict for values to be added and a list for values to be removed.

Parameters

user_input (dict) – The dict to be parsed

Returns

Values to be added, values to be removed

Return type

dict, list

class schrodinger.application.matsci.permittivity.StepBase(basename, config_yaml, task_name=None, infile='$infile', outfile=None, additional_infiles=None, master_logger=None, node_index=None)

Bases: object

OUTFILE_EXT = '-out.mae'
TERMINAL_INFILE_NUM = 1
DRIVER_PATH = None
NUM_CRU_PROP = 'i_matsci_Num_Cru'
REPLICA_TAG = 'Replica %s: '
__init__(basename, config_yaml, task_name=None, infile='$infile', outfile=None, additional_infiles=None, master_logger=None, node_index=None)
Parameters
  • basename (str) – The basename of this subjob

  • config_yaml (str) – The config yaml file contain all job config

  • task_name (str) – Task name of this sub job

  • infile (str) – The input filename

  • outfile (str) – The output filename

  • additional_infiles (list of str) – This records additional input files (e.g. the second, third, and so on)

  • master_logger (logging.Logger) – The logger to use for recording messages into master job -driver.log.

  • node_index (The node index) – tuple

log(msg, add_log_tag=True)

Log information to the master driver.log

Parameters
  • msg (str) – The info to print

  • add_log_tag (bool) – If True, additional tags is logged in front of the msg for the replica jobs.

setLogTag()

Set the log tag based on node index.

updateTaskReplicaSettings()

Update the task protocol due to replica.

setup(copy_infile=True, copy_additional_files=True, more_files=None)

Setup things before the job starts. For example, logging format, and file transfer.

Parameters
  • copy_infile (bool) – Copy the input files of the class to current folder

  • copy_additional_files (bool) – Copy the additional files of the class to current folder

  • more_files (None or list of str) – Use this arguments to copy customized files

copyFiles(copy_infile=True, copy_additional_files=True, more_files=None)

Copy files to current dir.

Parameters
  • copy_infile (bool) – Copy the input files of the class to current folder

  • copy_additional_files (bool) – Copy the additional files of the class to current folder

  • more_files (None or list of str) – Use this arguments to copy customized files

getDownStreamPolymerJob()

Search and return the down-stream polymer job

Returns

A subtask step with polymer driver in the cmd

Return type

‘Step’ or None

getFirstMatchedfilename(filenames, exts)

Get the filename that ends with the first extension. If multiple filenames end with that extension return the first match.

Parameters
  • filenames (list of string) – list of filenames

  • exts (list of string) – list of extensions

Returns

The matched filename or None

Return type

string or None

static finalizeStep(job)

Update child job’s command with the parent job output, and set output files if not set by the subjob itself.

Parameters

job (An instance of a BaseJob subclass (such as JobControlJob or SubprocessJob)) – current job

setOutfile()

Set the job outfile with an existing file based on the jobcontrol job, if not set.

Raises

FileNotFoundError – Failed to set an existing outfile

outfileExist()

Whether the outfile exists

Returns

Whether the file exists.

Return type

bool

updateInfileAndCommand(par_outfile_with_dir)

Update the input file in the command and the input file attributes of a child job to the output file path of the parent job.

Parameters
  • child_job (an instance of a BaseJob subclass (such as JobControlJob or SubprocessJob)) – The subjob whose command will be updated.

  • par_outfile_with_dir (str) – The output file from the parent job that will be used as the input file of this child job.

classmethod getSeedFlag()

Return the flag for random seed. Should be overwritten by the subclass only when subtask reads in this flag

Returns

The flag to set the random seed (without the ‘-‘)

Return type

str or None

classmethod getForceFieldFlag()

Return the flag for force field. Should be overwritten by the subclass only when subtask reads in this flag

Returns

The flag to set the force field (without the ‘-‘)

Return type

str or None

classmethod optionsToTaskProtocols(options, task_name, seed=None)

This is the class method to generate task_protocol based on command line options and default values from config yaml. This method should be overwritten by subclass method as this one returns the protocol in the default configure yaml.

Parameters
  • options (argparse.Namespace) – The parsed command line options

  • task_name (str) – Task name of the current stage

  • seed (int or None) – Random seed to randomize the initial velocities

Returns

Updated task protocol

Return type

TaskProtocol

class schrodinger.application.matsci.permittivity.Step(basename, config_yaml='default_permittivity_protocols.yaml', task_name=None, infile='$infile', outfile=None, additional_infiles=None, master_logger=None, node_index=None)

Bases: schrodinger.application.matsci.permittivity.StepBase, schrodinger.application.matsci.jobutils.RobustSubmissionJob

Over write the parent class, and set subjobname, subdir, and etc.

RESOURCE = 'cpu'
__init__(basename, config_yaml='default_permittivity_protocols.yaml', task_name=None, infile='$infile', outfile=None, additional_infiles=None, master_logger=None, node_index=None)
Parameters
  • basename (str) – The base name of this subjob

  • config_yaml (str) – The config yaml file contain all job config

  • task_name (str) – Task name of this sub job

  • infile (str) – The input filename

  • outfile (str) – The output filename

  • additional_infiles (list of str) – This records additional input files (e.g. the second, third, and so on)

  • master_logger (logging.Logger) – The logger to use for recording messages into master job -driver.log.

  • node_index (The node index) – tuple

DRIVER_PATH = None
NUM_CRU_PROP = 'i_matsci_Num_Cru'
OUTFILE_EXT = '-out.mae'
REPLICA_TAG = 'Replica %s: '
TERMINAL_INFILE_NUM = 1
acquireLicenseForSmartDistribution() bool

Acquire and hold licenses for a smart distribution job. This makes sure the job won’t fail due to unavailable licenses.

Returns True if the licenses registered for the job are acquired, and False if they are not. If no licenses are registered, it always returns True to avoid preventing jobs from using the smart distribution feature. For legacy jobcontrol, the license check is not performed, and is always returned True. We want to use this feature as a pitch to move users to JOB_SERVER.

addFinalizer(function: Callable[[schrodinger.job.queue.BaseJob], None], run_dir: Optional[str] = None)

Add a function to be invoked when the job completes successfully.

See also the add_multi_job_finalizer function.

addGroupPrereq(job: schrodinger.job.queue.BaseJob)

Make all jobs connected to job prerequisites of all jobs connected to this Job.

addLaunchEnv(key: str, val: str)

Adds the given environment key and and value to the list of launch environment.

Parameters
  • key – environment key to add to the launch environment.

  • val – environment value associcated with the key to add to the launch environment.

addPrereq(job: schrodinger.job.queue.BaseJob)

Add a job that is an immediate prerequisite for this one.

cancel()

Send kill request to jobcontrol managed job. This method will eventually deprecate JobControlJob.kill

cancelSubmitted(do_license_check: bool = False) schrodinger.job.queue.CancelSubmittedStatus

If the job is still in the ‘submitted’ state, cancel it, purge the jobrecord and set the job handle to None. This tries to acquire licenses for the job before canceling from the queue if do_license_check is turned on.

Parameters

do_license_check – Acquire licenses for the job before canceling from the queue.

Returns one of the status of CancelSubmittedStatus.

copyFiles(copy_infile=True, copy_additional_files=True, more_files=None)

Copy files to current dir.

Parameters
  • copy_infile (bool) – Copy the input files of the class to current folder

  • copy_additional_files (bool) – Copy the additional files of the class to current folder

  • more_files (None or list of str) – Use this arguments to copy customized files

doCommand(host: str, local: bool = False)

Launch job on specified host using jobcontrol.launch_job().

Parameters
  • host – Host on which the job will be executed.

  • local – Removed in JOB_SERVER.

finalize()

Clean up after a job successfully runs.

static finalizeStep(job)

Update child job’s command with the parent job output, and set output files if not set by the subjob itself.

Parameters

job (An instance of a BaseJob subclass (such as JobControlJob or SubprocessJob)) – current job

genAllJobs(seen: Optional[Set[schrodinger.job.queue.BaseJob]] = None) Generator[schrodinger.job.queue.BaseJob, None, None]

A generator that yields all jobs connected to this one.

genAllPrereqs(seen=None) Generator[schrodinger.job.queue.BaseJob, None, None]

A generator that yields all jobs that are prerequisites on this one.

getCommand() List[str]

Return the command used to run this job.

getCommandDir() str

Return the launch/command directory name. If None is returned, the job will be launched in the current directory.

getDownStreamPolymerJob()

Search and return the down-stream polymer job

Returns

A subtask step with polymer driver in the cmd

Return type

‘Step’ or None

getDuration() Optional[int]

Return the duration of the Job as recorded by job server. The duration does not include queue wait time.

If the job is running or has not launched, returns None.

Note that this method makes a blocking call to the job server.

getFirstMatchedfilename(filenames, exts)

Get the filename that ends with the first extension. If multiple filenames end with that extension return the first match.

Parameters
  • filenames (list of string) – list of filenames

  • exts (list of string) – list of extensions

Returns

The matched filename or None

Return type

string or None

classmethod getForceFieldFlag()

Return the flag for force field. Should be overwritten by the subclass only when subtask reads in this flag

Returns

The flag to set the force field (without the ‘-‘)

Return type

str or None

getJob() Optional[schrodinger.job.jobcontrol.Job]

Return the job record as a schrodinger.job.jobcontrol.Job instance.

Returns None if the job hasn’t been launched.

getJobDJ() schrodinger.job.queue.JobDJ

Return the JobDJ instance that this job has been added to.

getPrereqs()

Return a set of all immediate prerequisites for this job.

classmethod getSeedFlag()

Return the flag for random seed. Should be overwritten by the subclass only when subtask reads in this flag

Returns

The flag to set the random seed (without the ‘-‘)

Return type

str or None

getStatusStrings() Tuple[str, str, str]

Return a tuple of status strings for printing by JobDJ.

The strings returned are (status, jobid, host).

hasExited() bool

Returns True if this job finished, successfully or not.

hasStarted() bool

Returns True if this job has started (not waiting)

init_count = 0
isComplete() bool

Returns True if this job finished successfully

kill()

Send kill request to jobcontrol managed job

log(msg, add_log_tag=True)

Log information to the master driver.log

Parameters
  • msg (str) – The info to print

  • add_log_tag (bool) – If True, additional tags is logged in front of the msg for the replica jobs.

maxFailuresReached(msg: str)

Print an error summary, including the last 20 lines from each log file in the LogFiles list of the job record.

classmethod optionsToTaskProtocols(options, task_name, seed=None)

This is the class method to generate task_protocol based on command line options and default values from config yaml. This method should be overwritten by subclass method as this one returns the protocol in the default configure yaml.

Parameters
  • options (argparse.Namespace) – The parsed command line options

  • task_name (str) – Task name of the current stage

  • seed (int or None) – Random seed to randomize the initial velocities

Returns

Updated task protocol

Return type

TaskProtocol

outfileExist()

Whether the outfile exists

Returns

Whether the file exists.

Return type

bool

postCommand()

A method to restore things to the pre-command state.

preCommand()

A method to make pre-command changes, like cd’ing to the correct directory to run the command in.

retryFailure(max_retries=0)

Determine if the job should be retried or not. This overwrites the parent method to by default not retry jobs that have a status of “died” as that will indicate that Jaguar failed, which it almost certainly will again.

Parameters

max_retries (int) – The queue’s max_retries parameter

Return type

bool

Returns

True if the job should be retried, False if not

run(*args, **kwargs)

Run the job.

The steps taken are as follows:
  1. Execute the preCommand method for things like changing the working directory.

  2. Call the doCommand to do the actual work of computation or job launching.

  3. Call the postCommand method to undo the changes from the preCommand that need to be undone.

runsLocally() bool

Return True if the job runs on the JobDJ control host, False if not. Jobs that run locally don’t need hosts.

There is no limit on the number of locally run jobs.

setLogTag()

Set the log tag based on node index.

setOutfile()

Set the job outfile with an existing file based on the jobcontrol job, if not set.

Raises

FileNotFoundError – Failed to set an existing outfile

setup(copy_infile=True, copy_additional_files=True, more_files=None)

Setup things before the job starts. For example, logging format, and file transfer.

Parameters
  • copy_infile (bool) – Copy the input files of the class to current folder

  • copy_additional_files (bool) – Copy the additional files of the class to current folder

  • more_files (None or list of str) – Use this arguments to copy customized files

property state: schrodinger.job.queue.JobState

Return the current state of the job.

Note that this method can be overridden by subclasses that wish to provide for restartability at a higher level than unpickling BaseJob instances. For example, by examining some external condition (e.g. presence of output files) the state JobState.DONE could be returned immediately and the job would not run.

update()

Checks for changes in job status, and updates the object appropriately (marks for restart, etc).

Raises

RuntimeError – if an unknown Job Status or ExitStatus is encountered.

updateInfileAndCommand(par_outfile_with_dir)

Update the input file in the command and the input file attributes of a child job to the output file path of the parent job.

Parameters
  • child_job (an instance of a BaseJob subclass (such as JobControlJob or SubprocessJob)) – The subjob whose command will be updated.

  • par_outfile_with_dir (str) – The output file from the parent job that will be used as the input file of this child job.

updateTaskReplicaSettings()

Update the task protocol due to replica.

usesJobServer() bool

Detect, by looking at the jobId, whether this job uses a job server.

class schrodinger.application.matsci.permittivity.PolymerBuilder(*arg, **kwargs)

Bases: schrodinger.application.matsci.permittivity.Step

Class for customized polymer builder.

DRIVER_PATH = 'polymer_builder_gui_dir/polymer_builder_driver.py'
POLYMER_BUILDER = 'polymer_builder'
DEFAULT_JOBNAME = 'permittivity_polymer_builder_task'
FLAG_NUM_CRU = '-num_cru'
SEQUENCE_PROP = 's_matsci_polymer_sequence'
FLAG_POLYMER_CRU_NUM = '-polymer_cru_num'
DEFAULT_NUMBER_OF_POLYMERS = 25
__init__(*arg, **kwargs)
Parameters
  • basename (str) – The base name of this subjob

  • config_yaml (str) – The config yaml file contain all job config

  • task_name (str) – Task name of this sub job

  • infile (str) – The input filename

  • outfile (str) – The output filename

  • additional_infiles (list of str) – This records additional input files (e.g. the second, third, and so on)

  • master_logger (logging.Logger) – The logger to use for recording messages into master job -driver.log.

  • node_index (The node index) – tuple

updateTaskReplicaSettings()

Update the task settings due to replica.

static getTemplates(moiety_dir=None, moiety_filename=None)

Return the polymer template file or dir

Parameters
  • moiety_dir (str) – Moiety dirname inside the polymer template dir

  • moiety_filename (str) – Filename inside the moiety dir

Returns

A polymer template file or dir

Return type

str

classmethod optionsToTaskProtocols(options, task_name, seed=None)

Update the polymer driver commands based on users’ input.

Parameters
  • options (argparse.Namespace) – The parsed command line options

  • task_name (str) – Task name

  • seed (int or None) – Random seed to randomize the initial velocities

Returns

Updated task protocol

Return type

TaskProtocol

classmethod getForceFieldFlag()

Return the flag for force field. Should be overwritten by the subclass only when subtask reads in this flag

Returns

The flag to set the force field (without the ‘-‘)

Return type

str or None

NUM_CRU_PROP = 'i_matsci_Num_Cru'
OUTFILE_EXT = '-out.mae'
REPLICA_TAG = 'Replica %s: '
RESOURCE = 'cpu'
TERMINAL_INFILE_NUM = 1
acquireLicenseForSmartDistribution() bool

Acquire and hold licenses for a smart distribution job. This makes sure the job won’t fail due to unavailable licenses.

Returns True if the licenses registered for the job are acquired, and False if they are not. If no licenses are registered, it always returns True to avoid preventing jobs from using the smart distribution feature. For legacy jobcontrol, the license check is not performed, and is always returned True. We want to use this feature as a pitch to move users to JOB_SERVER.

addFinalizer(function: Callable[[schrodinger.job.queue.BaseJob], None], run_dir: Optional[str] = None)

Add a function to be invoked when the job completes successfully.

See also the add_multi_job_finalizer function.

addGroupPrereq(job: schrodinger.job.queue.BaseJob)

Make all jobs connected to job prerequisites of all jobs connected to this Job.

addLaunchEnv(key: str, val: str)

Adds the given environment key and and value to the list of launch environment.

Parameters
  • key – environment key to add to the launch environment.

  • val – environment value associcated with the key to add to the launch environment.

addPrereq(job: schrodinger.job.queue.BaseJob)

Add a job that is an immediate prerequisite for this one.

cancel()

Send kill request to jobcontrol managed job. This method will eventually deprecate JobControlJob.kill

cancelSubmitted(do_license_check: bool = False) schrodinger.job.queue.CancelSubmittedStatus

If the job is still in the ‘submitted’ state, cancel it, purge the jobrecord and set the job handle to None. This tries to acquire licenses for the job before canceling from the queue if do_license_check is turned on.

Parameters

do_license_check – Acquire licenses for the job before canceling from the queue.

Returns one of the status of CancelSubmittedStatus.

copyFiles(copy_infile=True, copy_additional_files=True, more_files=None)

Copy files to current dir.

Parameters
  • copy_infile (bool) – Copy the input files of the class to current folder

  • copy_additional_files (bool) – Copy the additional files of the class to current folder

  • more_files (None or list of str) – Use this arguments to copy customized files

doCommand(host: str, local: bool = False)

Launch job on specified host using jobcontrol.launch_job().

Parameters
  • host – Host on which the job will be executed.

  • local – Removed in JOB_SERVER.

finalize()

Clean up after a job successfully runs.

static finalizeStep(job)

Update child job’s command with the parent job output, and set output files if not set by the subjob itself.

Parameters

job (An instance of a BaseJob subclass (such as JobControlJob or SubprocessJob)) – current job

genAllJobs(seen: Optional[Set[schrodinger.job.queue.BaseJob]] = None) Generator[schrodinger.job.queue.BaseJob, None, None]

A generator that yields all jobs connected to this one.

genAllPrereqs(seen=None) Generator[schrodinger.job.queue.BaseJob, None, None]

A generator that yields all jobs that are prerequisites on this one.

getCommand() List[str]

Return the command used to run this job.

getCommandDir() str

Return the launch/command directory name. If None is returned, the job will be launched in the current directory.

getDownStreamPolymerJob()

Search and return the down-stream polymer job

Returns

A subtask step with polymer driver in the cmd

Return type

‘Step’ or None

getDuration() Optional[int]

Return the duration of the Job as recorded by job server. The duration does not include queue wait time.

If the job is running or has not launched, returns None.

Note that this method makes a blocking call to the job server.

getFirstMatchedfilename(filenames, exts)

Get the filename that ends with the first extension. If multiple filenames end with that extension return the first match.

Parameters
  • filenames (list of string) – list of filenames

  • exts (list of string) – list of extensions

Returns

The matched filename or None

Return type

string or None

getJob() Optional[schrodinger.job.jobcontrol.Job]

Return the job record as a schrodinger.job.jobcontrol.Job instance.

Returns None if the job hasn’t been launched.

getJobDJ() schrodinger.job.queue.JobDJ

Return the JobDJ instance that this job has been added to.

getPrereqs()

Return a set of all immediate prerequisites for this job.

classmethod getSeedFlag()

Return the flag for random seed. Should be overwritten by the subclass only when subtask reads in this flag

Returns

The flag to set the random seed (without the ‘-‘)

Return type

str or None

getStatusStrings() Tuple[str, str, str]

Return a tuple of status strings for printing by JobDJ.

The strings returned are (status, jobid, host).

hasExited() bool

Returns True if this job finished, successfully or not.

hasStarted() bool

Returns True if this job has started (not waiting)

init_count = 0
isComplete() bool

Returns True if this job finished successfully

kill()

Send kill request to jobcontrol managed job

log(msg, add_log_tag=True)

Log information to the master driver.log

Parameters
  • msg (str) – The info to print

  • add_log_tag (bool) – If True, additional tags is logged in front of the msg for the replica jobs.

maxFailuresReached(msg: str)

Print an error summary, including the last 20 lines from each log file in the LogFiles list of the job record.

outfileExist()

Whether the outfile exists

Returns

Whether the file exists.

Return type

bool

postCommand()

A method to restore things to the pre-command state.

preCommand()

A method to make pre-command changes, like cd’ing to the correct directory to run the command in.

retryFailure(max_retries=0)

Determine if the job should be retried or not. This overwrites the parent method to by default not retry jobs that have a status of “died” as that will indicate that Jaguar failed, which it almost certainly will again.

Parameters

max_retries (int) – The queue’s max_retries parameter

Return type

bool

Returns

True if the job should be retried, False if not

run(*args, **kwargs)

Run the job.

The steps taken are as follows:
  1. Execute the preCommand method for things like changing the working directory.

  2. Call the doCommand to do the actual work of computation or job launching.

  3. Call the postCommand method to undo the changes from the preCommand that need to be undone.

runsLocally() bool

Return True if the job runs on the JobDJ control host, False if not. Jobs that run locally don’t need hosts.

There is no limit on the number of locally run jobs.

setLogTag()

Set the log tag based on node index.

setOutfile()

Set the job outfile with an existing file based on the jobcontrol job, if not set.

Raises

FileNotFoundError – Failed to set an existing outfile

setup(copy_infile=True, copy_additional_files=True, more_files=None)

Setup things before the job starts. For example, logging format, and file transfer.

Parameters
  • copy_infile (bool) – Copy the input files of the class to current folder

  • copy_additional_files (bool) – Copy the additional files of the class to current folder

  • more_files (None or list of str) – Use this arguments to copy customized files

property state: schrodinger.job.queue.JobState

Return the current state of the job.

Note that this method can be overridden by subclasses that wish to provide for restartability at a higher level than unpickling BaseJob instances. For example, by examining some external condition (e.g. presence of output files) the state JobState.DONE could be returned immediately and the job would not run.

update()

Checks for changes in job status, and updates the object appropriately (marks for restart, etc).

Raises

RuntimeError – if an unknown Job Status or ExitStatus is encountered.

updateInfileAndCommand(par_outfile_with_dir)

Update the input file in the command and the input file attributes of a child job to the output file path of the parent job.

Parameters
  • child_job (an instance of a BaseJob subclass (such as JobControlJob or SubprocessJob)) – The subjob whose command will be updated.

  • par_outfile_with_dir (str) – The output file from the parent job that will be used as the input file of this child job.

usesJobServer() bool

Detect, by looking at the jobId, whether this job uses a job server.

class schrodinger.application.matsci.permittivity.CMSParser(basename, config_yaml='default_permittivity_protocols.yaml', task_name=None, infile='$infile', outfile=None, additional_infiles=None, master_logger=None, node_index=None)

Bases: schrodinger.application.matsci.permittivity.Step

Class to parse equilibrated cms file.

DRIVER_PATH = 'permittivity_gui_dir/permittivity_cms_parser.py'
CMS_PARSER = 'cms_parser'
ICMS = 'icms'
DEFAULT_JOBNAME = 'permittivity_cms_parser_task'
FLAG_ELECTRIC_POLAR = '-electric_polar'
classmethod optionsToTaskProtocols(options, task_name, seed=None)

Process the stages, for example, update relaxation stages, update the productions stage, and remove productions markers.

Parameters
  • options (argparse.Namespace) – The parsed command line options

  • task_name (str) – Task name

  • seed (int or None) – Random seed to randomize the initial velocities

Returns

Updated task protocol

Return type

TaskProtocol

updateTaskReplicaSettings()

Update the task settings due to replica.

NUM_CRU_PROP = 'i_matsci_Num_Cru'
OUTFILE_EXT = '-out.mae'
REPLICA_TAG = 'Replica %s: '
RESOURCE = 'cpu'
TERMINAL_INFILE_NUM = 1
__init__(basename, config_yaml='default_permittivity_protocols.yaml', task_name=None, infile='$infile', outfile=None, additional_infiles=None, master_logger=None, node_index=None)
Parameters
  • basename (str) – The base name of this subjob

  • config_yaml (str) – The config yaml file contain all job config

  • task_name (str) – Task name of this sub job

  • infile (str) – The input filename

  • outfile (str) – The output filename

  • additional_infiles (list of str) – This records additional input files (e.g. the second, third, and so on)

  • master_logger (logging.Logger) – The logger to use for recording messages into master job -driver.log.

  • node_index (The node index) – tuple

acquireLicenseForSmartDistribution() bool

Acquire and hold licenses for a smart distribution job. This makes sure the job won’t fail due to unavailable licenses.

Returns True if the licenses registered for the job are acquired, and False if they are not. If no licenses are registered, it always returns True to avoid preventing jobs from using the smart distribution feature. For legacy jobcontrol, the license check is not performed, and is always returned True. We want to use this feature as a pitch to move users to JOB_SERVER.

addFinalizer(function: Callable[[schrodinger.job.queue.BaseJob], None], run_dir: Optional[str] = None)

Add a function to be invoked when the job completes successfully.

See also the add_multi_job_finalizer function.

addGroupPrereq(job: schrodinger.job.queue.BaseJob)

Make all jobs connected to job prerequisites of all jobs connected to this Job.

addLaunchEnv(key: str, val: str)

Adds the given environment key and and value to the list of launch environment.

Parameters
  • key – environment key to add to the launch environment.

  • val – environment value associcated with the key to add to the launch environment.

addPrereq(job: schrodinger.job.queue.BaseJob)

Add a job that is an immediate prerequisite for this one.

cancel()

Send kill request to jobcontrol managed job. This method will eventually deprecate JobControlJob.kill

cancelSubmitted(do_license_check: bool = False) schrodinger.job.queue.CancelSubmittedStatus

If the job is still in the ‘submitted’ state, cancel it, purge the jobrecord and set the job handle to None. This tries to acquire licenses for the job before canceling from the queue if do_license_check is turned on.

Parameters

do_license_check – Acquire licenses for the job before canceling from the queue.

Returns one of the status of CancelSubmittedStatus.

copyFiles(copy_infile=True, copy_additional_files=True, more_files=None)

Copy files to current dir.

Parameters
  • copy_infile (bool) – Copy the input files of the class to current folder

  • copy_additional_files (bool) – Copy the additional files of the class to current folder

  • more_files (None or list of str) – Use this arguments to copy customized files

doCommand(host: str, local: bool = False)

Launch job on specified host using jobcontrol.launch_job().

Parameters
  • host – Host on which the job will be executed.

  • local – Removed in JOB_SERVER.

finalize()

Clean up after a job successfully runs.

static finalizeStep(job)

Update child job’s command with the parent job output, and set output files if not set by the subjob itself.

Parameters

job (An instance of a BaseJob subclass (such as JobControlJob or SubprocessJob)) – current job

genAllJobs(seen: Optional[Set[schrodinger.job.queue.BaseJob]] = None) Generator[schrodinger.job.queue.BaseJob, None, None]

A generator that yields all jobs connected to this one.

genAllPrereqs(seen=None) Generator[schrodinger.job.queue.BaseJob, None, None]

A generator that yields all jobs that are prerequisites on this one.

getCommand() List[str]

Return the command used to run this job.

getCommandDir() str

Return the launch/command directory name. If None is returned, the job will be launched in the current directory.

getDownStreamPolymerJob()

Search and return the down-stream polymer job

Returns

A subtask step with polymer driver in the cmd

Return type

‘Step’ or None

getDuration() Optional[int]

Return the duration of the Job as recorded by job server. The duration does not include queue wait time.

If the job is running or has not launched, returns None.

Note that this method makes a blocking call to the job server.

getFirstMatchedfilename(filenames, exts)

Get the filename that ends with the first extension. If multiple filenames end with that extension return the first match.

Parameters
  • filenames (list of string) – list of filenames

  • exts (list of string) – list of extensions

Returns

The matched filename or None

Return type

string or None

classmethod getForceFieldFlag()

Return the flag for force field. Should be overwritten by the subclass only when subtask reads in this flag

Returns

The flag to set the force field (without the ‘-‘)

Return type

str or None

getJob() Optional[schrodinger.job.jobcontrol.Job]

Return the job record as a schrodinger.job.jobcontrol.Job instance.

Returns None if the job hasn’t been launched.

getJobDJ() schrodinger.job.queue.JobDJ

Return the JobDJ instance that this job has been added to.

getPrereqs()

Return a set of all immediate prerequisites for this job.

classmethod getSeedFlag()

Return the flag for random seed. Should be overwritten by the subclass only when subtask reads in this flag

Returns

The flag to set the random seed (without the ‘-‘)

Return type

str or None

getStatusStrings() Tuple[str, str, str]

Return a tuple of status strings for printing by JobDJ.

The strings returned are (status, jobid, host).

hasExited() bool

Returns True if this job finished, successfully or not.

hasStarted() bool

Returns True if this job has started (not waiting)

init_count = 0
isComplete() bool

Returns True if this job finished successfully

kill()

Send kill request to jobcontrol managed job

log(msg, add_log_tag=True)

Log information to the master driver.log

Parameters
  • msg (str) – The info to print

  • add_log_tag (bool) – If True, additional tags is logged in front of the msg for the replica jobs.

maxFailuresReached(msg: str)

Print an error summary, including the last 20 lines from each log file in the LogFiles list of the job record.

outfileExist()

Whether the outfile exists

Returns

Whether the file exists.

Return type

bool

postCommand()

A method to restore things to the pre-command state.

preCommand()

A method to make pre-command changes, like cd’ing to the correct directory to run the command in.

retryFailure(max_retries=0)

Determine if the job should be retried or not. This overwrites the parent method to by default not retry jobs that have a status of “died” as that will indicate that Jaguar failed, which it almost certainly will again.

Parameters

max_retries (int) – The queue’s max_retries parameter

Return type

bool

Returns

True if the job should be retried, False if not

run(*args, **kwargs)

Run the job.

The steps taken are as follows:
  1. Execute the preCommand method for things like changing the working directory.

  2. Call the doCommand to do the actual work of computation or job launching.

  3. Call the postCommand method to undo the changes from the preCommand that need to be undone.

runsLocally() bool

Return True if the job runs on the JobDJ control host, False if not. Jobs that run locally don’t need hosts.

There is no limit on the number of locally run jobs.

setLogTag()

Set the log tag based on node index.

setOutfile()

Set the job outfile with an existing file based on the jobcontrol job, if not set.

Raises

FileNotFoundError – Failed to set an existing outfile

setup(copy_infile=True, copy_additional_files=True, more_files=None)

Setup things before the job starts. For example, logging format, and file transfer.

Parameters
  • copy_infile (bool) – Copy the input files of the class to current folder

  • copy_additional_files (bool) – Copy the additional files of the class to current folder

  • more_files (None or list of str) – Use this arguments to copy customized files

property state: schrodinger.job.queue.JobState

Return the current state of the job.

Note that this method can be overridden by subclasses that wish to provide for restartability at a higher level than unpickling BaseJob instances. For example, by examining some external condition (e.g. presence of output files) the state JobState.DONE could be returned immediately and the job would not run.

update()

Checks for changes in job status, and updates the object appropriately (marks for restart, etc).

Raises

RuntimeError – if an unknown Job Status or ExitStatus is encountered.

updateInfileAndCommand(par_outfile_with_dir)

Update the input file in the command and the input file attributes of a child job to the output file path of the parent job.

Parameters
  • child_job (an instance of a BaseJob subclass (such as JobControlJob or SubprocessJob)) – The subjob whose command will be updated.

  • par_outfile_with_dir (str) – The output file from the parent job that will be used as the input file of this child job.

usesJobServer() bool

Detect, by looking at the jobId, whether this job uses a job server.

class schrodinger.application.matsci.permittivity.DisorderSystemBuilder(basename, config_yaml='default_permittivity_protocols.yaml', task_name=None, infile='$infile', outfile=None, additional_infiles=None, master_logger=None, node_index=None)

Bases: schrodinger.application.matsci.permittivity.Step

Class for customized disorder system builder.

DSB_DRIVER = <module 'disordered_system_builder_driver' from '/scr/buildbot/savedbuilds/2023-4/NB/build-133/mmshare-v6.4/python/scripts/disordered_system_builder_gui_dir/disordered_system_builder_driver.py'>
DRIVER_PATH = 'disordered_system_builder_gui_dir/disordered_system_builder_driver.py'
DISORDER_SYSTEM = 'disorder_system'
DEFAULT_JOBNAME = 'permittivity_disorder_system_task'
FLAG_MOLECULES = '-molecules'
FLAG_COMPOSITION = '-composition'
FLAG_DENSITY = '-density'
FLAG_MONOMER_CHARGE = '-monomer_ff_q'
DEFAULT_DENSITY = 0.5
DEFAULT_NUMBER_OF_MOLECULES = 500
classmethod getSeedFlag()

Return the flag for random seed.

Returns

The flag to set the random seed (without the ‘-‘)

Return type

str

classmethod getForceFieldFlag()

Return the flag for force field. Should be overwritten by the subclass only when subtask reads in this flag

Returns

The flag to set the force field (without the ‘-‘)

Return type

str or None

classmethod optionsToTaskProtocols(options, task_name, seed=None)

Process the stages, for example, update relaxation stages, update the productions stage, and remove productions markers.

Parameters
  • options (argparse.Namespace) – The parsed command line options

  • task_name (str) – Task name

  • seed (int or None) – Random seed to randomize the initial velocities

Returns

Updated task protocol

Return type

TaskProtocol

updateTaskReplicaSettings()

Update the task protocol due to replica.

NUM_CRU_PROP = 'i_matsci_Num_Cru'
OUTFILE_EXT = '-out.mae'
REPLICA_TAG = 'Replica %s: '
RESOURCE = 'cpu'
TERMINAL_INFILE_NUM = 1
__init__(basename, config_yaml='default_permittivity_protocols.yaml', task_name=None, infile='$infile', outfile=None, additional_infiles=None, master_logger=None, node_index=None)
Parameters
  • basename (str) – The base name of this subjob

  • config_yaml (str) – The config yaml file contain all job config

  • task_name (str) – Task name of this sub job

  • infile (str) – The input filename

  • outfile (str) – The output filename

  • additional_infiles (list of str) – This records additional input files (e.g. the second, third, and so on)

  • master_logger (logging.Logger) – The logger to use for recording messages into master job -driver.log.

  • node_index (The node index) – tuple

acquireLicenseForSmartDistribution() bool

Acquire and hold licenses for a smart distribution job. This makes sure the job won’t fail due to unavailable licenses.

Returns True if the licenses registered for the job are acquired, and False if they are not. If no licenses are registered, it always returns True to avoid preventing jobs from using the smart distribution feature. For legacy jobcontrol, the license check is not performed, and is always returned True. We want to use this feature as a pitch to move users to JOB_SERVER.

addFinalizer(function: Callable[[schrodinger.job.queue.BaseJob], None], run_dir: Optional[str] = None)

Add a function to be invoked when the job completes successfully.

See also the add_multi_job_finalizer function.

addGroupPrereq(job: schrodinger.job.queue.BaseJob)

Make all jobs connected to job prerequisites of all jobs connected to this Job.

addLaunchEnv(key: str, val: str)

Adds the given environment key and and value to the list of launch environment.

Parameters
  • key – environment key to add to the launch environment.

  • val – environment value associcated with the key to add to the launch environment.

addPrereq(job: schrodinger.job.queue.BaseJob)

Add a job that is an immediate prerequisite for this one.

cancel()

Send kill request to jobcontrol managed job. This method will eventually deprecate JobControlJob.kill

cancelSubmitted(do_license_check: bool = False) schrodinger.job.queue.CancelSubmittedStatus

If the job is still in the ‘submitted’ state, cancel it, purge the jobrecord and set the job handle to None. This tries to acquire licenses for the job before canceling from the queue if do_license_check is turned on.

Parameters

do_license_check – Acquire licenses for the job before canceling from the queue.

Returns one of the status of CancelSubmittedStatus.

copyFiles(copy_infile=True, copy_additional_files=True, more_files=None)

Copy files to current dir.

Parameters
  • copy_infile (bool) – Copy the input files of the class to current folder

  • copy_additional_files (bool) – Copy the additional files of the class to current folder

  • more_files (None or list of str) – Use this arguments to copy customized files

doCommand(host: str, local: bool = False)

Launch job on specified host using jobcontrol.launch_job().

Parameters
  • host – Host on which the job will be executed.

  • local – Removed in JOB_SERVER.

finalize()

Clean up after a job successfully runs.

static finalizeStep(job)

Update child job’s command with the parent job output, and set output files if not set by the subjob itself.

Parameters

job (An instance of a BaseJob subclass (such as JobControlJob or SubprocessJob)) – current job

genAllJobs(seen: Optional[Set[schrodinger.job.queue.BaseJob]] = None) Generator[schrodinger.job.queue.BaseJob, None, None]

A generator that yields all jobs connected to this one.

genAllPrereqs(seen=None) Generator[schrodinger.job.queue.BaseJob, None, None]

A generator that yields all jobs that are prerequisites on this one.

getCommand() List[str]

Return the command used to run this job.

getCommandDir() str

Return the launch/command directory name. If None is returned, the job will be launched in the current directory.

getDownStreamPolymerJob()

Search and return the down-stream polymer job

Returns

A subtask step with polymer driver in the cmd

Return type

‘Step’ or None

getDuration() Optional[int]

Return the duration of the Job as recorded by job server. The duration does not include queue wait time.

If the job is running or has not launched, returns None.

Note that this method makes a blocking call to the job server.

getFirstMatchedfilename(filenames, exts)

Get the filename that ends with the first extension. If multiple filenames end with that extension return the first match.

Parameters
  • filenames (list of string) – list of filenames

  • exts (list of string) – list of extensions

Returns

The matched filename or None

Return type

string or None

getJob() Optional[schrodinger.job.jobcontrol.Job]

Return the job record as a schrodinger.job.jobcontrol.Job instance.

Returns None if the job hasn’t been launched.

getJobDJ() schrodinger.job.queue.JobDJ

Return the JobDJ instance that this job has been added to.

getPrereqs()

Return a set of all immediate prerequisites for this job.

getStatusStrings() Tuple[str, str, str]

Return a tuple of status strings for printing by JobDJ.

The strings returned are (status, jobid, host).

hasExited() bool

Returns True if this job finished, successfully or not.

hasStarted() bool

Returns True if this job has started (not waiting)

init_count = 0
isComplete() bool

Returns True if this job finished successfully

kill()

Send kill request to jobcontrol managed job

log(msg, add_log_tag=True)

Log information to the master driver.log

Parameters
  • msg (str) – The info to print

  • add_log_tag (bool) – If True, additional tags is logged in front of the msg for the replica jobs.

maxFailuresReached(msg: str)

Print an error summary, including the last 20 lines from each log file in the LogFiles list of the job record.

outfileExist()

Whether the outfile exists

Returns

Whether the file exists.

Return type

bool

postCommand()

A method to restore things to the pre-command state.

preCommand()

A method to make pre-command changes, like cd’ing to the correct directory to run the command in.

retryFailure(max_retries=0)

Determine if the job should be retried or not. This overwrites the parent method to by default not retry jobs that have a status of “died” as that will indicate that Jaguar failed, which it almost certainly will again.

Parameters

max_retries (int) – The queue’s max_retries parameter

Return type

bool

Returns

True if the job should be retried, False if not

run(*args, **kwargs)

Run the job.

The steps taken are as follows:
  1. Execute the preCommand method for things like changing the working directory.

  2. Call the doCommand to do the actual work of computation or job launching.

  3. Call the postCommand method to undo the changes from the preCommand that need to be undone.

runsLocally() bool

Return True if the job runs on the JobDJ control host, False if not. Jobs that run locally don’t need hosts.

There is no limit on the number of locally run jobs.

setLogTag()

Set the log tag based on node index.

setOutfile()

Set the job outfile with an existing file based on the jobcontrol job, if not set.

Raises

FileNotFoundError – Failed to set an existing outfile

setup(copy_infile=True, copy_additional_files=True, more_files=None)

Setup things before the job starts. For example, logging format, and file transfer.

Parameters
  • copy_infile (bool) – Copy the input files of the class to current folder

  • copy_additional_files (bool) – Copy the additional files of the class to current folder

  • more_files (None or list of str) – Use this arguments to copy customized files

property state: schrodinger.job.queue.JobState

Return the current state of the job.

Note that this method can be overridden by subclasses that wish to provide for restartability at a higher level than unpickling BaseJob instances. For example, by examining some external condition (e.g. presence of output files) the state JobState.DONE could be returned immediately and the job would not run.

update()

Checks for changes in job status, and updates the object appropriately (marks for restart, etc).

Raises

RuntimeError – if an unknown Job Status or ExitStatus is encountered.

updateInfileAndCommand(par_outfile_with_dir)

Update the input file in the command and the input file attributes of a child job to the output file path of the parent job.

Parameters
  • child_job (an instance of a BaseJob subclass (such as JobControlJob or SubprocessJob)) – The subjob whose command will be updated.

  • par_outfile_with_dir (str) – The output file from the parent job that will be used as the input file of this child job.

usesJobServer() bool

Detect, by looking at the jobId, whether this job uses a job server.

class schrodinger.application.matsci.permittivity.MultiStageMd(*arg, **kwarg)

Bases: schrodinger.application.matsci.permittivity.Step

Multi-stage simulations with relaxation.

BROWNIAN_DYNAMICS = 'Brownian Dynamics'
MOLECULAR_DYNAMICS = 'Molecular Dynamics'
AVERAGE_CELL = 'Average Cell'
MATSCI_ANALYSIS = 'Matsci Analysis'
SIMULATE = 'simulate'
CFG_FILE = 'cfg_file'
TIME = 'time'
TEMP = 'temp'
PRESS = 'pressure'
TIMESTEP = 'timestep'
ENSEMBLE = 'ensemble'
DIPOLE_INTERVAL = 'dipole_moment_dot_interval'
SIM_TYPE = 'sim_type'
TRJ_INTVL = 'trajectory.interval'
SEED = 'seed'
FLAG_TO_KEY = {'-md_ensemble': 'ensemble', '-md_press': 'pressure', '-md_temp': 'temp', '-md_time': 'time', '-md_timestep': 'timestep', '-md_trj_int': 'trajectory.interval'}
DESMOND_UNIT_CONVERTERS = {'-md_time': <function MultiStageMd.<lambda>>, '-md_timestep': <function MultiStageMd.<lambda>>}
TRJ_WRITE_VEL = 'trajectory_dot_write_velocity'
LAST_STAGE_DICT = {'compress': '""', 'dir': '"."'}
FLOAT_FIELDS = ['time', 'temp', 'pressure']
DUMMY_FIELDS = ['index', 'is_production', 'is_relaxation', 'use_customized_relaxation']
MSJSTRINGERS = {'Average Cell': <class 'schrodinger.application.matsci.desconfig.AveCellMSJStringer'>, 'Brownian Dynamics': <class 'schrodinger.application.matsci.desconfig.BrownieMSJStringer'>, 'Matsci Analysis': <class 'schrodinger.application.matsci.desconfig.MSAnalysisMSJStringer'>, 'Molecular Dynamics': <class 'schrodinger.application.matsci.desconfig.MDMSJStringer'>}
DEFAULT_MSJ_HEADER = 'task { task = "desmond:auto"}\n'
HOFMANN = 'Hofmann'
COMPRESSIVE = 'Compressive'
ADD_NEW = 'Add New...'
HOFMANN_PROTOCOL = 'hofmann.yaml'
COMPRESSIVE_PROTOCOL = 'compressive.msj'
RELAXATION_MAP = {'Compressive': 'relaxation_protocols/compressive.msj', 'Hofmann': 'relaxation_protocols/hofmann.yaml'}
OUTFILE_EXT = '-out.cms'
RESOURCE = 'gpu'
__init__(*arg, **kwarg)

See parent class.

setup()

Over write parent class method.

createMSJ()

Create msj for desmond.

getStages()

Get desmond stages from config yaml.

Returns

The MSJSTRINGERS contains desmond stage information, the orig_msj_str is for msj string provided by users.

Return type

list of desconfig.MSJStringer, str

parseMsjStr(msj_str)

Parse MSJ string, set task stage and customize settings.

Parameters

msj_str (str) – A string in MSJ format

Returns

Modified msj string with task stage

Return type

schrodinger.application.desmond.multisim.Msj

copyCfgFiles(msj_stages)

Copy the config files into the subtask dir.

Parameters

msj_stages ('schrodinger.application.desmond.multisim.parser.Msj') – The msj that may contain cfg files

updateReplicaSeed(stages, msj_stages)

Update the random seed in the msj so that each replica has a different value.

Parameters
  • stages (list of desconfig.MSJStringer) – The desmond MSJSTRINGERS contains desmond information

  • msj_header (schrodinger.application.desmond.multisim.Msj) – The msj header with task stage (may have other simulation stages)

modifyReplicaStages(stages)

Search the desmond stages for seed, and tune them based on the replica index.

Parameters

stages (list of the MSJSTRINGERS) – The desmond MSJSTRINGERS contains desmond information

Returns

Whether some seeds in the stages are modified

Return type

bool

modifyReplicaMsjHeader(msj_stages)

Modify the replica Msj header.

Parameters

msj_stages (schrodinger.application.desmond.multisim.Msj) – The msj header with task stage (may have other simulation stages)

Returns

Whether the msj_stages are modified

Return type

bool

modifyReplicaFirstStage(stages)

Modify the first desmond stages to add seed based on the replica index

Parameters

stages (list of the MSJSTRINGERS) – The desmond MSJSTRINGERS contains desmond information

classmethod optionsToStage(options)

Convert command line options to a stage like dict.

Parameters

options (argparse.Namespace) – The command parsered options

Returns

Key and values for a desmond stage

Return type

dict

classmethod optionsToTaskProtocols(options, task_name, seed=None)

Process the stages, for example, update relaxation stages, update the productions stage, and remove productions markers.

Parameters
  • options (argparse.Namespace) – The parsed command line options

  • task_name (str) – Task name

  • seed (int or None) – Random seed to randomize the initial velocities

Returns

Updated task protocol

Return type

TaskProtocol

classmethod getRelaxationProtocolFile(relaxation_option)

Return the relaxation protocol file based on the relaxation option.

Parameters

relaxation_option (str) – File with path or a protocol name

Returns

Relaxation file with path

Return type

str

classmethod getAllStages(options, task_name, time=100.0)

Construct the stages in general by looking at the config yaml, commandline relaxation, and productions. Note: only when stages are marked by USE_CUSTOMIZED_RELAXATION and options.relaxation_protocol is provided, the stages in the relaxation_protocol is used to overwrite the stages in options.config_yaml.

Parameters
  • options (argparse.Namespace) – The object holding all the cmd options

  • task_name (str) – The task name of the stage

  • time (float) – A short md threshold threshold for debug mode (simulation time longer than this is reduced to this value for fast testing)

Returns

task_protocol.protocol is a list of stages

Return type

‘TaskProtocol’

static getRelaxationStages(relaxation_file)

Get the relaxation stages from relaxation protocol file and return it as desmond stages.

Parameters

relaxation_file (str) – A file containing relaxation protocol

Returns

list of desmond stages

Return type

list

classmethod modifyStageSettings(task_protocol, options, seed=None)

Modify the stages based on command line options, including update the temperature and pressure of the first flexible stages before each production stage, pass velocity to NVE production stage.

Parameters
  • task_protocol ('TaskProtocol') – task_protocol.protocol is a list of stages

  • options (argparse.Namespace) – The parsed command line options

  • seed (int or None) – Random seed to randomize the initial velocities

DRIVER_PATH = None
NUM_CRU_PROP = 'i_matsci_Num_Cru'
REPLICA_TAG = 'Replica %s: '
TERMINAL_INFILE_NUM = 1
acquireLicenseForSmartDistribution() bool

Acquire and hold licenses for a smart distribution job. This makes sure the job won’t fail due to unavailable licenses.

Returns True if the licenses registered for the job are acquired, and False if they are not. If no licenses are registered, it always returns True to avoid preventing jobs from using the smart distribution feature. For legacy jobcontrol, the license check is not performed, and is always returned True. We want to use this feature as a pitch to move users to JOB_SERVER.

addFinalizer(function: Callable[[schrodinger.job.queue.BaseJob], None], run_dir: Optional[str] = None)

Add a function to be invoked when the job completes successfully.

See also the add_multi_job_finalizer function.

addGroupPrereq(job: schrodinger.job.queue.BaseJob)

Make all jobs connected to job prerequisites of all jobs connected to this Job.

addLaunchEnv(key: str, val: str)

Adds the given environment key and and value to the list of launch environment.

Parameters
  • key – environment key to add to the launch environment.

  • val – environment value associcated with the key to add to the launch environment.

addPrereq(job: schrodinger.job.queue.BaseJob)

Add a job that is an immediate prerequisite for this one.

cancel()

Send kill request to jobcontrol managed job. This method will eventually deprecate JobControlJob.kill

cancelSubmitted(do_license_check: bool = False) schrodinger.job.queue.CancelSubmittedStatus

If the job is still in the ‘submitted’ state, cancel it, purge the jobrecord and set the job handle to None. This tries to acquire licenses for the job before canceling from the queue if do_license_check is turned on.

Parameters

do_license_check – Acquire licenses for the job before canceling from the queue.

Returns one of the status of CancelSubmittedStatus.

copyFiles(copy_infile=True, copy_additional_files=True, more_files=None)

Copy files to current dir.

Parameters
  • copy_infile (bool) – Copy the input files of the class to current folder

  • copy_additional_files (bool) – Copy the additional files of the class to current folder

  • more_files (None or list of str) – Use this arguments to copy customized files

doCommand(host: str, local: bool = False)

Launch job on specified host using jobcontrol.launch_job().

Parameters
  • host – Host on which the job will be executed.

  • local – Removed in JOB_SERVER.

finalize()

Clean up after a job successfully runs.

static finalizeStep(job)

Update child job’s command with the parent job output, and set output files if not set by the subjob itself.

Parameters

job (An instance of a BaseJob subclass (such as JobControlJob or SubprocessJob)) – current job

genAllJobs(seen: Optional[Set[schrodinger.job.queue.BaseJob]] = None) Generator[schrodinger.job.queue.BaseJob, None, None]

A generator that yields all jobs connected to this one.

genAllPrereqs(seen=None) Generator[schrodinger.job.queue.BaseJob, None, None]

A generator that yields all jobs that are prerequisites on this one.

getCommand() List[str]

Return the command used to run this job.

getCommandDir() str

Return the launch/command directory name. If None is returned, the job will be launched in the current directory.

getDownStreamPolymerJob()

Search and return the down-stream polymer job

Returns

A subtask step with polymer driver in the cmd

Return type

‘Step’ or None

getDuration() Optional[int]

Return the duration of the Job as recorded by job server. The duration does not include queue wait time.

If the job is running or has not launched, returns None.

Note that this method makes a blocking call to the job server.

getFirstMatchedfilename(filenames, exts)

Get the filename that ends with the first extension. If multiple filenames end with that extension return the first match.

Parameters
  • filenames (list of string) – list of filenames

  • exts (list of string) – list of extensions

Returns

The matched filename or None

Return type

string or None

classmethod getForceFieldFlag()

Return the flag for force field. Should be overwritten by the subclass only when subtask reads in this flag

Returns

The flag to set the force field (without the ‘-‘)

Return type

str or None

getJob() Optional[schrodinger.job.jobcontrol.Job]

Return the job record as a schrodinger.job.jobcontrol.Job instance.

Returns None if the job hasn’t been launched.

getJobDJ() schrodinger.job.queue.JobDJ

Return the JobDJ instance that this job has been added to.

getPrereqs()

Return a set of all immediate prerequisites for this job.

classmethod getSeedFlag()

Return the flag for random seed. Should be overwritten by the subclass only when subtask reads in this flag

Returns

The flag to set the random seed (without the ‘-‘)

Return type

str or None

getStatusStrings() Tuple[str, str, str]

Return a tuple of status strings for printing by JobDJ.

The strings returned are (status, jobid, host).

hasExited() bool

Returns True if this job finished, successfully or not.

hasStarted() bool

Returns True if this job has started (not waiting)

init_count = 0
isComplete() bool

Returns True if this job finished successfully

kill()

Send kill request to jobcontrol managed job

log(msg, add_log_tag=True)

Log information to the master driver.log

Parameters
  • msg (str) – The info to print

  • add_log_tag (bool) – If True, additional tags is logged in front of the msg for the replica jobs.

maxFailuresReached(msg: str)

Print an error summary, including the last 20 lines from each log file in the LogFiles list of the job record.

outfileExist()

Whether the outfile exists

Returns

Whether the file exists.

Return type

bool

postCommand()

A method to restore things to the pre-command state.

preCommand()

A method to make pre-command changes, like cd’ing to the correct directory to run the command in.

retryFailure(max_retries=0)

Determine if the job should be retried or not. This overwrites the parent method to by default not retry jobs that have a status of “died” as that will indicate that Jaguar failed, which it almost certainly will again.

Parameters

max_retries (int) – The queue’s max_retries parameter

Return type

bool

Returns

True if the job should be retried, False if not

run(*args, **kwargs)

Run the job.

The steps taken are as follows:
  1. Execute the preCommand method for things like changing the working directory.

  2. Call the doCommand to do the actual work of computation or job launching.

  3. Call the postCommand method to undo the changes from the preCommand that need to be undone.

runsLocally() bool

Return True if the job runs on the JobDJ control host, False if not. Jobs that run locally don’t need hosts.

There is no limit on the number of locally run jobs.

setLogTag()

Set the log tag based on node index.

setOutfile()

Set the job outfile with an existing file based on the jobcontrol job, if not set.

Raises

FileNotFoundError – Failed to set an existing outfile

property state: schrodinger.job.queue.JobState

Return the current state of the job.

Note that this method can be overridden by subclasses that wish to provide for restartability at a higher level than unpickling BaseJob instances. For example, by examining some external condition (e.g. presence of output files) the state JobState.DONE could be returned immediately and the job would not run.

update()

Checks for changes in job status, and updates the object appropriately (marks for restart, etc).

Raises

RuntimeError – if an unknown Job Status or ExitStatus is encountered.

updateInfileAndCommand(par_outfile_with_dir)

Update the input file in the command and the input file attributes of a child job to the output file path of the parent job.

Parameters
  • child_job (an instance of a BaseJob subclass (such as JobControlJob or SubprocessJob)) – The subjob whose command will be updated.

  • par_outfile_with_dir (str) – The output file from the parent job that will be used as the input file of this child job.

updateTaskReplicaSettings()

Update the task protocol due to replica.

usesJobServer() bool

Detect, by looking at the jobId, whether this job uses a job server.

class schrodinger.application.matsci.permittivity.MdStageModifier(task_protocol, options, seed=None)

Bases: object

TEMPERATURE = 'temperature'
RANDOMIZE_VELOCITY = 'randomize_velocity'
FIRST = 'first'
RANDOMIZE_VELOCITY_DOT_FIRST = 'randomize_velocity.first'
RANDOMIZE_VELOCITY_DOT_SEED = 'randomize_velocity.seed'
LAST_RELAX_STAGE_TRJ_INTVL = 100.0
OTHER_RELAX_STAGE_TRJ_INTVL = 500.0
__init__(task_protocol, options, seed=None)
Parameters
  • task_protocol ('TaskProtocol') – task_protocol.protocol is a list of stages

  • options (argparse.Namespace) – The parsed command line options

  • seed (int or None) – Random seed to randomize the initial velocities

run()

Main method to drive the functionality.

setStages()

Set stages. If the protocol contains only one stage and the only item in this stage list is a dict with ‘msj’ being the only key, the stage is parsed by standard msj parser. Otherwise, each stage is a list.

setRelaxAndProductionIndexes()

Set relaxation and production stage indexes according to markers. Note: if only relaxation stages are found, the stage right after the last relaxation is assumed to be the production stages.

setRelaxRandomVel()

Set the randomize velocity seed for the first relaxation stage.

static getStageIndicesByMarker(stages, marker='is_production', expected_value='yes', remove_marker=False)

Indexes of the stages marked with certain markers. For example, IS_PRODUCTION markers stages as production stages; IS_RELAXATION markers stages as relaxation stages; If USE_CUSTOMIZED_RELAXATION markers some stages, the first with this marker and those before this one will be replaced by customized relaxation stages defined by users.

Parameters
  • stages (list) – Multistages for desmond serial simulations

  • marker (bool) – Remove the marker flag, if True

  • expected_value (str) – This is expected value pointed to by the marker

  • remove_marker (bool) – Remove the yes production flag, if True

Returns

The indexes of all the stages marked with ‘xxx:yes’

Return type

list of int

updateProductStageTempAndPress()

Update the temp and press of the production stage.

updateRelaxStageTempAndPress()

Update the temperature and pressure settings of stages. If no NPT or NVT ahead of the NVE, randomize the NVE production velocity.

connectNVEInitialVelocity()

Seamlessly connect the NVE production stage to the previous stages by writing out velocities and skip the randomizing initial velocities.

duplicateRelaxStage()

Update and duplicate the last relaxation stage settings.

updateLastStage()

Update the settings of the last stage.

saveMsjStages()

Save the msj stages to the task protocol

updateTrjIntvel()

Update the trajectory output interval for the stages before the last relaxation stage.

removeCom()

Add remove center of mass string to relaxation and production stages.

updateDipoleInterval()

Update the dipole interval in production run

removeDummyFields()

Remove the intermediate arguments that desmond doesn’t recognize.

class schrodinger.application.matsci.permittivity.MdPostAnalysis(basename, config_yaml='default_permittivity_protocols.yaml', task_name=None, infile='$infile', outfile=None, additional_infiles=None, master_logger=None, node_index=None)

Bases: schrodinger.application.matsci.permittivity.Step

Base class to hold molecular dynamics post analysis functionality.

TEMP_PROP = 'r_matsci_Temperature(K)'
TEMP_STD_PROP = 'r_matsci_stdev_Temperature(K)'
setup(copy_ene=False, write_cms=False)

Over write parent class method.

addEnefileToAdditionalInfiles()

Add the ene file as one of the additional files.

writeCms()

Write out cms files to current dir and each of them has a ‘msprops.ORIGINAL_CMS_PROP’ property pointing to the original cms file path.

static autocorrelation(time_serial_data, normalize=False)

Calculate the auto correlation of the input numpy.array data.

Parameters
  • time_serial_data (n x m numpy.array) – Autocorrelation of each column of the data

  • normalize (bool) – If True, the auto correlation data will be normalized

Returns

Autocorrelated data (by column)

Return type

n x m numpy.array

static autocorrelationWithSum(time_serial_data, normalize=False)

Calculate the auto correlation of the input numpy.array data.

Parameters
  • time_serial_data (n x m numpy.array) – Autocorrelation of each column of the data

  • normalize (bool) – If True, the auto correlation data will be normalized

Returns

Autocorrelated data (by column)

Return type

n x m numpy.array

static getRelatedFile(cms_file, file_ext='.ene')

Get the requested file based on cms file name and file extension

Parameters
  • cms_file (str) – The cms file whose related file is searched.

  • file_ext (str) – the extension of file to search for. The file extension must include the separator as well. For example, to get ene file, file_ext must be “.ene”

Returns

Found file with correct extension

Return type

str or None

static getRelatedJobFile(input_cms, orig_cms=None, file_ext='.ene')

Search existing ene file and return the ene found based on the input_cms. Existing ene file may be found in current folder, in the input cms folder or in the PROP_CMS (‘s_m_original_cms_file’) folder when ene is not copied from the PROP_CMS folder to the current folder.

Parameters
  • input_cms (str) – INPUT_CMS defined for INPUT_TRJ searching.

  • orig_cms (str) – The original cms defined by users.

  • file_ext (str) – the extension of file to search for. The file extension must include the separator as well. For example, to get ene file, file_ext must be “.ene”

Raises

KeyError, FileNotFoundError, ValueError – when ene file cannot be found.

Return type

str, str or None

Returns

Existing ene file if found, the original cms file that the ene file sits with or None (sit with the input_cms)

DRIVER_PATH = None
NUM_CRU_PROP = 'i_matsci_Num_Cru'
OUTFILE_EXT = '-out.mae'
REPLICA_TAG = 'Replica %s: '
RESOURCE = 'cpu'
TERMINAL_INFILE_NUM = 1
__init__(basename, config_yaml='default_permittivity_protocols.yaml', task_name=None, infile='$infile', outfile=None, additional_infiles=None, master_logger=None, node_index=None)
Parameters
  • basename (str) – The base name of this subjob

  • config_yaml (str) – The config yaml file contain all job config

  • task_name (str) – Task name of this sub job

  • infile (str) – The input filename

  • outfile (str) – The output filename

  • additional_infiles (list of str) – This records additional input files (e.g. the second, third, and so on)

  • master_logger (logging.Logger) – The logger to use for recording messages into master job -driver.log.

  • node_index (The node index) – tuple

acquireLicenseForSmartDistribution() bool

Acquire and hold licenses for a smart distribution job. This makes sure the job won’t fail due to unavailable licenses.

Returns True if the licenses registered for the job are acquired, and False if they are not. If no licenses are registered, it always returns True to avoid preventing jobs from using the smart distribution feature. For legacy jobcontrol, the license check is not performed, and is always returned True. We want to use this feature as a pitch to move users to JOB_SERVER.

addFinalizer(function: Callable[[schrodinger.job.queue.BaseJob], None], run_dir: Optional[str] = None)

Add a function to be invoked when the job completes successfully.

See also the add_multi_job_finalizer function.

addGroupPrereq(job: schrodinger.job.queue.BaseJob)

Make all jobs connected to job prerequisites of all jobs connected to this Job.

addLaunchEnv(key: str, val: str)

Adds the given environment key and and value to the list of launch environment.

Parameters
  • key – environment key to add to the launch environment.

  • val – environment value associcated with the key to add to the launch environment.

addPrereq(job: schrodinger.job.queue.BaseJob)

Add a job that is an immediate prerequisite for this one.

cancel()

Send kill request to jobcontrol managed job. This method will eventually deprecate JobControlJob.kill

cancelSubmitted(do_license_check: bool = False) schrodinger.job.queue.CancelSubmittedStatus

If the job is still in the ‘submitted’ state, cancel it, purge the jobrecord and set the job handle to None. This tries to acquire licenses for the job before canceling from the queue if do_license_check is turned on.

Parameters

do_license_check – Acquire licenses for the job before canceling from the queue.

Returns one of the status of CancelSubmittedStatus.

copyFiles(copy_infile=True, copy_additional_files=True, more_files=None)

Copy files to current dir.

Parameters
  • copy_infile (bool) – Copy the input files of the class to current folder

  • copy_additional_files (bool) – Copy the additional files of the class to current folder

  • more_files (None or list of str) – Use this arguments to copy customized files

doCommand(host: str, local: bool = False)

Launch job on specified host using jobcontrol.launch_job().

Parameters
  • host – Host on which the job will be executed.

  • local – Removed in JOB_SERVER.

finalize()

Clean up after a job successfully runs.

static finalizeStep(job)

Update child job’s command with the parent job output, and set output files if not set by the subjob itself.

Parameters

job (An instance of a BaseJob subclass (such as JobControlJob or SubprocessJob)) – current job

genAllJobs(seen: Optional[Set[schrodinger.job.queue.BaseJob]] = None) Generator[schrodinger.job.queue.BaseJob, None, None]

A generator that yields all jobs connected to this one.

genAllPrereqs(seen=None) Generator[schrodinger.job.queue.BaseJob, None, None]

A generator that yields all jobs that are prerequisites on this one.

getCommand() List[str]

Return the command used to run this job.

getCommandDir() str

Return the launch/command directory name. If None is returned, the job will be launched in the current directory.

getDownStreamPolymerJob()

Search and return the down-stream polymer job

Returns

A subtask step with polymer driver in the cmd

Return type

‘Step’ or None

getDuration() Optional[int]

Return the duration of the Job as recorded by job server. The duration does not include queue wait time.

If the job is running or has not launched, returns None.

Note that this method makes a blocking call to the job server.

getFirstMatchedfilename(filenames, exts)

Get the filename that ends with the first extension. If multiple filenames end with that extension return the first match.

Parameters
  • filenames (list of string) – list of filenames

  • exts (list of string) – list of extensions

Returns

The matched filename or None

Return type

string or None

classmethod getForceFieldFlag()

Return the flag for force field. Should be overwritten by the subclass only when subtask reads in this flag

Returns

The flag to set the force field (without the ‘-‘)

Return type

str or None

getJob() Optional[schrodinger.job.jobcontrol.Job]

Return the job record as a schrodinger.job.jobcontrol.Job instance.

Returns None if the job hasn’t been launched.

getJobDJ() schrodinger.job.queue.JobDJ

Return the JobDJ instance that this job has been added to.

getPrereqs()

Return a set of all immediate prerequisites for this job.

classmethod getSeedFlag()

Return the flag for random seed. Should be overwritten by the subclass only when subtask reads in this flag

Returns

The flag to set the random seed (without the ‘-‘)

Return type

str or None

getStatusStrings() Tuple[str, str, str]

Return a tuple of status strings for printing by JobDJ.

The strings returned are (status, jobid, host).

hasExited() bool

Returns True if this job finished, successfully or not.

hasStarted() bool

Returns True if this job has started (not waiting)

init_count = 0
isComplete() bool

Returns True if this job finished successfully

kill()

Send kill request to jobcontrol managed job

log(msg, add_log_tag=True)

Log information to the master driver.log

Parameters
  • msg (str) – The info to print

  • add_log_tag (bool) – If True, additional tags is logged in front of the msg for the replica jobs.

maxFailuresReached(msg: str)

Print an error summary, including the last 20 lines from each log file in the LogFiles list of the job record.

classmethod optionsToTaskProtocols(options, task_name, seed=None)

This is the class method to generate task_protocol based on command line options and default values from config yaml. This method should be overwritten by subclass method as this one returns the protocol in the default configure yaml.

Parameters
  • options (argparse.Namespace) – The parsed command line options

  • task_name (str) – Task name of the current stage

  • seed (int or None) – Random seed to randomize the initial velocities

Returns

Updated task protocol

Return type

TaskProtocol

outfileExist()

Whether the outfile exists

Returns

Whether the file exists.

Return type

bool

postCommand()

A method to restore things to the pre-command state.

preCommand()

A method to make pre-command changes, like cd’ing to the correct directory to run the command in.

retryFailure(max_retries=0)

Determine if the job should be retried or not. This overwrites the parent method to by default not retry jobs that have a status of “died” as that will indicate that Jaguar failed, which it almost certainly will again.

Parameters

max_retries (int) – The queue’s max_retries parameter

Return type

bool

Returns

True if the job should be retried, False if not

run(*args, **kwargs)

Run the job.

The steps taken are as follows:
  1. Execute the preCommand method for things like changing the working directory.

  2. Call the doCommand to do the actual work of computation or job launching.

  3. Call the postCommand method to undo the changes from the preCommand that need to be undone.

runsLocally() bool

Return True if the job runs on the JobDJ control host, False if not. Jobs that run locally don’t need hosts.

There is no limit on the number of locally run jobs.

setLogTag()

Set the log tag based on node index.

setOutfile()

Set the job outfile with an existing file based on the jobcontrol job, if not set.

Raises

FileNotFoundError – Failed to set an existing outfile

property state: schrodinger.job.queue.JobState

Return the current state of the job.

Note that this method can be overridden by subclasses that wish to provide for restartability at a higher level than unpickling BaseJob instances. For example, by examining some external condition (e.g. presence of output files) the state JobState.DONE could be returned immediately and the job would not run.

update()

Checks for changes in job status, and updates the object appropriately (marks for restart, etc).

Raises

RuntimeError – if an unknown Job Status or ExitStatus is encountered.

updateInfileAndCommand(par_outfile_with_dir)

Update the input file in the command and the input file attributes of a child job to the output file path of the parent job.

Parameters
  • child_job (an instance of a BaseJob subclass (such as JobControlJob or SubprocessJob)) – The subjob whose command will be updated.

  • par_outfile_with_dir (str) – The output file from the parent job that will be used as the input file of this child job.

updateTaskReplicaSettings()

Update the task protocol due to replica.

usesJobServer() bool

Detect, by looking at the jobId, whether this job uses a job server.

class schrodinger.application.matsci.permittivity.DensityAnalysis(basename, config_yaml='default_permittivity_protocols.yaml', task_name=None, infile='$infile', outfile=None, additional_infiles=None, master_logger=None, node_index=None)

Bases: schrodinger.application.matsci.permittivity.MdPostAnalysis

Class to do post desmond density analysis.

DRIVER_PATH = 'permittivity_gui_dir/permittivity_density_driver.py'
DENSITY = 'density'
DEFAULT_JOBNAME = 'permittivity_density_task'
DENSITY_PROP = 'r_matsci_Density(g/cm3)'
DENSITY_STD_PROP = 'r_matsci_stdev_Density(g/cm3)'
DENSITY_REPLICA_PROP = 'r_matsci_Density_Replica_%i(g/cm3)'
DENSITY_STD_REPLICA_PROP = 'r_matsci_stdev_Density_Replica_%i(g/cm3)'
TEMP_REPLICA_PROP = 'r_matsci_Temperature_Replica_%i(K)'
TEMP_STD_REPLICA_PROP = 'r_matsci_stdev_Temperature_Replica_%i(K)'
DENSITY_REPLICA_PROP_REX = 'r_matsci_Density_Replica_(\\d)\\(g/cm3\\)'
TEMP_REPLICA_PROP_REX = 'r_matsci_Temperature_Replica_(\\d)\\(K\\)'
DENSITY_EXT = '_@_{density:.5g}(g/cm3)'
OUTFILE_EXT = '-out.cms'
setup(copy_ene=True)

Over write parent class method.

static finalizeStep(job)

Finalize this step. Can be overwritten for light weight post process.

Parameters

job (An instance of a BaseJob subclass (such as JobControlJob or SubprocessJob)) – Current job

NUM_CRU_PROP = 'i_matsci_Num_Cru'
REPLICA_TAG = 'Replica %s: '
RESOURCE = 'cpu'
TEMP_PROP = 'r_matsci_Temperature(K)'
TEMP_STD_PROP = 'r_matsci_stdev_Temperature(K)'
TERMINAL_INFILE_NUM = 1
__init__(basename, config_yaml='default_permittivity_protocols.yaml', task_name=None, infile='$infile', outfile=None, additional_infiles=None, master_logger=None, node_index=None)
Parameters
  • basename (str) – The base name of this subjob

  • config_yaml (str) – The config yaml file contain all job config

  • task_name (str) – Task name of this sub job

  • infile (str) – The input filename

  • outfile (str) – The output filename

  • additional_infiles (list of str) – This records additional input files (e.g. the second, third, and so on)

  • master_logger (logging.Logger) – The logger to use for recording messages into master job -driver.log.

  • node_index (The node index) – tuple

acquireLicenseForSmartDistribution() bool

Acquire and hold licenses for a smart distribution job. This makes sure the job won’t fail due to unavailable licenses.

Returns True if the licenses registered for the job are acquired, and False if they are not. If no licenses are registered, it always returns True to avoid preventing jobs from using the smart distribution feature. For legacy jobcontrol, the license check is not performed, and is always returned True. We want to use this feature as a pitch to move users to JOB_SERVER.

addEnefileToAdditionalInfiles()

Add the ene file as one of the additional files.

addFinalizer(function: Callable[[schrodinger.job.queue.BaseJob], None], run_dir: Optional[str] = None)

Add a function to be invoked when the job completes successfully.

See also the add_multi_job_finalizer function.

addGroupPrereq(job: schrodinger.job.queue.BaseJob)

Make all jobs connected to job prerequisites of all jobs connected to this Job.

addLaunchEnv(key: str, val: str)

Adds the given environment key and and value to the list of launch environment.

Parameters
  • key – environment key to add to the launch environment.

  • val – environment value associcated with the key to add to the launch environment.

addPrereq(job: schrodinger.job.queue.BaseJob)

Add a job that is an immediate prerequisite for this one.

static autocorrelation(time_serial_data, normalize=False)

Calculate the auto correlation of the input numpy.array data.

Parameters
  • time_serial_data (n x m numpy.array) – Autocorrelation of each column of the data

  • normalize (bool) – If True, the auto correlation data will be normalized

Returns

Autocorrelated data (by column)

Return type

n x m numpy.array

static autocorrelationWithSum(time_serial_data, normalize=False)

Calculate the auto correlation of the input numpy.array data.

Parameters
  • time_serial_data (n x m numpy.array) – Autocorrelation of each column of the data

  • normalize (bool) – If True, the auto correlation data will be normalized

Returns

Autocorrelated data (by column)

Return type

n x m numpy.array

cancel()

Send kill request to jobcontrol managed job. This method will eventually deprecate JobControlJob.kill

cancelSubmitted(do_license_check: bool = False) schrodinger.job.queue.CancelSubmittedStatus

If the job is still in the ‘submitted’ state, cancel it, purge the jobrecord and set the job handle to None. This tries to acquire licenses for the job before canceling from the queue if do_license_check is turned on.

Parameters

do_license_check – Acquire licenses for the job before canceling from the queue.

Returns one of the status of CancelSubmittedStatus.

copyFiles(copy_infile=True, copy_additional_files=True, more_files=None)

Copy files to current dir.

Parameters
  • copy_infile (bool) – Copy the input files of the class to current folder

  • copy_additional_files (bool) – Copy the additional files of the class to current folder

  • more_files (None or list of str) – Use this arguments to copy customized files

doCommand(host: str, local: bool = False)

Launch job on specified host using jobcontrol.launch_job().

Parameters
  • host – Host on which the job will be executed.

  • local – Removed in JOB_SERVER.

finalize()

Clean up after a job successfully runs.

genAllJobs(seen: Optional[Set[schrodinger.job.queue.BaseJob]] = None) Generator[schrodinger.job.queue.BaseJob, None, None]

A generator that yields all jobs connected to this one.

genAllPrereqs(seen=None) Generator[schrodinger.job.queue.BaseJob, None, None]

A generator that yields all jobs that are prerequisites on this one.

getCommand() List[str]

Return the command used to run this job.

getCommandDir() str

Return the launch/command directory name. If None is returned, the job will be launched in the current directory.

getDownStreamPolymerJob()

Search and return the down-stream polymer job

Returns

A subtask step with polymer driver in the cmd

Return type

‘Step’ or None

getDuration() Optional[int]

Return the duration of the Job as recorded by job server. The duration does not include queue wait time.

If the job is running or has not launched, returns None.

Note that this method makes a blocking call to the job server.

getFirstMatchedfilename(filenames, exts)

Get the filename that ends with the first extension. If multiple filenames end with that extension return the first match.

Parameters
  • filenames (list of string) – list of filenames

  • exts (list of string) – list of extensions

Returns

The matched filename or None

Return type

string or None

classmethod getForceFieldFlag()

Return the flag for force field. Should be overwritten by the subclass only when subtask reads in this flag

Returns

The flag to set the force field (without the ‘-‘)

Return type

str or None

getJob() Optional[schrodinger.job.jobcontrol.Job]

Return the job record as a schrodinger.job.jobcontrol.Job instance.

Returns None if the job hasn’t been launched.

getJobDJ() schrodinger.job.queue.JobDJ

Return the JobDJ instance that this job has been added to.

getPrereqs()

Return a set of all immediate prerequisites for this job.

static getRelatedFile(cms_file, file_ext='.ene')

Get the requested file based on cms file name and file extension

Parameters
  • cms_file (str) – The cms file whose related file is searched.

  • file_ext (str) – the extension of file to search for. The file extension must include the separator as well. For example, to get ene file, file_ext must be “.ene”

Returns

Found file with correct extension

Return type

str or None

static getRelatedJobFile(input_cms, orig_cms=None, file_ext='.ene')

Search existing ene file and return the ene found based on the input_cms. Existing ene file may be found in current folder, in the input cms folder or in the PROP_CMS (‘s_m_original_cms_file’) folder when ene is not copied from the PROP_CMS folder to the current folder.

Parameters
  • input_cms (str) – INPUT_CMS defined for INPUT_TRJ searching.

  • orig_cms (str) – The original cms defined by users.

  • file_ext (str) – the extension of file to search for. The file extension must include the separator as well. For example, to get ene file, file_ext must be “.ene”

Raises

KeyError, FileNotFoundError, ValueError – when ene file cannot be found.

Return type

str, str or None

Returns

Existing ene file if found, the original cms file that the ene file sits with or None (sit with the input_cms)

classmethod getSeedFlag()

Return the flag for random seed. Should be overwritten by the subclass only when subtask reads in this flag

Returns

The flag to set the random seed (without the ‘-‘)

Return type

str or None

getStatusStrings() Tuple[str, str, str]

Return a tuple of status strings for printing by JobDJ.

The strings returned are (status, jobid, host).

hasExited() bool

Returns True if this job finished, successfully or not.

hasStarted() bool

Returns True if this job has started (not waiting)

init_count = 0
isComplete() bool

Returns True if this job finished successfully

kill()

Send kill request to jobcontrol managed job

log(msg, add_log_tag=True)

Log information to the master driver.log

Parameters
  • msg (str) – The info to print

  • add_log_tag (bool) – If True, additional tags is logged in front of the msg for the replica jobs.

maxFailuresReached(msg: str)

Print an error summary, including the last 20 lines from each log file in the LogFiles list of the job record.

classmethod optionsToTaskProtocols(options, task_name, seed=None)

This is the class method to generate task_protocol based on command line options and default values from config yaml. This method should be overwritten by subclass method as this one returns the protocol in the default configure yaml.

Parameters
  • options (argparse.Namespace) – The parsed command line options

  • task_name (str) – Task name of the current stage

  • seed (int or None) – Random seed to randomize the initial velocities

Returns

Updated task protocol

Return type

TaskProtocol

outfileExist()

Whether the outfile exists

Returns

Whether the file exists.

Return type

bool

postCommand()

A method to restore things to the pre-command state.

preCommand()

A method to make pre-command changes, like cd’ing to the correct directory to run the command in.

retryFailure(max_retries=0)

Determine if the job should be retried or not. This overwrites the parent method to by default not retry jobs that have a status of “died” as that will indicate that Jaguar failed, which it almost certainly will again.

Parameters

max_retries (int) – The queue’s max_retries parameter

Return type

bool

Returns

True if the job should be retried, False if not

run(*args, **kwargs)

Run the job.

The steps taken are as follows:
  1. Execute the preCommand method for things like changing the working directory.

  2. Call the doCommand to do the actual work of computation or job launching.

  3. Call the postCommand method to undo the changes from the preCommand that need to be undone.

runsLocally() bool

Return True if the job runs on the JobDJ control host, False if not. Jobs that run locally don’t need hosts.

There is no limit on the number of locally run jobs.

setLogTag()

Set the log tag based on node index.

setOutfile()

Set the job outfile with an existing file based on the jobcontrol job, if not set.

Raises

FileNotFoundError – Failed to set an existing outfile

property state: schrodinger.job.queue.JobState

Return the current state of the job.

Note that this method can be overridden by subclasses that wish to provide for restartability at a higher level than unpickling BaseJob instances. For example, by examining some external condition (e.g. presence of output files) the state JobState.DONE could be returned immediately and the job would not run.

update()

Checks for changes in job status, and updates the object appropriately (marks for restart, etc).

Raises

RuntimeError – if an unknown Job Status or ExitStatus is encountered.

updateInfileAndCommand(par_outfile_with_dir)

Update the input file in the command and the input file attributes of a child job to the output file path of the parent job.

Parameters
  • child_job (an instance of a BaseJob subclass (such as JobControlJob or SubprocessJob)) – The subjob whose command will be updated.

  • par_outfile_with_dir (str) – The output file from the parent job that will be used as the input file of this child job.

updateTaskReplicaSettings()

Update the task protocol due to replica.

usesJobServer() bool

Detect, by looking at the jobId, whether this job uses a job server.

writeCms()

Write out cms files to current dir and each of them has a ‘msprops.ORIGINAL_CMS_PROP’ property pointing to the original cms file path.

class schrodinger.application.matsci.permittivity.MdPostTrajectoryAnalysis(basename, config_yaml='default_permittivity_protocols.yaml', task_name=None, infile='$infile', outfile=None, additional_infiles=None, master_logger=None, node_index=None)

Bases: schrodinger.application.matsci.permittivity.MdPostAnalysis

Base class to hold molecular dynamics post trajectory analysis functionality.

static getTrajectoryFromCms(input_cms, orig_cms=None)

Search existing trajectory and return the trajectory found based on the input_cms. Existing trajectory (desmondutils.PROP_TRJ) may be found in current folder, sitting with input cms or sitting with the original cms defined by users or pointed to by PROP_CMS (‘s_m_original_cms_file’) when trajectory is not copied from the PROP_CMS folder to the current folder.

Parameters
  • input_cms (str) – INPUT_CMS defined for INPUT_TRJ searching.

  • orig_cms (str) – The original cms defined by users.

Raises

KeyError, FileNotFoundError, ValueError – when trajectory cannot be found.

Return type

str, str or None

Returns

existing trajectory if found, whether the input trajectory sits with the original cms

classmethod registerCmsAndTrjToJob(options, job_builder, orig_cms=None)

Register cms file and trajectory folder to job if needed.

Parameters
  • options (argparse.Namespace) – The parser to get the cms options from and set the trj options for.

  • job_builder (launchapi.JobSpecification) – JobSpecification object

DRIVER_PATH = None
NUM_CRU_PROP = 'i_matsci_Num_Cru'
OUTFILE_EXT = '-out.mae'
REPLICA_TAG = 'Replica %s: '
RESOURCE = 'cpu'
TEMP_PROP = 'r_matsci_Temperature(K)'
TEMP_STD_PROP = 'r_matsci_stdev_Temperature(K)'
TERMINAL_INFILE_NUM = 1
__init__(basename, config_yaml='default_permittivity_protocols.yaml', task_name=None, infile='$infile', outfile=None, additional_infiles=None, master_logger=None, node_index=None)
Parameters
  • basename (str) – The base name of this subjob

  • config_yaml (str) – The config yaml file contain all job config

  • task_name (str) – Task name of this sub job

  • infile (str) – The input filename

  • outfile (str) – The output filename

  • additional_infiles (list of str) – This records additional input files (e.g. the second, third, and so on)

  • master_logger (logging.Logger) – The logger to use for recording messages into master job -driver.log.

  • node_index (The node index) – tuple

acquireLicenseForSmartDistribution() bool

Acquire and hold licenses for a smart distribution job. This makes sure the job won’t fail due to unavailable licenses.

Returns True if the licenses registered for the job are acquired, and False if they are not. If no licenses are registered, it always returns True to avoid preventing jobs from using the smart distribution feature. For legacy jobcontrol, the license check is not performed, and is always returned True. We want to use this feature as a pitch to move users to JOB_SERVER.

addEnefileToAdditionalInfiles()

Add the ene file as one of the additional files.

addFinalizer(function: Callable[[schrodinger.job.queue.BaseJob], None], run_dir: Optional[str] = None)

Add a function to be invoked when the job completes successfully.

See also the add_multi_job_finalizer function.

addGroupPrereq(job: schrodinger.job.queue.BaseJob)

Make all jobs connected to job prerequisites of all jobs connected to this Job.

addLaunchEnv(key: str, val: str)

Adds the given environment key and and value to the list of launch environment.

Parameters
  • key – environment key to add to the launch environment.

  • val – environment value associcated with the key to add to the launch environment.

addPrereq(job: schrodinger.job.queue.BaseJob)

Add a job that is an immediate prerequisite for this one.

static autocorrelation(time_serial_data, normalize=False)

Calculate the auto correlation of the input numpy.array data.

Parameters
  • time_serial_data (n x m numpy.array) – Autocorrelation of each column of the data

  • normalize (bool) – If True, the auto correlation data will be normalized

Returns

Autocorrelated data (by column)

Return type

n x m numpy.array

static autocorrelationWithSum(time_serial_data, normalize=False)

Calculate the auto correlation of the input numpy.array data.

Parameters
  • time_serial_data (n x m numpy.array) – Autocorrelation of each column of the data

  • normalize (bool) – If True, the auto correlation data will be normalized

Returns

Autocorrelated data (by column)

Return type

n x m numpy.array

cancel()

Send kill request to jobcontrol managed job. This method will eventually deprecate JobControlJob.kill

cancelSubmitted(do_license_check: bool = False) schrodinger.job.queue.CancelSubmittedStatus

If the job is still in the ‘submitted’ state, cancel it, purge the jobrecord and set the job handle to None. This tries to acquire licenses for the job before canceling from the queue if do_license_check is turned on.

Parameters

do_license_check – Acquire licenses for the job before canceling from the queue.

Returns one of the status of CancelSubmittedStatus.

copyFiles(copy_infile=True, copy_additional_files=True, more_files=None)

Copy files to current dir.

Parameters
  • copy_infile (bool) – Copy the input files of the class to current folder

  • copy_additional_files (bool) – Copy the additional files of the class to current folder

  • more_files (None or list of str) – Use this arguments to copy customized files

doCommand(host: str, local: bool = False)

Launch job on specified host using jobcontrol.launch_job().

Parameters
  • host – Host on which the job will be executed.

  • local – Removed in JOB_SERVER.

finalize()

Clean up after a job successfully runs.

static finalizeStep(job)

Update child job’s command with the parent job output, and set output files if not set by the subjob itself.

Parameters

job (An instance of a BaseJob subclass (such as JobControlJob or SubprocessJob)) – current job

genAllJobs(seen: Optional[Set[schrodinger.job.queue.BaseJob]] = None) Generator[schrodinger.job.queue.BaseJob, None, None]

A generator that yields all jobs connected to this one.

genAllPrereqs(seen=None) Generator[schrodinger.job.queue.BaseJob, None, None]

A generator that yields all jobs that are prerequisites on this one.

getCommand() List[str]

Return the command used to run this job.

getCommandDir() str

Return the launch/command directory name. If None is returned, the job will be launched in the current directory.

getDownStreamPolymerJob()

Search and return the down-stream polymer job

Returns

A subtask step with polymer driver in the cmd

Return type

‘Step’ or None

getDuration() Optional[int]

Return the duration of the Job as recorded by job server. The duration does not include queue wait time.

If the job is running or has not launched, returns None.

Note that this method makes a blocking call to the job server.

getFirstMatchedfilename(filenames, exts)

Get the filename that ends with the first extension. If multiple filenames end with that extension return the first match.

Parameters
  • filenames (list of string) – list of filenames

  • exts (list of string) – list of extensions

Returns

The matched filename or None

Return type

string or None

classmethod getForceFieldFlag()

Return the flag for force field. Should be overwritten by the subclass only when subtask reads in this flag

Returns

The flag to set the force field (without the ‘-‘)

Return type

str or None

getJob() Optional[schrodinger.job.jobcontrol.Job]

Return the job record as a schrodinger.job.jobcontrol.Job instance.

Returns None if the job hasn’t been launched.

getJobDJ() schrodinger.job.queue.JobDJ

Return the JobDJ instance that this job has been added to.

getPrereqs()

Return a set of all immediate prerequisites for this job.

static getRelatedFile(cms_file, file_ext='.ene')

Get the requested file based on cms file name and file extension

Parameters
  • cms_file (str) – The cms file whose related file is searched.

  • file_ext (str) – the extension of file to search for. The file extension must include the separator as well. For example, to get ene file, file_ext must be “.ene”

Returns

Found file with correct extension

Return type

str or None

static getRelatedJobFile(input_cms, orig_cms=None, file_ext='.ene')

Search existing ene file and return the ene found based on the input_cms. Existing ene file may be found in current folder, in the input cms folder or in the PROP_CMS (‘s_m_original_cms_file’) folder when ene is not copied from the PROP_CMS folder to the current folder.

Parameters
  • input_cms (str) – INPUT_CMS defined for INPUT_TRJ searching.

  • orig_cms (str) – The original cms defined by users.

  • file_ext (str) – the extension of file to search for. The file extension must include the separator as well. For example, to get ene file, file_ext must be “.ene”

Raises

KeyError, FileNotFoundError, ValueError – when ene file cannot be found.

Return type

str, str or None

Returns

Existing ene file if found, the original cms file that the ene file sits with or None (sit with the input_cms)

classmethod getSeedFlag()

Return the flag for random seed. Should be overwritten by the subclass only when subtask reads in this flag

Returns

The flag to set the random seed (without the ‘-‘)

Return type

str or None

getStatusStrings() Tuple[str, str, str]

Return a tuple of status strings for printing by JobDJ.

The strings returned are (status, jobid, host).

hasExited() bool

Returns True if this job finished, successfully or not.

hasStarted() bool

Returns True if this job has started (not waiting)

init_count = 0
isComplete() bool

Returns True if this job finished successfully

kill()

Send kill request to jobcontrol managed job

log(msg, add_log_tag=True)

Log information to the master driver.log

Parameters
  • msg (str) – The info to print

  • add_log_tag (bool) – If True, additional tags is logged in front of the msg for the replica jobs.

maxFailuresReached(msg: str)

Print an error summary, including the last 20 lines from each log file in the LogFiles list of the job record.

classmethod optionsToTaskProtocols(options, task_name, seed=None)

This is the class method to generate task_protocol based on command line options and default values from config yaml. This method should be overwritten by subclass method as this one returns the protocol in the default configure yaml.

Parameters
  • options (argparse.Namespace) – The parsed command line options

  • task_name (str) – Task name of the current stage

  • seed (int or None) – Random seed to randomize the initial velocities

Returns

Updated task protocol

Return type

TaskProtocol

outfileExist()

Whether the outfile exists

Returns

Whether the file exists.

Return type

bool

postCommand()

A method to restore things to the pre-command state.

preCommand()

A method to make pre-command changes, like cd’ing to the correct directory to run the command in.

retryFailure(max_retries=0)

Determine if the job should be retried or not. This overwrites the parent method to by default not retry jobs that have a status of “died” as that will indicate that Jaguar failed, which it almost certainly will again.

Parameters

max_retries (int) – The queue’s max_retries parameter

Return type

bool

Returns

True if the job should be retried, False if not

run(*args, **kwargs)

Run the job.

The steps taken are as follows:
  1. Execute the preCommand method for things like changing the working directory.

  2. Call the doCommand to do the actual work of computation or job launching.

  3. Call the postCommand method to undo the changes from the preCommand that need to be undone.

runsLocally() bool

Return True if the job runs on the JobDJ control host, False if not. Jobs that run locally don’t need hosts.

There is no limit on the number of locally run jobs.

setLogTag()

Set the log tag based on node index.

setOutfile()

Set the job outfile with an existing file based on the jobcontrol job, if not set.

Raises

FileNotFoundError – Failed to set an existing outfile

setup(copy_ene=False, write_cms=False)

Over write parent class method.

property state: schrodinger.job.queue.JobState

Return the current state of the job.

Note that this method can be overridden by subclasses that wish to provide for restartability at a higher level than unpickling BaseJob instances. For example, by examining some external condition (e.g. presence of output files) the state JobState.DONE could be returned immediately and the job would not run.

update()

Checks for changes in job status, and updates the object appropriately (marks for restart, etc).

Raises

RuntimeError – if an unknown Job Status or ExitStatus is encountered.

updateInfileAndCommand(par_outfile_with_dir)

Update the input file in the command and the input file attributes of a child job to the output file path of the parent job.

Parameters
  • child_job (an instance of a BaseJob subclass (such as JobControlJob or SubprocessJob)) – The subjob whose command will be updated.

  • par_outfile_with_dir (str) – The output file from the parent job that will be used as the input file of this child job.

updateTaskReplicaSettings()

Update the task protocol due to replica.

usesJobServer() bool

Detect, by looking at the jobId, whether this job uses a job server.

writeCms()

Write out cms files to current dir and each of them has a ‘msprops.ORIGINAL_CMS_PROP’ property pointing to the original cms file path.

class schrodinger.application.matsci.permittivity.AveCellAnalysis(basename, config_yaml='default_permittivity_protocols.yaml', task_name=None, infile='$infile', outfile=None, additional_infiles=None, master_logger=None, node_index=None)

Bases: schrodinger.application.matsci.permittivity.MdPostTrajectoryAnalysis

Class to do post cell average analysis on desmond trajectory.

DRIVER_PATH = 'permittivity_gui_dir/permittivity_ave_cell_driver.py'
AVE_CELL = 'ave_cell'
DEFAULT_JOBNAME = 'permittivity_ave_cell_task'
OUTFILE_EXT = '-out.cms'
setup(copy_ene=True, write_cms=True)

Over write parent class method.

static finalizeStep(job)

Finalize this step. Can be overwritten for light weight post process.

Parameters

job (An instance of a BaseJob subclass (such as JobControlJob or SubprocessJob)) – current job

NUM_CRU_PROP = 'i_matsci_Num_Cru'
REPLICA_TAG = 'Replica %s: '
RESOURCE = 'cpu'
TEMP_PROP = 'r_matsci_Temperature(K)'
TEMP_STD_PROP = 'r_matsci_stdev_Temperature(K)'
TERMINAL_INFILE_NUM = 1
__init__(basename, config_yaml='default_permittivity_protocols.yaml', task_name=None, infile='$infile', outfile=None, additional_infiles=None, master_logger=None, node_index=None)
Parameters
  • basename (str) – The base name of this subjob

  • config_yaml (str) – The config yaml file contain all job config

  • task_name (str) – Task name of this sub job

  • infile (str) – The input filename

  • outfile (str) – The output filename

  • additional_infiles (list of str) – This records additional input files (e.g. the second, third, and so on)

  • master_logger (logging.Logger) – The logger to use for recording messages into master job -driver.log.

  • node_index (The node index) – tuple

acquireLicenseForSmartDistribution() bool

Acquire and hold licenses for a smart distribution job. This makes sure the job won’t fail due to unavailable licenses.

Returns True if the licenses registered for the job are acquired, and False if they are not. If no licenses are registered, it always returns True to avoid preventing jobs from using the smart distribution feature. For legacy jobcontrol, the license check is not performed, and is always returned True. We want to use this feature as a pitch to move users to JOB_SERVER.

addEnefileToAdditionalInfiles()

Add the ene file as one of the additional files.

addFinalizer(function: Callable[[schrodinger.job.queue.BaseJob], None], run_dir: Optional[str] = None)

Add a function to be invoked when the job completes successfully.

See also the add_multi_job_finalizer function.

addGroupPrereq(job: schrodinger.job.queue.BaseJob)

Make all jobs connected to job prerequisites of all jobs connected to this Job.

addLaunchEnv(key: str, val: str)

Adds the given environment key and and value to the list of launch environment.

Parameters
  • key – environment key to add to the launch environment.

  • val – environment value associcated with the key to add to the launch environment.

addPrereq(job: schrodinger.job.queue.BaseJob)

Add a job that is an immediate prerequisite for this one.

static autocorrelation(time_serial_data, normalize=False)

Calculate the auto correlation of the input numpy.array data.

Parameters
  • time_serial_data (n x m numpy.array) – Autocorrelation of each column of the data

  • normalize (bool) – If True, the auto correlation data will be normalized

Returns

Autocorrelated data (by column)

Return type

n x m numpy.array

static autocorrelationWithSum(time_serial_data, normalize=False)

Calculate the auto correlation of the input numpy.array data.

Parameters
  • time_serial_data (n x m numpy.array) – Autocorrelation of each column of the data

  • normalize (bool) – If True, the auto correlation data will be normalized

Returns

Autocorrelated data (by column)

Return type

n x m numpy.array

cancel()

Send kill request to jobcontrol managed job. This method will eventually deprecate JobControlJob.kill

cancelSubmitted(do_license_check: bool = False) schrodinger.job.queue.CancelSubmittedStatus

If the job is still in the ‘submitted’ state, cancel it, purge the jobrecord and set the job handle to None. This tries to acquire licenses for the job before canceling from the queue if do_license_check is turned on.

Parameters

do_license_check – Acquire licenses for the job before canceling from the queue.

Returns one of the status of CancelSubmittedStatus.

copyFiles(copy_infile=True, copy_additional_files=True, more_files=None)

Copy files to current dir.

Parameters
  • copy_infile (bool) – Copy the input files of the class to current folder

  • copy_additional_files (bool) – Copy the additional files of the class to current folder

  • more_files (None or list of str) – Use this arguments to copy customized files

doCommand(host: str, local: bool = False)

Launch job on specified host using jobcontrol.launch_job().

Parameters
  • host – Host on which the job will be executed.

  • local – Removed in JOB_SERVER.

finalize()

Clean up after a job successfully runs.

genAllJobs(seen: Optional[Set[schrodinger.job.queue.BaseJob]] = None) Generator[schrodinger.job.queue.BaseJob, None, None]

A generator that yields all jobs connected to this one.

genAllPrereqs(seen=None) Generator[schrodinger.job.queue.BaseJob, None, None]

A generator that yields all jobs that are prerequisites on this one.

getCommand() List[str]

Return the command used to run this job.

getCommandDir() str

Return the launch/command directory name. If None is returned, the job will be launched in the current directory.

getDownStreamPolymerJob()

Search and return the down-stream polymer job

Returns

A subtask step with polymer driver in the cmd

Return type

‘Step’ or None

getDuration() Optional[int]

Return the duration of the Job as recorded by job server. The duration does not include queue wait time.

If the job is running or has not launched, returns None.

Note that this method makes a blocking call to the job server.

getFirstMatchedfilename(filenames, exts)

Get the filename that ends with the first extension. If multiple filenames end with that extension return the first match.

Parameters
  • filenames (list of string) – list of filenames

  • exts (list of string) – list of extensions

Returns

The matched filename or None

Return type

string or None

classmethod getForceFieldFlag()

Return the flag for force field. Should be overwritten by the subclass only when subtask reads in this flag

Returns

The flag to set the force field (without the ‘-‘)

Return type

str or None

getJob() Optional[schrodinger.job.jobcontrol.Job]

Return the job record as a schrodinger.job.jobcontrol.Job instance.

Returns None if the job hasn’t been launched.

getJobDJ() schrodinger.job.queue.JobDJ

Return the JobDJ instance that this job has been added to.

getPrereqs()

Return a set of all immediate prerequisites for this job.

static getRelatedFile(cms_file, file_ext='.ene')

Get the requested file based on cms file name and file extension

Parameters
  • cms_file (str) – The cms file whose related file is searched.

  • file_ext (str) – the extension of file to search for. The file extension must include the separator as well. For example, to get ene file, file_ext must be “.ene”

Returns

Found file with correct extension

Return type

str or None

static getRelatedJobFile(input_cms, orig_cms=None, file_ext='.ene')

Search existing ene file and return the ene found based on the input_cms. Existing ene file may be found in current folder, in the input cms folder or in the PROP_CMS (‘s_m_original_cms_file’) folder when ene is not copied from the PROP_CMS folder to the current folder.

Parameters
  • input_cms (str) – INPUT_CMS defined for INPUT_TRJ searching.

  • orig_cms (str) – The original cms defined by users.

  • file_ext (str) – the extension of file to search for. The file extension must include the separator as well. For example, to get ene file, file_ext must be “.ene”

Raises

KeyError, FileNotFoundError, ValueError – when ene file cannot be found.

Return type

str, str or None

Returns

Existing ene file if found, the original cms file that the ene file sits with or None (sit with the input_cms)

classmethod getSeedFlag()

Return the flag for random seed. Should be overwritten by the subclass only when subtask reads in this flag

Returns

The flag to set the random seed (without the ‘-‘)

Return type

str or None

getStatusStrings() Tuple[str, str, str]

Return a tuple of status strings for printing by JobDJ.

The strings returned are (status, jobid, host).

static getTrajectoryFromCms(input_cms, orig_cms=None)

Search existing trajectory and return the trajectory found based on the input_cms. Existing trajectory (desmondutils.PROP_TRJ) may be found in current folder, sitting with input cms or sitting with the original cms defined by users or pointed to by PROP_CMS (‘s_m_original_cms_file’) when trajectory is not copied from the PROP_CMS folder to the current folder.

Parameters
  • input_cms (str) – INPUT_CMS defined for INPUT_TRJ searching.

  • orig_cms (str) – The original cms defined by users.

Raises

KeyError, FileNotFoundError, ValueError – when trajectory cannot be found.

Return type

str, str or None

Returns

existing trajectory if found, whether the input trajectory sits with the original cms

hasExited() bool

Returns True if this job finished, successfully or not.

hasStarted() bool

Returns True if this job has started (not waiting)

init_count = 0
isComplete() bool

Returns True if this job finished successfully

kill()

Send kill request to jobcontrol managed job

log(msg, add_log_tag=True)

Log information to the master driver.log

Parameters
  • msg (str) – The info to print

  • add_log_tag (bool) – If True, additional tags is logged in front of the msg for the replica jobs.

maxFailuresReached(msg: str)

Print an error summary, including the last 20 lines from each log file in the LogFiles list of the job record.

classmethod optionsToTaskProtocols(options, task_name, seed=None)

This is the class method to generate task_protocol based on command line options and default values from config yaml. This method should be overwritten by subclass method as this one returns the protocol in the default configure yaml.

Parameters
  • options (argparse.Namespace) – The parsed command line options

  • task_name (str) – Task name of the current stage

  • seed (int or None) – Random seed to randomize the initial velocities

Returns

Updated task protocol

Return type

TaskProtocol

outfileExist()

Whether the outfile exists

Returns

Whether the file exists.

Return type

bool

postCommand()

A method to restore things to the pre-command state.

preCommand()

A method to make pre-command changes, like cd’ing to the correct directory to run the command in.

classmethod registerCmsAndTrjToJob(options, job_builder, orig_cms=None)

Register cms file and trajectory folder to job if needed.

Parameters
  • options (argparse.Namespace) – The parser to get the cms options from and set the trj options for.

  • job_builder (launchapi.JobSpecification) – JobSpecification object

retryFailure(max_retries=0)

Determine if the job should be retried or not. This overwrites the parent method to by default not retry jobs that have a status of “died” as that will indicate that Jaguar failed, which it almost certainly will again.

Parameters

max_retries (int) – The queue’s max_retries parameter

Return type

bool

Returns

True if the job should be retried, False if not

run(*args, **kwargs)

Run the job.

The steps taken are as follows:
  1. Execute the preCommand method for things like changing the working directory.

  2. Call the doCommand to do the actual work of computation or job launching.

  3. Call the postCommand method to undo the changes from the preCommand that need to be undone.

runsLocally() bool

Return True if the job runs on the JobDJ control host, False if not. Jobs that run locally don’t need hosts.

There is no limit on the number of locally run jobs.

setLogTag()

Set the log tag based on node index.

setOutfile()

Set the job outfile with an existing file based on the jobcontrol job, if not set.

Raises

FileNotFoundError – Failed to set an existing outfile

property state: schrodinger.job.queue.JobState

Return the current state of the job.

Note that this method can be overridden by subclasses that wish to provide for restartability at a higher level than unpickling BaseJob instances. For example, by examining some external condition (e.g. presence of output files) the state JobState.DONE could be returned immediately and the job would not run.

update()

Checks for changes in job status, and updates the object appropriately (marks for restart, etc).

Raises

RuntimeError – if an unknown Job Status or ExitStatus is encountered.

updateInfileAndCommand(par_outfile_with_dir)

Update the input file in the command and the input file attributes of a child job to the output file path of the parent job.

Parameters
  • child_job (an instance of a BaseJob subclass (such as JobControlJob or SubprocessJob)) – The subjob whose command will be updated.

  • par_outfile_with_dir (str) – The output file from the parent job that will be used as the input file of this child job.

updateTaskReplicaSettings()

Update the task protocol due to replica.

usesJobServer() bool

Detect, by looking at the jobId, whether this job uses a job server.

writeCms()

Write out cms files to current dir and each of them has a ‘msprops.ORIGINAL_CMS_PROP’ property pointing to the original cms file path.

class schrodinger.application.matsci.permittivity.AnalyzeSimulation(*arg, **kwarg)

Bases: schrodinger.application.matsci.permittivity.MdPostTrajectoryAnalysis

Class to analyze trajectory from desmond simulation using analyze_simulation.py

DRIVER_PATH = 'analyze_simulation.py'
ANALYZE_SIMULATION = 'analyze_simulation'
DEFAULT_JOBNAME = 'permittivity_analyze_simulation_task'
OUTFILE_EXT = '-out.cms'
ST2_EXT = '.st2'
OUT_ST2_EXT = '-out.st2'
INPUT_ST2 = 'input_st2'
OUT_ST2_PROP = 's_matsci_St2_File'
__init__(*arg, **kwarg)

See parent class for documentation

setup()

Over write parent class method.

appendTrjInOutst2ToCmd()

Append the trajectory, input st2, and output st2 information to the cmd.

createInputSt2()

Create input st2 file based on the configure yaml.

setOutfile()

Set the outfile of a job.

static finalizeStep(job)

Finalize this step. Can be overwritten for light weight post process.

Parameters

job (An instance of a BaseJob subclass (such as JobControlJob or SubprocessJob)) – Current job

NUM_CRU_PROP = 'i_matsci_Num_Cru'
REPLICA_TAG = 'Replica %s: '
RESOURCE = 'cpu'
TEMP_PROP = 'r_matsci_Temperature(K)'
TEMP_STD_PROP = 'r_matsci_stdev_Temperature(K)'
TERMINAL_INFILE_NUM = 1
acquireLicenseForSmartDistribution() bool

Acquire and hold licenses for a smart distribution job. This makes sure the job won’t fail due to unavailable licenses.

Returns True if the licenses registered for the job are acquired, and False if they are not. If no licenses are registered, it always returns True to avoid preventing jobs from using the smart distribution feature. For legacy jobcontrol, the license check is not performed, and is always returned True. We want to use this feature as a pitch to move users to JOB_SERVER.

addEnefileToAdditionalInfiles()

Add the ene file as one of the additional files.

addFinalizer(function: Callable[[schrodinger.job.queue.BaseJob], None], run_dir: Optional[str] = None)

Add a function to be invoked when the job completes successfully.

See also the add_multi_job_finalizer function.

addGroupPrereq(job: schrodinger.job.queue.BaseJob)

Make all jobs connected to job prerequisites of all jobs connected to this Job.

addLaunchEnv(key: str, val: str)

Adds the given environment key and and value to the list of launch environment.

Parameters
  • key – environment key to add to the launch environment.

  • val – environment value associcated with the key to add to the launch environment.

addPrereq(job: schrodinger.job.queue.BaseJob)

Add a job that is an immediate prerequisite for this one.

static autocorrelation(time_serial_data, normalize=False)

Calculate the auto correlation of the input numpy.array data.

Parameters
  • time_serial_data (n x m numpy.array) – Autocorrelation of each column of the data

  • normalize (bool) – If True, the auto correlation data will be normalized

Returns

Autocorrelated data (by column)

Return type

n x m numpy.array

static autocorrelationWithSum(time_serial_data, normalize=False)

Calculate the auto correlation of the input numpy.array data.

Parameters
  • time_serial_data (n x m numpy.array) – Autocorrelation of each column of the data

  • normalize (bool) – If True, the auto correlation data will be normalized

Returns

Autocorrelated data (by column)

Return type

n x m numpy.array

cancel()

Send kill request to jobcontrol managed job. This method will eventually deprecate JobControlJob.kill

cancelSubmitted(do_license_check: bool = False) schrodinger.job.queue.CancelSubmittedStatus

If the job is still in the ‘submitted’ state, cancel it, purge the jobrecord and set the job handle to None. This tries to acquire licenses for the job before canceling from the queue if do_license_check is turned on.

Parameters

do_license_check – Acquire licenses for the job before canceling from the queue.

Returns one of the status of CancelSubmittedStatus.

copyFiles(copy_infile=True, copy_additional_files=True, more_files=None)

Copy files to current dir.

Parameters
  • copy_infile (bool) – Copy the input files of the class to current folder

  • copy_additional_files (bool) – Copy the additional files of the class to current folder

  • more_files (None or list of str) – Use this arguments to copy customized files

doCommand(host: str, local: bool = False)

Launch job on specified host using jobcontrol.launch_job().

Parameters
  • host – Host on which the job will be executed.

  • local – Removed in JOB_SERVER.

finalize()

Clean up after a job successfully runs.

genAllJobs(seen: Optional[Set[schrodinger.job.queue.BaseJob]] = None) Generator[schrodinger.job.queue.BaseJob, None, None]

A generator that yields all jobs connected to this one.

genAllPrereqs(seen=None) Generator[schrodinger.job.queue.BaseJob, None, None]

A generator that yields all jobs that are prerequisites on this one.

getCommand() List[str]

Return the command used to run this job.

getCommandDir() str

Return the launch/command directory name. If None is returned, the job will be launched in the current directory.

getDownStreamPolymerJob()

Search and return the down-stream polymer job

Returns

A subtask step with polymer driver in the cmd

Return type

‘Step’ or None

getDuration() Optional[int]

Return the duration of the Job as recorded by job server. The duration does not include queue wait time.

If the job is running or has not launched, returns None.

Note that this method makes a blocking call to the job server.

getFirstMatchedfilename(filenames, exts)

Get the filename that ends with the first extension. If multiple filenames end with that extension return the first match.

Parameters
  • filenames (list of string) – list of filenames

  • exts (list of string) – list of extensions

Returns

The matched filename or None

Return type

string or None

classmethod getForceFieldFlag()

Return the flag for force field. Should be overwritten by the subclass only when subtask reads in this flag

Returns

The flag to set the force field (without the ‘-‘)

Return type

str or None

getJob() Optional[schrodinger.job.jobcontrol.Job]

Return the job record as a schrodinger.job.jobcontrol.Job instance.

Returns None if the job hasn’t been launched.

getJobDJ() schrodinger.job.queue.JobDJ

Return the JobDJ instance that this job has been added to.

getPrereqs()

Return a set of all immediate prerequisites for this job.

static getRelatedFile(cms_file, file_ext='.ene')

Get the requested file based on cms file name and file extension

Parameters
  • cms_file (str) – The cms file whose related file is searched.

  • file_ext (str) – the extension of file to search for. The file extension must include the separator as well. For example, to get ene file, file_ext must be “.ene”

Returns

Found file with correct extension

Return type

str or None

static getRelatedJobFile(input_cms, orig_cms=None, file_ext='.ene')

Search existing ene file and return the ene found based on the input_cms. Existing ene file may be found in current folder, in the input cms folder or in the PROP_CMS (‘s_m_original_cms_file’) folder when ene is not copied from the PROP_CMS folder to the current folder.

Parameters
  • input_cms (str) – INPUT_CMS defined for INPUT_TRJ searching.

  • orig_cms (str) – The original cms defined by users.

  • file_ext (str) – the extension of file to search for. The file extension must include the separator as well. For example, to get ene file, file_ext must be “.ene”

Raises

KeyError, FileNotFoundError, ValueError – when ene file cannot be found.

Return type

str, str or None

Returns

Existing ene file if found, the original cms file that the ene file sits with or None (sit with the input_cms)

classmethod getSeedFlag()

Return the flag for random seed. Should be overwritten by the subclass only when subtask reads in this flag

Returns

The flag to set the random seed (without the ‘-‘)

Return type

str or None

getStatusStrings() Tuple[str, str, str]

Return a tuple of status strings for printing by JobDJ.

The strings returned are (status, jobid, host).

static getTrajectoryFromCms(input_cms, orig_cms=None)

Search existing trajectory and return the trajectory found based on the input_cms. Existing trajectory (desmondutils.PROP_TRJ) may be found in current folder, sitting with input cms or sitting with the original cms defined by users or pointed to by PROP_CMS (‘s_m_original_cms_file’) when trajectory is not copied from the PROP_CMS folder to the current folder.

Parameters
  • input_cms (str) – INPUT_CMS defined for INPUT_TRJ searching.

  • orig_cms (str) – The original cms defined by users.

Raises

KeyError, FileNotFoundError, ValueError – when trajectory cannot be found.

Return type

str, str or None

Returns

existing trajectory if found, whether the input trajectory sits with the original cms

hasExited() bool

Returns True if this job finished, successfully or not.

hasStarted() bool

Returns True if this job has started (not waiting)

init_count = 0
isComplete() bool

Returns True if this job finished successfully

kill()

Send kill request to jobcontrol managed job

log(msg, add_log_tag=True)

Log information to the master driver.log

Parameters
  • msg (str) – The info to print

  • add_log_tag (bool) – If True, additional tags is logged in front of the msg for the replica jobs.

maxFailuresReached(msg: str)

Print an error summary, including the last 20 lines from each log file in the LogFiles list of the job record.

classmethod optionsToTaskProtocols(options, task_name, seed=None)

This is the class method to generate task_protocol based on command line options and default values from config yaml. This method should be overwritten by subclass method as this one returns the protocol in the default configure yaml.

Parameters
  • options (argparse.Namespace) – The parsed command line options

  • task_name (str) – Task name of the current stage

  • seed (int or None) – Random seed to randomize the initial velocities

Returns

Updated task protocol

Return type

TaskProtocol

outfileExist()

Whether the outfile exists

Returns

Whether the file exists.

Return type

bool

postCommand()

A method to restore things to the pre-command state.

preCommand()

A method to make pre-command changes, like cd’ing to the correct directory to run the command in.

classmethod registerCmsAndTrjToJob(options, job_builder, orig_cms=None)

Register cms file and trajectory folder to job if needed.

Parameters
  • options (argparse.Namespace) – The parser to get the cms options from and set the trj options for.

  • job_builder (launchapi.JobSpecification) – JobSpecification object

retryFailure(max_retries=0)

Determine if the job should be retried or not. This overwrites the parent method to by default not retry jobs that have a status of “died” as that will indicate that Jaguar failed, which it almost certainly will again.

Parameters

max_retries (int) – The queue’s max_retries parameter

Return type

bool

Returns

True if the job should be retried, False if not

run(*args, **kwargs)

Run the job.

The steps taken are as follows:
  1. Execute the preCommand method for things like changing the working directory.

  2. Call the doCommand to do the actual work of computation or job launching.

  3. Call the postCommand method to undo the changes from the preCommand that need to be undone.

runsLocally() bool

Return True if the job runs on the JobDJ control host, False if not. Jobs that run locally don’t need hosts.

There is no limit on the number of locally run jobs.

setLogTag()

Set the log tag based on node index.

property state: schrodinger.job.queue.JobState

Return the current state of the job.

Note that this method can be overridden by subclasses that wish to provide for restartability at a higher level than unpickling BaseJob instances. For example, by examining some external condition (e.g. presence of output files) the state JobState.DONE could be returned immediately and the job would not run.

update()

Checks for changes in job status, and updates the object appropriately (marks for restart, etc).

Raises

RuntimeError – if an unknown Job Status or ExitStatus is encountered.

updateInfileAndCommand(par_outfile_with_dir)

Update the input file in the command and the input file attributes of a child job to the output file path of the parent job.

Parameters
  • child_job (an instance of a BaseJob subclass (such as JobControlJob or SubprocessJob)) – The subjob whose command will be updated.

  • par_outfile_with_dir (str) – The output file from the parent job that will be used as the input file of this child job.

updateTaskReplicaSettings()

Update the task protocol due to replica.

usesJobServer() bool

Detect, by looking at the jobId, whether this job uses a job server.

writeCms()

Write out cms files to current dir and each of them has a ‘msprops.ORIGINAL_CMS_PROP’ property pointing to the original cms file path.

class schrodinger.application.matsci.permittivity.BaseDipoleAnalysis(basename, config_yaml='default_permittivity_protocols.yaml', task_name=None, infile='$infile', outfile=None, additional_infiles=None, master_logger=None, node_index=None)

Bases: schrodinger.application.matsci.permittivity.MdPostTrajectoryAnalysis

Class to do post dipole analysis on desmond trajectory.

FLAG_SLICE_INTVL = '-slice_intvl'
FLAG_NORMALIZATION = '-normalization'
DRIVER_PATH = 'permittivity_gui_dir/permittivity_dipole_driver.py'
DIPOLE = 'dipole'
DIPOLE_CAP = 'Dipole'
STATISTICS_CSV_EX = '_dp-out.csv'
STATISTICS_FILE_PROP = 's_matsci_Dipole_Statistics_File'
DEFAULT_JOBNAME = 'permittivity_dipole_task'
OUTFILE_EXT = '-out.cms'
TIME_SERIAL = 'time_serial'
AUTOCORRELATION = 'autocorrelation'
COMPLEX_PERMITTIVITY = 'complex_permittivity'
SUSCEPTIBILITY = 'susceptibility'
SUSCEPT_CAP = 'Susceptibility'
TIME_SERIAL_CAPITALIZE = 'Time_Serial'
TIME_SERIAL_FILE_PROP = 's_matsci_Dipole_Time_Serial_File'
AUTOCORRELATION_FILE_PROP = 's_matsci_Dipole_Autocorrelation_File'
MD_COMPLEX_PERMITTIVITY_FILE_PROP = 's_matsci_Md_Complex_permittivity_File'
COMPLEX_PERMITTIVITY_FILE_PROP = 's_matsci_Complex_permittivity_File'
DIPOLE_SUSCEPTIBILITY_PROP = 'r_matsci_Dipole_Susceptibility'
DIPOLE_SUSCEPTIBILITY_STORE_PROP = 'r_matsci_Dipole_Susceptibility_Store'
DIPOLE_SUSCEPTIBILITY_STD_PROP = 'r_matsci_stdev_Dipole_Susceptibility'
SYSTEMWIDE_DIPOLE = 'systemwide_dipole'
SYSTEMWIDE_DIPOLE_X_PROP = 'r_matsci_Systemwide_Dipole_X'
SYSTEMWIDE_DIPOLE_Y_PROP = 'r_matsci_Systemwide_Dipole_Y'
SYSTEMWIDE_DIPOLE_Z_PROP = 'r_matsci_Systemwide_Dipole_Z'
SYSTEMWIDE_DIPOLE_PROPS = ['r_matsci_Systemwide_Dipole_X', 'r_matsci_Systemwide_Dipole_Y', 'r_matsci_Systemwide_Dipole_Z']
SYSTEMWIDE_DIPOLE_X_STD_PROP = 'r_matsci_Systemwide_Dipole_X_SD'
SYSTEMWIDE_DIPOLE_Y_STD_PROP = 'r_matsci_Systemwide_Dipole_Y_SD'
SYSTEMWIDE_DIPOLE_Z_STD_PROP = 'r_matsci_Systemwide_Dipole_Z_SD'
SYSTEMWIDE_DIPOLE_STD_PROPS = ['r_matsci_Systemwide_Dipole_X_SD', 'r_matsci_Systemwide_Dipole_Y_SD', 'r_matsci_Systemwide_Dipole_Z_SD']
KWW = 'kww'
TAU = 'tau'
BETA = 'beta'
TAU_START_PROP = 'r_matsci_Permittivity_Tau_Start_(ns)'
TAU_END_PROP = 'r_matsci_Permittivity_Tau_End_(ns)'
KWW_TAU_PROP = 'r_matsci_Kww_Tau_(ps)'
KWW_BETA_PROP = 'r_matsci_Kww_Beta'
TIME_SERIAL_LABELS = ['Time (ps)', 'Dipole_x (debye)', 'Dipole_y (debye)', 'Dipole_z (debye)', '<Dipole^2> (debye^2)']
TAU_PS = 'Tau (ps)'
DIPOLE_SQ = 'Dipole^2 (debye^2)'
DIPOLE_SQ_MEAN = 'Dipole^2 - <Dipole>^2 (debye^2)'
AUTOCORRELATION_LABELS = ['Tau (ps)', 'Dipole_x^2 (debye^2)', 'Dipole_y^2 (debye^2)', 'Dipole_z^2 (debye^2)', 'Dipole^2 (debye^2)', 'Dipole^2 - <Dipole>^2 (debye^2)']
TAU_PS_INDEX = 0
DIPOLE_SQ_INDEX = 4
DIPOLE_SQ_MEAN_INDEX = 5
LABEL_MAP = {'autocorrelation': ['Tau (ps)', 'Dipole_x^2 (debye^2)', 'Dipole_y^2 (debye^2)', 'Dipole_z^2 (debye^2)', 'Dipole^2 (debye^2)', 'Dipole^2 - <Dipole>^2 (debye^2)'], 'time_serial': ['Time (ps)', 'Dipole_x (debye)', 'Dipole_y (debye)', 'Dipole_z (debye)', '<Dipole^2> (debye^2)']}
STD_DEV = 'Std Dev of '
class SysDipole(mean, sd)

Bases: tuple

__contains__(key, /)

Return key in self.

__len__()

Return len(self).

count(value, /)

Return number of occurrences of value.

index(value, start=0, stop=9223372036854775807, /)

Return first index of value.

Raises ValueError if the value is not present.

mean

Alias for field number 0

sd

Alias for field number 1

setup(copy_ene=False, write_cms=True)

Over write parent class method.

static finalizeStep(job)

Finalize this step. Can be overwritten for light weight post process.

Parameters

job (An instance of a BaseJob subclass (such as JobControlJob or SubprocessJob)) – Current job

NUM_CRU_PROP = 'i_matsci_Num_Cru'
REPLICA_TAG = 'Replica %s: '
RESOURCE = 'cpu'
TEMP_PROP = 'r_matsci_Temperature(K)'
TEMP_STD_PROP = 'r_matsci_stdev_Temperature(K)'
TERMINAL_INFILE_NUM = 1
__init__(basename, config_yaml='default_permittivity_protocols.yaml', task_name=None, infile='$infile', outfile=None, additional_infiles=None, master_logger=None, node_index=None)
Parameters
  • basename (str) – The base name of this subjob

  • config_yaml (str) – The config yaml file contain all job config

  • task_name (str) – Task name of this sub job

  • infile (str) – The input filename

  • outfile (str) – The output filename

  • additional_infiles (list of str) – This records additional input files (e.g. the second, third, and so on)

  • master_logger (logging.Logger) – The logger to use for recording messages into master job -driver.log.

  • node_index (The node index) – tuple

acquireLicenseForSmartDistribution() bool

Acquire and hold licenses for a smart distribution job. This makes sure the job won’t fail due to unavailable licenses.

Returns True if the licenses registered for the job are acquired, and False if they are not. If no licenses are registered, it always returns True to avoid preventing jobs from using the smart distribution feature. For legacy jobcontrol, the license check is not performed, and is always returned True. We want to use this feature as a pitch to move users to JOB_SERVER.

addEnefileToAdditionalInfiles()

Add the ene file as one of the additional files.

addFinalizer(function: Callable[[schrodinger.job.queue.BaseJob], None], run_dir: Optional[str] = None)

Add a function to be invoked when the job completes successfully.

See also the add_multi_job_finalizer function.

addGroupPrereq(job: schrodinger.job.queue.BaseJob)

Make all jobs connected to job prerequisites of all jobs connected to this Job.

addLaunchEnv(key: str, val: str)

Adds the given environment key and and value to the list of launch environment.

Parameters
  • key – environment key to add to the launch environment.

  • val – environment value associcated with the key to add to the launch environment.

addPrereq(job: schrodinger.job.queue.BaseJob)

Add a job that is an immediate prerequisite for this one.

static autocorrelation(time_serial_data, normalize=False)

Calculate the auto correlation of the input numpy.array data.

Parameters
  • time_serial_data (n x m numpy.array) – Autocorrelation of each column of the data

  • normalize (bool) – If True, the auto correlation data will be normalized

Returns

Autocorrelated data (by column)

Return type

n x m numpy.array

static autocorrelationWithSum(time_serial_data, normalize=False)

Calculate the auto correlation of the input numpy.array data.

Parameters
  • time_serial_data (n x m numpy.array) – Autocorrelation of each column of the data

  • normalize (bool) – If True, the auto correlation data will be normalized

Returns

Autocorrelated data (by column)

Return type

n x m numpy.array

cancel()

Send kill request to jobcontrol managed job. This method will eventually deprecate JobControlJob.kill

cancelSubmitted(do_license_check: bool = False) schrodinger.job.queue.CancelSubmittedStatus

If the job is still in the ‘submitted’ state, cancel it, purge the jobrecord and set the job handle to None. This tries to acquire licenses for the job before canceling from the queue if do_license_check is turned on.

Parameters

do_license_check – Acquire licenses for the job before canceling from the queue.

Returns one of the status of CancelSubmittedStatus.

copyFiles(copy_infile=True, copy_additional_files=True, more_files=None)

Copy files to current dir.

Parameters
  • copy_infile (bool) – Copy the input files of the class to current folder

  • copy_additional_files (bool) – Copy the additional files of the class to current folder

  • more_files (None or list of str) – Use this arguments to copy customized files

doCommand(host: str, local: bool = False)

Launch job on specified host using jobcontrol.launch_job().

Parameters
  • host – Host on which the job will be executed.

  • local – Removed in JOB_SERVER.

finalize()

Clean up after a job successfully runs.

genAllJobs(seen: Optional[Set[schrodinger.job.queue.BaseJob]] = None) Generator[schrodinger.job.queue.BaseJob, None, None]

A generator that yields all jobs connected to this one.

genAllPrereqs(seen=None) Generator[schrodinger.job.queue.BaseJob, None, None]

A generator that yields all jobs that are prerequisites on this one.

getCommand() List[str]

Return the command used to run this job.

getCommandDir() str

Return the launch/command directory name. If None is returned, the job will be launched in the current directory.

getDownStreamPolymerJob()

Search and return the down-stream polymer job

Returns

A subtask step with polymer driver in the cmd

Return type

‘Step’ or None

getDuration() Optional[int]

Return the duration of the Job as recorded by job server. The duration does not include queue wait time.

If the job is running or has not launched, returns None.

Note that this method makes a blocking call to the job server.

getFirstMatchedfilename(filenames, exts)

Get the filename that ends with the first extension. If multiple filenames end with that extension return the first match.

Parameters
  • filenames (list of string) – list of filenames

  • exts (list of string) – list of extensions

Returns

The matched filename or None

Return type

string or None

classmethod getForceFieldFlag()

Return the flag for force field. Should be overwritten by the subclass only when subtask reads in this flag

Returns

The flag to set the force field (without the ‘-‘)

Return type

str or None

getJob() Optional[schrodinger.job.jobcontrol.Job]

Return the job record as a schrodinger.job.jobcontrol.Job instance.

Returns None if the job hasn’t been launched.

getJobDJ() schrodinger.job.queue.JobDJ

Return the JobDJ instance that this job has been added to.

getPrereqs()

Return a set of all immediate prerequisites for this job.

static getRelatedFile(cms_file, file_ext='.ene')

Get the requested file based on cms file name and file extension

Parameters
  • cms_file (str) – The cms file whose related file is searched.

  • file_ext (str) – the extension of file to search for. The file extension must include the separator as well. For example, to get ene file, file_ext must be “.ene”

Returns

Found file with correct extension

Return type

str or None

static getRelatedJobFile(input_cms, orig_cms=None, file_ext='.ene')

Search existing ene file and return the ene found based on the input_cms. Existing ene file may be found in current folder, in the input cms folder or in the PROP_CMS (‘s_m_original_cms_file’) folder when ene is not copied from the PROP_CMS folder to the current folder.

Parameters
  • input_cms (str) – INPUT_CMS defined for INPUT_TRJ searching.

  • orig_cms (str) – The original cms defined by users.

  • file_ext (str) – the extension of file to search for. The file extension must include the separator as well. For example, to get ene file, file_ext must be “.ene”

Raises

KeyError, FileNotFoundError, ValueError – when ene file cannot be found.

Return type

str, str or None

Returns

Existing ene file if found, the original cms file that the ene file sits with or None (sit with the input_cms)

classmethod getSeedFlag()

Return the flag for random seed. Should be overwritten by the subclass only when subtask reads in this flag

Returns

The flag to set the random seed (without the ‘-‘)

Return type

str or None

getStatusStrings() Tuple[str, str, str]

Return a tuple of status strings for printing by JobDJ.

The strings returned are (status, jobid, host).

static getTrajectoryFromCms(input_cms, orig_cms=None)

Search existing trajectory and return the trajectory found based on the input_cms. Existing trajectory (desmondutils.PROP_TRJ) may be found in current folder, sitting with input cms or sitting with the original cms defined by users or pointed to by PROP_CMS (‘s_m_original_cms_file’) when trajectory is not copied from the PROP_CMS folder to the current folder.

Parameters
  • input_cms (str) – INPUT_CMS defined for INPUT_TRJ searching.

  • orig_cms (str) – The original cms defined by users.

Raises

KeyError, FileNotFoundError, ValueError – when trajectory cannot be found.

Return type

str, str or None

Returns

existing trajectory if found, whether the input trajectory sits with the original cms

hasExited() bool

Returns True if this job finished, successfully or not.

hasStarted() bool

Returns True if this job has started (not waiting)

init_count = 0
isComplete() bool

Returns True if this job finished successfully

kill()

Send kill request to jobcontrol managed job

log(msg, add_log_tag=True)

Log information to the master driver.log

Parameters
  • msg (str) – The info to print

  • add_log_tag (bool) – If True, additional tags is logged in front of the msg for the replica jobs.

maxFailuresReached(msg: str)

Print an error summary, including the last 20 lines from each log file in the LogFiles list of the job record.

classmethod optionsToTaskProtocols(options, task_name, seed=None)

This is the class method to generate task_protocol based on command line options and default values from config yaml. This method should be overwritten by subclass method as this one returns the protocol in the default configure yaml.

Parameters
  • options (argparse.Namespace) – The parsed command line options

  • task_name (str) – Task name of the current stage

  • seed (int or None) – Random seed to randomize the initial velocities

Returns

Updated task protocol

Return type

TaskProtocol

outfileExist()

Whether the outfile exists

Returns

Whether the file exists.

Return type

bool

postCommand()

A method to restore things to the pre-command state.

preCommand()

A method to make pre-command changes, like cd’ing to the correct directory to run the command in.

classmethod registerCmsAndTrjToJob(options, job_builder, orig_cms=None)

Register cms file and trajectory folder to job if needed.

Parameters
  • options (argparse.Namespace) – The parser to get the cms options from and set the trj options for.

  • job_builder (launchapi.JobSpecification) – JobSpecification object

retryFailure(max_retries=0)

Determine if the job should be retried or not. This overwrites the parent method to by default not retry jobs that have a status of “died” as that will indicate that Jaguar failed, which it almost certainly will again.

Parameters

max_retries (int) – The queue’s max_retries parameter

Return type

bool

Returns

True if the job should be retried, False if not

run(*args, **kwargs)

Run the job.

The steps taken are as follows:
  1. Execute the preCommand method for things like changing the working directory.

  2. Call the doCommand to do the actual work of computation or job launching.

  3. Call the postCommand method to undo the changes from the preCommand that need to be undone.

runsLocally() bool

Return True if the job runs on the JobDJ control host, False if not. Jobs that run locally don’t need hosts.

There is no limit on the number of locally run jobs.

setLogTag()

Set the log tag based on node index.

setOutfile()

Set the job outfile with an existing file based on the jobcontrol job, if not set.

Raises

FileNotFoundError – Failed to set an existing outfile

property state: schrodinger.job.queue.JobState

Return the current state of the job.

Note that this method can be overridden by subclasses that wish to provide for restartability at a higher level than unpickling BaseJob instances. For example, by examining some external condition (e.g. presence of output files) the state JobState.DONE could be returned immediately and the job would not run.

update()

Checks for changes in job status, and updates the object appropriately (marks for restart, etc).

Raises

RuntimeError – if an unknown Job Status or ExitStatus is encountered.

updateInfileAndCommand(par_outfile_with_dir)

Update the input file in the command and the input file attributes of a child job to the output file path of the parent job.

Parameters
  • child_job (an instance of a BaseJob subclass (such as JobControlJob or SubprocessJob)) – The subjob whose command will be updated.

  • par_outfile_with_dir (str) – The output file from the parent job that will be used as the input file of this child job.

updateTaskReplicaSettings()

Update the task protocol due to replica.

usesJobServer() bool

Detect, by looking at the jobId, whether this job uses a job server.

writeCms()

Write out cms files to current dir and each of them has a ‘msprops.ORIGINAL_CMS_PROP’ property pointing to the original cms file path.

class schrodinger.application.matsci.permittivity.DipoleAnalysis(basename, config_yaml='default_permittivity_protocols.yaml', task_name=None, infile='$infile', outfile=None, additional_infiles=None, master_logger=None, node_index=None)

Bases: schrodinger.application.matsci.permittivity.BaseDipoleAnalysis

Class to do post dipole analysis on desmond trajectory.

FLAG_DATA_LAST_FRAC = 'data_last_frac'
classmethod optionsToTaskProtocols(options, task_name, seed=None)

Update the task protocol according to the user input.

Parameters
  • options (argparse.Namespace) – The parsed command line options

  • task_name (str) – Task name

  • seed (int or None) – Random seed to randomize the initial velocities

Returns

Updated task protocol

Return type

TaskProtocol

AUTOCORRELATION = 'autocorrelation'
AUTOCORRELATION_FILE_PROP = 's_matsci_Dipole_Autocorrelation_File'
AUTOCORRELATION_LABELS = ['Tau (ps)', 'Dipole_x^2 (debye^2)', 'Dipole_y^2 (debye^2)', 'Dipole_z^2 (debye^2)', 'Dipole^2 (debye^2)', 'Dipole^2 - <Dipole>^2 (debye^2)']
BETA = 'beta'
COMPLEX_PERMITTIVITY = 'complex_permittivity'
COMPLEX_PERMITTIVITY_FILE_PROP = 's_matsci_Complex_permittivity_File'
DEFAULT_JOBNAME = 'permittivity_dipole_task'
DIPOLE = 'dipole'
DIPOLE_CAP = 'Dipole'
DIPOLE_SQ = 'Dipole^2 (debye^2)'
DIPOLE_SQ_INDEX = 4
DIPOLE_SQ_MEAN = 'Dipole^2 - <Dipole>^2 (debye^2)'
DIPOLE_SQ_MEAN_INDEX = 5
DIPOLE_SUSCEPTIBILITY_PROP = 'r_matsci_Dipole_Susceptibility'
DIPOLE_SUSCEPTIBILITY_STD_PROP = 'r_matsci_stdev_Dipole_Susceptibility'
DIPOLE_SUSCEPTIBILITY_STORE_PROP = 'r_matsci_Dipole_Susceptibility_Store'
DRIVER_PATH = 'permittivity_gui_dir/permittivity_dipole_driver.py'
FLAG_NORMALIZATION = '-normalization'
FLAG_SLICE_INTVL = '-slice_intvl'
KWW = 'kww'
KWW_BETA_PROP = 'r_matsci_Kww_Beta'
KWW_TAU_PROP = 'r_matsci_Kww_Tau_(ps)'
LABEL_MAP = {'autocorrelation': ['Tau (ps)', 'Dipole_x^2 (debye^2)', 'Dipole_y^2 (debye^2)', 'Dipole_z^2 (debye^2)', 'Dipole^2 (debye^2)', 'Dipole^2 - <Dipole>^2 (debye^2)'], 'time_serial': ['Time (ps)', 'Dipole_x (debye)', 'Dipole_y (debye)', 'Dipole_z (debye)', '<Dipole^2> (debye^2)']}
MD_COMPLEX_PERMITTIVITY_FILE_PROP = 's_matsci_Md_Complex_permittivity_File'
NUM_CRU_PROP = 'i_matsci_Num_Cru'
OUTFILE_EXT = '-out.cms'
REPLICA_TAG = 'Replica %s: '
RESOURCE = 'cpu'
STATISTICS_CSV_EX = '_dp-out.csv'
STATISTICS_FILE_PROP = 's_matsci_Dipole_Statistics_File'
STD_DEV = 'Std Dev of '
SUSCEPTIBILITY = 'susceptibility'
SUSCEPT_CAP = 'Susceptibility'
SYSTEMWIDE_DIPOLE = 'systemwide_dipole'
SYSTEMWIDE_DIPOLE_PROPS = ['r_matsci_Systemwide_Dipole_X', 'r_matsci_Systemwide_Dipole_Y', 'r_matsci_Systemwide_Dipole_Z']
SYSTEMWIDE_DIPOLE_STD_PROPS = ['r_matsci_Systemwide_Dipole_X_SD', 'r_matsci_Systemwide_Dipole_Y_SD', 'r_matsci_Systemwide_Dipole_Z_SD']
SYSTEMWIDE_DIPOLE_X_PROP = 'r_matsci_Systemwide_Dipole_X'
SYSTEMWIDE_DIPOLE_X_STD_PROP = 'r_matsci_Systemwide_Dipole_X_SD'
SYSTEMWIDE_DIPOLE_Y_PROP = 'r_matsci_Systemwide_Dipole_Y'
SYSTEMWIDE_DIPOLE_Y_STD_PROP = 'r_matsci_Systemwide_Dipole_Y_SD'
SYSTEMWIDE_DIPOLE_Z_PROP = 'r_matsci_Systemwide_Dipole_Z'
SYSTEMWIDE_DIPOLE_Z_STD_PROP = 'r_matsci_Systemwide_Dipole_Z_SD'
class SysDipole(mean, sd)

Bases: tuple

__contains__(key, /)

Return key in self.

__len__()

Return len(self).

count(value, /)

Return number of occurrences of value.

index(value, start=0, stop=9223372036854775807, /)

Return first index of value.

Raises ValueError if the value is not present.

mean

Alias for field number 0

sd

Alias for field number 1

TAU = 'tau'
TAU_END_PROP = 'r_matsci_Permittivity_Tau_End_(ns)'
TAU_PS = 'Tau (ps)'
TAU_PS_INDEX = 0
TAU_START_PROP = 'r_matsci_Permittivity_Tau_Start_(ns)'
TEMP_PROP = 'r_matsci_Temperature(K)'
TEMP_STD_PROP = 'r_matsci_stdev_Temperature(K)'
TERMINAL_INFILE_NUM = 1
TIME_SERIAL = 'time_serial'
TIME_SERIAL_CAPITALIZE = 'Time_Serial'
TIME_SERIAL_FILE_PROP = 's_matsci_Dipole_Time_Serial_File'
TIME_SERIAL_LABELS = ['Time (ps)', 'Dipole_x (debye)', 'Dipole_y (debye)', 'Dipole_z (debye)', '<Dipole^2> (debye^2)']
__init__(basename, config_yaml='default_permittivity_protocols.yaml', task_name=None, infile='$infile', outfile=None, additional_infiles=None, master_logger=None, node_index=None)
Parameters
  • basename (str) – The base name of this subjob

  • config_yaml (str) – The config yaml file contain all job config

  • task_name (str) – Task name of this sub job

  • infile (str) – The input filename

  • outfile (str) – The output filename

  • additional_infiles (list of str) – This records additional input files (e.g. the second, third, and so on)

  • master_logger (logging.Logger) – The logger to use for recording messages into master job -driver.log.

  • node_index (The node index) – tuple

acquireLicenseForSmartDistribution() bool

Acquire and hold licenses for a smart distribution job. This makes sure the job won’t fail due to unavailable licenses.

Returns True if the licenses registered for the job are acquired, and False if they are not. If no licenses are registered, it always returns True to avoid preventing jobs from using the smart distribution feature. For legacy jobcontrol, the license check is not performed, and is always returned True. We want to use this feature as a pitch to move users to JOB_SERVER.

addEnefileToAdditionalInfiles()

Add the ene file as one of the additional files.

addFinalizer(function: Callable[[schrodinger.job.queue.BaseJob], None], run_dir: Optional[str] = None)

Add a function to be invoked when the job completes successfully.

See also the add_multi_job_finalizer function.

addGroupPrereq(job: schrodinger.job.queue.BaseJob)

Make all jobs connected to job prerequisites of all jobs connected to this Job.

addLaunchEnv(key: str, val: str)

Adds the given environment key and and value to the list of launch environment.

Parameters
  • key – environment key to add to the launch environment.

  • val – environment value associcated with the key to add to the launch environment.

addPrereq(job: schrodinger.job.queue.BaseJob)

Add a job that is an immediate prerequisite for this one.

static autocorrelation(time_serial_data, normalize=False)

Calculate the auto correlation of the input numpy.array data.

Parameters
  • time_serial_data (n x m numpy.array) – Autocorrelation of each column of the data

  • normalize (bool) – If True, the auto correlation data will be normalized

Returns

Autocorrelated data (by column)

Return type

n x m numpy.array

static autocorrelationWithSum(time_serial_data, normalize=False)

Calculate the auto correlation of the input numpy.array data.

Parameters
  • time_serial_data (n x m numpy.array) – Autocorrelation of each column of the data

  • normalize (bool) – If True, the auto correlation data will be normalized

Returns

Autocorrelated data (by column)

Return type

n x m numpy.array

cancel()

Send kill request to jobcontrol managed job. This method will eventually deprecate JobControlJob.kill

cancelSubmitted(do_license_check: bool = False) schrodinger.job.queue.CancelSubmittedStatus

If the job is still in the ‘submitted’ state, cancel it, purge the jobrecord and set the job handle to None. This tries to acquire licenses for the job before canceling from the queue if do_license_check is turned on.

Parameters

do_license_check – Acquire licenses for the job before canceling from the queue.

Returns one of the status of CancelSubmittedStatus.

copyFiles(copy_infile=True, copy_additional_files=True, more_files=None)

Copy files to current dir.

Parameters
  • copy_infile (bool) – Copy the input files of the class to current folder

  • copy_additional_files (bool) – Copy the additional files of the class to current folder

  • more_files (None or list of str) – Use this arguments to copy customized files

doCommand(host: str, local: bool = False)

Launch job on specified host using jobcontrol.launch_job().

Parameters
  • host – Host on which the job will be executed.

  • local – Removed in JOB_SERVER.

finalize()

Clean up after a job successfully runs.

static finalizeStep(job)

Finalize this step. Can be overwritten for light weight post process.

Parameters

job (An instance of a BaseJob subclass (such as JobControlJob or SubprocessJob)) – Current job

genAllJobs(seen: Optional[Set[schrodinger.job.queue.BaseJob]] = None) Generator[schrodinger.job.queue.BaseJob, None, None]

A generator that yields all jobs connected to this one.

genAllPrereqs(seen=None) Generator[schrodinger.job.queue.BaseJob, None, None]

A generator that yields all jobs that are prerequisites on this one.

getCommand() List[str]

Return the command used to run this job.

getCommandDir() str

Return the launch/command directory name. If None is returned, the job will be launched in the current directory.

getDownStreamPolymerJob()

Search and return the down-stream polymer job

Returns

A subtask step with polymer driver in the cmd

Return type

‘Step’ or None

getDuration() Optional[int]

Return the duration of the Job as recorded by job server. The duration does not include queue wait time.

If the job is running or has not launched, returns None.

Note that this method makes a blocking call to the job server.

getFirstMatchedfilename(filenames, exts)

Get the filename that ends with the first extension. If multiple filenames end with that extension return the first match.

Parameters
  • filenames (list of string) – list of filenames

  • exts (list of string) – list of extensions

Returns

The matched filename or None

Return type

string or None

classmethod getForceFieldFlag()

Return the flag for force field. Should be overwritten by the subclass only when subtask reads in this flag

Returns

The flag to set the force field (without the ‘-‘)

Return type

str or None

getJob() Optional[schrodinger.job.jobcontrol.Job]

Return the job record as a schrodinger.job.jobcontrol.Job instance.

Returns None if the job hasn’t been launched.

getJobDJ() schrodinger.job.queue.JobDJ

Return the JobDJ instance that this job has been added to.

getPrereqs()

Return a set of all immediate prerequisites for this job.

static getRelatedFile(cms_file, file_ext='.ene')

Get the requested file based on cms file name and file extension

Parameters
  • cms_file (str) – The cms file whose related file is searched.

  • file_ext (str) – the extension of file to search for. The file extension must include the separator as well. For example, to get ene file, file_ext must be “.ene”

Returns

Found file with correct extension

Return type

str or None

static getRelatedJobFile(input_cms, orig_cms=None, file_ext='.ene')

Search existing ene file and return the ene found based on the input_cms. Existing ene file may be found in current folder, in the input cms folder or in the PROP_CMS (‘s_m_original_cms_file’) folder when ene is not copied from the PROP_CMS folder to the current folder.

Parameters
  • input_cms (str) – INPUT_CMS defined for INPUT_TRJ searching.

  • orig_cms (str) – The original cms defined by users.

  • file_ext (str) – the extension of file to search for. The file extension must include the separator as well. For example, to get ene file, file_ext must be “.ene”

Raises

KeyError, FileNotFoundError, ValueError – when ene file cannot be found.

Return type

str, str or None

Returns

Existing ene file if found, the original cms file that the ene file sits with or None (sit with the input_cms)

classmethod getSeedFlag()

Return the flag for random seed. Should be overwritten by the subclass only when subtask reads in this flag

Returns

The flag to set the random seed (without the ‘-‘)

Return type

str or None

getStatusStrings() Tuple[str, str, str]

Return a tuple of status strings for printing by JobDJ.

The strings returned are (status, jobid, host).

static getTrajectoryFromCms(input_cms, orig_cms=None)

Search existing trajectory and return the trajectory found based on the input_cms. Existing trajectory (desmondutils.PROP_TRJ) may be found in current folder, sitting with input cms or sitting with the original cms defined by users or pointed to by PROP_CMS (‘s_m_original_cms_file’) when trajectory is not copied from the PROP_CMS folder to the current folder.

Parameters
  • input_cms (str) – INPUT_CMS defined for INPUT_TRJ searching.

  • orig_cms (str) – The original cms defined by users.

Raises

KeyError, FileNotFoundError, ValueError – when trajectory cannot be found.

Return type

str, str or None

Returns

existing trajectory if found, whether the input trajectory sits with the original cms

hasExited() bool

Returns True if this job finished, successfully or not.

hasStarted() bool

Returns True if this job has started (not waiting)

init_count = 0
isComplete() bool

Returns True if this job finished successfully

kill()

Send kill request to jobcontrol managed job

log(msg, add_log_tag=True)

Log information to the master driver.log

Parameters
  • msg (str) – The info to print

  • add_log_tag (bool) – If True, additional tags is logged in front of the msg for the replica jobs.

maxFailuresReached(msg: str)

Print an error summary, including the last 20 lines from each log file in the LogFiles list of the job record.

outfileExist()

Whether the outfile exists

Returns

Whether the file exists.

Return type

bool

postCommand()

A method to restore things to the pre-command state.

preCommand()

A method to make pre-command changes, like cd’ing to the correct directory to run the command in.

classmethod registerCmsAndTrjToJob(options, job_builder, orig_cms=None)

Register cms file and trajectory folder to job if needed.

Parameters
  • options (argparse.Namespace) – The parser to get the cms options from and set the trj options for.

  • job_builder (launchapi.JobSpecification) – JobSpecification object

retryFailure(max_retries=0)

Determine if the job should be retried or not. This overwrites the parent method to by default not retry jobs that have a status of “died” as that will indicate that Jaguar failed, which it almost certainly will again.

Parameters

max_retries (int) – The queue’s max_retries parameter

Return type

bool

Returns

True if the job should be retried, False if not

run(*args, **kwargs)

Run the job.

The steps taken are as follows:
  1. Execute the preCommand method for things like changing the working directory.

  2. Call the doCommand to do the actual work of computation or job launching.

  3. Call the postCommand method to undo the changes from the preCommand that need to be undone.

runsLocally() bool

Return True if the job runs on the JobDJ control host, False if not. Jobs that run locally don’t need hosts.

There is no limit on the number of locally run jobs.

setLogTag()

Set the log tag based on node index.

setOutfile()

Set the job outfile with an existing file based on the jobcontrol job, if not set.

Raises

FileNotFoundError – Failed to set an existing outfile

setup(copy_ene=False, write_cms=True)

Over write parent class method.

property state: schrodinger.job.queue.JobState

Return the current state of the job.

Note that this method can be overridden by subclasses that wish to provide for restartability at a higher level than unpickling BaseJob instances. For example, by examining some external condition (e.g. presence of output files) the state JobState.DONE could be returned immediately and the job would not run.

update()

Checks for changes in job status, and updates the object appropriately (marks for restart, etc).

Raises

RuntimeError – if an unknown Job Status or ExitStatus is encountered.

updateInfileAndCommand(par_outfile_with_dir)

Update the input file in the command and the input file attributes of a child job to the output file path of the parent job.

Parameters
  • child_job (an instance of a BaseJob subclass (such as JobControlJob or SubprocessJob)) – The subjob whose command will be updated.

  • par_outfile_with_dir (str) – The output file from the parent job that will be used as the input file of this child job.

updateTaskReplicaSettings()

Update the task protocol due to replica.

usesJobServer() bool

Detect, by looking at the jobId, whether this job uses a job server.

writeCms()

Write out cms files to current dir and each of them has a ‘msprops.ORIGINAL_CMS_PROP’ property pointing to the original cms file path.

class schrodinger.application.matsci.permittivity.SusceptibilityMerge<