From d586a4bbbbe331369e83ce2b584144d63cb715fa Mon Sep 17 00:00:00 2001 From: sjplimp Date: Wed, 5 Nov 2014 16:35:50 +0000 Subject: [PATCH 1/4] git-svn-id: svn://svn.icms.temple.edu/lammps-ro/trunk@12678 f3b2605a-c512-4ea7-a41b-209d697bcdaa --- examples/COUPLE/simple/README | 9 ++-- src/GPU/pppm_gpu.cpp | 23 ++++++---- src/USER-INTEL/TEST/README | 67 ++++++++++++++++++++++++++++++ src/USER-INTEL/TEST/in.intel.lc | 61 +++++++++++++++++++++++++++ src/USER-INTEL/TEST/in.intel.rhodo | 39 +++++++++++++++++ 5 files changed, 187 insertions(+), 12 deletions(-) create mode 100644 src/USER-INTEL/TEST/README create mode 100644 src/USER-INTEL/TEST/in.intel.lc create mode 100644 src/USER-INTEL/TEST/in.intel.rhodo diff --git a/examples/COUPLE/simple/README b/examples/COUPLE/simple/README index b79c9f3fed..d40aaa6246 100644 --- a/examples/COUPLE/simple/README +++ b/examples/COUPLE/simple/README @@ -12,10 +12,11 @@ libfwrapper.c is the Fortran-to-C wrapper The 3 codes do the same thing, so you can compare them to see how to drive LAMMPS in this manner. The C driver is similar in spirit to what -one could use to write a scripting language interface. The Fortran -driver in addition requires a wrapper library that interfaces the C -interface of the LAMMPS library to Fortran and also translates the MPI -communicator from Fortran to C. +one could use to write a scripting language interface. See +python/examples/simple.py for an example of using Python as a wrapper +in that way. The Fortran driver in addition requires a wrapper +library that interfaces the C interface of the LAMMPS library to +Fortran and also translates the MPI communicator from Fortran to C. First, you must build LAMMPS as a library, either static or shared. See http://lammps.sandia.gov/doc/Section_start.html#start_5 for diff --git a/src/GPU/pppm_gpu.cpp b/src/GPU/pppm_gpu.cpp index c026dca445..d85af78649 100644 --- a/src/GPU/pppm_gpu.cpp +++ b/src/GPU/pppm_gpu.cpp @@ -206,13 +206,13 @@ void PPPMGPU::compute(int eflag, int vflag) else evflag = evflag_atom = eflag_global = vflag_global = eflag_atom = vflag_atom = 0; - // If need per-atom energies/virials, also do particle map on host - // concurrently with GPU calculations + // If need per-atom energies/virials, allocate per-atom arrays here + // so that particle map on host can be done concurrently with GPU calculations + if (evflag_atom && !peratom_allocate_flag) { allocate_peratom(); cg_peratom->ghost_notify(); cg_peratom->setup(); - peratom_allocate_flag = 1; } bool success = true; @@ -233,12 +233,19 @@ void PPPMGPU::compute(int eflag, int vflag) domain->x2lamda(atom->nlocal); } - // extend size of per-atom arrays if necessary + // If need per-atom energies/virials, also do particle map on host + // concurrently with GPU calculations + + if (evflag_atom) { + + // extend size of per-atom arrays if necessary + + if (atom->nlocal > nmax) { + memory->destroy(part2grid); + nmax = atom->nmax; + memory->create(part2grid,nmax,3,"pppm:part2grid"); + } - if (evflag_atom && atom->nlocal > nmax) { - memory->destroy(part2grid); - nmax = atom->nmax; - memory->create(part2grid,nmax,3,"pppm:part2grid"); particle_map(); } diff --git a/src/USER-INTEL/TEST/README b/src/USER-INTEL/TEST/README new file mode 100644 index 0000000000..62b8a58188 --- /dev/null +++ b/src/USER-INTEL/TEST/README @@ -0,0 +1,67 @@ +If you run in another directory, please edit the read_data line to point to +the data.rhodo file. This is included in the LAMMPS distribution in the +'bench' directory. + +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ +Expected times are the expected LOOP times based on runs using dual-socket +Intel Xeon processor E5-2697 V2 with Intel Xeon Phi coprocessor 7120P. +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ + + +TO RUN WITHOUT A PACKAGE: +----------------------------------------------------------------------------- +mpirun -np 48 ../../../src/lmp_YOUR_MACHINE -in in.intel.rhodo -log none -v b 0 -v s off +mpirun -np 48 ../../../src/lmp_YOUR_MACHINE -in in.intel.lc -log none -v b 0 -v s off + + +TO RUN WITH OMP PACKAGE +----------------------------------------------------------------------------- +env OMP_NUM_THREADS=2 mpirun -np 24 ../../../src/lmp_YOUR_MACHINE -in in.intel.rhodo -log none -v b 0 -v s omp ++++++++++++++++++++++++ ++ EXPECTED TIME: 20.33s ++++++++++++++++++++++++ + +env OMP_NUM_THREADS=1 mpirun -np 48 ../../../src/lmp_YOUR_MACHINE -in in.intel.lc -log none -v b 0 -v s omp ++++++++++++++++++++++++ ++ EXPECTED TIME: 19.92s ++++++++++++++++++++++++ + + +TO RUN WITH INTEL+OMP PACKAGE WITHOUT OFFLOAD: +----------------------------------------------------------------------------- +env OMP_NUM_THREADS=2 mpirun -np 24 ../../../src/lmp_YOUR_MACHINE -in in.intel.rhodo -log none -v b 0 -v s intel ++++++++++++++++++++++++ ++ EXPECTED TIME: 16.94s ++++++++++++++++++++++++ + +env OMP_NUM_THREADS=2 mpirun -np 24 ../../../src/lmp_YOUR_MACHINE -in in.intel.lc -log none -v b 0 -v s intel ++++++++++++++++++++++++ ++ EXPECTED TIME: 5.80s ++++++++++++++++++++++++ + + +TO RUN WITH INTEL+OMP PACKAGE WITH OFFLOAD TO XEON PHI (AUTO-BALANCED): +----------------------------------------------------------------------------- +env OMP_NUM_THREADS=1 mpirun -np 24 ../../../src/lmp_YOUR_MACHINE -in in.intel.rhodo -log none -v b -1 -v s intel ++++++++++++++++++++++++ ++ EXPECTED TIME: 12.31s ++++++++++++++++++++++++ + +env OMP_NUM_THREADS=1 mpirun -np 24 ../../../src/lmp_YOUR_MACHINE -in in.intel.lc -log none -v b -1 -v s intel ++++++++++++++++++++++++ ++ EXPECTED TIME: 4.00s ++++++++++++++++++++++++ + + +TO RUN WITH INTEL+OMP PACKAGE WITH OFFLOAD TO XEON PHI (FIXED BALANCE): +----------------------------------------------------------------------------- +env OMP_NUM_THREADS=1 mpirun -np 24 ../../../src/lmp_YOUR_MACHINE -in in.intel.rhodo -log none -v b 0.68 -v s intel ++++++++++++++++++++++++ ++ EXPECTED TIME: 11.40s ++++++++++++++++++++++++ + +env OMP_NUM_THREADS=1 mpirun -np 24 ../../../src/lmp_YOUR_MACHINE -in in.intel.lc -log none -v b 0.53 -v s intel ++++++++++++++++++++++++ ++ EXPECTED TIME: 3.93s ++++++++++++++++++++++++ + diff --git a/src/USER-INTEL/TEST/in.intel.lc b/src/USER-INTEL/TEST/in.intel.lc new file mode 100644 index 0000000000..646065f6f9 --- /dev/null +++ b/src/USER-INTEL/TEST/in.intel.lc @@ -0,0 +1,61 @@ +# Gay-Berne benchmark +# biaxial ellipsoid mesogens in isotropic phase +# shape: 2 1.5 1 +# cutoff 4.0 with skin 0.8 +# NPT, T=2.4, P=8.0 + +package intel 1 mode mixed balance $b +package omp 0 +suffix $s +processors * * * grid numa + +variable x index 4 +variable y index 2 +variable z index 2 + +variable i equal $x*32 +variable j equal $y*32 +variable k equal $z*32 + +units lj +atom_style ellipsoid + +# creation +lattice sc 0.22 +region box block 0 $i 0 $j 0 $k +create_box 1 box +create_atoms 1 box + +# read_data data.gb + +set type 1 mass 1.5 +set type 1 shape 1 1.5 2 +set group all quat/random 982381 + +compute rot all temp/asphere +group spheroid type 1 +variable dof equal count(spheroid)+3 +compute_modify rot extra ${dof} + +velocity all create 2.4 41787 loop geom + +pair_style gayberne 1.0 3.0 1.0 4.0 +pair_coeff 1 1 1.0 1.0 1.0 0.5 0.2 1.0 0.5 0.2 + +neighbor 0.8 bin + +timestep 0.002 +thermo 300 + +# equilibration run +fix 1 all npt/asphere temp 2.4 2.4 0.1 iso 5.0 8.0 0.1 +compute_modify 1_temp extra ${dof} +run 210 +thermo 100 + +reset_timestep 0 +unfix 1 +fix 1 all nve/asphere +run 10 +run 50 + diff --git a/src/USER-INTEL/TEST/in.intel.rhodo b/src/USER-INTEL/TEST/in.intel.rhodo new file mode 100644 index 0000000000..4b227b3d1e --- /dev/null +++ b/src/USER-INTEL/TEST/in.intel.rhodo @@ -0,0 +1,39 @@ +# Rhodopsin model + +package intel 1 mode mixed balance $b +package omp 0 +suffix $s + +variable x index 4 +variable y index 2 +variable z index 2 + +units real +neigh_modify delay 5 every 1 + +atom_style full +atom_modify map hash +bond_style harmonic +angle_style charmm +dihedral_style charmm +improper_style harmonic +pair_style lj/charmm/coul/long 8.0 10.0 +pair_modify mix arithmetic +kspace_style pppm 1e-4 + +read_data ../../../bench/data.rhodo + +replicate $x $y $z + +fix 1 all shake 0.0001 5 0 m 1.0 a 232 +fix 2 all npt temp 300.0 300.0 100.0 & + z 0.0 0.0 1000.0 mtk no pchain 0 tchain 1 + +special_bonds charmm + +thermo 50 +thermo_style multi +timestep 2.0 + +run 10 +run 100 From a5a013ed1a96e03017f1fa574df25765796e1933 Mon Sep 17 00:00:00 2001 From: sjplimp Date: Wed, 5 Nov 2014 16:36:11 +0000 Subject: [PATCH 2/4] git-svn-id: svn://svn.icms.temple.edu/lammps-ro/trunk@12679 f3b2605a-c512-4ea7-a41b-209d697bcdaa --- src/version.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/version.h b/src/version.h index b9da07334e..65016e33ba 100644 --- a/src/version.h +++ b/src/version.h @@ -1 +1 @@ -#define LAMMPS_VERSION "30 Oct 2014" +#define LAMMPS_VERSION "5 Nov 2014" From bd63d4b96766eca943bdae81c151fc0851cea242 Mon Sep 17 00:00:00 2001 From: sjplimp Date: Wed, 5 Nov 2014 16:36:12 +0000 Subject: [PATCH 3/4] git-svn-id: svn://svn.icms.temple.edu/lammps-ro/trunk@12680 f3b2605a-c512-4ea7-a41b-209d697bcdaa --- doc/Manual.html | 4 ++-- doc/Manual.txt | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/doc/Manual.html b/doc/Manual.html index 0b9017aaa7..e1dbf50a04 100644 --- a/doc/Manual.html +++ b/doc/Manual.html @@ -1,7 +1,7 @@ LAMMPS Users Manual - + @@ -22,7 +22,7 @@

LAMMPS Documentation

-

30 Oct 2014 version +

5 Nov 2014 version

Version info:

diff --git a/doc/Manual.txt b/doc/Manual.txt index cc0e1f5743..9790a92253 100644 --- a/doc/Manual.txt +++ b/doc/Manual.txt @@ -1,6 +1,6 @@ LAMMPS Users Manual - + @@ -18,7 +18,7 @@

LAMMPS Documentation :c,h3 -30 Oct 2014 version :c,h4 +5 Nov 2014 version :c,h4 Version info: :h4 From 79034a7dcfd916006539185a125accbc4bd23cef Mon Sep 17 00:00:00 2001 From: sjplimp Date: Wed, 5 Nov 2014 21:37:16 +0000 Subject: [PATCH 4/4] git-svn-id: svn://svn.icms.temple.edu/lammps-ro/trunk@12682 f3b2605a-c512-4ea7-a41b-209d697bcdaa --- examples/MC/README | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) diff --git a/examples/MC/README b/examples/MC/README index adbd13c420..7c38b65478 100644 --- a/examples/MC/README +++ b/examples/MC/README @@ -26,8 +26,5 @@ are printed. Dump file snapshots or images or a movie of the MC relaxation can be produced by uncommenting the appropriate dump lines in the script. -At some point, we will add a Python script to the python/examples -directory that performs the same operation as this script. It will -invoke LAMMPS as a library and use Python to implement the MC -accept/reject logic more cleanly than the LAMMPS input script can do -it. +See the Python script mc.py in python/examples for similar +functionality encoded in a script that invokes LAMMPS as a library.