示例#1
0
def main():
    sim_input = make_input(simulation_parameters=params_file,
                           topology=topology_file,
                           conformation=configuration)
    md = simulate(sim_input)
    # Indicate where to force dependency resolution. This is an opportunity for
    # user-provided exception handling and inspection.
    scalems.wait(md)
示例#2
0
from scalems.wrappers.gromacs import simulate

# Add a TPR-loading operation to the default work graph (initially empty) that
# produces simulation input data bundle (parameters, structure, topology)

N = 50  # Number of ensemble members
starting_structure = 'input_conf.gro'
topology_file = 'input.top'
run_parameters = 'params.mdp'
potential_parameters = 'myparams.json'
with open(potential_parameters, mode='r') as fh:
    my_dict_params = json.load(fh)

# make a single simulation input file
initial_tpr = make_input(simulation_parameters=run_parameters,
                         topology=topology_file,
                         conformation=starting_structure)

initial_input = list([initial_tpr
                      for _ in range(N)])  # An array of N simulations

# Just to demonstrate functionality, modify a parameter here.
# Change parameters with width 1 value. Implicitly broadcasts on an ensemble with width 50.
# If we wanted each ensemble member to have a different value, we would just
# have the new parameter value be an array of width 50, assuming API integration
# with the tool to understand allowed input data type and shape.
lengthened_input = modify_input(initial_input, parameters={'nsteps': 50000000})

# Create subgraph objects that encapsulate multiple operations
# and can be used in conditional and loop operations.
# For subgraphs, inputs can be accessed as variables and are copied to the next