From 7d759e7583c1cd8858cf8da4ff25032bf063fbcd Mon Sep 17 00:00:00 2001 From: Marc Siggel Date: Sun, 21 Oct 2018 11:42:07 +0200 Subject: [PATCH 1/4] initial implementation of lammps support --- mdbenchmark/generate.py | 10 +++- mdbenchmark/mdengines/__init__.py | 7 +-- mdbenchmark/mdengines/lammps.py | 83 +++++++++++++++++++++++++++++++ mdbenchmark/mdengines/utils.py | 8 +++ mdbenchmark/templates/cobra | 2 + mdbenchmark/templates/draco | 2 + mdbenchmark/templates/hydra | 2 + 7 files changed, 109 insertions(+), 5 deletions(-) create mode 100644 mdbenchmark/mdengines/lammps.py diff --git a/mdbenchmark/generate.py b/mdbenchmark/generate.py index dcfb763c..aad41154 100644 --- a/mdbenchmark/generate.py +++ b/mdbenchmark/generate.py @@ -31,7 +31,11 @@ "Parameter paths must be absolute. Only crude file checks are performed! " "If you use the {} option make sure you use the GPU compatible NAMD module!" ) - +LAMMPS_WARNING = ( + "LAMMPS support is experimental." + "All input files must be in the same directory and have the same base name!" + "We hope you know what you're doing..." +) def validate_name(ctx, param, name=None): """Validate that we are given a name argument.""" @@ -215,9 +219,11 @@ def generate(name, cpu, gpu, module, host, min_nodes, max_nodes, time, skip_vali # click does the validation for us template = utils.retrieve_host_template(host) - # Warn the user that NAMD support is still experimental. + # Warn the user that NAMD and LAMMPS support is still experimental. if any(["namd" in m for m in module]): console.warn(NAMD_WARNING, "--gpu") + if any(["lammps" in m for m in module]): + console.warn(LAMMPS_WARNING) module = mdengines.normalize_modules(module, skip_validation) diff --git a/mdbenchmark/mdengines/__init__.py b/mdbenchmark/mdengines/__init__.py index 1d40e3ff..e2cbe25a 100644 --- a/mdbenchmark/mdengines/__init__.py +++ b/mdbenchmark/mdengines/__init__.py @@ -22,10 +22,10 @@ import six -from . import gromacs, namd +from . import gromacs, namd, lammps from .. import console -SUPPORTED_ENGINES = {"gromacs": gromacs, "namd": namd} +SUPPORTED_ENGINES = {"gromacs": gromacs, "namd": namd, "lammps": lammps} def detect_md_engine(modulename): @@ -63,6 +63,7 @@ def prepare_module_name(module, skip_validation=False): "--skip-validation", "gromacs/dummy", "namd/dummy", + "lammps/dummy" ) console.error("We were not able to determine the module name.") @@ -120,7 +121,7 @@ def normalize_modules(modules, skip_validation): if detect_md_engine(engine_name) is None: console.error( "There is currently no support for '{}'. " - "Supported MD engines are: gromacs, namd.", + "Supported MD engines are: gromacs, namd, lammps.", engine_name, ) diff --git a/mdbenchmark/mdengines/lammps.py b/mdbenchmark/mdengines/lammps.py new file mode 100644 index 00000000..21a5abb0 --- /dev/null +++ b/mdbenchmark/mdengines/lammps.py @@ -0,0 +1,83 @@ +# -*- Mode: python; tab-width: 4; indent-tabs-mode:nil; coding:utf-8 -*- +# vim: tabstop=4 expandtab shiftwidth=4 softtabstop=4 fileencoding=utf-8 +# +# MDBenchmark +# Copyright (c) 2017 Max Linke & Michael Gecht and contributors +# (see the file AUTHORS for the full list of names) +# +# MDBenchmark is free software: you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation, either version 3 of the License, or +# (at your option) any later version. +# +# MDBenchmark is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with MDBenchmark. If not, see . +import os +import re +from glob import glob +from shutil import copyfile + +import mdsynthesis as mds +import numpy as np + +from .. import console + +NAME = "lammps" + + +def prepare_benchmark(name, *args, **kwargs): + sim = kwargs["sim"] + + full_filename = name + ".in" + if name.endswith(".in"): + full_filename = name + name = name[:-3] + + copyfile(full_filename, sim[full_filename].relpath) + + return name + + +def analyze_lammps_file(fh): + """ Check whether the LAMMPS config file has any relative imports or variables + """ + lines = fh.readlines() + + for line in lines: + # Continue if we do not need to do anything with the current line + if ( + ("parameters" not in line) + and ("coordinates" not in line) + and ("structure" not in line) + ): + continue + + path = line.split()[1] + if "$" in path: + console.error("Variable Substitutions are not allowed in NAMD files!") + if ".." in path: + console.error("Relative file paths are not allowed in NAMD files!") + if "/" not in path or ("/" in path and not path.startswith("/")): + console.error("No absolute path detected in NAMD file!") + + +def check_input_file_exists(name): + """Check and append the correct file extensions for the LAMMPS module.""" + # Check whether the needed files are there. + fn = name + if fn.endswith(".in"): + fn = name[:-4] + + infile = fn + ".in" + if not os.path.exists(infile): + console.error( + "File {} does not exist, but is needed for LAMMPS benchmarks.", infile + ) + + + return True diff --git a/mdbenchmark/mdengines/utils.py b/mdbenchmark/mdengines/utils.py index 06bee549..cf0e9382 100644 --- a/mdbenchmark/mdengines/utils.py +++ b/mdbenchmark/mdengines/utils.py @@ -31,6 +31,7 @@ FILES_TO_KEEP = { "gromacs": [".*/bench\.job", ".*\.tpr", ".*\.mdp"], "namd": [".*/bench\.job", ".*\.namd", ".*\.psf", ".*\.pdb"], + "lammps": [".*/bench\.job", ".*\.in"], } PARSE_ENGINE = { @@ -48,6 +49,13 @@ "ncores_return": lambda line: int(line.split()[3]), "analyze": "*out*", }, + "lammps": { + "performance": "Performance", + "performance_return": lambda line: 1 / float(line.split()[1]), + "ncores": "Loop", + "ncores_return": lambda line: int(line.split()[5]), + "analyze": "*log*", + } } diff --git a/mdbenchmark/templates/cobra b/mdbenchmark/templates/cobra index 71c03978..c2dfde28 100644 --- a/mdbenchmark/templates/cobra +++ b/mdbenchmark/templates/cobra @@ -40,4 +40,6 @@ module load {{ module }} srun gmx_mpi mdrun -v -maxh {{ time / 60 }} -deffnm {{ name }} {%- elif mdengine == "namd" %} srun namd2 {{ name }}.namd +{%- elif mdengine == "lammps" %} +srun lmp_mpi -v f tmp.out -l my.log -sc none -i in.alloy {%- endif %} diff --git a/mdbenchmark/templates/draco b/mdbenchmark/templates/draco index 98f917bb..969ff2fc 100644 --- a/mdbenchmark/templates/draco +++ b/mdbenchmark/templates/draco @@ -37,4 +37,6 @@ module load {{ module }} srun gmx_mpi mdrun -v -maxh {{ time / 60 }} -deffnm {{ name }} {%- elif mdengine == "namd" %} srun namd2 {{ name }}.namd +{%- elif mdengine == "lammps" %} +srun lmp_mpi -v f tmp.out -l my.log -sc none -i in.alloy {%- endif %} diff --git a/mdbenchmark/templates/hydra b/mdbenchmark/templates/hydra index f7fbe545..84b9bb61 100644 --- a/mdbenchmark/templates/hydra +++ b/mdbenchmark/templates/hydra @@ -23,4 +23,6 @@ module load cuda poe gmx_mpi mdrun -deffnm {{ name }} -maxh {{ time / 60 }} {%- elif mdengine == "namd" %} poe namd2 {{ name }}.namd +{%- elif mdengine == "lammps" %} +poe lmp_mpi -v f tmp.out -l my.log -sc none -i {{ name }}.in {%- endif %} From 8c17bb01702bcd6968794fd157cc5535064be4e3 Mon Sep 17 00:00:00 2001 From: Marc Siggel Date: Sun, 21 Oct 2018 18:06:44 +0200 Subject: [PATCH 2/4] lammps files for tests --- .../analyze-files-lammps/.lmps_out.log.swp | Bin 0 -> 16384 bytes ....d9427a82-789d-4789-9186-83e390455fee.json | 1 + .../data/analyze-files-lammps/1/bench.job | 25 +++ .../tests/data/analyze-files-lammps/1/bulk.in | 90 +++++++++ .../data/analyze-files-lammps/1/bulk.log | 178 ++++++++++++++++++ ....8e48f7fe-5a83-405c-9a4a-0364436ed090.json | 1 + .../data/analyze-files-lammps/2/bench.job | 25 +++ .../tests/data/analyze-files-lammps/2/bulk.in | 90 +++++++++ .../2018-10-21_114048.csv | 6 + ....3b64fda9-fdbe-4a94-b72e-2b97b787e1ab.json | 1 + .../data/analyze-files-lammps/3/bench.job | 25 +++ .../tests/data/analyze-files-lammps/3/bulk.in | 90 +++++++++ ....632d511b-03bb-4d1f-b462-d80fdf54d509.json | 1 + .../data/analyze-files-lammps/4/bench.job | 25 +++ .../tests/data/analyze-files-lammps/4/bulk.in | 90 +++++++++ ....3aebd58d-893c-4310-addc-60b9f1befa1b.json | 1 + .../data/analyze-files-lammps/5/bench.job | 25 +++ .../tests/data/analyze-files-lammps/5/bulk.in | 90 +++++++++ 18 files changed, 764 insertions(+) create mode 100644 mdbenchmark/tests/data/analyze-files-lammps/.lmps_out.log.swp create mode 100644 mdbenchmark/tests/data/analyze-files-lammps/1/Sim.d9427a82-789d-4789-9186-83e390455fee.json create mode 100644 mdbenchmark/tests/data/analyze-files-lammps/1/bench.job create mode 100644 mdbenchmark/tests/data/analyze-files-lammps/1/bulk.in create mode 100644 mdbenchmark/tests/data/analyze-files-lammps/1/bulk.log create mode 100644 mdbenchmark/tests/data/analyze-files-lammps/2/Sim.8e48f7fe-5a83-405c-9a4a-0364436ed090.json create mode 100644 mdbenchmark/tests/data/analyze-files-lammps/2/bench.job create mode 100644 mdbenchmark/tests/data/analyze-files-lammps/2/bulk.in create mode 100644 mdbenchmark/tests/data/analyze-files-lammps/2018-10-21_114048.csv create mode 100644 mdbenchmark/tests/data/analyze-files-lammps/3/Sim.3b64fda9-fdbe-4a94-b72e-2b97b787e1ab.json create mode 100644 mdbenchmark/tests/data/analyze-files-lammps/3/bench.job create mode 100644 mdbenchmark/tests/data/analyze-files-lammps/3/bulk.in create mode 100644 mdbenchmark/tests/data/analyze-files-lammps/4/Sim.632d511b-03bb-4d1f-b462-d80fdf54d509.json create mode 100644 mdbenchmark/tests/data/analyze-files-lammps/4/bench.job create mode 100644 mdbenchmark/tests/data/analyze-files-lammps/4/bulk.in create mode 100644 mdbenchmark/tests/data/analyze-files-lammps/5/Sim.3aebd58d-893c-4310-addc-60b9f1befa1b.json create mode 100644 mdbenchmark/tests/data/analyze-files-lammps/5/bench.job create mode 100644 mdbenchmark/tests/data/analyze-files-lammps/5/bulk.in diff --git a/mdbenchmark/tests/data/analyze-files-lammps/.lmps_out.log.swp b/mdbenchmark/tests/data/analyze-files-lammps/.lmps_out.log.swp new file mode 100644 index 0000000000000000000000000000000000000000..0155c5fe581f8d8d76ea0a84ee18e92bfa5e2986 GIT binary patch literal 16384 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 C9c}3V literal 0 HcmV?d00001 diff --git a/mdbenchmark/tests/data/analyze-files-lammps/1/Sim.d9427a82-789d-4789-9186-83e390455fee.json b/mdbenchmark/tests/data/analyze-files-lammps/1/Sim.d9427a82-789d-4789-9186-83e390455fee.json new file mode 100644 index 00000000..6986a04a --- /dev/null +++ b/mdbenchmark/tests/data/analyze-files-lammps/1/Sim.d9427a82-789d-4789-9186-83e390455fee.json @@ -0,0 +1 @@ +{"mdsynthesis": {}, "categories": {"module": "lammps/2016", "gpu": false, "nodes": 1, "host": "draco", "time": 15, "name": "bulk", "started": false}, "tags": []} \ No newline at end of file diff --git a/mdbenchmark/tests/data/analyze-files-lammps/1/bench.job b/mdbenchmark/tests/data/analyze-files-lammps/1/bench.job new file mode 100644 index 00000000..5ed7b7b8 --- /dev/null +++ b/mdbenchmark/tests/data/analyze-files-lammps/1/bench.job @@ -0,0 +1,25 @@ +#!/bin/bash -l +# Standard output and error: +#SBATCH -o ./bulk.out.%j +#SBATCH -e ./bulk.err.%j +# Initial working directory: +#SBATCH -D ./ +# Job Name: +#SBATCH -J bulk +# +# Queue (Partition): +#SBATCH --partition=express +# +# Number of nodes and MPI tasks per node: +#SBATCH --nodes=1 +#SBATCH --ntasks-per-node=32 +# Wall clock limit: +#SBATCH --time=00:20:00 + +module purge +module load impi +module load cuda +module load lammps/2016 + +# Run lammps/2016 for 15 minutes +srun lmp_mpi -v f tmp.out -l my.log -sc none -i in.alloy \ No newline at end of file diff --git a/mdbenchmark/tests/data/analyze-files-lammps/1/bulk.in b/mdbenchmark/tests/data/analyze-files-lammps/1/bulk.in new file mode 100644 index 00000000..0902db89 --- /dev/null +++ b/mdbenchmark/tests/data/analyze-files-lammps/1/bulk.in @@ -0,0 +1,90 @@ +# LAMMPS input script for standardized atomistic simulations +# Created by emc_setup.pl v2.2.12, July 28, 2017 as part of EMC +# on Mon Mar 5 16:29:28 CET 2018 + +# Variable definitions + +variable project index "bulk" # project name +variable source index . # data directory +variable params index . # parameter directory +variable temperature index 300 # system temperature +variable tdamp index 100.0 # temperature damping +variable dielectric index 1 # medium dielectric +variable kappa index 4 # electrostatics kappa +variable cutoff index 9.5 # standard cutoff +variable charge_cutoff index 9.5 # charge cutoff +variable precision index 0.001 # kspace precision +variable lseed index 723853 # langevin seed +variable vseed index 1486234 # velocity init seed +variable tequil index 1000 # equilibration time +variable trun index 5000 # run time +variable frestart index 0 # 0: equil, 1: restart +variable dtrestart index 100000 # delta restart time +variable dtdump index 100 # delta dump time +variable dtthermo index 1000 # delta thermo time +variable timestep index 1 # integration time step +variable tfreq index 10 # profile sampling freq +variable nsample index 1000 # profile conf sampling +variable dtime equal ${tfreq}*${nsample} # profile dtime +variable restart index ${params}/${project}.restart + +if "${frestart} != 0" then & +"variable data index ${restart}" & +else & +"variable data index ${params}/${project}.data" & + +# LAMMPS atomistic input script + +echo screen +units real +atom_style full + +# Interaction potential definition + +pair_style lj/class2/coul/long ${cutoff} ${charge_cutoff} +bond_style harmonic +special_bonds lj/coul 0 0 1 +if "${frestart} != 0" then "read_restart ${data}" else "read_data ${data}" +include ${params}/${project}.params + +# Integration conditions (check) + +timestep ${timestep} +kspace_style pppm/cg ${precision} +dielectric ${dielectric} +fix mom all momentum 100 linear 1 1 1 angular + +# Equilibration + +thermo ${dtthermo} +if "${frestart} != 0" then "jump SELF simulate" +velocity all create ${temperature} ${vseed} & + dist gaussian rot yes mom yes sum yes +fix temp all langevin ${temperature} ${temperature} ${tdamp} & + ${lseed} +fix int all nve/limit 0.1 +run ${tequil} +unfix temp +unfix int +write_restart ${project}.restart2 + +# Simulation + +label simulate +fix temp all langevin ${temperature} ${temperature} ${tdamp} & + ${lseed} +fix int all nve + +# System sampling: pressure + +fix press all ave/time ${tfreq} ${nsample} ${dtime} & + c_thermo_temp & + c_thermo_press[1] c_thermo_press[2] c_thermo_press[3] & + c_thermo_press[4] c_thermo_press[5] c_thermo_press[6] & + file ${project}.pressure + +# Run conditions + +restart ${dtrestart} ${project}.restart1 ${project}.restart2 +dump 1 all custom ${dtdump} ${project}.dump id type x y z +run ${trun} diff --git a/mdbenchmark/tests/data/analyze-files-lammps/1/bulk.log b/mdbenchmark/tests/data/analyze-files-lammps/1/bulk.log new file mode 100644 index 00000000..19a08442 --- /dev/null +++ b/mdbenchmark/tests/data/analyze-files-lammps/1/bulk.log @@ -0,0 +1,178 @@ +LAMMPS (11 Aug 2017) +# LAMMPS input script for standardized atomistic simulations +# Created by emc_setup.pl v2.2.12, July 28, 2017 as part of EMC +# on Mon Mar 5 16:29:28 CET 2018 + +# Variable definitions + +variable project index "bulk" # project name +variable source index . # data directory +variable params index . # parameter directory +variable temperature index 300 # system temperature +variable tdamp index 100.0 # temperature damping +variable dielectric index 1 # medium dielectric +variable kappa index 4 # electrostatics kappa +variable cutoff index 9.5 # standard cutoff +variable charge_cutoff index 9.5 # charge cutoff +variable precision index 0.001 # kspace precision +variable lseed index 723853 # langevin seed +variable vseed index 1486234 # velocity init seed +variable tequil index 1000 # equilibration time +variable trun index 5000 # run time +variable frestart index 0 # 0: equil, 1: restart +variable dtrestart index 100000 # delta restart time +variable dtdump index 100 # delta dump time +variable dtthermo index 1000 # delta thermo time +variable timestep index 1 # integration time step +variable tfreq index 10 # profile sampling freq +variable nsample index 1000 # profile conf sampling +variable dtime equal ${tfreq}*${nsample} # profile dtime +variable dtime equal 10*${nsample} +variable dtime equal 10*1000 +variable restart index ${params}/${project}.restart +variable restart index ./${project}.restart +variable restart index ./bulk.restart + +if "${frestart} != 0" then "variable data index ${restart}" else "variable data index ${params}/${project}.data" +variable data index ${params}/${project}.data +variable data index ./${project}.data +variable data index ./bulk.data +# LAMMPS atomistic input script + +echo screen + orthogonal box = (0 0 0) to (27.0666 27.0666 27.0666) + 1 by 1 by 1 MPI processor grid + reading atoms ... + 2006 atoms + scanning bonds ... + 4 = max bonds/atom + scanning angles ... + 6 = max angles/atom + scanning dihedrals ... + 12 = max dihedrals/atom + scanning impropers ... + 4 = max impropers/atom + reading bonds ... + 1586 bonds + reading angles ... + 1930 angles + reading dihedrals ... + 1698 dihedrals + reading impropers ... + 992 impropers + 4 = max # of 1-2 neighbors + 7 = max # of 1-3 neighbors + 11 = max # of special neighbors +PPPM initialization ... +WARNING: Using 12-bit tables for long-range coulomb (../kspace.cpp:321) + G vector (1/distance) = 0.219179 + grid = 8 8 8 + stencil order = 5 + estimated absolute RMS force accuracy = 0.23836 + estimated relative force accuracy = 0.000717814 + using double precision FFTs + 3d grid and FFT values/proc = 2197 512 +Neighbor list info ... + update every 1 steps, delay 10 steps, check yes + max neighbors/atom: 2000, page size: 100000 + master list distance cutoff = 11.5 + ghost atom cutoff = 11.5 + binsize = 5.75, bins = 5 5 5 + 1 neighbor lists, perpetual/occasional/extra = 1 0 0 + (1) pair lj/class2/coul/long, perpetual + attributes: half, newton on + pair build: half/bin/newton + stencil: half/bin/3d/newton + bin: standard + PPPM/cg optimization cutoff: 1e-05 + Total charged atoms: 100.0% + Min/max charged atoms/proc: 100.0% 100.0% +Per MPI rank memory allocation (min/avg/max) = 16.96 | 16.96 | 16.96 Mbytes +Step Temp E_pair E_mol TotEng Press + 0 300 -864.06711 348.92602 1277.8162 19231.608 + 1000 297.11138 -5903.2511 556.92948 -3570.6283 1271.6265 +Loop time of 22.7831 on 1 procs for 1000 steps with 2006 atoms + +Performance: 3.792 ns/day, 6.329 hours/ns, 43.892 timesteps/s +96.0% CPU use with 1 MPI tasks x no OpenMP threads + +MPI task timing breakdown: +Section | min time | avg time | max time |%varavg| %total +--------------------------------------------------------------- +Pair | 17.217 | 17.217 | 17.217 | 0.0 | 75.57 +Bond | 2.0891 | 2.0891 | 2.0891 | 0.0 | 9.17 +Kspace | 1.4043 | 1.4043 | 1.4043 | 0.0 | 6.16 +Neigh | 1.8156 | 1.8156 | 1.8156 | 0.0 | 7.97 +Comm | 0.11909 | 0.11909 | 0.11909 | 0.0 | 0.52 +Output | 3.1948e-05 | 3.1948e-05 | 3.1948e-05 | 0.0 | 0.00 +Modify | 0.11381 | 0.11381 | 0.11381 | 0.0 | 0.50 +Other | | 0.02458 | | | 0.11 + +Nlocal: 2006 ave 2006 max 2006 min +Histogram: 1 0 0 0 0 0 0 0 0 0 +Nghost: 10568 ave 10568 max 10568 min +Histogram: 1 0 0 0 0 0 0 0 0 0 +Neighs: 646166 ave 646166 max 646166 min +Histogram: 1 0 0 0 0 0 0 0 0 0 + +Total # of neighbors = 646166 +Ave neighs/atom = 322.117 +Ave special neighs/atom = 3.50548 +Neighbor list builds = 51 +Dangerous builds = 0 +PPPM initialization ... +WARNING: Using 12-bit tables for long-range coulomb (../kspace.cpp:321) + G vector (1/distance) = 0.219179 + grid = 8 8 8 + stencil order = 5 + estimated absolute RMS force accuracy = 0.23836 + estimated relative force accuracy = 0.000717814 + using double precision FFTs + 3d grid and FFT values/proc = 2197 512 +PPPM initialization ... +WARNING: Using 12-bit tables for long-range coulomb (../kspace.cpp:321) + G vector (1/distance) = 0.219179 + grid = 8 8 8 + stencil order = 5 + estimated absolute RMS force accuracy = 0.23836 + estimated relative force accuracy = 0.000717814 + using double precision FFTs + 3d grid and FFT values/proc = 2197 512 +Per MPI rank memory allocation (min/avg/max) = 18.29 | 18.29 | 18.29 Mbytes +Step Temp E_pair E_mol TotEng Press + 1000 297.11138 -5903.2511 556.92948 -3570.6283 1271.6265 + 2000 297.33518 -6022.6452 580.34683 -3665.2675 281.28799 + 3000 311.72752 -6012.5449 551.38014 -3598.1177 -166.33791 + 4000 297.91039 -6048.5889 516.69338 -3751.4269 -328.64059 + 5000 304.90559 -6068.1182 504.4505 -3741.3921 1154.0152 + 6000 303.58606 -6051.2181 468.16069 -3768.668 -123.65105 +Loop time of 115.611 on 1 procs for 5000 steps with 2006 atoms + +Performance: 3.737 ns/day, 6.423 hours/ns, 43.248 timesteps/s +94.3% CPU use with 1 MPI tasks x no OpenMP threads + +MPI task timing breakdown: +Section | min time | avg time | max time |%varavg| %total +--------------------------------------------------------------- +Pair | 88.161 | 88.161 | 88.161 | 0.0 | 76.26 +Bond | 10.751 | 10.751 | 10.751 | 0.0 | 9.30 +Kspace | 7.3221 | 7.3221 | 7.3221 | 0.0 | 6.33 +Neigh | 7.9037 | 7.9037 | 7.9037 | 0.0 | 6.84 +Comm | 0.58391 | 0.58391 | 0.58391 | 0.0 | 0.51 +Output | 0.2048 | 0.2048 | 0.2048 | 0.0 | 0.18 +Modify | 0.55618 | 0.55618 | 0.55618 | 0.0 | 0.48 +Other | | 0.129 | | | 0.11 + +Nlocal: 2006 ave 2006 max 2006 min +Histogram: 1 0 0 0 0 0 0 0 0 0 +Nghost: 10643 ave 10643 max 10643 min +Histogram: 1 0 0 0 0 0 0 0 0 0 +Neighs: 645376 ave 645376 max 645376 min +Histogram: 1 0 0 0 0 0 0 0 0 0 + +Total # of neighbors = 645376 +Ave neighs/atom = 321.723 +Ave special neighs/atom = 3.50548 +Neighbor list builds = 218 +Dangerous builds = 0 +Total wall time: 0:02:18 diff --git a/mdbenchmark/tests/data/analyze-files-lammps/2/Sim.8e48f7fe-5a83-405c-9a4a-0364436ed090.json b/mdbenchmark/tests/data/analyze-files-lammps/2/Sim.8e48f7fe-5a83-405c-9a4a-0364436ed090.json new file mode 100644 index 00000000..8131c5d1 --- /dev/null +++ b/mdbenchmark/tests/data/analyze-files-lammps/2/Sim.8e48f7fe-5a83-405c-9a4a-0364436ed090.json @@ -0,0 +1 @@ +{"mdsynthesis": {}, "categories": {"module": "lammps/2016", "gpu": false, "nodes": 2, "host": "draco", "time": 15, "name": "bulk", "started": false}, "tags": []} \ No newline at end of file diff --git a/mdbenchmark/tests/data/analyze-files-lammps/2/bench.job b/mdbenchmark/tests/data/analyze-files-lammps/2/bench.job new file mode 100644 index 00000000..41573018 --- /dev/null +++ b/mdbenchmark/tests/data/analyze-files-lammps/2/bench.job @@ -0,0 +1,25 @@ +#!/bin/bash -l +# Standard output and error: +#SBATCH -o ./bulk.out.%j +#SBATCH -e ./bulk.err.%j +# Initial working directory: +#SBATCH -D ./ +# Job Name: +#SBATCH -J bulk +# +# Queue (Partition): +#SBATCH --partition=express +# +# Number of nodes and MPI tasks per node: +#SBATCH --nodes=2 +#SBATCH --ntasks-per-node=32 +# Wall clock limit: +#SBATCH --time=00:20:00 + +module purge +module load impi +module load cuda +module load lammps/2016 + +# Run lammps/2016 for 15 minutes +srun lmp_mpi -v f tmp.out -l my.log -sc none -i in.alloy \ No newline at end of file diff --git a/mdbenchmark/tests/data/analyze-files-lammps/2/bulk.in b/mdbenchmark/tests/data/analyze-files-lammps/2/bulk.in new file mode 100644 index 00000000..0902db89 --- /dev/null +++ b/mdbenchmark/tests/data/analyze-files-lammps/2/bulk.in @@ -0,0 +1,90 @@ +# LAMMPS input script for standardized atomistic simulations +# Created by emc_setup.pl v2.2.12, July 28, 2017 as part of EMC +# on Mon Mar 5 16:29:28 CET 2018 + +# Variable definitions + +variable project index "bulk" # project name +variable source index . # data directory +variable params index . # parameter directory +variable temperature index 300 # system temperature +variable tdamp index 100.0 # temperature damping +variable dielectric index 1 # medium dielectric +variable kappa index 4 # electrostatics kappa +variable cutoff index 9.5 # standard cutoff +variable charge_cutoff index 9.5 # charge cutoff +variable precision index 0.001 # kspace precision +variable lseed index 723853 # langevin seed +variable vseed index 1486234 # velocity init seed +variable tequil index 1000 # equilibration time +variable trun index 5000 # run time +variable frestart index 0 # 0: equil, 1: restart +variable dtrestart index 100000 # delta restart time +variable dtdump index 100 # delta dump time +variable dtthermo index 1000 # delta thermo time +variable timestep index 1 # integration time step +variable tfreq index 10 # profile sampling freq +variable nsample index 1000 # profile conf sampling +variable dtime equal ${tfreq}*${nsample} # profile dtime +variable restart index ${params}/${project}.restart + +if "${frestart} != 0" then & +"variable data index ${restart}" & +else & +"variable data index ${params}/${project}.data" & + +# LAMMPS atomistic input script + +echo screen +units real +atom_style full + +# Interaction potential definition + +pair_style lj/class2/coul/long ${cutoff} ${charge_cutoff} +bond_style harmonic +special_bonds lj/coul 0 0 1 +if "${frestart} != 0" then "read_restart ${data}" else "read_data ${data}" +include ${params}/${project}.params + +# Integration conditions (check) + +timestep ${timestep} +kspace_style pppm/cg ${precision} +dielectric ${dielectric} +fix mom all momentum 100 linear 1 1 1 angular + +# Equilibration + +thermo ${dtthermo} +if "${frestart} != 0" then "jump SELF simulate" +velocity all create ${temperature} ${vseed} & + dist gaussian rot yes mom yes sum yes +fix temp all langevin ${temperature} ${temperature} ${tdamp} & + ${lseed} +fix int all nve/limit 0.1 +run ${tequil} +unfix temp +unfix int +write_restart ${project}.restart2 + +# Simulation + +label simulate +fix temp all langevin ${temperature} ${temperature} ${tdamp} & + ${lseed} +fix int all nve + +# System sampling: pressure + +fix press all ave/time ${tfreq} ${nsample} ${dtime} & + c_thermo_temp & + c_thermo_press[1] c_thermo_press[2] c_thermo_press[3] & + c_thermo_press[4] c_thermo_press[5] c_thermo_press[6] & + file ${project}.pressure + +# Run conditions + +restart ${dtrestart} ${project}.restart1 ${project}.restart2 +dump 1 all custom ${dtdump} ${project}.dump id type x y z +run ${trun} diff --git a/mdbenchmark/tests/data/analyze-files-lammps/2018-10-21_114048.csv b/mdbenchmark/tests/data/analyze-files-lammps/2018-10-21_114048.csv new file mode 100644 index 00000000..fd863c9f --- /dev/null +++ b/mdbenchmark/tests/data/analyze-files-lammps/2018-10-21_114048.csv @@ -0,0 +1,6 @@ +,module,nodes,ns/day,run time [min],gpu,host,ncores +0,lammps/2016,1,0.26371308016877637,15,False,draco,1 +1,lammps/2016,2,,15,False,draco, +2,lammps/2016,3,,15,False,draco, +3,lammps/2016,4,,15,False,draco, +4,lammps/2016,5,,15,False,draco, diff --git a/mdbenchmark/tests/data/analyze-files-lammps/3/Sim.3b64fda9-fdbe-4a94-b72e-2b97b787e1ab.json b/mdbenchmark/tests/data/analyze-files-lammps/3/Sim.3b64fda9-fdbe-4a94-b72e-2b97b787e1ab.json new file mode 100644 index 00000000..13e2fde4 --- /dev/null +++ b/mdbenchmark/tests/data/analyze-files-lammps/3/Sim.3b64fda9-fdbe-4a94-b72e-2b97b787e1ab.json @@ -0,0 +1 @@ +{"mdsynthesis": {}, "categories": {"module": "lammps/2016", "gpu": false, "nodes": 3, "host": "draco", "time": 15, "name": "bulk", "started": false}, "tags": []} \ No newline at end of file diff --git a/mdbenchmark/tests/data/analyze-files-lammps/3/bench.job b/mdbenchmark/tests/data/analyze-files-lammps/3/bench.job new file mode 100644 index 00000000..e5016f2c --- /dev/null +++ b/mdbenchmark/tests/data/analyze-files-lammps/3/bench.job @@ -0,0 +1,25 @@ +#!/bin/bash -l +# Standard output and error: +#SBATCH -o ./bulk.out.%j +#SBATCH -e ./bulk.err.%j +# Initial working directory: +#SBATCH -D ./ +# Job Name: +#SBATCH -J bulk +# +# Queue (Partition): +#SBATCH --partition=express +# +# Number of nodes and MPI tasks per node: +#SBATCH --nodes=3 +#SBATCH --ntasks-per-node=32 +# Wall clock limit: +#SBATCH --time=00:20:00 + +module purge +module load impi +module load cuda +module load lammps/2016 + +# Run lammps/2016 for 15 minutes +srun lmp_mpi -v f tmp.out -l my.log -sc none -i in.alloy \ No newline at end of file diff --git a/mdbenchmark/tests/data/analyze-files-lammps/3/bulk.in b/mdbenchmark/tests/data/analyze-files-lammps/3/bulk.in new file mode 100644 index 00000000..0902db89 --- /dev/null +++ b/mdbenchmark/tests/data/analyze-files-lammps/3/bulk.in @@ -0,0 +1,90 @@ +# LAMMPS input script for standardized atomistic simulations +# Created by emc_setup.pl v2.2.12, July 28, 2017 as part of EMC +# on Mon Mar 5 16:29:28 CET 2018 + +# Variable definitions + +variable project index "bulk" # project name +variable source index . # data directory +variable params index . # parameter directory +variable temperature index 300 # system temperature +variable tdamp index 100.0 # temperature damping +variable dielectric index 1 # medium dielectric +variable kappa index 4 # electrostatics kappa +variable cutoff index 9.5 # standard cutoff +variable charge_cutoff index 9.5 # charge cutoff +variable precision index 0.001 # kspace precision +variable lseed index 723853 # langevin seed +variable vseed index 1486234 # velocity init seed +variable tequil index 1000 # equilibration time +variable trun index 5000 # run time +variable frestart index 0 # 0: equil, 1: restart +variable dtrestart index 100000 # delta restart time +variable dtdump index 100 # delta dump time +variable dtthermo index 1000 # delta thermo time +variable timestep index 1 # integration time step +variable tfreq index 10 # profile sampling freq +variable nsample index 1000 # profile conf sampling +variable dtime equal ${tfreq}*${nsample} # profile dtime +variable restart index ${params}/${project}.restart + +if "${frestart} != 0" then & +"variable data index ${restart}" & +else & +"variable data index ${params}/${project}.data" & + +# LAMMPS atomistic input script + +echo screen +units real +atom_style full + +# Interaction potential definition + +pair_style lj/class2/coul/long ${cutoff} ${charge_cutoff} +bond_style harmonic +special_bonds lj/coul 0 0 1 +if "${frestart} != 0" then "read_restart ${data}" else "read_data ${data}" +include ${params}/${project}.params + +# Integration conditions (check) + +timestep ${timestep} +kspace_style pppm/cg ${precision} +dielectric ${dielectric} +fix mom all momentum 100 linear 1 1 1 angular + +# Equilibration + +thermo ${dtthermo} +if "${frestart} != 0" then "jump SELF simulate" +velocity all create ${temperature} ${vseed} & + dist gaussian rot yes mom yes sum yes +fix temp all langevin ${temperature} ${temperature} ${tdamp} & + ${lseed} +fix int all nve/limit 0.1 +run ${tequil} +unfix temp +unfix int +write_restart ${project}.restart2 + +# Simulation + +label simulate +fix temp all langevin ${temperature} ${temperature} ${tdamp} & + ${lseed} +fix int all nve + +# System sampling: pressure + +fix press all ave/time ${tfreq} ${nsample} ${dtime} & + c_thermo_temp & + c_thermo_press[1] c_thermo_press[2] c_thermo_press[3] & + c_thermo_press[4] c_thermo_press[5] c_thermo_press[6] & + file ${project}.pressure + +# Run conditions + +restart ${dtrestart} ${project}.restart1 ${project}.restart2 +dump 1 all custom ${dtdump} ${project}.dump id type x y z +run ${trun} diff --git a/mdbenchmark/tests/data/analyze-files-lammps/4/Sim.632d511b-03bb-4d1f-b462-d80fdf54d509.json b/mdbenchmark/tests/data/analyze-files-lammps/4/Sim.632d511b-03bb-4d1f-b462-d80fdf54d509.json new file mode 100644 index 00000000..4e5120c9 --- /dev/null +++ b/mdbenchmark/tests/data/analyze-files-lammps/4/Sim.632d511b-03bb-4d1f-b462-d80fdf54d509.json @@ -0,0 +1 @@ +{"mdsynthesis": {}, "categories": {"module": "lammps/2016", "gpu": false, "nodes": 4, "host": "draco", "time": 15, "name": "bulk", "started": false}, "tags": []} \ No newline at end of file diff --git a/mdbenchmark/tests/data/analyze-files-lammps/4/bench.job b/mdbenchmark/tests/data/analyze-files-lammps/4/bench.job new file mode 100644 index 00000000..fd6eda85 --- /dev/null +++ b/mdbenchmark/tests/data/analyze-files-lammps/4/bench.job @@ -0,0 +1,25 @@ +#!/bin/bash -l +# Standard output and error: +#SBATCH -o ./bulk.out.%j +#SBATCH -e ./bulk.err.%j +# Initial working directory: +#SBATCH -D ./ +# Job Name: +#SBATCH -J bulk +# +# Queue (Partition): +#SBATCH --partition=express +# +# Number of nodes and MPI tasks per node: +#SBATCH --nodes=4 +#SBATCH --ntasks-per-node=32 +# Wall clock limit: +#SBATCH --time=00:20:00 + +module purge +module load impi +module load cuda +module load lammps/2016 + +# Run lammps/2016 for 15 minutes +srun lmp_mpi -v f tmp.out -l my.log -sc none -i in.alloy \ No newline at end of file diff --git a/mdbenchmark/tests/data/analyze-files-lammps/4/bulk.in b/mdbenchmark/tests/data/analyze-files-lammps/4/bulk.in new file mode 100644 index 00000000..0902db89 --- /dev/null +++ b/mdbenchmark/tests/data/analyze-files-lammps/4/bulk.in @@ -0,0 +1,90 @@ +# LAMMPS input script for standardized atomistic simulations +# Created by emc_setup.pl v2.2.12, July 28, 2017 as part of EMC +# on Mon Mar 5 16:29:28 CET 2018 + +# Variable definitions + +variable project index "bulk" # project name +variable source index . # data directory +variable params index . # parameter directory +variable temperature index 300 # system temperature +variable tdamp index 100.0 # temperature damping +variable dielectric index 1 # medium dielectric +variable kappa index 4 # electrostatics kappa +variable cutoff index 9.5 # standard cutoff +variable charge_cutoff index 9.5 # charge cutoff +variable precision index 0.001 # kspace precision +variable lseed index 723853 # langevin seed +variable vseed index 1486234 # velocity init seed +variable tequil index 1000 # equilibration time +variable trun index 5000 # run time +variable frestart index 0 # 0: equil, 1: restart +variable dtrestart index 100000 # delta restart time +variable dtdump index 100 # delta dump time +variable dtthermo index 1000 # delta thermo time +variable timestep index 1 # integration time step +variable tfreq index 10 # profile sampling freq +variable nsample index 1000 # profile conf sampling +variable dtime equal ${tfreq}*${nsample} # profile dtime +variable restart index ${params}/${project}.restart + +if "${frestart} != 0" then & +"variable data index ${restart}" & +else & +"variable data index ${params}/${project}.data" & + +# LAMMPS atomistic input script + +echo screen +units real +atom_style full + +# Interaction potential definition + +pair_style lj/class2/coul/long ${cutoff} ${charge_cutoff} +bond_style harmonic +special_bonds lj/coul 0 0 1 +if "${frestart} != 0" then "read_restart ${data}" else "read_data ${data}" +include ${params}/${project}.params + +# Integration conditions (check) + +timestep ${timestep} +kspace_style pppm/cg ${precision} +dielectric ${dielectric} +fix mom all momentum 100 linear 1 1 1 angular + +# Equilibration + +thermo ${dtthermo} +if "${frestart} != 0" then "jump SELF simulate" +velocity all create ${temperature} ${vseed} & + dist gaussian rot yes mom yes sum yes +fix temp all langevin ${temperature} ${temperature} ${tdamp} & + ${lseed} +fix int all nve/limit 0.1 +run ${tequil} +unfix temp +unfix int +write_restart ${project}.restart2 + +# Simulation + +label simulate +fix temp all langevin ${temperature} ${temperature} ${tdamp} & + ${lseed} +fix int all nve + +# System sampling: pressure + +fix press all ave/time ${tfreq} ${nsample} ${dtime} & + c_thermo_temp & + c_thermo_press[1] c_thermo_press[2] c_thermo_press[3] & + c_thermo_press[4] c_thermo_press[5] c_thermo_press[6] & + file ${project}.pressure + +# Run conditions + +restart ${dtrestart} ${project}.restart1 ${project}.restart2 +dump 1 all custom ${dtdump} ${project}.dump id type x y z +run ${trun} diff --git a/mdbenchmark/tests/data/analyze-files-lammps/5/Sim.3aebd58d-893c-4310-addc-60b9f1befa1b.json b/mdbenchmark/tests/data/analyze-files-lammps/5/Sim.3aebd58d-893c-4310-addc-60b9f1befa1b.json new file mode 100644 index 00000000..8aa5aabe --- /dev/null +++ b/mdbenchmark/tests/data/analyze-files-lammps/5/Sim.3aebd58d-893c-4310-addc-60b9f1befa1b.json @@ -0,0 +1 @@ +{"mdsynthesis": {}, "categories": {"module": "lammps/2016", "gpu": false, "nodes": 5, "host": "draco", "time": 15, "name": "bulk", "started": false}, "tags": []} \ No newline at end of file diff --git a/mdbenchmark/tests/data/analyze-files-lammps/5/bench.job b/mdbenchmark/tests/data/analyze-files-lammps/5/bench.job new file mode 100644 index 00000000..0a8eff54 --- /dev/null +++ b/mdbenchmark/tests/data/analyze-files-lammps/5/bench.job @@ -0,0 +1,25 @@ +#!/bin/bash -l +# Standard output and error: +#SBATCH -o ./bulk.out.%j +#SBATCH -e ./bulk.err.%j +# Initial working directory: +#SBATCH -D ./ +# Job Name: +#SBATCH -J bulk +# +# Queue (Partition): +#SBATCH --partition=express +# +# Number of nodes and MPI tasks per node: +#SBATCH --nodes=5 +#SBATCH --ntasks-per-node=32 +# Wall clock limit: +#SBATCH --time=00:20:00 + +module purge +module load impi +module load cuda +module load lammps/2016 + +# Run lammps/2016 for 15 minutes +srun lmp_mpi -v f tmp.out -l my.log -sc none -i in.alloy \ No newline at end of file diff --git a/mdbenchmark/tests/data/analyze-files-lammps/5/bulk.in b/mdbenchmark/tests/data/analyze-files-lammps/5/bulk.in new file mode 100644 index 00000000..0902db89 --- /dev/null +++ b/mdbenchmark/tests/data/analyze-files-lammps/5/bulk.in @@ -0,0 +1,90 @@ +# LAMMPS input script for standardized atomistic simulations +# Created by emc_setup.pl v2.2.12, July 28, 2017 as part of EMC +# on Mon Mar 5 16:29:28 CET 2018 + +# Variable definitions + +variable project index "bulk" # project name +variable source index . # data directory +variable params index . # parameter directory +variable temperature index 300 # system temperature +variable tdamp index 100.0 # temperature damping +variable dielectric index 1 # medium dielectric +variable kappa index 4 # electrostatics kappa +variable cutoff index 9.5 # standard cutoff +variable charge_cutoff index 9.5 # charge cutoff +variable precision index 0.001 # kspace precision +variable lseed index 723853 # langevin seed +variable vseed index 1486234 # velocity init seed +variable tequil index 1000 # equilibration time +variable trun index 5000 # run time +variable frestart index 0 # 0: equil, 1: restart +variable dtrestart index 100000 # delta restart time +variable dtdump index 100 # delta dump time +variable dtthermo index 1000 # delta thermo time +variable timestep index 1 # integration time step +variable tfreq index 10 # profile sampling freq +variable nsample index 1000 # profile conf sampling +variable dtime equal ${tfreq}*${nsample} # profile dtime +variable restart index ${params}/${project}.restart + +if "${frestart} != 0" then & +"variable data index ${restart}" & +else & +"variable data index ${params}/${project}.data" & + +# LAMMPS atomistic input script + +echo screen +units real +atom_style full + +# Interaction potential definition + +pair_style lj/class2/coul/long ${cutoff} ${charge_cutoff} +bond_style harmonic +special_bonds lj/coul 0 0 1 +if "${frestart} != 0" then "read_restart ${data}" else "read_data ${data}" +include ${params}/${project}.params + +# Integration conditions (check) + +timestep ${timestep} +kspace_style pppm/cg ${precision} +dielectric ${dielectric} +fix mom all momentum 100 linear 1 1 1 angular + +# Equilibration + +thermo ${dtthermo} +if "${frestart} != 0" then "jump SELF simulate" +velocity all create ${temperature} ${vseed} & + dist gaussian rot yes mom yes sum yes +fix temp all langevin ${temperature} ${temperature} ${tdamp} & + ${lseed} +fix int all nve/limit 0.1 +run ${tequil} +unfix temp +unfix int +write_restart ${project}.restart2 + +# Simulation + +label simulate +fix temp all langevin ${temperature} ${temperature} ${tdamp} & + ${lseed} +fix int all nve + +# System sampling: pressure + +fix press all ave/time ${tfreq} ${nsample} ${dtime} & + c_thermo_temp & + c_thermo_press[1] c_thermo_press[2] c_thermo_press[3] & + c_thermo_press[4] c_thermo_press[5] c_thermo_press[6] & + file ${project}.pressure + +# Run conditions + +restart ${dtrestart} ${project}.restart1 ${project}.restart2 +dump 1 all custom ${dtdump} ${project}.dump id type x y z +run ${trun} From ae8b77344d9814663d28b7d53631013f192d657d Mon Sep 17 00:00:00 2001 From: Marc Siggel Date: Tue, 23 Oct 2018 09:48:16 +0200 Subject: [PATCH 3/4] added file checks --- mdbenchmark/mdengines/lammps.py | 6 +++++- mdbenchmark/mdengines/namd.py | 4 ++++ 2 files changed, 9 insertions(+), 1 deletion(-) diff --git a/mdbenchmark/mdengines/lammps.py b/mdbenchmark/mdengines/lammps.py index 21a5abb0..e82f5926 100644 --- a/mdbenchmark/mdengines/lammps.py +++ b/mdbenchmark/mdengines/lammps.py @@ -38,7 +38,9 @@ def prepare_benchmark(name, *args, **kwargs): full_filename = name name = name[:-3] - copyfile(full_filename, sim[full_filename].relpath) + input_file_list = glob("{}*".format(name)) + for fn in input_file_list: + copyfile(full_filename, sim[fn].relpath) return name @@ -79,5 +81,7 @@ def check_input_file_exists(name): "File {} does not exist, but is needed for LAMMPS benchmarks.", infile ) + input_files = glob("{}*".format(fn)) + console.info("The following files will be used to generate the benchmarks:\n {}", ", ".join(input_files)) return True diff --git a/mdbenchmark/mdengines/namd.py b/mdbenchmark/mdengines/namd.py index d369c125..70681b23 100644 --- a/mdbenchmark/mdengines/namd.py +++ b/mdbenchmark/mdengines/namd.py @@ -77,6 +77,7 @@ def analyze_namd_file(fh): def check_input_file_exists(name): """Check and append the correct file extensions for the NAMD module.""" # Check whether the needed files are there. + input_files = [] for extension in ["namd", "psf", "pdb"]: if name.endswith(".{}".format(extension)): name = name[: -2 + len(extension)] @@ -86,5 +87,8 @@ def check_input_file_exists(name): console.error( "File {} does not exist, but is needed for NAMD benchmarks.", fn ) + input_files.append(fn) + + console.info("The following files will be used to generate the benchmarks: {}", ", ".join(input_files)) return True From dbecd19d2bc11ec080419c6d40dbf44c8fc54622 Mon Sep 17 00:00:00 2001 From: Marc Siggel Date: Tue, 23 Oct 2018 10:51:27 +0200 Subject: [PATCH 4/4] updated lammps file checks --- mdbenchmark/mdengines/lammps.py | 23 ----------------------- 1 file changed, 23 deletions(-) diff --git a/mdbenchmark/mdengines/lammps.py b/mdbenchmark/mdengines/lammps.py index e82f5926..683e7aa7 100644 --- a/mdbenchmark/mdengines/lammps.py +++ b/mdbenchmark/mdengines/lammps.py @@ -45,29 +45,6 @@ def prepare_benchmark(name, *args, **kwargs): return name -def analyze_lammps_file(fh): - """ Check whether the LAMMPS config file has any relative imports or variables - """ - lines = fh.readlines() - - for line in lines: - # Continue if we do not need to do anything with the current line - if ( - ("parameters" not in line) - and ("coordinates" not in line) - and ("structure" not in line) - ): - continue - - path = line.split()[1] - if "$" in path: - console.error("Variable Substitutions are not allowed in NAMD files!") - if ".." in path: - console.error("Relative file paths are not allowed in NAMD files!") - if "/" not in path or ("/" in path and not path.startswith("/")): - console.error("No absolute path detected in NAMD file!") - - def check_input_file_exists(name): """Check and append the correct file extensions for the LAMMPS module.""" # Check whether the needed files are there.