Beispiel #1
0
from paprika.amber import Simulation

import logging

logging.basicConfig(
    filename='tscc.log',
    format='%(asctime)s %(message)s',
    datefmt='%Y-%m-%d %I:%M:%S %p',
    level=logging.DEBUG)
logging.info('Started logging...')
logging.info(paprika.__version__)

ntwprt = 206
nstlim = 500000

sim = Simulation()

# Minimization
sim.executable = 'pmemd.cuda'
sim.topology = 'solvate.prmtop'
sim.prefix = 'minimize'
sim.inpcrd = 'solvate.rst7'
sim.path = './'
sim.ref = 'solvate.rst7'
sim.config_pbc_min()
sim.cntrl['maxcyc'] = 500
sim.cntrl['ncyc'] = 400
sim.cntrl['ntr'] = 1
sim.cntrl['restraint_wt'] = 50.0
sim.cntrl['restraintmask'] = "'@DUM'"
sim.cntrl['cut'] = 9.0
Beispiel #2
0
def test_amber_minimization(clean_files):
    simulation = Simulation()
    simulation.path = os.path.join("tmp")

    shutil.copy(os.path.join(os.path.dirname(__file__), "../data/k-cl/k-cl.prmtop"), "tmp")
    shutil.copy(os.path.join(os.path.dirname(__file__), "../data/k-cl/k-cl.rst7"), "tmp")

    simulation.executable = "sander"
    simulation.restraint_file = None

    simulation.prefix = "minimize"
    simulation.topology = "k-cl.prmtop"
    simulation.inpcrd = "k-cl.rst7"

    simulation.config_gb_min()
    # Turn off GB for now.
    simulation.cntrl["igb"] = 0
    simulation.cntrl["ntb"] = 0

    simulation.run()

    mdout = parse_mdout(os.path.join("tmp", "minimize.out"))

    assert pytest.approx(mdout["Bond"][-1]) == 0
    assert pytest.approx(mdout["Angle"][-1]) == 0
    assert pytest.approx(mdout["Dihedral"][-1]) == 0
    assert pytest.approx(mdout["V14"][-1]) == 0
    assert pytest.approx(mdout["E14"][-1]) == 0

    assert pytest.approx(mdout["VDW"][0], 0.1) == 6.5734
    assert pytest.approx(mdout["Ele"][0], 0.1) == -211.7616
    datefmt="%Y-%m-%d %I:%M:%S %p",
    level=logging.DEBUG,
)
logging.info("Started logging...")
logging.info(paprika.__version__)
hostname = sp.check_output(["hostname"])
nvidia_smi = sp.check_output(["nvidia-smi"])
logging.info(hostname.decode("utf-8"))
logging.info(nvidia_smi.decode("utf-8"))

with open("n_atoms.dat", "r") as f:
    ntwprt = int(f.read())

nstlim = 500000

sim = Simulation()

# Minimization
sim.executable = "pmemd.cuda"
sim.topology = "smirnoff.prmtop"
sim.prefix = "minimize"
sim.inpcrd = "smirnoff.inpcrd"
sim.path = "./"
sim.ref = "smirnoff.inpcrd"
sim.config_pbc_min()
sim.cntrl["maxcyc"] = 500
sim.cntrl["ncyc"] = 400
sim.cntrl["ntr"] = 1
sim.cntrl["restraint_wt"] = 50.0
sim.cntrl["restraintmask"] = "'@Pb'"
sim.cntrl["cut"] = 9.0