diff --git a/mdbenchmark/generate.py b/mdbenchmark/generate.py index 61a72c78..806606c9 100644 --- a/mdbenchmark/generate.py +++ b/mdbenchmark/generate.py @@ -33,7 +33,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.""" @@ -222,9 +226,11 @@ def generate( # 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..683e7aa7 --- /dev/null +++ b/mdbenchmark/mdengines/lammps.py @@ -0,0 +1,64 @@ +# -*- 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] + + input_file_list = glob("{}*".format(name)) + for fn in input_file_list: + copyfile(full_filename, sim[fn].relpath) + + return name + + +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 + ) + + 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 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 %} 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 00000000..0155c5fe Binary files /dev/null and b/mdbenchmark/tests/data/analyze-files-lammps/.lmps_out.log.swp differ 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}