-
Notifications
You must be signed in to change notification settings - Fork 17
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
initial implementation of lammps support #114
Open
MSiggel
wants to merge
5
commits into
develop
Choose a base branch
from
lammps
base: develop
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from all commits
Commits
Show all changes
5 commits
Select commit
Hold shift + click to select a range
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change | ||||
---|---|---|---|---|---|---|
@@ -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 | ||||||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Suggested change
|
||||||
# (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 <http://www.gnu.org/licenses/>. | ||||||
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 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Binary file not shown.
1 change: 1 addition & 0 deletions
1
mdbenchmark/tests/data/analyze-files-lammps/1/Sim.d9427a82-789d-4789-9186-83e390455fee.json
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
{"mdsynthesis": {}, "categories": {"module": "lammps/2016", "gpu": false, "nodes": 1, "host": "draco", "time": 15, "name": "bulk", "started": false}, "tags": []} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -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 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -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} |
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.