Compare commits

...

1686 Commits

Author SHA1 Message Date
b635465154 Merge pull request #3633 from akohlmey/next_patch_release
Update versions strings for the next patch release
2023-02-09 00:16:26 -05:00
2ee81bfe1e Merge pull request #3638 from akohlmey/collected-fixes
Final fixes for the next patch release
2023-02-08 23:08:16 -05:00
af231a1327 explicitly request parallel compilation with 2 parallel processes on Windows 2023-02-08 21:20:46 -05:00
04bed1a6e0 roll back changes for vec3_scale() and vec3_scaleadd() and use temporary vector 2023-02-08 20:32:47 -05:00
09099dd29f correct preprocessor logic for non-Linux machines 2023-02-08 16:45:16 -05:00
0ae72ce36d update for recent doc updates 2023-02-08 16:44:32 -05:00
d7d0bc12af cosmetic 2023-02-08 15:25:46 -05:00
f67d378230 update comment and architecture name 2023-02-08 14:45:50 -05:00
912f046cd7 recover compilation of tersoff kernels with CUDA 2023-02-08 11:16:46 -05:00
1882dc2e8c ensure local q pointer is initialized to NULL 2023-02-08 10:24:29 -05:00
30abe68c82 recover kernel failure for tersoff with mixed and single precision 2023-02-08 09:13:04 -05:00
3b4c873beb another OpenCL bugfix attempt from Trung 2023-02-07 17:31:43 -05:00
d170f83c6d add experimental Ada CUDA architecture support for conventional make builds. 2023-02-07 13:31:55 -05:00
324a5aa727 Merge remote-tracking branch 'github/develop' into collected-fixes 2023-02-07 10:38:40 -05:00
bde2867251 Make Kokkos configuration compatible with RTX40x0 generation consumer GPUs
@stanmoore1 is this the correct way add this?
2023-02-07 08:40:04 -05:00
b9981ac51e update list of KOKKOS supported architectures for Kokkos 3.7.1 2023-02-07 07:18:40 -05:00
d63d918dc5 correct logic 2023-02-06 23:59:24 -05:00
f4974f1518 add download fallback handling 2023-02-06 23:59:15 -05:00
acf7f9184d fix failing unit tests with OpenCL 2023-02-06 18:40:59 -05:00
2dad11b36d Merge pull request #3635 from akohlmey/grammar-review
Review grammar in Developer guide and Howto pages
2023-02-06 14:48:11 -05:00
b501d4226a Merge branch 'develop' of github.com:srtee/lammps into collected-fixes 2023-02-06 14:45:52 -05:00
fb0af756eb Merge branch 'patch-1' of github.com:srtee/lammps into collected-fixes 2023-02-06 14:45:32 -05:00
9c2fe48a7b Update Howto_mdi.rst 2023-02-06 10:55:18 -07:00
83831ca222 Update variable.cpp
I remembered that I forgot to remove these commented printf() calls.
2023-02-06 10:23:22 -07:00
cd093d94b9 add versionadded tag to "maxtry" option 2023-02-06 11:12:02 -05:00
955004afc5 Align fix_controller.cpp with documentation
Documentation for `fix controller` says that the first calculation of error contributes to the integral term (in equation 2, at $n = 1$). Either the code should be changed to reflect this, or the documentation should be changed to reflect what the code currently does (i.e. start from $n = 2$ in the finite-difference integral term).
2023-02-06 15:42:41 +10:00
fb5c0a4c87 Correct typos and clarify fix_controller.rst
Fixes some typos and adds math expression c_0 for the initial control variable value; removes the "E-hat" term from equations (which doesn't appear elsewhere in the support doc or the source code)
2023-02-06 15:34:58 +10:00
3955bc8bfe revise a chunk of Howto pages with the help of languagetool.org 2023-02-05 18:09:36 -05:00
0885edc154 re-enable new neighbor lists with CUDA 12.0 and later 2023-02-05 03:02:19 -05:00
d1550bf9f6 starting grammar, punctuation, and spelling review for developer info sections 2023-02-04 22:00:35 -05:00
5ace12e3ef nullify freed pointers in list of dump data 2023-02-03 20:35:47 -05:00
6707ab6182 avoid illegal memory access in destructor after variables have been deleted 2023-02-03 20:23:41 -05:00
a0a7e76cc3 Merge pull request #3623 from ndtrung81/kokkos-dipole-lj-expand
Adding the kokkos variants for lj/cut/dipole/cut and lj/expand/coul/long
2023-02-03 13:52:47 -05:00
e28ff8a8aa Fix bug in full logic 2023-02-03 09:59:24 -07:00
9520be6aae update versions strings for the next feature release 2023-02-03 11:39:50 -05:00
afdc500379 Small tweaks 2023-02-03 09:27:15 -07:00
1f9aaa345f Add logic for full list 2023-02-03 09:21:30 -07:00
7fbb6095c6 Merge pull request #3614 from evoyiatzis/master
Extending the C library and the python interface
2023-02-03 11:02:40 -05:00
0823117ec5 Corrected per-atom energy and stress tally, removed the redundant kernel in lj/cut/dipole/cut/kk 2023-02-03 09:57:17 -06:00
8994633dab fix broken link 2023-02-02 23:25:57 -05:00
c8f0ca4556 Merge pull request #3631 from stanmoore1/kk_overlap
Disable Kokkos GPU <--> CPU overlap when using pair hybrid with non-K…
2023-02-02 22:23:04 -05:00
f717debbd4 use same main() function as with c-library interface. 2023-02-02 21:16:20 -05:00
8a0e9f6018 add tests for gathering angles, dihedrals, impropers from fortran 2023-02-02 20:58:47 -05:00
5797ba5bcf convert Fortran version of lammps_gather_bonds() test to be similar to C version 2023-02-02 19:10:51 -05:00
914b40f4bf LJ forces must be scaled with factor_lj 2023-02-02 17:30:32 -05:00
a91ae836a9 Fix Kokkos GPU bug in pair_mliap_kokkos 2023-02-02 14:35:35 -07:00
44ff363169 Removed the class member variable mu in the AtomVecDipoleKokkos that shadows the parent's variable mu, now as protected 2023-02-02 15:31:10 -06:00
96e94c74da Merge branch 'develop' of https://github.com/lammps/lammps into kk_overlap 2023-02-02 13:34:28 -07:00
72da6007d2 Another tweak 2023-02-02 13:32:56 -07:00
ea9f5abc4a Tweak logic for CPU 2023-02-02 13:23:59 -07:00
5cf1bbff7c Merge branch 'develop' 2023-02-02 15:07:05 -05:00
180dcf4459 add missing index entries 2023-02-02 15:06:22 -05:00
dd0398b7f2 Merge branch 'develop' into kokkos-dipole-lj-expand 2023-02-02 14:49:53 -05:00
11871ceb2e Merge pull request #3620 from akohlmey/collected-small-fixes
Collected small changes and fixes
2023-02-02 14:37:39 -05:00
a70efd9a1b Small cleanup 2023-02-02 12:19:55 -07:00
9b7e4478b3 Update docs 2023-02-02 12:00:42 -07:00
d7d6cb2328 Add new files to Kokkos Install.sh 2023-02-02 11:52:23 -07:00
e19f873f49 Added the missing source files for AtomVecDipoleKokkos 2023-02-02 12:31:21 -06:00
ffdca466e9 Merge branch 'develop' of https://github.com/lammps/lammps into kokkos-dipole-lj-expand 2023-02-02 11:10:56 -07:00
c9b23b8a03 Remove this-> 2023-02-02 10:25:31 -07:00
3d3bd0d7f2 Merge branch 'develop' into collected-small-fixes 2023-02-02 02:40:50 -05:00
c0c5c34290 Disable Kokkos GPU <--> CPU overlap when using pair hybrid with non-Kokkos styles 2023-02-01 16:13:09 -07:00
b8b5e385b6 Merge pull request #3630 from akohlmey/download-fallback
Fallback URLs for downloading external libraries
2023-02-01 14:40:13 -05:00
89b37c51df implement download fallback for traditional make build 2023-02-01 06:47:25 -05:00
7172d1bdd1 correct syntax error 2023-02-01 03:53:32 -05:00
6ed526c95b Merge branch 'develop' 2023-02-01 03:42:34 -05:00
dade985558 skip tests for lepton pair styles with INTEL package 2023-01-31 23:17:50 -05:00
6776c4215d add support for building a static lammps-shell executable with Linux/MUSL 2023-01-31 22:24:02 -05:00
957f98ddb7 Merge branch 'develop' into collected-small-fixes 2023-01-31 20:42:05 -05:00
454c77e874 Merge pull request #3621 from lammps/small_bugfixes
Small bugfixes for KOKKOS
2023-01-31 20:20:05 -05:00
0e4f917847 Merge pull request #3629 from yury-lysogorskiy/bugfix/kokkos-gpu-compilation
BUGFIX: update ML_PACE library version
2023-01-31 18:59:24 -05:00
5d16bea899 implement download fallback URLs pointing to download.lammps.org for CMake 2023-01-31 16:35:06 -05:00
83b578f604 BUGFIX: update ML_PACE library version (that fix compilation issue with nvcc)
extra update doc/src/pair_pace.rst
2023-01-31 21:08:32 +01:00
6b44d93eac port triclinic region vs box check from fix gcmc to fix widom 2023-01-31 09:08:58 -05:00
daf23068df update n2p2 lib version for traditional make, too. 2023-01-31 07:40:13 -05:00
e5d921585b cosmetic/whitespace 2023-01-31 06:49:21 -05:00
6bf5fc734e revert MD5 hash to current value after GitHub reversed its change 2023-01-31 06:40:15 -05:00
e5615f2579 Fix bug in ReaxFF with pair hybrid 2023-01-30 17:20:23 -07:00
0870bc3046 Allow neighbor class to set newton flag in Kokkos neigh list 2023-01-30 16:14:39 -07:00
0d8ba92b4d update N2P2 library to version 2.2.0 2023-01-30 14:44:20 -05:00
b54cdc48e2 whitespace 2023-01-30 12:34:29 -07:00
a74e57cfc1 Revert 69e7dd9 2023-01-30 12:31:27 -07:00
a92a3ec50b Try again to fix memory leak 2023-01-30 12:27:54 -07:00
5c5bc2026d compare region extent with box bounds for triclinic 2023-01-30 12:17:55 -05:00
5a89c69285 Merge branch 'patch-1' of github.com:RemiLacroix-IDRIS/lammps into collected-small-fixes 2023-01-30 08:10:34 -05:00
b115229dd2 Fix QUIP compilation with Intel compilers. 2023-01-30 13:30:34 +01:00
41e834d27f pair style gauss *does* support pair_modify shift 2023-01-30 06:12:45 -05:00
4637072a26 simplify 2023-01-30 00:08:51 -05:00
2a18c76361 preparations for unit tests of the Fortran module 2023-01-30 00:06:30 -05:00
f653ad7990 add unit tests for c-library interface 2023-01-29 14:13:28 -05:00
370c701f89 whitespace 2023-01-29 13:42:36 -05:00
f0578bbf63 Merge branch 'develop' 2023-01-29 13:27:54 -05:00
9c46f4dd39 Updated doc pages 2023-01-28 11:22:45 -06:00
7b0153eee6 Added lj/cut/dipole/cut/kk and lj/expand/coul/long/kk, added AtomVecKokkos, enabled FixNVESphereKokkos to update dipole 2023-01-28 00:34:55 -06:00
2e52afbd86 consistently skip over computing interactions with atoms set to NULL in hybrid styles 2023-01-27 22:12:33 -05:00
66e3d8c564 recover failing unit tests 2023-01-27 21:48:31 -05:00
373b578dc0 this is already checked for in Input class due to setting one_coeff = 1 2023-01-27 21:39:26 -05:00
7e6333fdd1 remove dead code 2023-01-27 20:48:32 -05:00
03c8b0ff89 use correct type for memset byte and avoid potential memory leaks 2023-01-27 20:42:37 -05:00
e0f090aa9e Fix invalid memory read, from @akohlmey 2023-01-27 14:43:16 -07:00
0677c1c3f5 Fix logic for neigh/trim yes and multiple runs 2023-01-27 14:29:00 -07:00
69e7dd9fd6 Change default for pair_modify neigh/trim 2023-01-27 14:28:40 -07:00
a31af4f46e Fix compile for OPENMP, remove unused var 2023-01-27 12:28:21 -07:00
b954c3ef86 Fix memory leak in pair_lj_cut_kokkos 2023-01-27 11:29:02 -07:00
db22961d49 Fix memory leak in Kokkos ReaxFF 2023-01-27 11:28:41 -07:00
b6f98244dc Fix out of bounds access in pair_vashishta_kokkos with skip list 2023-01-27 11:28:17 -07:00
4f0245d542 make Kokkos lib compatible with musl-libc
Note: this was adapted from https://github.com/kokkos/kokkos/pull/5678
to be usable without requiring C++17
2023-01-27 12:21:13 -05:00
34e8a74989 apply changes suggested by clang-tidy 2023-01-27 11:49:43 -05:00
d31595a36c fixing unit tests in python-scatter-gather.py 2023-01-27 15:27:13 +02:00
755766220c Include tests for gather_angles, gather_dihedrals & gather_impropers in python-scatter-gather.py 2023-01-27 10:28:28 +02:00
10ab0ffe19 Include tests for gather_angles, gather_dihedrals & gather_impropers in python-numpy.py 2023-01-27 09:59:28 +02:00
e7ea5e8bf5 enable and (mostly) apply clang-format 2023-01-26 22:02:12 -05:00
3756520078 Merge branch 'develop' into collected-small-fixes 2023-01-26 21:48:42 -05:00
4cb29ce413 Merge pull request #3608 from rohskopf/msmeam-adr
Multi-state MEAM with Kokkos support
2023-01-26 21:47:46 -05:00
3bcb59b284 Minor typo in docs 2023-01-26 18:24:39 -07:00
3be1dd0488 update PIMD examples 2023-01-26 18:48:30 -05:00
ba0d24d028 must initialize "np" in constructor 2023-01-26 18:33:48 -05:00
7f810ff59c update PIMD example1 2023-01-26 18:27:58 -05:00
f145e855ec initialized pointer 2023-01-26 18:07:56 -05:00
2f8ba9dd32 cleanup 2023-01-26 15:47:22 -07:00
6c8aec1ff4 whitespace 2023-01-26 15:35:08 -07:00
3a418290be Merge branch 'develop' into collected-small-fixes 2023-01-26 17:33:08 -05:00
f99853fab8 Update example with new syntax 2023-01-26 15:30:12 -07:00
b7dfa3db05 Whack extra files from #3532 2023-01-26 15:12:34 -07:00
866cf8ae60 Merge branch 'develop' of https://github.com/lammps/lammps into msmeam-adr 2023-01-26 15:10:30 -07:00
a7b357b951 Rename example 2023-01-26 15:10:01 -07:00
3e334fe10c Remove 'this->' in device code 2023-01-26 15:03:20 -07:00
1ded632010 Add new files to Kokkos Install.sh 2023-01-26 15:02:52 -07:00
b6a9e47494 update false positives 2023-01-26 16:22:40 -05:00
b48d483fd6 Merge branch 'develop' into msmeam-adr
# Conflicts:
#	src/MEAM/pair_meam.cpp
2023-01-26 15:46:34 -05:00
4d27b5480d Merge pull request #3612 from yotamfe/develop
Fix PIMD: bugfix in spring energy, and adding virial estimator
2023-01-26 15:42:28 -05:00
18171af1ea add a unit test for MS-MEAM 2023-01-26 15:28:34 -05:00
b7f2c3feda convert "ms" pair style flag for MEAM into meam/ms pair style 2023-01-26 15:23:31 -05:00
30f459da92 Merge pull request #3606 from bathmatt/kokkos-mliap-unified
Add MLIAP-KOKKOS version of the Unified model/descriptor
2023-01-26 13:57:42 -05:00
3713185b37 must use fmt::format() for universe errors. 2023-01-26 12:05:51 -05:00
210ec9d164 reformat 2023-01-26 11:59:20 -05:00
b905f6a239 Merge branch 'develop' into yotamfe/develop 2023-01-26 11:47:32 -05:00
49b639acd0 Changed author 2023-01-26 17:01:15 +01:00
469c4e8c7a Whitespace 2023-01-26 08:57:33 -07:00
83fc0f16f5 rephrasings for output information 2023-01-26 17:10:45 +02:00
07566abc8f Replacing arbitrary LAMMPS version with TBD in numpy_wrapper.py 2023-01-26 16:50:05 +02:00
14e9bb0033 Replacing arbitrary LAMMPS version with TBD in core.py 2023-01-26 16:48:49 +02:00
047e4eeebc Auxiliary test methods for angles, dihedrals and impropers in python-numpy 2023-01-26 16:41:47 +02:00
f7ee47f47f Auxiliary test methods for angles, dihedrals and impropers 2023-01-26 16:33:57 +02:00
fca553d1c2 document the Fortran module calls 2023-01-26 15:58:00 +02:00
15316f8e5e add documentation for the vector values fix_pimd returns, and the rest of the restart, modify etc. section 2023-01-26 15:57:47 +02:00
5d941da4e9 check if variable value is a valid number before converting it 2023-01-26 07:10:20 -05:00
915544e76d add Fortran wrappers to fortran/lammps.f90 2023-01-26 12:22:08 +02:00
d2539f45ae add doxygen style comments to document the new C library functions added 2023-01-26 11:40:58 +02:00
e4b2fd318f Update Library_scatter.rst 2023-01-26 11:00:26 +02:00
094be08e64 bugfix in testing of fix_pimd input variables. fmass should be between 0 and np, not 1. check for sp mistakenly was testing fmass again. 2023-01-26 10:04:25 +02:00
19dab05b45 Update liblammpsplugin.c 2023-01-26 09:35:10 +02:00
3714abec24 Update liblammpsplugin.h 2023-01-26 09:34:01 +02:00
2620726c96 Update lammps.i 2023-01-26 09:27:13 +02:00
f7725242fa Merge pull request #3615 from stanmoore1/kk_small_fixes
Small bugfixes for Kokkos
2023-01-25 18:18:47 -05:00
d88a4a768d Style changes 2023-01-25 14:52:02 -07:00
2fdf0ae3b3 Add this 2023-01-25 14:11:49 -07:00
f58aeecec0 Use bin neighbor list with Kokkos 2023-01-25 14:05:55 -07:00
16225acd05 Use group for Kokkos nvt temp compute 2023-01-25 14:01:21 -07:00
34a5123e29 Kokkos fix out-of-bounds access 2023-01-25 13:56:52 -07:00
624c95b164 Merge pull request #3617 from lammps/gpu-amoeba-cmake
Only added amoeba_convolution_gpu.* to the list of GPU source files w…
2023-01-25 15:35:18 -05:00
91ef7c22fa reindent 2023-01-25 15:29:13 -05:00
16354d0262 fix out-of-bounds access 2023-01-25 15:28:22 -05:00
7e5e5c1b6f Only added amoeba_convolution_gpu.* to the list of GPU source files when PKG_AMOEBA is on 2023-01-25 13:30:29 -06:00
171b182d42 Small tweaks 2023-01-25 11:51:35 -07:00
5bd7b95e60 Merge pull request #3613 from lammps/gpu-neigh-macos
Attempted to allow GPU acceleration on MacOS with neighbor builds on …
2023-01-25 13:34:52 -05:00
e048aed1b4 Small bugfixes for Kokkos 2023-01-25 11:28:16 -07:00
8e9d0e7fca Merge pull request #3610 from akohlmey/cmake-enable-pkg-deps
Auto-enable packages with CMake if needed
2023-01-25 13:26:36 -05:00
83f6b6aa40 Merge pull request #3603 from jrgissing/reaxff-species-delete-rate
reaxff/species delete rate limit
2023-01-25 13:25:34 -05:00
67a0c4e1a2 Merge pull request #3599 from lammps/amoeba-gpu
Adding support for the AMOEBA and HIPPO pair styles to the GPU package
2023-01-25 13:11:39 -05:00
fae750391d Update core.py 2023-01-25 19:53:41 +02:00
d5121bf2ee Update numpy_wrapper.py 2023-01-25 19:50:31 +02:00
954dbacf82 Update library.cpp 2023-01-25 19:48:23 +02:00
4af5ce3f96 Update library.h 2023-01-25 19:46:18 +02:00
6fefd8821a Attempted to allow GPU acceleration on MacOS with neighbor builds on the device by enforcing the old neighbor list code path (will revisit) 2023-01-25 10:42:55 -06:00
c6ff688c18 Merge branch 'lammps:develop' into develop 2023-01-25 16:00:10 +02:00
0204f942d2 support for reporting the virial estimator for the kinetic energy of the quantum system in PIMD. Based on f6f8aa346b 2023-01-25 15:15:58 +02:00
fcea881d3e programming style 2023-01-25 06:16:48 -05:00
c87b4c5887 must initialize msmeamflag 2023-01-25 06:16:36 -05:00
93b96f7cbf Merge branch 'develop' into reaxff-species-delete-rate 2023-01-25 05:31:04 -05:00
722e583b59 use available introspection API to get accumulator data type. update name of flag. 2023-01-25 05:22:49 -05:00
e068b14969 make consistent and simplify 2023-01-25 02:56:05 -05:00
c29012e85d fix segfault from accessing float array as double. use introspection to detect 2023-01-25 02:35:10 -05:00
adf43d7fee Fixed the issues with some OpenCL implementation to avoid errors casting changing the pointer address spaces 2023-01-25 00:02:25 -06:00
b206b4d1f6 Fixed bugs with hippo/gpu for single- and mixed- precisions 2023-01-24 23:55:30 -06:00
4c996eed3b auto-enabling prerequisite packages with CMake 2023-01-24 23:22:55 -05:00
c744be7060 forcibly disable COMPRESS package is zlib is not found 2023-01-24 23:18:04 -05:00
862c7180bb Enclose create/destroy in msmeam conditional 2023-01-24 21:11:33 -07:00
1e78254000 Merge pull request #3598 from stanmoore1/kk_atomvec
Fix some issues with Kokkos hybrid `atom_vec`
2023-01-24 23:04:06 -05:00
6c63d7dcb9 single precision FFTs are now supported on the CPU 2023-01-24 22:54:47 -05:00
8786819993 use FFT_SCALAR more consistently to perhaps support single precision FFT some time
also, use "override" instead of virtual and add a forgotten virtual
2023-01-24 22:32:40 -05:00
b17689af6b doc fixes 2023-01-24 21:28:08 -05:00
dec3afe595 make synchronization for timers optional. only enable with "timer sync" 2023-01-24 21:15:37 -05:00
40c8fcb03a disallow using single precision FFTs with AMOEBA package 2023-01-24 21:05:36 -05:00
64b5ad8966 Merge branch 'develop' into amoeba-gpu 2023-01-24 20:22:59 -05:00
aaa918cbe7 Fixed bugs with access mode on the host side of thetai[1-3] 2023-01-24 17:05:48 -06:00
647172bfe1 Clean up 2023-01-24 14:56:27 -07:00
d0a614b1fe Remove unnecessary conditional 2023-01-24 14:53:00 -07:00
9560fe2dd1 Fix logic for Kokkos hybrid atomvec 2023-01-24 14:15:58 -07:00
7f2e34ff57 Merge branch 'develop' of https://github.com/lammps/lammps into kk_atomvec 2023-01-24 14:15:44 -07:00
ab83b31ce2 Document changes 2023-01-24 13:05:47 -07:00
8f554a3b1c Clean up 2023-01-24 12:30:18 -07:00
f1ae427ee0 Format and organize pair MEAM 2023-01-24 12:04:47 -07:00
de32abeace Merge with Kokkos updates 2023-01-24 11:21:58 -07:00
f3f8613437 Debug final stage of dens setup 2023-01-24 11:21:04 -07:00
533af97d8e Format and clean Kokkos MEAM 2023-01-24 11:02:14 -07:00
79d8b98ab7 A correct calculation of the spring energy sould contain a prefactor (the spring contant) that transforms units of area to units of energy.
Also, we have replaced dx,dy,dz with delx2,dely2,delz3.
2023-01-24 16:41:43 +02:00
5014e04341 Removed commented out code, ensured that ic_kspace is not nullptr when call precompute_kspace for hippo/gpu 2023-01-24 08:40:08 -06:00
a82b028b72 Finish porting MS-MEAM to Kokkos; obtain agreement in forces and energies 2023-01-23 19:43:31 -07:00
554257ca63 Merge pull request #3607 from akohlmey/no-inn-sewer-ants
Getting out of the insurance business :-)
2023-01-23 21:02:53 -05:00
8b897e1fed fix spelling errors 2023-01-23 17:46:33 -05:00
917151f695 Update fix_reaxff_species.cpp 2023-01-23 17:30:42 -05:00
70012131b6 Update dihedral_table.cpp
Tweaked grammar and comment style
2023-01-23 15:11:09 -07:00
1812cf6264 Begin kokkos implementation up to calc_rho1 function 2023-01-23 15:10:59 -07:00
1e9d6def77 Update Developer_grid.rst
Fixed butchered sentence.
2023-01-23 14:58:00 -07:00
27da716852 getting out of the insurance business :-) 2023-01-23 16:45:41 -05:00
6148ee7ba4 Merge pull request #3604 from lammps/collected-small-changes
Collected small changes and fixes
2023-01-23 14:12:22 -05:00
0e1e8161ef Developed MLIAP-KOKKOS version of the Unified model/descriptor 2023-01-23 18:01:26 +01:00
379c88b5af Merge branch 'develop' into collected-small-changes 2023-01-23 11:52:06 -05:00
c367f37e56 Merge pull request #3605 from akohlmey/remove-mesont-fortran
Remove Fortran library and corresponding styles from MESONT package
2023-01-23 11:50:34 -05:00
39f776ae86 some more languagtool.org suggested updates 2023-01-23 05:15:34 -05:00
8e79e2efa5 More cleanup, fixed bugs with hippo fphi kernels for mixed precision 2023-01-23 00:18:42 -06:00
11d0449fec make compatible to non-glibc Linux 2023-01-22 18:25:32 -05:00
658328dd9d Added a note in the amoeba doc page on the not-yet resolved issue with integrated GPUs, removed commented out and debugging stuffs in the AM/HP kernels 2023-01-22 17:24:15 -06:00
c06470ca33 more revisions based on suggestions from languagetool.org 2023-01-22 16:53:39 -05:00
f65f79ef82 revise based on suggestions from languagetool.org 2023-01-22 09:50:27 -05:00
57349b042e one more pass at revising the introductory pages of the LAMMPS manual 2023-01-21 16:23:23 -05:00
af8c091ed5 add image to the cover page of the PDF version of the manual 2023-01-21 15:58:10 -05:00
ebe234d4e2 turn off automatic potential download for github actions 2023-01-21 11:33:33 -05:00
c42926feb0 add CMake option to skip automatic download of large potential files 2023-01-21 11:22:54 -05:00
8537ccb840 add CMake option to skip automatic download of large potential files 2023-01-21 11:22:29 -05:00
6f3c8fc48e add CMake option to skip automatic download of large potential files 2023-01-21 11:21:02 -05:00
a95f6d7aa0 update header 2023-01-21 11:19:04 -05:00
7eab385bb3 add CMake option to skip automatic download of large potential files 2023-01-21 11:18:51 -05:00
671b2b80fc fix typo 2023-01-21 07:59:09 -05:00
650caa356f update atom style tester for removed Atom class members 2023-01-21 05:28:14 -05:00
d5a8674c00 avoid creating __pycache__ folders outside of the docenv tree 2023-01-21 05:02:09 -05:00
682bb7c391 fix cut-n-paste error 2023-01-21 05:00:56 -05:00
ac09c5c7c9 add MESONT package to the "yes-most" selection for traditional make build 2023-01-21 04:35:49 -05:00
49b354bb6a small update for Installation overview 2023-01-21 04:24:04 -05:00
c3b1c661a8 small tweaks to the "breadcrumbs" part of the theme to avoid double inserting a separation character 2023-01-21 04:18:24 -05:00
3f34f54847 add page about portability 2023-01-20 23:40:41 -05:00
03b532db4a add false positive 2023-01-20 22:53:29 -05:00
ca1a8eb933 clarify, mention versionadd/changed markers 2023-01-20 22:50:39 -05:00
aab02da72d remove obsolete links, links to point back to the manual, updates 2023-01-20 22:50:18 -05:00
29689d6902 some more updates for LAMMPS features 2023-01-20 22:49:44 -05:00
e2773ea3d2 some updates 2023-01-20 22:48:36 -05:00
a6667f1b2c Minor tweaks to potentials 2023-01-20 18:45:19 -07:00
7ce59e775a Minor tweaks to potentials 2023-01-20 18:43:36 -07:00
3911f1e3ec Resolved merge conflict 2023-01-20 18:01:47 -07:00
cf033780cc add false positive 2023-01-20 19:15:20 -05:00
694b1b5748 remove Fortran library based MESONT styles and the library itself 2023-01-20 19:12:42 -05:00
02ab9bc67c add deprecation handler for removed/renamed minimizer styles 2023-01-20 19:05:50 -05:00
fd48702797 update some overview doc pages 2023-01-20 19:05:13 -05:00
4d545b3539 remove Fortran library and the styles based on it from MESONT package 2023-01-20 18:29:54 -05:00
ef692258b4 Merge pull request #3532 from stanmoore1/kk_occupancy
Update Kokkos version in LAMMPS to 3.7.1
2023-01-20 17:52:05 -05:00
f6ded5a7d7 reduce unnecessary communication 2023-01-20 17:36:46 -05:00
375fad6d2a parallel version 2023-01-20 17:13:56 -05:00
846f00ce32 add citation 2023-01-20 16:58:19 -05:00
ff709f5897 'include' for std::shuffle 2023-01-20 16:29:16 -05:00
3430ffbe5a Merge branch 'msmeam-adr' of https://github.com/rohskopf/lammps into msmeam-adr 2023-01-20 13:58:37 -07:00
617d70dd1c Replaced MPI_Wtime() with platform::walltime(), put the low-level timing breakdown inside #if DEBUG_AMOEBA 2023-01-20 14:19:16 -06:00
dfe3436e9c Merge pull request #3602 from akohlmey/collected-small-changes
Collected small changes and fixes
2023-01-20 15:03:46 -05:00
bb2553b079 Set comm size outside constructor 2023-01-20 13:02:50 -07:00
6477b19702 Backport kokkos 4dab4e0 from @weinbe2 2023-01-20 11:12:09 -07:00
4ee8cd8bf5 fix broken Lepton library compilation for traditional make build system 2023-01-20 12:13:31 -05:00
7ff98c6374 add one case to code maintainers list 2023-01-20 11:45:38 -05:00
996b542ea1 remove '.' 2023-01-20 10:37:09 -05:00
936ef7f92a Backport more Kokkos changes 2023-01-20 07:40:52 -07:00
13d4344999 Merge branch 'develop' of github.com:lammps/lammps into kk_occupancy 2023-01-20 07:32:46 -07:00
3e032c6b73 remove unused private class members 2023-01-20 07:04:37 -05:00
bebf79ec92 reaxff species delete_rate_limit keyword docs 2023-01-20 00:41:56 -05:00
096e0a14f0 off-by-one fix 2023-01-20 00:38:06 -05:00
bdf8dd4e54 serial version 2023-01-20 00:32:31 -05:00
827d0218db avoid that print_mode is uninitialized when called from TAD calculation 2023-01-19 23:56:10 -05:00
973190fef6 Merge remote-tracking branch 'upstream/develop' into msmeam-adr 2023-01-19 19:26:49 -07:00
3eb22313ed Default nvcc wrapper 2023-01-19 19:26:42 -07:00
cf8414d2e4 cannot test PYTHON package if it is not installed 2023-01-19 21:00:54 -05:00
31024f4b0e swap constexpr back to const 2023-01-19 18:16:14 -05:00
819ab9f2ff portability improvements for Solaris/OpenIndiana 2023-01-19 17:36:02 -05:00
8eb722a32a Enforced synchronous host-device transfers for cgrid_brick and fdip arrays 2023-01-19 13:22:27 -06:00
03ab42fd52 correct calling sequence for matching argument types 2023-01-19 08:57:24 -05:00
4244d2e6cd silence compiler warnings about unused parameters and variables 2023-01-19 08:56:54 -05:00
3ae2805316 add option variable to CMake build to select GPU library debug 2023-01-19 07:06:29 -05:00
75bd5b3d99 update podstruct initializer lists with SNAP default parameters 2023-01-18 22:56:43 -05:00
eddd3d6f25 Fixed a bug with extra being nullptr when _host_view is true: always allocate extra
(Note that BaseAmoeba has its own cast_extra_data() that doesn't know if extra is allocated properly, it is the case when _host_view is false for dedicated GPUs for example)
2023-01-18 20:04:45 -06:00
8f2c3cfda9 improve error messages for group command and more unit tests 2023-01-18 16:06:02 -05:00
62d5ffd5c9 add versionadded not to fix reaxff/species delete keyword 2023-01-18 16:06:01 -05:00
79cadef4ba Re-running CMake is now automatic for almost anybody. 2023-01-18 16:06:01 -05:00
7cf9b30943 Confirm agreement with old meam example 2023-01-17 21:27:21 -07:00
f98a2357fd Merge remote-tracking branch 'upstream/develop' into msmeam-adr 2023-01-17 21:18:58 -07:00
ff9ccc96bf Clean up 2023-01-17 21:11:07 -07:00
d14f070bef Fix segfault with normal meam 2023-01-17 20:46:54 -07:00
f86375c992 Attempted to ensure that extra gets allocated in the exactly same way as other added fields (charge, quat and vel) 2023-01-17 09:47:09 -06:00
71931d1d44 Cleaned up, and added missing zero timers for extra fields transfers 2023-01-17 09:39:03 -06:00
b59ee8d16c silence compiler warnings 2023-01-17 03:54:49 -05:00
28fbc2631b Fixed another bug with ic_kspace being nullptr 2023-01-16 22:33:21 -06:00
9ab7f792e1 Fixed nullptr bug in the mutual fft timer 2023-01-16 22:29:04 -06:00
0fd665c6f3 reformat 2023-01-16 21:39:07 -05:00
9ee9508365 Merge branch 'develop' of github.com:srtee/lammps into collected-small-changes 2023-01-16 21:37:32 -05:00
e8be2dfba8 Merge branch 'develop' into collected-small-changes 2023-01-16 21:37:24 -05:00
f8cbc777ce minor typo and rewording 2023-01-17 11:04:34 +10:00
3871918916 Store first, not last AtomVec created for hybrid 2023-01-16 17:53:47 -07:00
0a5f97c327 Merge pull request #3596 from tomswinburne/energy_spacing_neb
NEB routine to target equal energy difference between knots
2023-01-16 14:20:43 -05:00
b3e45c29ca Removed whitespaces 2023-01-16 10:30:03 -06:00
973b46a907 Attempted to resolve the memory access runtime errors when acquiring single and mixed precision arrays from the GPU lib 2023-01-16 10:12:42 -06:00
665b877063 Update msmeam example and clean up code 2023-01-16 07:37:32 -07:00
503c51c070 whitespace 2023-01-16 08:37:52 -05:00
a8d0f94a5a small clean up 2023-01-16 14:21:31 +01:00
07da78dfe8 Documentation update after suggestions of @athomps 2023-01-16 14:12:52 +01:00
9dc0369cee Attempted to resolve the address space change issue when casting for OpenCL 2.0 (ref: https://www.intel.com/content/www/us/en/developer/articles/technical/the-generic-address-space-in-opencl-20.html#06_address_space_casting) 2023-01-15 23:28:48 -06:00
62c010a7de add note to insert LAMMPS version when GPU acceleration was added 2023-01-15 18:11:33 -05:00
6ce7ea2f4b remove obsolete commands 2023-01-15 17:43:15 -05:00
88e1ce3379 flag GPU acceleration 2023-01-15 17:42:16 -05:00
637e12cd01 correct sphinx command 2023-01-15 17:41:27 -05:00
c9ae41246d Ran the four make commands in the src folder: make fix-whitespace; make fix-homepage; make fix-errordocs; make fix-permissions 2023-01-15 16:05:36 -06:00
d5b878d047 Updated the doc page of amoeba/hippo styles to indicate that their gpu versions are supported 2023-01-15 15:56:40 -06:00
67574601ed Cleaned up commented-out and debugging stuffs, removed irrelevant changes to lj/cut/dipole/cut, reverted unwanted changes in the PPPMGPU destructor, fixed unresolved conflicts in tinker.py, updated the userbinsize==0 case in atom.cpp and using Force::pair_match() as suggested. Internal timing stuffs need work. 2023-01-15 15:41:54 -06:00
a09540eb55 update embedded docs 2023-01-15 10:57:00 -05:00
c21f2faa1f Cleaned up debug statements and unused sections in the amoeba and hippo gpu styles 2023-01-14 20:02:36 -06:00
03e48f2658 Fixed memory leak in hippo/gpu 2023-01-14 19:51:42 -06:00
212da7f109 Merge branch 'develop' into amoeba-gpu 2023-01-14 18:36:26 -06:00
e1a8a70a6c replace individual *verbose* / *terse* keywords with *verbosity* setting 2023-01-14 07:06:26 -05:00
102934565e Merge branch 'develop' into energy_spacing_neb 2023-01-14 06:57:48 -05:00
24fec6bdbd Merge pull request #3592 from akohlmey/collected-small-changes
Collected small changes and fixes for the next patch release
2023-01-14 00:44:48 -05:00
c415385ab4 Merge pull request #3594 from akohlmey/abc-fire-alternative
Alternative implementation of ABC-FIRE
2023-01-13 21:28:25 -05:00
e522ddaf99 Set nmax for Kokkos hybrid atom_vec 2023-01-13 17:12:27 -07:00
b4d6f37c10 Fix some issues with Kokkos hybrid atom_vec 2023-01-13 16:33:44 -07:00
acb59c8b74 Merge pull request #3597 from lammps/dump-grid-dimension
Add ITEM: DIMENSION to dump grid output
2023-01-13 17:42:35 -05:00
882f155d94 whitespace 2023-01-13 14:51:40 -05:00
50cc866081 sync with stable branch 2023-01-13 14:47:51 -05:00
651e95654c more details on dump snapshot header values 2023-01-13 12:34:05 -07:00
652a8804e2 enable and apply clang-format 2023-01-13 12:31:47 -05:00
9169d88090 add ITEM: DIMENSION to dump grid src/doc 2023-01-13 09:42:11 -07:00
8e138161af add more thorough checks on Fortran and MPI support for Fortran.
also works around issue with GNU Fortran 12 and later
2023-01-13 11:02:24 -05:00
a1f5d8420a compile test for coupling to the LAMMPS library via fortran, check if it runs 2023-01-13 06:26:06 -05:00
aa2d2509d8 plug memory leaks in coupling examples 2023-01-13 05:40:28 -05:00
b03e9609ce synchronize API with library.h, zero struct on allocation, determine exception support at runtime. 2023-01-13 05:30:49 -05:00
59a9161435 add bugfix for plugin wrapper of library interface from Stan 2023-01-13 03:54:22 -05:00
a155ef8695 add MEAM example to fire minimizer examples 2023-01-12 23:26:30 -05:00
b97a0c62e4 whitespace 2023-01-12 23:00:52 -05:00
f27c7a9135 rework neb docs to use .. math:: and :math: in sphinx 2023-01-12 22:58:16 -05:00
03838f06f8 Zero arrays in dens setup to prevent forces from growing each timestep 2023-01-12 19:28:10 -07:00
7ac611b671 enable and apply clang-format 2023-01-12 18:51:45 -05:00
a6234ab3be move enum to .cpp file and away from header 2023-01-12 18:50:34 -05:00
692bdaea37 reorder 2023-01-12 18:28:01 -05:00
c8f380ffbb small changes- still not compiling on Windows... 2023-01-12 21:24:40 +01:00
bdf6cdd327 found two or -> || 2023-01-12 18:34:54 +01:00
b7db402c2d post-axel updates 2023-01-12 18:30:15 +01:00
a68fca43e5 make error message consistent with name of executable 2023-01-12 12:09:59 -05:00
5a8d191a4a Correct force rho and arho parameters; need to fix get_densref function 2023-01-12 09:26:19 -07:00
e3afc99c3a Merge branch 'lammps:develop' into energy_spacing_neb 2023-01-12 13:50:35 +01:00
8d42212f38 remove bogus tags 2023-01-12 05:33:51 -05:00
34e54dbfc9 grammar 2023-01-11 22:30:06 -05:00
27961907ad small doc tweaks 2023-01-11 21:23:57 -05:00
00908fef17 gather Kokkos device/arch settings and print in summary 2023-01-11 18:14:58 -05:00
0104824727 remove min style fire/old 2023-01-11 07:33:16 -05:00
ee77055e49 make consistent 2023-01-11 06:46:02 -05:00
91cfe90aa3 add missing tracking of updated file lists from globbing in the LEPTON package 2023-01-11 01:09:54 -05:00
5dd8a33abe improve error message 2023-01-10 21:07:45 -05:00
d5e29864ab Allocate meam arrays and fully implement force calculation 2023-01-10 15:14:14 -07:00
f5a8a0c398 update examples. add abcfire variants 2023-01-10 16:28:18 -05:00
8800adf1cd fully integrate ABC-FIRE and make it a min_modify option 2023-01-10 16:20:00 -05:00
f42fa9c565 remove references to long obsolete .d dependency files 2023-01-10 12:32:01 -05:00
58097b2e5f fold abcfire code into MinFire class 2023-01-09 20:49:57 -05:00
49792fd984 improve error checking and error messages when a pair style was use multiple times 2023-01-09 19:55:43 -05:00
b3396f109b Merge pull request #3589 from akohlmey/collected-small-fixes
Collected small fixes and changes
2023-01-09 19:07:03 -05:00
f3b14bc39c Merge pull request #3576 from ndtrung81/dielectric-updates
Updates to the DIELECTRIC package
2023-01-09 16:25:24 -05:00
f88bfbb6af use enumerators for symbolic constants to flag integrator and linesearch styles
also a small update to error, warning, and info output
2023-01-09 13:32:04 -05:00
d907baac83 sync docs with fire minimizer code features 2023-01-09 13:30:29 -05:00
36fbf05ac0 Merge pull request #3590 from akohlmey/lepton-zbl
Add a custom zbl() function to lepton pair styles
2023-01-09 11:30:38 -05:00
0d815a09a7 add unit test for custom zbl() function 2023-01-09 07:20:44 -05:00
8e2f2922d6 throw exception in case an unexpected derivative is requested 2023-01-09 07:16:16 -05:00
f34fd96185 Fixed typos in compute efield/atom and bug with set charge for atom_style dieletric 2023-01-09 00:26:30 -06:00
954f6ed1f3 fix double word 2023-01-08 15:51:22 -05:00
52b84c9776 use_qscaled must be initialized in the constructor 2023-01-08 14:07:46 -05:00
4ab1ce5d7d consistently use Kokkos:: namespace prefix when calling deep_copy() 2023-01-08 11:07:47 -05:00
caa7940b34 fix typo 2023-01-08 11:03:32 -05:00
f832a7ed46 Merge branch 'develop' into dielectric-updates 2023-01-08 10:52:30 -05:00
32a6b70b01 whitespace 2023-01-08 10:52:23 -05:00
5e837d23cc make sure member pointer is initialized and apply clang-format 2023-01-08 04:43:43 -05:00
3e06512418 plug small memory leak 2023-01-08 04:43:14 -05:00
6c914a7e37 add support for a custom zbl() function to lepton pair styles 2023-01-08 01:26:41 -05:00
d75e417a32 modernize error message creation 2023-01-07 16:39:28 -05:00
334643b300 avoid sprintf() 2023-01-07 16:13:27 -05:00
79820945f6 correct computation of number of packages for unit test 2023-01-07 15:55:04 -05:00
d572d8f051 avoid sprintf() through C++ features and libfmt 2023-01-07 15:47:46 -05:00
1556460b8f silence bogus warning about atom IDs with dump image/movie 2023-01-07 15:18:29 -05:00
141a6208a9 avoid sprintf 2023-01-07 07:45:11 -05:00
fb3180eae8 silence compiler warning 2023-01-07 07:18:25 -05:00
fc10c9d354 MESONT package needs explicit dependencies because mesocnt bond depends on harmonic 2023-01-06 22:18:50 -05:00
d4e2200c8c restore building of simple bundled libraries 2023-01-06 22:18:50 -05:00
f1471725e9 allow to always build the C++-only parts of the MESONT package 2023-01-06 22:18:50 -05:00
3036f8d4c6 Conditionally support the CONFIGURE_DEPENDS flag for globbing of CMake 3.12 and later.
# Conflicts:
#	cmake/Modules/Packages/COLVARS.cmake
2023-01-06 22:18:50 -05:00
a7ba11fee9 mliappy fixes for kokkos support 2023-01-06 22:18:49 -05:00
6a8df032b6 Merge pull request #3582 from athomps/sllod_variants
Implement sllod variants
2023-01-06 21:55:10 -05:00
be5cede69f Merge pull request #3551 from akohlmey/compute-efield-atom-wolf
Add new compute efield/wolf/atom command
2023-01-06 20:29:38 -05:00
aee93dbe69 Merge pull request #3571 from akohlmey/lepton-package
LEPTON package using the Lepton library to compute forces from expression strings
2023-01-06 18:41:18 -05:00
fbbe66c8bd Merge branch 'develop' into lepton-package 2023-01-06 17:53:23 -05:00
b419a98f0f Identify segfault with arho params 2023-01-06 15:49:09 -07:00
a218071b2b Merge pull request #3574 from akohlmey/collected-small-changes
Collected small changes and fixes
2023-01-06 16:24:19 -05:00
b2226f9c70 Merge pull request #3588 from srtee/electrode-intel
simplified intel suffix styles in ELECTRODE
2023-01-06 15:33:00 -05:00
e815bea894 Setup global function with msmeam parameters 2023-01-06 13:16:21 -07:00
7fd9086c65 whitespace 2023-01-06 14:44:18 -05:00
f007eaf946 Merge branch 'develop' into collected-small-changes 2023-01-06 14:41:22 -05:00
f28b0e491c Optionally read msmeam parameters 2023-01-06 12:37:38 -07:00
9a8455f546 Merge pull request #3577 from bathmatt/kokkos-mliap-pytorch
Have PyTorch interface for MLIAP working in Kokkos.  This uses cuPy a…
2023-01-06 14:24:10 -05:00
80ea94ae24 Envelope msmeam calculations in conditional 2023-01-06 11:10:52 -07:00
ddc8ed8c2d Merge branch 'develop' into collected-small-changes
# Conflicts:
#	src/dump.cpp
2023-01-06 13:09:22 -05:00
f6d8df5706 add unit tests for lepton/coul 2023-01-06 13:07:55 -05:00
3878cfa9b0 Merge pull request #3587 from akohlmey/collected-fixes
Collected fixes subset of pull request #3574
2023-01-06 12:57:19 -05:00
ce1e997de0 do now write out per-type pair cutoff with kspace enabled 2023-01-06 12:12:13 -05:00
af72a957f8 reorder lines, so syntax highlighting does not get messed up 2023-01-06 10:07:05 -05:00
909bbcfdbd a few more tweaks for consistency 2023-01-06 09:03:00 -05:00
92df9f1c71 update docs 2023-01-06 08:43:44 -05:00
523821d83e add extract() function to pair style lepton/coul for kspace compatibility 2023-01-06 08:43:10 -05:00
8813a65fe8 make use of charges in Lepton expressions optional 2023-01-06 08:01:26 -05:00
bf63cccda4 implement pair style lepton/coul and lepton/coul/omp 2023-01-06 07:27:28 -05:00
e460c3b6d5 improve error messages 2023-01-06 01:08:15 -05:00
da9e117e47 remove bogus comment 2023-01-06 01:05:39 -05:00
3f496905d6 Merge branch 'develop' into lepton-package 2023-01-06 00:44:28 -05:00
69169031ba spelling 2023-01-06 00:00:24 -05:00
289d319a6c drop a few more command prompt characters 2023-01-06 00:00:14 -05:00
8dc7a37ba0 register KOKKOS acceleration for pair style 2023-01-05 23:59:32 -05:00
84b8f3caa0 remove bogus "extract" data from angle style amoeba test 2023-01-05 23:43:19 -05:00
01d9033e2d Merge branch 'develop' into collected-small-changes 2023-01-05 23:36:45 -05:00
8beb718b37 require a minimum of 2 values for writing tables 2023-01-05 23:28:20 -05:00
66fff95455 add unit tests for fix deform and fix nvt with options 2023-01-05 23:01:52 -05:00
2ee523bcfd update unit tests for bugfix in dihedral style table 2023-01-05 23:01:45 -05:00
a3d8cca25b add unit test for the extract method of angle styles 2023-01-05 23:01:09 -05:00
32347792ad follow the usual convention and call dihedral angle phi 2023-01-05 23:00:33 -05:00
6ccdc8df4f include force function in angle table example to show the need for correct unit conversion (force is energy per radian squared) 2023-01-05 23:00:27 -05:00
e05104a45e fix copy-n-paste issue 2023-01-05 22:59:29 -05:00
cd54c41276 programming style 2023-01-05 22:58:16 -05:00
8d9a4d86ba flag member functions without side effect as const 2023-01-05 22:56:30 -05:00
f2e3b22222 make created tables better suitable for human consumption 2023-01-05 22:56:08 -05:00
0df140876c fix subtle bug in stress tally for dihedral style table 2023-01-05 22:54:27 -05:00
e82eb9ecc4 remove some legacy code and update for more recent code changes 2023-01-05 22:53:42 -05:00
ee48231bd6 improve error messages 2023-01-05 22:52:51 -05:00
e48e5ad965 update suffix handling to be consistent (also with pending fix pair changes) 2023-01-05 22:51:49 -05:00
73300b080b rephrase as requested by @sjplimp 2023-01-05 22:47:50 -05:00
3e053adfbe Print warning about unsorted custom dumps without atom IDs. Explain in manual. 2023-01-05 22:44:32 -05:00
56cb967991 enforce consisten eigenvector signs for ML-POD parameter coefficients
This also updates the bundled coeffs file and reference outputs.
2023-01-05 22:43:53 -05:00
ef10719476 add logic to rerun command to trigger dumps on expected steps or time 2023-01-05 22:43:40 -05:00
3bf527d070 Merge pull request #3579 from akohlmey/linalg-in-cpp
Convert linalg library from Fortran to C++
2023-01-05 21:16:06 -05:00
843cc98531 Merge pull request #3569 from jrgissing/type-labels-bond/react-examples
Type labels for bond/react examples
2023-01-05 19:22:43 -05:00
821b34de78 Merge pull request #3585 from yury-lysogorskiy/feature/pace-extrapolation-kokkos
Feature/pace extrapolation kokkos
2023-01-05 19:15:49 -05:00
9a0fd9d237 clarifications and documentation additions 2023-01-05 17:47:47 -05:00
e40ef346fe Merge pull request #3573 from akohlmey/angle-write
Implement angle_write and dihedral_write commands
2023-01-05 17:32:38 -05:00
12b930b0a6 updated string 2023-01-05 17:13:21 +01:00
c8a33aefd4 add versionadded tag 2023-01-05 08:49:35 -05:00
67c50e4d4f call macOS consistently macOS 2023-01-05 08:33:08 -05:00
6104b2241f add note about how to add OpenMP support to Xcode on macOS 2023-01-05 08:32:30 -05:00
3df61dac6f Build of the manual now uses venv instead of virtualenv which is bundled with python 3
macOS now includes python3
2023-01-05 08:32:08 -05:00
e7ab2bc97d add logic to rerun command to trigger dumps on expected steps or time 2023-01-05 04:06:11 -05:00
c3fb5257ae cleaned up parsing 2023-01-05 07:37:58 +01:00
8cfb6680e0 enforce consisten eigenvector signs for ML-POD parameter coefficients
This also updates the bundled coeffs file and reference outputs.
2023-01-04 15:31:03 -05:00
8644a6601d Merge branch 'develop' of https://github.com/lammps/lammps into kk_occupancy 2023-01-04 19:59:32 +00:00
a538cc93b7 programming style 2023-01-04 09:19:08 -05:00
20b6355888 refactor fix_pair.h/cpp: extract method "query_pstyle" and call it also in void FixPair::init() 2023-01-04 15:00:03 +01:00
501a5a7090 Print warning about unsorted custom dumps without atom IDs. Explain in manual. 2023-01-04 08:42:43 -05:00
5cbe303af4 Merge branch 'develop' into collected-small-changes 2023-01-04 07:28:03 -05:00
87a8cfe299 - replace #include "ace-evaluator/ace_radial.h" in pair_pace_kokkos.h and pair_pace_extrapolation_kokkos.h with forward declaration "class SplineInterpolator;"
- move SplineInterpolatorKokkos::operator=(const SplineInterpolator &spline) to .cpp files
2023-01-04 12:46:50 +01:00
8e1031ba3c fixed model_loaded being an int issue 2023-01-04 12:16:41 +01:00
17e949df55 whitespace 2023-01-04 06:12:26 -05:00
cd9e56469f updated output format 2023-01-04 12:00:08 +01:00
dd6f584476 removed debug lines 2023-01-04 11:53:43 +01:00
2e74813155 grammar 2023-01-04 05:43:40 -05:00
4a96ce6ccc whitespace 2023-01-03 21:33:27 -05:00
3aceb4a1e2 simplify and update GNU make scripts for ML-IAP with PYTHON and KOKKOS 2023-01-03 21:09:09 -05:00
21d42336e2 massively simplify CMake code for using ML-IAP Python wrappers with KOKKOS 2023-01-03 20:53:14 -05:00
e902b7a8f1 Merge pull request #3575 from akohlmey/dpd-exclusions
Correct handling of random force with exclusions in DPD pair styles
2023-01-03 17:28:24 -05:00
6a20e35edf update unit test inputs 2023-01-03 17:23:40 -05:00
0522c33288 Merge pull request #3572 from hammondkd/fortran2_updates
Mark Fortran2 library interface as obsolescent, remove Fortran 77 one.
2023-01-03 15:04:36 -05:00
aee3ba7c6b Backport kokkos/kokkos@f64e5a6 2023-01-03 12:32:30 -07:00
83f4dd0ff3 make consistent 2023-01-03 14:19:34 -05:00
dac37938f8 update suffix handling to be consistent (also with pending fix pair changes) 2023-01-03 14:16:50 -05:00
bcb5285ef9 update / correct suffix handling in fix pair 2023-01-03 14:15:12 -05:00
ac42068c89 Updated compute efield/atom with additional compatible pair styles, and fixed bugs with comm_reverse and the class name 2023-01-03 12:54:39 -06:00
54bbba8acd whitespace 2023-01-03 11:31:43 -07:00
e8b4001bdd add versionadded tag 2023-01-03 13:28:19 -05:00
4a248798d5 Fix compile error 2023-01-03 11:24:41 -07:00
9de99751c7 Add missing data movement 2023-01-03 11:18:15 -07:00
a3572b61d8 Small cleanup 2023-01-03 10:09:47 -07:00
d9abc3fcc0 update CUDA Toolkit / GPU compatibility lists and GPU package compilation settings 2023-01-03 11:56:44 -05:00
dc36f7e573 change "limit" to "group" 2023-01-03 11:13:06 -05:00
577d190de2 remove bogus 4th per-atom entry. 2023-01-03 11:12:53 -05:00
cfdc70532f Merge branch 'develop' into compute-efield-atom-wolf 2023-01-03 10:51:33 -05:00
295d8a6903 fix_pair.cpp: respect lmp->suffix when looking for pair_style name match 2023-01-03 15:58:34 +01:00
cfbc2d8894 update pair_pace.rst 2023-01-03 14:48:25 +01:00
4d50109731 add check that LINEAR ASI must be used 2023-01-03 14:43:46 +01:00
e033cebcdd update lammps-user-pace version and checksum 2023-01-03 14:30:04 +01:00
1f36bc49ab - add extract and extract_peratom methods
- rename device gamma array to d_gamma
- make host h_gamma array
- copy from h_gamma to host extrapolation_grade_gamma array for each chunk
- transpose two last dimensions of d_ASI (small improvement of performance)
- manage grows of extrapolation_grade_gamma
2023-01-03 14:08:31 +01:00
f502499e44 better separated buffer packing methods 2023-01-03 17:14:18 +10:00
8610fc6d33 simplify intel versions of electrode fixes 2023-01-03 12:32:12 +10:00
014b892e3b WIP:
- add TagPairPACEComputeGamma kernel
- add d_total_basis_size
- add gamma_flag, d_ASI, projections and gamma
2023-01-02 23:34:24 +01:00
1b92569187 WIP: pair_pace_extrapolation_kokkos.h/cpp:
- rename idx_rho_max -> idx_ms_combs_max,  d_idx_rho_count ->d_idx_ms_combs_count, d_offsets->d_func_inds
- remove d_ctildes, add d_gen_cgs and d_coeffs
- use ACEBBasisFunction
- update TagPairPACEComputeRho and TagPairPACEComputeWeights
- pair_pace_extrapolation.h/cpp: add chunksize option
2023-01-02 18:29:12 +01:00
396d577f40 port DPD exclusions corrections to GPU package 2023-01-02 12:04:10 -05:00
37b3ba827f propagate DPD exclusion changes to INTEL and KOKKOS packages 2023-01-02 11:33:08 -05:00
8fb1193a0b Merge branch 'develop' into dpd-exclusions 2023-01-02 10:20:03 -05:00
6565056424 WIP: add pair_pace_extrapolation_kokkos.cpp/h 2023-01-02 12:21:00 +01:00
b25eeb3b26 add unit tests for fix nvt/sllod 2023-01-01 12:56:44 -05:00
8f541488fb modernize fix deform checks with fix nvt/sllod 2023-01-01 12:54:57 -05:00
70f47e817a add unit tests for fix deform and fix nvt with options 2023-01-01 12:31:21 -05:00
7c66aeddf7 update and correct sllod thermostat docs 2022-12-31 22:24:17 -05:00
3a55a374a9 address compilation failures 2022-12-31 22:10:32 -05:00
8016378241 Extended to packages 2022-12-31 19:49:25 -07:00
2479624a76 Added psllod keyword to toggle between SLLOD and p-SLLOD 2022-12-31 16:47:13 -07:00
57790ef35f remove fortran sources and update README with pointer to the conversion package 2022-12-31 16:59:25 -05:00
0ddf7ed49c Merge remote-tracking branch 'upstream/develop' into develop 2022-12-31 14:46:28 -07:00
f84b64bc86 Merge pull request #3581 from rezarastak/patch-1
Use correct RST heading syntax
2022-12-31 15:52:14 -05:00
251f9d7778 make consistent with other doc files 2022-12-31 15:12:29 -05:00
d2f3c474dd Use correct RST heading syntax 2022-12-31 07:52:57 -05:00
d5e897ccbb Updated pppm/disp/dielectric for long-range energy calculation (eflag_global is true) 2022-12-30 16:02:26 -06:00
4a327649b5 fix a few entries, update links and tweak to reduce the table width 2022-12-30 10:12:05 -05:00
c6b73dc710 whitespace 2022-12-30 09:53:48 -05:00
09d743b8f1 update lammps theme base theme from read-the-docs version 1.0.0 to 1.1.1 2022-12-30 09:47:50 -05:00
be8d15a728 change the generated cannonical URL to always point to the current version docs 2022-12-30 09:46:10 -05:00
33711ac36e make code-block formatting more consistent and align with documented conventions 2022-12-30 06:46:09 -05:00
406289d0f9 update documentation conventions. add notes about adding packages 2022-12-30 06:45:08 -05:00
3b9799410b synchronize list with Build_extras.rst 2022-12-30 06:35:45 -05:00
f9a398c9a8 add to list 2022-12-30 06:33:10 -05:00
93689f40dd fix compiler flags issue on Ubuntu18.04 2022-12-30 00:39:23 -05:00
8166eaebbd report CMake version in config summary output 2022-12-29 23:28:23 -05:00
064e1abd5b Small tweaks to make Lepton test compile/link with MSVC 2022-12-29 22:22:45 -05:00
6c318b5e8e fix typo 2022-12-29 21:17:36 -05:00
ec244dbad3 get lepton compiler flags without having to link its library twice 2022-12-29 20:09:42 -05:00
cae18d01a3 add unit tests for Lepton lib and LeptonUtils functions 2022-12-29 19:10:46 -05:00
49eb9ca5fd revert to using the unions. looks nicer and passes the tests. 2022-12-29 19:10:15 -05:00
7d58811ad0 prevent installing Sphinx 6.0.0 which will require updates to the theme 2022-12-29 11:38:37 -05:00
4552a2791d add explicit dependency and link on linalg when used 2022-12-28 21:41:31 -05:00
6e60131f14 Windows portability changes 2022-12-28 20:53:53 -05:00
dba3eb0cf7 make AWPMD compatible with MSVC and c++-linalg on Windows 2022-12-28 17:39:38 -05:00
9d06a3b9a1 with linalg now being C++, a few more packages can be built natively on Windows 2022-12-28 17:18:33 -05:00
c9a3894d12 grammar 2022-12-28 17:11:18 -05:00
57713cf9a3 remove redundant comments from generated C++ files. clean up with clang-format. 2022-12-28 16:44:38 -05:00
f157ba2389 add some f2c runtime functions, remove exception, avoid name conflict with libgfortran 2022-12-28 16:00:38 -05:00
1e8b2ad5a0 whitespace fixes 2022-12-28 13:48:43 -05:00
a894cbfbb7 update linalg README 2022-12-28 13:48:43 -05:00
119fae3b8c remove unused code 2022-12-28 13:48:43 -05:00
52fb2e8156 don't need to link to Fortran runtime with linalg anymore 2022-12-28 13:48:36 -05:00
b0e8ec47da update manual for linalg being C++ now. 2022-12-28 13:45:13 -05:00
c5a87f75d6 convert linalg library from Fortran to C++ 2022-12-28 13:18:38 -05:00
7cceabe5bd ILAENV function does not use IPARAM2STAGE anymore 2022-12-28 12:17:49 -05:00
6f0216af75 ILAENV function does not use IPARAM2STAGE anymore 2022-12-28 12:17:19 -05:00
cdebbe8e54 conditionalized import of cupy 2022-12-28 17:32:39 +01:00
82c2b35423 improve error messages for dynamic groups 2022-12-28 07:11:13 -05:00
669ede9d4e Fixed unit test failure 2022-12-28 08:55:02 +01:00
d47acfc0c4 Have PyTorch interface for MLIAP working in Kokkos. This uses cuPy and a simple example is provided 2022-12-28 07:01:47 +01:00
67156420d4 avoid out-of-range read 2022-12-28 00:19:59 -05:00
50a370c4a5 use memcpy instead of union to avoid pointer aliasing 2022-12-27 21:39:35 -05:00
5dbb0e7455 update format of rst files 2022-12-27 21:30:11 -05:00
b28607234e update rst file formatting. work around duplicate target issue. 2022-12-27 21:29:37 -05:00
52fcd08e1c reformat colvars related docs. add false positive for spellchecker 2022-12-27 21:15:33 -05:00
d10e7195dc add missing entries for dihedral style lepton 2022-12-27 21:13:34 -05:00
24b16cf130 More updates to fix colvars doc 2022-12-27 20:27:38 -05:00
afae6222b0 Update build instructions for COLVARS package 2022-12-27 20:02:44 -05:00
9f15ad4795 simplify by using a custom constructor 2022-12-27 18:26:29 -05:00
246b25e2ed silence compiler warning 2022-12-27 17:43:39 -05:00
c63f1647fb work around pointer aliasing issue with JIT enabled 2022-12-27 17:43:31 -05:00
efc2e96a9e explicitly share Lepton settings between lepton and colvars folders 2022-12-27 17:42:59 -05:00
2a3d1a1ba5 import JIT settings to colvars library makefile 2022-12-27 15:16:58 -05:00
353f4cb361 must not remove settings for lepton library if colvars package is installed 2022-12-27 14:53:53 -05:00
307829ad10 add unit test for dihedral style lepton 2022-12-27 14:40:43 -05:00
fa55a86074 remove some legacy code and update for more recent code changes 2022-12-27 14:38:59 -05:00
a79a058bce fix up a few more details for conventional build 2022-12-27 14:37:56 -05:00
854089ef8d trigger building Lepton lib when requesting colvars 2022-12-27 14:05:16 -05:00
4f4f7be9c8 must provide list of object for colvars lib 2022-12-27 14:04:54 -05:00
c68f754923 remove access to non-existing option 2022-12-27 13:59:56 -05:00
faa2a9ffeb remove Lepton source from lib/colvars folder 2022-12-27 13:59:34 -05:00
973dd04c87 update OPENMP package versions 2022-12-27 11:23:18 -05:00
7e984bfa2c update traditional make build support for shaking Lepton between LEPTON and COLVARS 2022-12-27 11:16:09 -05:00
989ec1b859 remove lmp/LMP_ prefix from Lepton namespace and files to share it with colvars 2022-12-27 10:57:43 -05:00
7fb9ee1147 clarify 2022-12-27 10:29:25 -05:00
1e5e6063d3 update unit tests for bugfix in dihedral style table 2022-12-26 16:51:36 -05:00
e55396a25d fix typo 2022-12-26 16:47:37 -05:00
a32d2b29f2 fix subtle bug in stress tally for dihedral style table 2022-12-26 16:47:29 -05:00
2d602088c0 follow the usual convention and call dihedral angle phi 2022-12-26 16:46:59 -05:00
860dc1600d flag member functions without side effect as const 2022-12-26 16:46:41 -05:00
a5742a9147 make lepton package docs more consistent 2022-12-26 16:45:49 -05:00
5a99cf0dd5 add dihedral style lepton including /omp variant 2022-12-26 16:44:49 -05:00
e9dbdc7d1a clarify and reformat 2022-12-26 06:34:53 -05:00
9355b79b47 update dpd/ext styles in DPD-BASIC and OPENMP to correctly handle scaling for random force 2022-12-25 19:23:22 -05:00
652c237b5e Merge branch 'upstream' into dielectric-updates 2022-12-25 15:13:46 -06:00
793d66ce04 small programming style updates, pass Error class pointer for errors 2022-12-25 11:36:27 -05:00
63ddb07c59 add versionadded tags 2022-12-25 07:04:20 -05:00
4ac830bf73 add dihedral_write command 2022-12-25 07:01:37 -05:00
bbfc7381fb updates and corrections for docs 2022-12-25 06:54:53 -05:00
a4f8cb9a92 explicitly disallow angle_write with angle_style class2 2022-12-25 06:54:40 -05:00
c4f2befb1f add sanity check on valid angle type 2022-12-25 06:25:45 -05:00
ecf11f2f20 use macro for keeping repetitive code consistent 2022-12-25 06:06:34 -05:00
9a8c48c0b9 programming style update 2022-12-25 04:47:41 -05:00
bbdc6fd3ab fix file handle leak 2022-12-25 04:35:03 -05:00
55af6fc72b fix typo 2022-12-25 00:42:20 -05:00
4ee8dea4b3 improve bond_write docs and fix minor issues 2022-12-24 23:05:47 -05:00
1c223f7ce6 improve error messages 2022-12-24 23:05:23 -05:00
9b1d90854b make created tables better suitable for human consumption 2022-12-24 23:03:50 -05:00
07f587ccf3 include force function in angle table example to show the need for correct unit conversion (force is energy per radian squared) 2022-12-24 23:03:12 -05:00
da98363a25 implement angle_write command 2022-12-24 22:52:16 -05:00
f091233d7d Did some cleanup 2022-12-24 15:25:04 -06:00
24e5fafd7f more documentation tweaks and corrections. make consistent across package styles 2022-12-24 15:38:58 -05:00
be01ec2e07 document variable substitution 2022-12-24 05:53:18 -05:00
cebb97e790 Merge branch 'develop' after the distributed-grids PR was merged into amoeba-gpu, noted some API changes in reverse_comm 2022-12-24 00:41:07 -06:00
93cfa6ef30 fix typo. more clarifications 2022-12-24 01:16:51 -05:00
30a6a8a54e add support for substituting LAMMPS variables in Lepton expressions 2022-12-24 00:35:22 -05:00
7b3866d04c move lepton utilities to lepton_utils namespace in LEPTON package 2022-12-24 00:08:03 -05:00
a1a3a89a3d enable and apply clang-format to pair style morse 2022-12-23 16:26:39 -05:00
b36031571d remove bogus "extract" data from angle style amoeba test 2022-12-23 16:22:15 -05:00
f9e17d5e79 add unit test for the extract method of angle styles 2022-12-23 16:18:18 -05:00
3d7082499d update docs to include angle style lepton 2022-12-23 16:07:14 -05:00
67f0c48781 add angle styles lepton and lepton/omp 2022-12-23 15:34:01 -05:00
9099f7b7a5 Use minimal scope for args 2022-12-23 11:09:03 -07:00
a2af2b4135 add versionadded tags 2022-12-23 12:15:36 -05:00
132a4cbc91 update traditional build for updated Lepton library and inclusion of asmjit 2022-12-23 12:13:10 -05:00
adb27c6e3c Update CMake 2022-12-23 08:56:00 -07:00
ea0a91f2bc Merge branch 'develop' of https://github.com/lammps/lammps into kk_occupancy 2022-12-23 08:54:23 -07:00
ae1dc7b52c Backport https://github.com/kokkos/kokkos/pull/5624 to Kokkos version bundled with LAMMPS 2022-12-23 07:41:33 -07:00
8a2257f568 remove the obsolete legacy fortran 77 wrapper. update Fortran section of manual. 2022-12-23 06:56:07 -05:00
b67dcd7ca3 small tweaks 2022-12-23 06:30:00 -05:00
749adf3a59 one more tweak to allow more x86 platforms to use JIT with Lepton 2022-12-23 05:32:35 -05:00
acf683e9d0 define ASMJIT_STATIC to work around Windows issues 2022-12-23 01:35:05 -05:00
3a6492fc42 use JIT compiler only on Linux for now 2022-12-22 23:46:21 -05:00
09871a0178 mention JIT 2022-12-22 23:32:06 -05:00
ca108c6f69 use blank instead of empty string which is not supported by all compilers 2022-12-22 23:23:32 -05:00
338cee917f fix copy-n-paste issue 2022-12-22 23:13:06 -05:00
992ef989b3 Fixed warning message encountered with -std=f2003 2022-12-22 22:09:20 -06:00
a8c881aaf3 try to address linker issues with asmjit on older Linux machines 2022-12-22 23:09:09 -05:00
ae8f03803c Merge branch 'develop' into lepton-package 2022-12-22 22:52:20 -05:00
5b42064fcf add docs for lepton pair and bond style 2022-12-22 22:50:24 -05:00
e59f99b440 add support for JIT compilation 2022-12-22 22:50:01 -05:00
ca27fb3a98 update Lepton to current master branch 2022-12-22 22:47:45 -05:00
44e6078437 fix for bug detected by gfortran 12.2 2022-12-22 22:01:48 -05:00
885108e95b Merge branch 'lammps:develop' into fortran2_updates 2022-12-22 20:31:05 -06:00
f79d49ae64 Merge branch 'develop' into dpd-exclusions 2022-12-22 16:33:36 -05:00
91c498c413 suppres explicit exports/import in Lepton lib 2022-12-22 16:32:17 -05:00
a7a5a83308 minor tweaks 2022-12-22 15:49:11 -05:00
d9b1e318e8 add documentation for LEPTON package and lepton pair and bond style 2022-12-22 15:48:24 -05:00
07fe2fa29d Merge pull request #3570 from lammps/doc-ovito-info
OVITO info for dump doc page
2022-12-22 15:46:35 -05:00
d4af1834ec Update dump.rst 2022-12-22 10:44:03 -07:00
090a4a69b9 Merge pull request #3561 from lammps/map_ghost_bug
Fix bug when atoms are added after run
2022-12-22 12:27:56 -05:00
90cf1d6fca update VMD compatibility info, too. 2022-12-22 12:25:49 -05:00
01c2bca67d Merge branch 'fix-kokkos-4' of github.com:crtrott/lammps into kk_occupancy 2022-12-22 09:24:21 -07:00
25df28292f Update Kokkos library in LAMMPS to v3.7.1 2022-12-22 09:20:35 -07:00
33f3adf85c Merge branch 'develop' of github.com:lammps/lammps into kk_occupancy 2022-12-22 09:18:24 -07:00
0b7a55dac6 OVITO info in dump doc page 2022-12-22 08:11:22 -07:00
a5ecef708f correctly compute offsets. update unit test files. 2022-12-22 09:59:55 -05:00
e99bd14fd8 Merge branch 'develop' into lepton-package 2022-12-22 09:25:26 -05:00
8b8c0ee72d Merge pull request #3567 from akohlmey/next_patch_release
Set version strings for next patch release
2022-12-22 09:16:33 -05:00
ab72e95d0a restart offset for bond style lepton 2022-12-22 07:26:00 -05:00
2865929558 update for added source 2022-12-22 07:11:04 -05:00
48c23788f2 handle pair_modify shift and enforce the bond lepton has zero energy at r0 2022-12-22 07:10:48 -05:00
4cbe8b353b move shared functionality to utility function added to Lepton library 2022-12-22 05:37:59 -05:00
3bb6e1ab19 Merge branch 'develop' into lepton-package 2022-12-22 04:45:51 -05:00
ea8d90059a Merge pull request #3566 from akohlmey/collected-small-changes
Final collection of small changes for next patch release
2022-12-22 02:21:06 -05:00
5da8242690 add bond style lepton 2022-12-22 02:13:51 -05:00
966211bb53 avoid conflicting names 2022-12-22 02:13:28 -05:00
73c95d43af whitespace 2022-12-21 22:33:15 -05:00
46f514d2ca add support for writing binary restart files 2022-12-21 22:30:05 -05:00
4293771ae8 silence compiler warnings 2022-12-21 21:53:25 -05:00
e2f9d59484 whitespace fixes 2022-12-21 21:34:56 -05:00
cf0fb7f5df build system updates for presets and dependencies 2022-12-21 21:32:27 -05:00
8511aae211 add OPENMP package version of pair style lepton 2022-12-21 21:18:20 -05:00
c64066eb21 simplify processing of expressions 2022-12-21 21:16:59 -05:00
969ac57256 make expression string compact and easier restartable by removing quotes and whitespace 2022-12-21 21:16:23 -05:00
6c5a698be4 try to speed up compute kernel 2022-12-21 19:24:28 -05:00
2cf1793a93 add unit test for pair style lepton 2022-12-21 18:29:11 -05:00
76a84d7865 add pair style lepton 2022-12-21 18:28:57 -05:00
5f934e3eae add LEPTON package build system support for CMake 2022-12-21 18:28:35 -05:00
c44e87d87a avoid name conflict with COLVARS package 2022-12-21 18:28:04 -05:00
60b9bfd217 Updated pppm/dielectric for elong to match with regular pppm 2022-12-21 15:47:38 -06:00
517a2e5e26 import Lepton library with namespace and header changed to LMP_Lepton 2022-12-21 14:18:39 -05:00
6edcd995af Merge branch 'develop' into fix-kokkos-4 2022-12-21 12:31:50 -05:00
3137122476 remove kokkos numa option and its documentation 2022-12-21 12:31:32 -05:00
8b22b22203 remove conditional compatibility code for pre-3.7 Kokkos versions 2022-12-21 12:28:49 -05:00
b6701f1892 improve error messages 2022-12-21 12:11:34 -05:00
3d8e5be653 apply clang-format 2022-12-21 12:11:25 -05:00
5c02803e02 Merge branch 'develop' into collected-small-changes 2022-12-21 12:06:26 -05:00
d8620fc34c Merge pull request #3553 from evoyiatzis/patch-3
Fixing bug #3545
2022-12-21 12:05:44 -05:00
12a23b0ef1 Fixing comment from bug report #3545 2022-12-21 16:22:56 +02:00
0460649d5b add note about porting legacy code to the new Grid3d/Grid2d classes 2022-12-20 19:27:56 -05:00
a235cd4719 mention type labels in bond/react docs 2022-12-20 14:02:46 -05:00
4309e0a6c8 Added important restriction on number of atom types 2022-12-20 11:55:24 -07:00
d98026a473 Added important restriction on number of atom types 2022-12-20 11:49:08 -07:00
1d7e627aa0 Added important restriction on number of atom types 2022-12-20 11:41:02 -07:00
9973c01f4c Added important restriction on number of atom types 2022-12-20 11:30:53 -07:00
4a2d928d91 Merge remote-tracking branch 'upstream/develop' into develop 2022-12-20 11:20:52 -07:00
84d97a9ef7 type labels for create_atoms_polystyrene example 2022-12-20 13:15:59 -05:00
21b14cd7e4 remove now-redundant code 2022-12-20 12:46:59 -05:00
7383a8957b refactor atom stabilization code 2022-12-20 11:41:11 -05:00
e94a89baf7 update .gitignore and Purge.list for recent changes 2022-12-20 11:05:32 -05:00
cc34cfb917 add missing entry to list 2022-12-20 10:57:38 -05:00
b79f08b8d5 fix logic bug 2022-12-20 07:10:28 -05:00
8e36fcfa6a address integer overflow issues detected by CodeQL 2022-12-20 07:04:57 -05:00
aba0ead71f programming style changes to reduce warnings from static code analysis 2022-12-20 06:34:07 -05:00
0f23659523 fix bug detected by coverity scan 2022-12-20 06:34:07 -05:00
9e45fba4c4 skip test where it causes an internal compiler error 2022-12-20 06:34:00 -05:00
2e6b975878 update version tag placeholders for added, removed, or changed functionality 2022-12-19 22:11:06 -05:00
fd41ea9eae update version strings for next patch release 2022-12-19 22:09:48 -05:00
fa6251d83b Merge pull request #3560 from akohlmey/collected-small-changes
Collected small changes and fixes for the next patch release
2022-12-19 21:38:36 -05:00
c160eb7f11 clear memory before use 2022-12-19 20:52:15 -05:00
a4f2e452e0 temporary disable test that is failing consistently on github action w/o explanation 2022-12-19 20:32:07 -05:00
a44f5c8594 fix uninitialized memory access in fortran unit test. must have consumer to access compute 2022-12-19 20:29:52 -05:00
e9b4d2c55d fix windows support bug 2022-12-19 20:04:27 -05:00
078468a94f fix uninitialized variable access through local variable scoping 2022-12-19 19:59:54 -05:00
457746dadc Merge branch 'develop' into collected-small-changes 2022-12-19 19:45:04 -05:00
5deb6df2ad Merge pull request #3547 from hammondkd/fortran-fix-external
Completing the Fortran interface
2022-12-19 18:44:45 -05:00
219b971caf Merge branch 'update-mliap' of github.com:rohskopf/lammps into collected-small-changes 2022-12-19 12:57:39 -05:00
3e9bb99daa Merge branch 'develop' into collected-small-changes to resolve merge conflicts 2022-12-19 12:42:09 -05:00
18d07883c3 python 2 compatibility 2022-12-19 12:13:40 -05:00
bc8812c391 add one more tabulation example showing how to smoothly replace part of a function in a different potential 2022-12-19 12:13:25 -05:00
72b0a2dfdf Merge pull request #3405 from lammps/distributed-grids
Support for distributed grids
2022-12-19 12:06:25 -05:00
e5bece9a01 Output python model loading on one proc 2022-12-19 09:44:16 -07:00
fe4bc9baa2 small fixes 2022-12-18 16:41:43 -05:00
feb33fdf3b port dpd/ext pair styles to OPENMP package 2022-12-18 16:41:09 -05:00
fa8e3256eb add unit tests for dpd/ext pair styles 2022-12-18 16:40:56 -05:00
aa31f85535 partial implementation for a fix to correctly apply exclusions with dpd pair styles 2022-12-18 11:38:07 -05:00
91325d49c5 update examples and log files for pair style meam/spline 2022-12-18 11:32:37 -05:00
9de23dd2df correct for changed reference results due to fixing the potential file issue 2022-12-18 11:22:11 -05:00
0cc5a5dbbc update pair style meam/sw/spline examples add log files 2022-12-18 11:18:43 -05:00
387c07e6a2 update meam/sw/spline examples for Si. add logs 2022-12-18 11:08:14 -05:00
cc94770928 correct order of coefficients in pair style dpd/ext docs 2022-12-18 10:57:32 -05:00
15dfb090c9 speed up utils::is_double() by putting most likely matching regexps first 2022-12-18 06:06:22 -05:00
63d7b87bc1 Match the number of grid points in pppm/dielectric with that in pppm, found out that elong cannot match because energy is not linearly dependent on charge density, which are qscaled for pppm/dielectric, needs a way to resolve this issue 2022-12-18 00:40:16 -06:00
1cd7011b66 fix incorrect floating point number (missing "e") in meam/sw/spline potential
this also requires updating the unit test
2022-12-17 23:02:07 -05:00
9137edae10 fix incorrect detection of leading '-' on floating point numbers 2022-12-17 22:31:02 -05:00
5a18cea6c9 tighter checking of what is a valid integer/floating point number
also use the check consistently when converting numbers
2022-12-17 22:06:50 -05:00
b6c7d24b6d do not accept kspace style accuracy values > 1.0, improve error message 2022-12-17 21:35:44 -05:00
00f8d2b96d small fixes 2022-12-17 16:11:06 -05:00
b70f4c8fa8 port dpd/ext pair styles to OPENMP package 2022-12-17 16:07:28 -05:00
bf129ce61a add unit tests for dpd/ext pair styles 2022-12-17 15:43:34 -05:00
3e26056228 warn about growing the box with read_data add messing up coordinates 2022-12-16 22:17:56 -05:00
ea5fa92c2f Merge remote-tracking branch 'github/develop' into collected-small-changes 2022-12-16 22:16:03 -05:00
17d69b7dbd small documentation improvements 2022-12-16 22:09:30 -05:00
db3ccf93c6 Merge pull request #3562 from bramoore/intel_fixes
Collection of small fixes to INTEL package
2022-12-16 20:14:02 -05:00
ac20f22056 type-labels: polystyrene example 2022-12-16 18:39:37 -05:00
4f944cfe0a Revert accidental change 2022-12-16 16:36:02 -07:00
9d4af4098c index entries were missing 2022-12-16 18:30:28 -05:00
111faa758d Merge branch 'develop' into collected-small-changes 2022-12-16 18:25:12 -05:00
42c41ac151 Remove unused var 2022-12-16 16:22:20 -07:00
3b267682b5 Merge pull request #3522 from mkanski/fix_viscous_kokkos
KOKKOS version of fix viscous and fix dt/reset
2022-12-16 18:12:29 -05:00
d9e9062854 Initialize pointers 2022-12-16 16:03:44 -07:00
c421a445bd Small cleanup, docs 2022-12-16 15:18:57 -07:00
6833bed347 Merge branch 'develop' of github.com:lammps/lammps into fix_viscous_kokkos 2022-12-16 14:35:16 -07:00
544e171635 Avoid trying to free a wild pointer 2022-12-16 14:13:08 -07:00
6eeab59a5e Remove redundant variable 2022-12-16 14:12:21 -07:00
e137240909 Fix init arguments fnd some join stuff for Kokkos 4 2022-12-16 12:36:11 -07:00
e9cc625eae Whitespace 2022-12-16 12:11:45 -07:00
b734ddc9d4 Port grid3d changes to Kokkos 2022-12-16 12:04:49 -07:00
ce1190aebb Templated functions calling math libraries should use type-aware calls 2022-12-16 12:56:25 -06:00
1013cd6eae Vector masking is part of AVX512, not limited to Intel compiler 2022-12-16 12:56:25 -06:00
4e078b01f4 Fix uninitialized memebr 2022-12-16 12:56:24 -06:00
b4302ea899 Merge branch 'lammps:develop' into fortran2_updates 2022-12-16 12:16:23 -06:00
14fd40acc5 Merge branch 'lammps:develop' into fortran-fix-external 2022-12-16 12:15:27 -06:00
85ac3ac98b Also need to clear atom map 2022-12-16 09:42:06 -07:00
a633915829 Merge pull request #3559 from akohlmey/tabulate-scripts
Add python scripts in tools folder to generate table files for different table force styles
2022-12-16 11:18:06 -05:00
9e5b419e4e Fix bug when atoms are added after run 2022-12-16 08:33:26 -07:00
7eb22f691b remove unused variables 2022-12-16 06:16:51 -05:00
dc7bf29c09 whitespace fixes 2022-12-16 05:08:07 -05:00
dc0496ed48 Merge branch 'develop' into fortran-fix-external 2022-12-16 04:39:24 -05:00
8998ef23de update docs for tools/tabulate scripts 2022-12-16 02:49:39 -05:00
2de997b52d import tabulate scripts for table files 2022-12-16 01:11:52 -05:00
9713a552e9 Reimplemented qsum_qsq() for pppm/dielectric for local dielectric constants 2022-12-16 00:10:21 -06:00
a51f31fa6d remove no longer needed discussion of read_restart remap option 2022-12-16 01:00:40 -05:00
b649b9e963 remove dead code 2022-12-15 22:56:58 -05:00
9d149a4734 Updated polarize fixes for eflag and evflag settings 2022-12-15 17:42:37 -06:00
0407620645 document removal of remap option for read_restart 2022-12-15 16:34:38 -05:00
bacb43ea59 add check to detect incorrectly used role keywords. 2022-12-15 16:27:00 -05:00
b2f0f89d67 reformat 2022-12-15 16:27:00 -05:00
ed248d1a6a enforce initialization of data 2022-12-15 16:27:00 -05:00
bded6b7fd0 update OpenMP suppressions for clang 15.0 2022-12-15 16:27:00 -05:00
f0af982d09 tiny_epoxy: actually use log files 2022-12-15 13:22:15 -05:00
35eff624ab nylon_melt: actually use log files
not output file
2022-12-15 13:16:49 -05:00
b5eb64cc0c type labels for tiny_nylon example 2022-12-15 13:08:25 -05:00
28f8525fa0 one more valgrind error 2022-12-15 08:55:55 -07:00
6b2b3765c2 fix valgrind issues 2022-12-15 08:48:27 -07:00
8b12ab04e0 Cleaned up and added comments 2022-12-15 00:03:19 -06:00
2e4f419e19 Merge pull request #3538 from akohlmey/strip-style-suffix
Remove suffix from style names when writing restart files
2022-12-14 20:53:56 -05:00
bbaa2cbf3c Merge pull request #3558 from jtclemm/BPM
Small patch to BPM package
2022-12-14 18:24:47 -05:00
2446a7855e Merge branch 'distributed-grids' of github.com:lammps/lammps into distributed-grids 2022-12-14 18:15:59 -05:00
f99ac7dc88 bug fix for 2d grid corners 2022-12-14 16:14:05 -07:00
281e67d6fb Merge branch 'develop' into distributed-grids 2022-12-14 18:12:10 -05:00
cf8bce646f Merge branch 'distributed-grids' of github.com:lammps/lammps into distributed-grids 2022-12-14 15:41:10 -07:00
4efe379b7b tweak dump image settings for better viz of grid cells 2022-12-14 15:41:01 -07:00
60a4ef5c71 Merge pull request #3556 from lammps/add-user-vcsgc
Add streamlined version of fix sgcmc from USER-VCSGC package
2022-12-14 17:24:58 -05:00
88cc0b646a Fix memory leak in Kokkos fix shake 2022-12-14 15:05:27 -07:00
8df01b2a73 Fixed bugs with two fixes polarize icc and gmres for induced charges 2022-12-14 15:32:21 -06:00
9b3cc46ccf add override keyword 2022-12-14 16:15:24 -05:00
b60a6e796e Ensuring data is updated before writing restarts 2022-12-14 14:14:43 -07:00
85ed8edfcb Prevent double free of CPU memory 2022-12-14 13:58:10 -07:00
3268687391 Removing unnecessary clears in update special fix 2022-12-14 13:39:19 -07:00
d2c77f1d0c small tweaks from @athomps 2022-12-14 15:19:07 -05:00
82147f1eb6 Merge branch 'strip-style-suffix' of https://github.com/akohlmey/lammps into strip-style-suffix 2022-12-14 13:05:01 -07:00
8af77c690c Merge branch 'develop' into amoeba-gpu 2022-12-14 13:16:41 -06:00
babec093ca Merge branch 'develop' into strip-style-suffix 2022-12-14 13:45:59 -05:00
b70d60ef48 small documentation tweak 2022-12-14 13:44:42 -05:00
13e5b12f21 Merge pull request #3555 from stanmoore1/kk_atom_vec
Refactor Kokkos `AtomVec`
2022-12-14 13:43:07 -05:00
26ad12e2af add code owner for gcmc and sgcmc fixes 2022-12-14 12:28:20 -05:00
34cc36176a Working on fix polarize, the induced charges are not correct for spherical interfaces yet 2022-12-14 10:02:18 -06:00
d8b404cc42 update docs, fix references, correct spelling issues 2022-12-14 10:22:47 -05:00
08a257c361 small IWYU fix 2022-12-13 20:55:53 -05:00
cf0a16a33c remove comments for known functions 2022-12-13 20:42:19 -05:00
fdb9a75714 programming style updates
- partially enable clang-format
- reindent
- update parsing of numeric arguments
- update handling of error messages
- add blank after "if", "for", "while" where needed
- silence compiler warnings
2022-12-13 20:36:12 -05:00
df12232e24 Merge branch 'develop' into add-user-vcsgc 2022-12-13 18:31:01 -05:00
fe7b489149 Merge pull request #3550 from akohlmey/collected-small-changes
Collected small changes and fixes
2022-12-13 18:26:28 -05:00
b2b21540bf import docs for fix sgcmc 2022-12-13 17:07:43 -05:00
998f41b8f4 fix typo 2022-12-13 16:39:18 -05:00
49cccd7526 add example for fix sgcmc 2022-12-13 16:35:49 -05:00
88ac09a8c0 build system support: fix sgcmc may only be compiled if EAM is available 2022-12-13 16:35:19 -05:00
b76e645182 remove optional code 2022-12-13 16:14:29 -05:00
630b770f80 rename files 2022-12-13 15:58:16 -05:00
422b9999f5 add lammps copyright headers 2022-12-13 15:56:42 -05:00
1440ff7b16 import fix sgcmc code from lammps-plugin repo 2022-12-13 15:50:21 -05:00
01cfe4a2ac Merge branch 'kk_atom_vec' of github.com:stanmoore1/lammps into strip-style-suffix 2022-12-13 13:14:51 -07:00
8248b5bc18 Merge branch 'develop' of github.com:lammps/lammps into distributed-grids 2022-12-13 13:00:31 -07:00
77dea685b5 Small cleanup 2022-12-13 12:10:56 -07:00
bd2001578b Remove more redundant variables 2022-12-13 10:56:56 -07:00
a94ec5fdf7 Remove redundant variables 2022-12-13 10:20:12 -07:00
88b89b67a2 Merge pull request #15 from akohlmey/kk_atom_vec
Small update to LAMMPS PR #3555 branch for consistency and to fix compilation errors
2022-12-13 08:58:31 -07:00
dd7a39b702 add missing entry to table 2022-12-13 09:22:02 -05:00
62a1cf5a84 provide backward compatible URLs to reduce 404 errors on www.lammps.org 2022-12-13 05:28:28 -05:00
96f5e046e5 Made progress on fix polarize functional, need to review the induced charge-neutral constraint 2022-12-13 00:13:44 -06:00
983401b015 type labels for nylon_melt example 2022-12-13 00:37:09 -05:00
d7742412b3 must use dynamic cast due to virtual inheritance 2022-12-12 20:37:53 -05:00
3b2376d0bb use virtual inheritance consistently for all atom styles 2022-12-12 20:37:30 -05:00
6d8e7e1ece Refactor Kokkos AtomVec 2022-12-12 17:34:18 -07:00
32f2acd1a1 Updated polarize bem/gmres and bem/icc, note that charge in the dump files are now unscaled values, polarize/functional needs work 2022-12-12 17:55:36 -06:00
0375a7569e type labels for tiny_epoxy example 2022-12-12 17:08:42 -05:00
4458c36676 some more dead code removed that was detected by clang 15 2022-12-12 09:45:55 -05:00
79ab63a33c a few more IWYU updates 2022-12-12 09:45:29 -05:00
ebcb702e95 remove dead code detected by clang 15 2022-12-12 07:07:06 -05:00
6113bd5aa4 small clean up 2022-12-12 11:30:21 +01:00
b30ce3ff32 next round of IWYU updates 2022-12-12 01:07:46 -05:00
01a54723d7 more iwyu updates 2022-12-11 23:40:31 -05:00
302bec9de4 stay compatible with older C++ compilers 2022-12-11 22:58:54 -05:00
a3c0be875e include-what-you-use updates 2022-12-11 22:46:54 -05:00
e0792d3a62 apply code changes suggested by clang-tidy 2022-12-11 18:44:50 -05:00
126f597e71 need no longer need to Fortran MPI library 2022-12-11 18:02:49 -05:00
c0a39dc7b8 add c wrapper to allow testing fortran interface w/o fortran MPI libs 2022-12-11 18:00:35 -05:00
0984b11cb4 skip gather_bonds test when atom style full is no available 2022-12-11 17:59:23 -05:00
33bee575b4 Merge branch 'develop' into fortran-fix-external 2022-12-11 17:56:32 -05:00
9beb64236e skip gather_bonds test when atom style full is no available 2022-12-11 17:50:47 -05:00
2f84eac5c5 add c wrapper to allow testing fortran interface w/o fortran MPI libs 2022-12-11 17:50:03 -05:00
2d804937c1 Working on polarize fixes and kspace styles for q_scaled and q, need tests for nonzero q_free (unscaled) for interface particles 2022-12-11 00:08:10 -06:00
aed6eb0947 fix typo 2022-12-10 09:59:49 -05:00
2421f9098c Merge pull request #3517 from akohlmey/document-style-flags
Provide more and updated details about implementing new styles in LAMMPS
2022-12-10 09:59:01 -05:00
d3b1fecd03 Fixing bug #3545
Instead of storing the vector from the nearest point of an ellipse to an atom, delxyz was storing the coordinates of the nearest point of the ellipse to the atom.
2022-12-10 13:46:12 +01:00
86c2ae6dab Switched to using q_scaled, keeping q as the real, unscaled charges 2022-12-09 23:34:49 -06:00
07bb7b3195 fix up kim unit tests broken by recent changes 2022-12-09 19:56:45 -05:00
4a18561005 Merge pull request #3552 from lammps/kk_min_bug
Fix bug in Kokkos minimize on GPUs
2022-12-09 19:30:53 -05:00
db13738056 Update bond/react readme 2022-12-09 17:52:05 -05:00
34f44daef5 some small programming style updates 2022-12-09 16:56:50 -05:00
b0accb4ebf replace atoi() with suitable utility functions 2022-12-09 16:56:17 -05:00
f24cb96517 use utils::numeric() instead of atof(), improve error messages 2022-12-09 16:29:32 -05:00
5e2a8beb4a Fix bug in Kokkos minimize on GPUs 2022-12-09 14:28:26 -07:00
f6d6e1ef01 remove workaround that is no longer needed 2022-12-09 16:23:10 -05:00
72789904c3 Update packages_details.rst take 2 2022-12-09 15:35:14 -05:00
3d3368ed99 Update Packages_details.rst 2022-12-09 12:02:09 -05:00
249ac0b34e ignore 2022-12-09 16:52:01 +01:00
1d601f23b1 terse screen output 2022-12-09 16:49:30 +01:00
434685f439 small addition 2022-12-09 16:35:51 +01:00
3ab2651851 must add const attribute to method 2022-12-09 00:41:23 -05:00
946f7ca389 add test and warning for missing charge info and point dipoles, respectively 2022-12-09 00:33:26 -05:00
8eb1b0042d error out without charge data 2022-12-09 00:30:40 -05:00
4aaf003fb1 fix minor issues reported by coverity scan, re-apply clang-format 2022-12-08 23:59:42 -05:00
f0244255ff improve warning message 2022-12-08 13:35:41 -05:00
19e6d1cd9f new command compute efield/wolf/atom 2022-12-08 06:32:17 -05:00
f450c12b3d Merge branch 'lammps:develop' into fortran2_updates 2022-12-07 23:55:11 -06:00
34449fc47c fix typo and reformat 2022-12-07 20:41:33 -05:00
4a92316cf2 improve error message 2022-12-07 15:02:59 -05:00
739537930d use utils::numeric() instead of atof and improve error messages in QEQ package 2022-12-07 13:35:57 -05:00
92e6c6ea9d avoid 32-bit integer overflow for memory allocation 2022-12-07 13:35:52 -05:00
0007788e01 cleaner, minimal changes 2022-12-07 14:20:45 +01:00
21dd804819 Merge branch 'lammps:develop' into energy_spacing_neb 2022-12-07 13:41:56 +01:00
0fc9bb2cdf Add optional msmeam flag 2022-12-06 18:56:58 -07:00
213a2a21ea Merge pull request #3548 from akohlmey/collected-small-changes
Collected small changes and fixes
2022-12-06 20:13:19 -05:00
8ade2d1ad9 Merge branch 'lammps:develop' into fortran-fix-external 2022-12-06 18:12:07 -06:00
0a608abaac Merge branch 'lammps:develop' into fortran2_updates 2022-12-06 18:11:36 -06:00
77cbd8c1c9 update .gitignore for renamed source file 2022-12-05 19:47:08 -05:00
2f8c379e37 Merge branch 'ml-pod-fixes' into collected-small-changes 2022-12-05 19:18:03 -05:00
2c6cd42038 silence compiler warnings about unused function parameters 2022-12-05 19:17:47 -05:00
92d8994189 add initializer for podptr 2022-12-05 18:03:43 -05:00
1fa0b432a4 avoid making members public 2022-12-05 18:03:43 -05:00
69d402fa7b handle dead code 2022-12-05 18:03:43 -05:00
20f568e1ae avoid division by zero 2022-12-05 18:03:39 -05:00
f33d7b8fc1 avoid string copy 2022-12-05 18:03:28 -05:00
ecf5b5a848 use call-by-reference to pass datastruct to functions 2022-12-05 17:30:13 -05:00
080b3b9ccb avoid 32-bit integer overflow 2022-12-05 13:23:12 -05:00
08129bfc00 Merge branch 'develop' into collected-small-changes 2022-12-05 12:40:28 -05:00
31ca8fbbed Merge pull request #3449 from cesmix-mit/pod
ML potentials with proper orthogonal descriptors
2022-12-05 12:29:13 -05:00
642aaf3d7d Merge branch 'collected-small-changes' of github.com:akohlmey/lammps into collected-small-changes 2022-12-05 11:18:06 -05:00
18af945f4d added documentation 2022-12-05 16:59:26 +01:00
3c08bbb790 added documentation 2022-12-05 16:57:39 +01:00
5f735467fe added documentation 2022-12-05 16:53:50 +01:00
8dd9682ce2 remove iostream 2022-12-05 15:28:35 +01:00
978db4b737 even simpler, still works 2022-12-05 15:19:33 +01:00
d69f22176f a version which works in initial tests 2022-12-05 15:16:40 +01:00
1048c26900 working but not always optimal.. 2022-12-05 14:07:03 +01:00
0d2e0f5b36 working ? 2022-12-05 13:58:05 +01:00
be17106ecf Merge branch 'develop' into collected-small-changes 2022-12-05 07:02:13 -05:00
c8545154b8 Merge branch 'lammps:develop' into newmaster 2022-12-05 11:12:38 +01:00
01f835d6d6 Merge branch 'lammps:develop' into fortran2_updates 2022-12-04 23:40:53 -06:00
0a7943f941 Merge branch 'lammps:develop' into fortran-fix-external 2022-12-04 23:36:21 -06:00
0c238d179d Merge pull request #3544 from robeme/electrode
Electrode package update
2022-12-04 20:01:18 -05:00
17a921f8e5 Added obsolescence warning to Makefile 2022-12-04 18:54:27 -06:00
e20235b7e5 Added text to README and LAMMPS.F90 making examples/COUPLE/fortran2 obsolete 2022-12-04 18:34:22 -06:00
d4289a2774 update list of commands in pygments LAMMPS lexer 2022-12-04 16:59:35 -05:00
e67bec6b2f use consistent pygments language tags 2022-12-04 16:59:17 -05:00
cf4d1ec744 add version tags 2022-12-04 16:30:50 -05:00
97c058d156 correct syntax-highlighting to use C++ lexer instead of C 2022-12-04 16:22:15 -05:00
d49840e8d5 rename doc file for all electrode fixes to fix_electrode.rst 2022-12-04 16:10:02 -05:00
a96d4101ea small doc updates, add version tags, rewrap paragraphs 2022-12-04 16:07:32 -05:00
7b818ace88 NEARLY working E_neb 2022-12-04 17:20:41 +01:00
1cde202079 test for coul/slater/long requires KSpace style ewald from KSPACE package 2022-12-04 04:24:10 -05:00
162f2f9384 whitespace; versionadded tags 2022-12-04 00:27:48 -06:00
f381a78c46 Added missing "call to" in Fortran docs 2022-12-03 21:52:30 -06:00
411f9b450f documented two overlooked functions; added NULL check to neighlist_element_neighbors 2022-12-03 21:39:14 -06:00
c0345845e8 unit test for gather and scatter; char* to const char* in library.* 2022-12-03 20:38:42 -06:00
dac55cf64d avoid segfault on short data read when parsing tabulated potentials 2022-12-03 20:45:52 -05:00
2f321576c5 Added documentation for scatter and gather; updated other docs 2022-12-03 16:03:29 -06:00
7c0c2234b3 Remove unused functions 2022-12-03 09:01:42 -05:00
71f086e159 implemented scatter, gather, and friends; wrote and updated documentation 2022-12-02 17:19:42 -06:00
b61b432078 update fitpod doc 2022-12-02 17:42:49 -05:00
fa160a21c2 Move precision and basename options from param input file to data input file 2022-12-02 17:41:34 -05:00
1eb489236e make certain binlo/binhi are initialized 2022-12-02 14:35:21 -05:00
6ef59196cf Update the description of the fitting in the fitpod doc 2022-12-02 10:43:01 -05:00
792635d1a9 address spelling issues 2022-12-02 10:42:40 -05:00
96c022d2d5 fix white spaces 2022-12-02 10:34:02 -05:00
25748781e2 Update doc for the regularization parameter as an optional input 2022-12-02 10:33:04 -05:00
e4791356c7 Add regularization parameter to make the fitting more robust. 2022-12-02 10:29:46 -05:00
43dca96ca4 Merge branch 'fortran-fix-external' of github.com:hammondkd/lammps into fortran-fix-external 2022-12-02 00:02:10 -06:00
b1664ce8ea replaced unit 0 with error_unit 2022-12-02 00:00:57 -06:00
4c9ca8761c Merge branch 'lammps:develop' into fortran-fix-external 2022-12-01 23:50:26 -06:00
c2a0660112 Bug fix and unit tests for fix external-related commands 2022-12-01 23:49:17 -06:00
539f5b2fcb Merge pull request #11 from akohlmey/pod-updates
ML-POD updates
2022-12-01 23:34:31 -05:00
5b42b607d9 add precision parameter keyword to docs 2022-12-01 23:26:55 -05:00
7968c49916 rename old log and add logs for second example 2022-12-01 23:22:27 -05:00
8224e05515 simplify by making precision directly an integer 2022-12-01 23:19:38 -05:00
ef7b18cd34 remove dead code 2022-12-01 23:19:00 -05:00
7ec27b4c09 update logs and unit test 2022-12-01 23:18:41 -05:00
7063574d61 whitespace 2022-12-01 23:03:30 -05:00
b9a70c3998 update unit test 2022-12-01 22:59:58 -05:00
e79ae87957 Stabilize the linear solve and update Ta examples 2022-12-01 22:38:09 -05:00
3fea762e30 Merge branch 'distributed-grids' of github.com:lammps/lammps into distributed-grids 2022-12-01 15:51:31 -07:00
1ba9ff7817 add new grid-based examples 2022-12-01 15:51:17 -07:00
713c7d3508 Cleaned up documentation 2022-12-01 16:49:18 -06:00
99b5053991 Update log files 2022-12-01 16:07:22 -05:00
82375f75e4 Update reference log files 2022-12-01 15:53:26 -05:00
1228b89ece Add a quadratic pod example for Ta 2022-12-01 15:37:05 -05:00
3c9a6c4265 Fix white space 2022-12-01 14:42:24 -05:00
2738f18889 Add optional precision to round the coefficients to ensure consistency across platforms 2022-12-01 13:53:42 -05:00
f91828d7a6 improve error messages 2022-12-01 11:02:16 -05:00
cd7b3897a4 enable and apply clang-format 2022-12-01 11:02:04 -05:00
65488ca217 silence compiler warnings 2022-12-01 10:51:04 -05:00
6365af8704 Merge branch 'develop' into distributed-grids 2022-12-01 10:38:55 -05:00
dbfc5c74ce spelling 2022-12-01 10:36:12 -05:00
6d4cb38d1f parse_gridid was renamed to parse_grid_id 2022-12-01 10:12:39 -05:00
87a0833edd whitespace fixes 2022-12-01 10:12:14 -05:00
196f16325c Update fitpod 2022-12-01 09:27:16 -05:00
db8b4af924 Merge branch 'pod' of https://github.com/cesmix-mit/lammps into pod 2022-12-01 09:18:18 -05:00
929f23095c Update fitpod to let proc 0 handle the linear system and broadcast the solution to other processors 2022-12-01 09:17:41 -05:00
d900c5adf0 Merge pull request #10 from akohlmey/pod-updates
More ML-POD updates
2022-12-01 09:09:46 -05:00
1d957d2c71 convert keyword lists in fitpod docs to proper tables 2022-12-01 08:49:54 -05:00
3792140734 prettify and simplify output table formatting using fmt::format() 2022-12-01 06:38:20 -05:00
1b40ff2a81 simplify 2022-12-01 06:38:20 -05:00
d7f16eb713 apply clang-format 2022-12-01 06:38:20 -05:00
587cfbeafe simplify. atom type to element mapping is checked in map_element2type() 2022-12-01 06:38:13 -05:00
8300d0865c correct name of pair style in error messages 2022-12-01 04:57:27 -05:00
52bd4ec9cf Merge pull request #9 from akohlmey/pod-updates 2022-11-30 23:52:06 -07:00
7cdb8a971a add false positive 2022-12-01 01:40:26 -05:00
8951aceecb add madelung logs 2022-12-01 16:35:57 +10:00
ad68eb8a59 add piston logs 2022-12-01 16:35:00 +10:00
a346d7c6ca truncate coefficient output to 8 digits precision that are reproducible 2022-12-01 01:12:26 -05:00
61c4953119 update log files 2022-12-01 00:55:29 -05:00
9523163300 update unittest 2022-12-01 00:53:05 -05:00
05669fd7ed whitespace 2022-12-01 00:32:13 -05:00
deb4684d26 Update README 2022-12-01 00:14:11 -05:00
bf07ccba77 Update documentation 2022-12-01 00:11:21 -05:00
a87aff7b87 Fixed bug and wrote unit tests for fix_external_array functions 2022-11-30 22:48:29 -06:00
fd13fe1e9a Add basename feature to output files and removed existing files 2022-11-30 22:34:42 -05:00
657054205d Merge pull request #8 from akohlmey/pod-updates
ML-POD updates
2022-11-30 21:44:27 -05:00
b7034e0380 update log files with updated coeff data 2022-11-30 21:27:01 -05:00
3333bdd5b9 update data without excess precision 2022-11-30 21:22:08 -05:00
264627daa6 programming style 2022-11-30 21:19:59 -05:00
d924d6bd17 plug one more memory leak 2022-11-30 21:19:46 -05:00
2a093e45ad Merge branch 'pod' into pod-updates 2022-11-30 21:07:58 -05:00
169d08fdf9 use new/delete for memory management in podstruct. add a destructor 2022-11-30 21:07:01 -05:00
8ba297fa64 Merge pull request #6 from akohlmey/pod-updates
ML-POD updates
2022-11-30 21:04:12 -05:00
793987e0c3 replace planar logs 2022-12-01 11:48:26 +10:00
a733e4ddf9 replace au-aq logs 2022-12-01 11:46:51 +10:00
d377a79f83 small style updates 2022-11-30 20:33:17 -05:00
cadffe7e8b rename fitpod command class to be consistent with rest of LAMMPS 2022-11-30 20:33:05 -05:00
2da2bf54b9 reduce memory leakage 2022-11-30 20:32:42 -05:00
d53701117b write to files only on MPI rank 0 2022-11-30 20:31:23 -05:00
c7300f47b1 replace logs for graph-il 2022-12-01 11:17:49 +10:00
736f545bad move install instructions for ML-POD into the correct place 2022-11-30 19:56:29 -05:00
4badeabd55 add versionadded tag 2022-11-30 19:56:02 -05:00
a52769f783 update README for potentials 2022-11-30 19:35:01 -05:00
6fe8b84c23 correct updating Makefile.package.setting edits, fix a few broken ones. 2022-11-30 19:31:00 -05:00
1b29f1d351 remove dead code and fix typo 2022-11-30 19:26:59 -05:00
26ecd2a9b0 update ML-POD example and include log files 2022-11-30 19:26:31 -05:00
0997842bf7 add back symlinks 2022-11-30 19:23:09 -05:00
13d1ce38d2 remove copies 2022-11-30 19:22:59 -05:00
6966a0726b remove redundant files and recreate logs 2022-11-30 19:17:40 -05:00
b68e56e9be (partially) apply clang-format 2022-11-30 19:11:20 -05:00
c0a01ae19b remove dead code 2022-11-30 19:10:27 -05:00
16e8e33d5b move podstruct initialization from header to implementation file 2022-11-30 19:09:43 -05:00
cd5bd9f378 add C++ marker for emacs 2022-11-30 19:08:18 -05:00
8eca05752a sort list of files to achieve consistent fitting 2022-11-30 18:49:59 -05:00
d61bfa05ea correct Install.sh brokenness inherited from ELECTRODE/Install.sh 2022-11-30 18:49:29 -05:00
5ed380c2d6 Merge pull request #5 from akohlmey/pod-updates
More ML-POD updates
2022-11-30 16:07:52 -05:00
2db1a74ba7 update false positives list 2022-11-30 14:13:11 -05:00
479e5ca862 Merge branch 'develop' into document-style-flags 2022-11-30 13:57:45 -05:00
7ce4b2eb68 fix bug with slab geometries 2022-11-30 11:55:19 -07:00
e1d31a5633 Merge branch 'develop' into pod-updates 2022-11-30 13:47:40 -05:00
e76e864152 Merge pull request #3539 from akohlmey/collected-small-changes
Collected small changes and fixes
2022-11-30 13:45:05 -05:00
5900c8a06d rewrap paragraphs 2022-11-30 13:41:42 -05:00
cd4d6261e2 spelling 2022-11-30 13:34:42 -05:00
e5b1b29912 Merge branch 'develop' into pod-updates 2022-11-30 13:25:32 -05:00
cc18528ea1 more bookkeeping changes 2022-11-30 10:56:54 -07:00
be8b96557c whitespace fixes 2022-11-30 12:13:31 -05:00
afd7a6f485 programming style 2022-11-30 12:02:03 -05:00
b543c4caa3 replace non-portable file globbing with LAMMPS utility functions 2022-11-30 12:01:53 -05:00
fdeeb3fdbc update .gitignore 2022-11-30 11:59:33 -05:00
d32da83eb6 small bookkeeping changes 2022-11-30 09:51:13 -07:00
72140e2608 Merge branch 'develop' into collected-small-changes 2022-11-30 08:52:13 -05:00
c11eabddc0 error out when a bond/angle/dihedral/improper substyle is not used
this implements the same behavior as for pair style hybrid
2022-11-30 08:09:51 -05:00
5f3b719a7d improve error messages 2022-11-30 08:09:12 -05:00
80e6575784 avoid segfault, if repscale array is not allocated 2022-11-30 08:08:32 -05:00
8579b117af Implemented remaining fix_external functions and documentation 2022-11-29 23:23:14 -06:00
dcf68bbf59 Update doc to reflect a change in the pair style name 2022-11-29 20:20:42 -05:00
362739a337 Move examples to lammps/examples/PACKAGES/pod and rename source files 2022-11-29 20:06:04 -05:00
aecd3841be Initial implementation of fix_external_get_force 2022-11-29 18:28:52 -06:00
47d46e0257 doc page tweak 2022-11-29 16:58:07 -07:00
051ed8f884 spell checks 2022-11-29 16:39:31 -07:00
1924689867 spell checks 2022-11-29 16:37:43 -07:00
0fc25a9942 reformating RST file 2022-11-29 16:28:40 -07:00
2d3630a31f reformating RST file 2022-11-29 16:22:48 -07:00
479f7e19ee reformating RST file 2022-11-29 16:21:08 -07:00
e0c7ea9db6 reformating RST file 2022-11-29 16:19:01 -07:00
bb7bfc7ee7 developer doc page for distributed grids 2022-11-29 16:14:05 -07:00
9b7b45bdea update lib/linalg README 2022-11-29 17:27:07 -05:00
63b2d2eec7 Merge pull request #3530 from akohlmey/reset-command
Add reset_atoms meta-command and reset_atoms image command
2022-11-29 17:17:20 -05:00
c674f0864d Added lammps_fix_external_get_force to C library utility doc page 2022-11-29 15:56:26 -06:00
df5b97d6fe Merge branch 'lammps:develop' into fortran-fix-external 2022-11-29 15:43:40 -06:00
5f9956405a Updated docs and wrote unit tests for lmp_set_fix_external_callback; fixed typos 2022-11-29 15:37:15 -06:00
a3e0cfa8f7 Merge pull request #3541 from stanmoore1/kk_reax_tag
Fix bug in Kokkos ReaxFF, Tersoff, and Fix Neigh History on GPUs
2022-11-29 14:56:00 -05:00
b53964a5ac print aligned column headers for NEB output 2022-11-29 14:48:13 -05:00
c43b332b13 Merge pull request #4 from akohlmey/pod-updates
Some more ML-POD updates
2022-11-29 14:45:06 -05:00
5de185e89b Allow name tag for output files 2022-11-29 14:43:55 -05:00
1701b713a0 update code owners file for ML-POD package 2022-11-29 13:58:51 -05:00
6cd8689705 performance improvement replacing pow(x,0.5) with sqrt(x) and similar 2022-11-29 13:47:18 -05:00
690d889b38 use MathConst::MY_PI instead of M_PI 2022-11-29 13:25:29 -05:00
4b4f8507ea update code owners file for ML-POD package 2022-11-29 13:20:33 -05:00
3ac4202de2 Fix GPU tag issues in other Kokkos styles 2022-11-29 10:25:43 -07:00
2cfcb16e31 update python to version to 3.11 and disable png/jpeg for now 2022-11-29 11:55:04 -05:00
1e408416d2 Fix bug in Kokkos ReaxFF on GPUs 2022-11-29 09:21:15 -07:00
f787a0934b Merge pull request #2 from akohlmey/pod-updates
More ML-POD package updates and fixes
2022-11-28 17:08:57 -05:00
748ba7f6f5 fix broken link and clarify 2022-11-28 15:53:31 -05:00
e84a80e58c Update Developer_code_design.rst 2022-11-28 13:42:11 -07:00
7e09bc6e04 update python to version to 3.11 and disable png/jpeg for now 2022-11-28 15:11:33 -05:00
38f659f80e add metadata tags to potential file for mlpod 2022-11-28 15:05:20 -05:00
e1d1c72d94 update example to conform to LAMMPS conventions 2022-11-28 15:04:38 -05:00
e95551a16c update python to version to 3.11 and disable png/jpeg for now 2022-11-28 14:34:27 -05:00
d5da179afc correct docs for compute pair/local dx/dy/dz to reflect the code behavior 2022-11-28 14:12:30 -05:00
9b00d455b3 whitespace 2022-11-28 14:05:03 -05:00
9ba759bdd7 fix sphinx formatting issue 2022-11-28 14:00:26 -05:00
e2fa4a978b reformat changes 2022-11-28 10:44:19 -07:00
cf0ff1614e merged 3 doc pages for reset_atoms command 2022-11-28 10:32:53 -07:00
afe751fc8f style updates 2022-11-28 12:21:49 -05:00
6a8ee284bc print warning when per-atom energy or per-atom stress is requested in a run 2022-11-28 12:21:21 -05:00
0f216b5830 whitespace 2022-11-28 11:41:37 -05:00
ebdce82009 Merge branch 'pod' into pod-updates 2022-11-28 11:40:40 -05:00
e78ee616c3 update fitpod documentation 2022-11-28 11:08:50 -05:00
3b56d5e9b1 Update for documentation, change percentage to fraction, and fix some printing issues in fitpod_command 2022-11-28 11:03:18 -05:00
a3f1c25537 Merge branch 'develop' into merge-develop 2022-11-28 09:16:50 +01:00
ccc24b68ac avoid memory leak 2022-11-28 01:53:48 -05:00
518d51257c avoid leaking file pointer 2022-11-28 01:53:41 -05:00
bba486f0f1 simplify code and plug some memory leaks 2022-11-28 01:40:27 -05:00
1aa0154f3e document lack of per-atom energy/stress 2022-11-28 01:30:33 -05:00
3de72cee14 Merge branch 'pod' into pod-updates 2022-11-28 01:17:07 -05:00
b2cbfee47e add unit test for ML-POD package pair style mlpod 2022-11-28 01:10:46 -05:00
7ad7796508 fix a combination of programming style, memory leak, and formatting issues 2022-11-28 01:10:03 -05:00
ccffe80b8d update MPI functionality for fitpod command 2022-11-28 01:09:36 -05:00
ac67514016 apply clang-format 2022-11-28 01:09:16 -05:00
86f7023a7a skip per-atom energy check for pair style mlpod 2022-11-28 01:08:59 -05:00
484b84396c whitespace 2022-11-27 23:50:04 -05:00
fda10cf604 Merge branch 'pod' into pod-updates 2022-11-27 23:48:27 -05:00
45c2d1f45d fix typo and improve wording 2022-11-27 23:41:10 -05:00
72d28297be disable png/jpeg for now 2022-11-27 23:37:43 -05:00
234725a9fb Update MPI functionality for quadratic POD 2022-11-27 22:22:52 -05:00
cdc0157dcf improve output formatting 2022-11-27 19:42:54 -05:00
2e8fd7e316 respect all q for fix/electrode/conq with symm off 2022-11-28 10:14:00 +10:00
4c65d0c50e ignore last q for fix/electrode/conq with symm on and cg algos 2022-11-28 09:56:50 +10:00
e732fcacf3 include comm in electrode/conq 2022-11-27 23:46:00 +00:00
9958c9dfd7 update documentation 2022-11-27 23:46:00 +00:00
e58b71b0c9 issue warnings from only proc 0 2022-11-27 23:46:00 +00:00
32a3fc21bc enable symm for conq and thermo 2022-11-27 23:46:00 +00:00
37c7d7e325 avoid uninitialized data in sw/intel pair style 2022-11-27 18:35:05 -05:00
fb74d64889 disable building PYTHON package on Windows until the failure is understood 2022-11-27 18:10:28 -05:00
e7d72040e1 update BLAS/LAPACK to version 3.11.0 from 22 Nov 2022 2022-11-27 18:06:01 -05:00
c366441c15 add DPOTSV and DPOTRS LAPACK functions 2022-11-27 18:05:54 -05:00
d3d8dda40a try to debug python failure with v3.11 some more 2022-11-27 17:34:37 -05:00
d3bb55fa4f update BLAS/LAPACK to version 3.11.0 from 22 Nov 2022 2022-11-27 17:24:05 -05:00
5205e208a0 add DPOTSV and DPOTRS LAPACK functions 2022-11-27 17:18:23 -05:00
308f9ce8bf provide customized Install.sh for ML-POD package 2022-11-27 17:16:31 -05:00
1df948b26b add ML-POD package to relevant CMake presets 2022-11-27 17:16:13 -05:00
5bc4ac1cd8 add ml-pod package to "lib", "int", and "all" package lists 2022-11-27 17:12:41 -05:00
0636be8289 update .gitignore 2022-11-27 17:11:46 -05:00
50cb575415 temporarily disable failing command 2022-11-27 16:33:08 -05:00
b5238b9353 improve argument parsing and error messages 2022-11-27 16:27:49 -05:00
816736afd1 fix memory leak 2022-11-27 16:27:14 -05:00
ee5b021c57 Update MLPOD's documentation and changed example folder name from pod to mlpod 2022-11-27 11:14:21 -05:00
c8894e4d48 Change CPOD to MLPOD 2022-11-27 10:50:53 -05:00
f49b50be5e update installed python version to 3.11 in MSVC native compile/test 2022-11-26 15:29:32 -05:00
5458992dd3 Rename class PairPOD to PairMLPOD, initialize variables in constructor 2022-11-25 20:37:02 -07:00
76dbc498a0 doc tweaks 2022-11-25 15:03:03 -07:00
878b8a8a13 better argument checking with threebody off, disallow invalid uses
this now reads the potential file only on the first pair_coeff command
and also creates the element to atom type map then. all following
pair_coeff commands must be consistent. LAMMPS will stop if not.

we also need to explicity assign setflag and must not have it reset
when creating the mappings.
2022-11-25 15:37:06 -05:00
2e6fdf2ea3 improved error message 2022-11-25 15:31:16 -05:00
2efd485bd0 update Intel buffers for calculations 2022-11-25 08:37:49 +00:00
170c312a0c Fixed oversight in set_fix_external_callback and wrote its documentation 2022-11-24 21:07:46 -06:00
e36a360891 error out when reduced units are used with fix ipi or fix pimd 2022-11-24 13:17:11 -05:00
3ce79f8da3 strip style suffixes when writing restart files if suffixes are enabled 2022-11-24 11:51:58 -05:00
4adf3708d4 add strip_style_suffix utility function 2022-11-24 11:50:21 -05:00
242cc5f993 error out when reduced units are used with fix ipi or fix pimd 2022-11-24 10:14:09 -05:00
48a808122f Merge branch 'develop' into reset-command 2022-11-23 16:12:10 -05:00
7a4e1ed5bf Merge pull request #3527 from akohlmey/collected-small-changes
Collected small changes and fixes
2022-11-23 15:37:25 -05:00
4ba604fd37 Merge branch 'collected-small-changes' into reset-command 2022-11-23 13:38:40 -05:00
7f4ebaf672 correct triclinic box check 2022-11-23 13:32:13 -05:00
0ae5fd3a60 cosmetic 2022-11-23 13:31:47 -05:00
32ce17c9ad fix typo 2022-11-23 12:55:51 -05:00
dd8a14789b update docs for new image features 2022-11-23 10:52:46 -07:00
b2f680e4bc update unit tests for pair style bugfixes 2022-11-23 12:26:11 -05:00
ed756f5077 fix bug parsing arguments in nm/cut/coul/* pair styles 2022-11-23 12:23:42 -05:00
0f05f8650b Merge branch 'fix_sph_example' of github.com:timteichmann/lammps into collected-small-changes 2022-11-23 09:29:54 -05:00
3a49b69dee Fix SPH shock tube 2d example input deck 2022-11-23 15:14:12 +01:00
41f97430e1 fix leaks for ewald and pppm/intel 2022-11-23 15:20:11 +10:00
e9c2608e76 delete boundcorr in deallocate() 2022-11-23 15:08:31 +10:00
fbc1dc099d Merge pull request #1 from akohlmey/pod-updates
Some updates to the ML-POD package pull request
2022-11-22 18:51:00 -05:00
9ab4c65f31 more work on dump image 2022-11-22 16:40:39 -07:00
e2d6bb0c31 Merge branch 'develop' into pod-updates 2022-11-22 18:32:20 -05:00
e5ac673e2b avoid implicit string copy 2022-11-22 18:31:13 -05:00
14f47a27ca avoid variable length arrays 2022-11-22 18:30:47 -05:00
bbe3a10059 avoid variable length array 2022-11-22 18:21:13 -05:00
80f20f5314 remove dead code 2022-11-22 18:21:03 -05:00
b572b40ef1 follow include style more closely 2022-11-22 18:12:54 -05:00
3b07e64da5 whitespace 2022-11-22 18:11:17 -05:00
741620148d use fmt library features for aligned output 2022-11-22 18:10:06 -05:00
b7c4d5737b avoid variable length array 2022-11-22 18:09:41 -05:00
a1b40a8c08 remove dead code 2022-11-22 18:09:19 -05:00
de8f0c9ae9 use platform::walltime() 2022-11-22 17:20:35 -05:00
135531e0b7 Merge pull request #3533 from ssande7/maxwarn
Bugfix: Respect thermo_modify warn always
2022-11-22 10:58:48 -05:00
e165607710 Remove unnecessary functions and variables from pairstyle 2022-11-22 08:45:43 -07:00
00b474eee5 simplify 2022-11-22 05:46:53 -05:00
a8f45846a7 Respect thermo_modify warn always 2022-11-22 16:30:55 +10:00
95841b0efd Implementation (after several failures) of set_fix_external_callback 2022-11-21 22:38:10 -06:00
a098b16030 expand valid range of bond/angle style gaussian. update docs and tests. 2022-11-21 22:28:44 -05:00
23025316c9 Merge branch 'develop' into collected-small-changes 2022-11-21 18:11:30 -05:00
13e6c82273 document the change of the reset_* commands 2022-11-21 18:02:46 -05:00
e9ec915e45 document removal of "box" command. 2022-11-21 17:59:29 -05:00
cbab8fa102 update documentation with new command names 2022-11-21 17:52:33 -05:00
2b9d5c6c9a rename reset metacommands to use reset_atoms 2022-11-21 17:20:29 -05:00
a21a09f6d3 Backport https://github.com/kokkos/kokkos/pull/5624 to Kokkos version bundled with LAMMPS 2022-11-21 14:57:55 -07:00
356827df12 update documentation for removal of box command 2022-11-21 14:04:58 -05:00
13fcbeda18 remove "box" command 2022-11-21 13:46:59 -05:00
8559857540 Fix double deallocation in fitpod 2022-11-20 16:03:04 -07:00
98d2dc3d01 removed some redundant code 2022-11-20 15:00:21 -05:00
8247d127b8 removed some headers 2022-11-20 14:39:05 -05:00
714ad002f3 Merge branch 'pod' of https://github.com/cesmix-mit/lammps into pod 2022-11-20 14:13:53 -05:00
d75bf01b2d create Makefile for ML-POD 2022-11-20 14:13:51 -05:00
341ea2847f Merge branch 'pod' of https://github.com/cesmix-mit/lammps into pod 2022-11-20 11:30:29 -07:00
8114bfbd3d Replace unnecessary memory functions with lammps memory class 2022-11-20 11:29:57 -07:00
78c4f46565 Merge branch 'pod' of https://github.com/cesmix-mit/lammps into pod 2022-11-20 12:30:14 -05:00
1c1f3f8e2b update pod doc 2022-11-20 12:30:11 -05:00
5424344dc6 Forward declare podptr in fitpod header 2022-11-20 09:56:37 -07:00
7d31793460 Use mlpod instead of pod 2022-11-20 09:42:05 -07:00
143147e7b9 Use lammps memory allocation everywhere 2022-11-20 09:41:36 -07:00
33356aebcf update pod.txt 2022-11-20 11:40:33 -05:00
d8b8a8bad1 Delete podcommon.h 2022-11-20 11:36:00 -05:00
942bb40f60 Update fitpod_command.h 2022-11-19 22:16:36 -05:00
50d3f88705 Update fitpod command 2022-11-19 22:05:54 -05:00
045afe00d8 add tests for read_data add, and read_data with fix property/atom 2022-11-19 21:19:20 -05:00
4b71ceeb92 Merge branch 'pod' of https://github.com/cesmix-mit/lammps into pod 2022-11-19 21:09:12 -05:00
a0879cf923 pod fit 2022-11-19 21:09:08 -05:00
e0a251f7b4 Use forward declaration of podptr in pair_pod.h 2022-11-19 16:47:18 -07:00
d8169b02ff Use lammps memory class in pair_pod 2022-11-19 16:37:27 -07:00
442eeb9f52 support special case where number of data lines from fix is number of added atoms 2022-11-19 14:06:16 -05:00
b39842ba23 avoid segfault when reading beyond the provided number of lines 2022-11-19 14:00:22 -05:00
6c87236e7a fix typos 2022-11-18 13:29:23 -05:00
1cb927294f use group that is not "all" 2022-11-18 04:51:56 -05:00
22c2cf5c3e update existing tests. add new tests for reset image_flags 2022-11-18 04:42:13 -05:00
0dd193d70d error out on extra keywords 2022-11-18 00:30:52 -05:00
7a929d2124 update error messags and enable/apply clang-format 2022-11-17 23:24:26 -05:00
60122f2aeb update docs 2022-11-17 23:23:29 -05:00
e8471790bc route renamed reset sub-commands through Deprecated class to print warning 2022-11-17 23:11:41 -05:00
7e9d66bbfb unfix style check 2022-11-17 23:10:38 -05:00
c9a6299d28 add reset command to docs, adapt pages for sub-commands 2022-11-17 22:52:07 -05:00
0635a46891 generalize meta command processing. make better use of std::string class 2022-11-17 22:09:52 -05:00
612a2b2711 add reset meta-command 2022-11-17 21:39:32 -05:00
0c306fde04 apply clang-format 2022-11-17 21:05:26 -05:00
03247aa28e add reset_image_flags command 2022-11-17 21:04:35 -05:00
3683f144a6 fixed compile issue 2022-11-17 16:32:15 -07:00
c9b431214c more work on dump image 2022-11-17 15:56:15 -07:00
94cc3f6590 Merge pull request #3524 from ssande7/respa_fix
Fix segfault when using dynamic groups with r-RESPA
2022-11-17 17:13:15 -05:00
ae1b48b52b use smaller maximum box count for maximum allowed distance 2022-11-17 14:15:30 -05:00
15bf4a281d documentation corrections 2022-11-17 11:48:13 -05:00
096a70363b allow to check if Kokkos is active and retrieve number of threads and gpus 2022-11-17 11:31:34 -05:00
ae59b6ca3f Merge branch 'correct-tune' of github.com:mehdibghk/lammps into collected-small-changes 2022-11-17 10:56:10 -05:00
dde2ef3462 correct a grammatical error 2022-11-17 23:25:04 +08:00
df5cfd18eb start adding support for dump image of grid cell values 2022-11-16 15:35:21 -07:00
b60725197f address uninitialized data warnings from coverity scan 2022-11-16 14:50:16 -05:00
a46b1114ff spelling updates for fix bond/react 2022-11-16 14:15:56 -05:00
57e42a06af make overloaded alias inline function 2022-11-16 10:02:02 -05:00
925a9a4bb3 use name in capitals for compile time constant 2022-11-16 09:59:02 -05:00
67c5bb2a0d small programming style updates 2022-11-15 21:13:22 -05:00
ef7b5017cf Merge branch 'develop' into collected-small-changes 2022-11-15 21:05:34 -05:00
4655039774 Merge pull request #3514 from jrgissing/per-bond_custom_constraint
bond/react feature updates
2022-11-15 21:03:12 -05:00
81c37f6dd6 add versionchanged tag to "python source" docs 2022-11-15 17:15:07 -05:00
b8121be513 Merge branch 'respa_fix' of github.com:ssande7/lammps into collected-small-changes 2022-11-15 17:07:31 -05:00
1464b55f81 add symbolic links for data file for FEP examples 2022-11-15 17:07:02 -05:00
40c05114f2 update pair style suffix handling in compute fep to support hybrid suffixes 2022-11-15 17:01:30 -05:00
7b968cf7a9 Merge branch 'develop' into collected-small-changes 2022-11-15 16:31:27 -05:00
7a42d2a54a Merge pull request #3525 from davidfir3/fep
Append suffix to pstyle (pair style name) of compute fep
2022-11-15 16:31:00 -05:00
d813da3fcd Merge pull request #3521 from akohlmey/refactor-python-source-command
Refactor python source command and error reporting
2022-11-15 13:01:07 -05:00
31972fc287 reduce redundant code. avoid Domain::minimum_image() getting "stuck". 2022-11-15 07:40:02 -05:00
859403e2af dt/reset now works in parallel 2022-11-15 12:01:29 +01:00
97bd404f33 add versionadded marker 2022-11-15 03:46:50 -05:00
3fd122311d some more grammar updates and clarifications 2022-11-15 03:45:04 -05:00
742265bfdb append suffix to pair style 2022-11-15 16:39:38 +08:00
c191086812 Fix segfault when using dynamic groups with r-RESPA 2022-11-15 15:02:35 +10:00
a2435ea200 more work on dump grid/vtk 2022-11-14 15:31:11 -07:00
175b2b045a tweak grammar 2022-11-14 14:10:43 -05:00
a7de83d289 Update Kokkos Install.sh and fix typo in docs 2022-11-14 08:24:28 -07:00
670f68e4d5 Merge branch 'lammps:develop' into fix_viscous_kokkos 2022-11-14 13:43:28 +01:00
54dbe36fe9 Merge branch 'fix_viscous_kokkos' of github.com:mkanski/lammps into fix_viscous_kokkos 2022-11-14 13:30:56 +01:00
4647096a97 Add docs 2022-11-14 13:30:41 +01:00
f5261b449a Remove setup from BoundaryCorrection 2022-11-14 10:02:36 +01:00
eee6862f25 copy error + other fixes 2022-11-12 02:13:39 -05:00
cc4c59649c spelling 2022-11-11 22:06:53 -05:00
d4bd0a74a7 change "inline" keyword to "here" for consistency with the other uses 2022-11-11 22:05:35 -05:00
5e832aa360 revise documentation 2022-11-11 22:05:09 -05:00
72752931fa version tags 2022-11-11 17:25:49 -05:00
86172eb75f bond/react restart revision numbers 2022-11-11 17:16:37 -05:00
0890bc026e ensure backward compatibility of restarts 2022-11-11 15:28:36 -05:00
148df8589b revise error reporting in the python command 2022-11-10 23:30:03 -05:00
b6b81a951a improve error reporting for python style variables 2022-11-10 17:17:23 -05:00
5dbc41c168 First working version (rmass not tested yet) 2022-11-10 22:33:19 +01:00
34a5093229 refactor handling of the python source command. document it and more limits. 2022-11-10 16:03:06 -05:00
dd8c1df9c2 Merge pull request #3516 from akohlmey/collected-small-changes
Collected small changes and fixes
2022-11-10 14:30:57 -05:00
fabfd86338 Base for KOKKOS dt/reset 2022-11-10 20:23:55 +01:00
27bd28bf34 CUDA should work now 2022-11-10 18:52:28 +01:00
9a78f45c09 Second try for CUDA 2022-11-10 17:03:55 +01:00
ee5d40984f Change the way gamma is accessed 2022-11-10 15:43:08 +01:00
c2f4c8d23a First version of KOKKOS fix viscous 2022-11-10 14:13:44 +01:00
01b4600ba5 remove obsolete file 2022-11-10 07:11:22 -05:00
1932b6390a update and sort codeowners lists 2022-11-10 07:11:12 -05:00
c00a5d52d2 silence compiler warnings 2022-11-10 02:25:00 -05:00
4392b9c8cb store LAMMPS version of restart, if initialized from restart file 2022-11-10 02:24:50 -05:00
1fa7308ade Merge branch 'github-ylz-update' of github.com:mehdibghk/lammps into collected-small-changes 2022-11-10 01:52:40 -05:00
aaa8e9d219 populate atoms2bond in bond/react 2022-11-09 17:51:21 -05:00
f9d07d8932 revert non-bond-react changes 2022-11-09 17:40:57 -05:00
4e36a81f2a clarify doc page 2022-11-09 10:05:24 -07:00
cd5d41868f remove debug statements 2022-11-09 09:54:04 -07:00
e16aed28b6 debug 2022-11-09 09:20:19 -07:00
d53ce7aba9 initialize pointer to null 2022-11-09 11:15:18 +08:00
de090bf3d4 add doc line 2022-11-08 18:11:04 -07:00
ec0b38f7b7 bug fix in pppm/disp 2022-11-08 18:08:22 -07:00
df9dc387ac debug 2022-11-08 17:26:29 -07:00
f684cd560f Merge branch 'distributed-grids' of github.com:lammps/lammps into distributed-grids 2022-11-08 17:14:05 -07:00
65ce9aa791 KSpace bug fixes 2022-11-08 11:22:25 -07:00
af36dc3df0 Style changes, alphabetize headers, cleaner READMEs 2022-11-08 09:25:26 -07:00
a62defa8ad Merge branch 'pod' of https://github.com/cesmix-mit/lammps into pod 2022-11-08 11:03:48 -05:00
f18295bb51 Ta example 2022-11-08 11:02:44 -05:00
64c9f7ffed Merge branch 'develop' into electrode 2022-11-08 09:46:56 +01:00
a3e7106f31 expand docs for bond/angle/dihedral/improper styles 2022-11-07 23:52:23 -05:00
aa46f5560a add .. versiondded:: tag to BPM package commands and restrictions text consistent 2022-11-07 22:57:32 -05:00
f6d9f58bfc Remove unnecessary functions 2022-11-07 18:25:39 -07:00
da929b4f7f Fix merge conflicts 2022-11-07 17:37:50 -07:00
1fbd45a05d Format docs 2022-11-07 17:33:00 -07:00
4616c1b4a3 Fix whitespace 2022-11-07 17:31:53 -07:00
09bcb02145 Clean up example 2022-11-07 17:17:48 -07:00
7d5b85812f Write error analysis with fmt 2022-11-07 16:45:03 -07:00
90b54300e9 remove whitespace 2022-11-07 16:18:40 -07:00
b18d388e4c fix segfault in base class destructor when destructing PPPMElectrode() 2022-11-07 17:17:48 -05:00
959b9c220f Cleaned up unused member functions and hd_balancer calls 2022-11-07 15:49:37 -06:00
a986f035d6 update list of functions and add list of flags for pair styles 2022-11-07 16:10:12 -05:00
e6da584a76 doc pages 2022-11-07 11:41:59 -07:00
3390d51c48 bug fix in amoeba_convolution 2022-11-07 10:40:45 -07:00
d2a90a05fb add support for ELECTRODE pkg PPPM 2022-11-07 10:16:39 -07:00
0a0ac226d1 Merge remote-tracking branch 'akohlmey/support-msmpi' into collected-small-changes 2022-11-07 11:21:16 -05:00
dc4301dfa8 initialize ADIOS dumps only the first time when used in multiple runs 2022-11-07 08:57:12 -05:00
401b5cee6d add -y flag to add-repository commands to avoid issues with GPG support changes 2022-11-07 07:32:08 -05:00
09e490db40 add support for building/using the ADIOS package without MPI
This needs the ADIOS2 installation being configured accordingly.
2022-11-07 07:24:17 -05:00
89f896ea73 Include MS-MPI in Windows build and test through GitHub Actions 2022-11-05 23:57:29 -04:00
7d7227c334 Read xyz files with lammps utils 2022-11-05 19:59:48 -06:00
97a0f0f40a Read training/testing data file with lammps utils 2022-11-05 14:44:28 -06:00
6ec8ff3c51 Read pod file with lammps utils 2022-11-05 13:34:45 -06:00
f8c90c2674 Read coefficients with lammps utils 2022-11-05 12:10:13 -06:00
3b47afa69f Update fix_bond_react.rst 2022-11-05 02:03:02 -04:00
b2652a4542 fix writing restarts without rate_limit 2022-11-05 01:22:54 -04:00
565853ee07 rescale_charges keyword 2022-11-05 01:05:45 -04:00
d5929a5cf8 reflect rate_limit restart support in docs 2022-11-04 23:52:13 -04:00
3dab9cf8d8 bug fixes to grid remapping 2022-11-04 21:41:58 -06:00
bd5ea1b896 add MS-MPI support to ML-PACE plugin and demo plugins 2022-11-04 23:32:40 -04:00
710197cd88 add MS-MPI support to CMake support for plugins 2022-11-04 23:00:34 -04:00
0de50f29f7 add option to use the MS-MPI SDK to cross-compile Windows binaries 2022-11-04 21:56:06 -04:00
a3cc0e8432 Reverted the block size tuning, which caused bugs for low atom counts (will revisit later) 2022-11-04 13:45:59 -05:00
b4118c51cc merged in current master 2022-11-04 08:22:18 -06:00
0b7c391dfd smooth restart when using rate_limit
breaks backward compatibility of restart files (probably can be avoided)
2022-11-04 00:49:26 -04:00
2f1f7ee0fa Cleaned up code 2022-11-03 23:45:40 -05:00
559ed8c490 doc page updates, start adding remap support to fix ave/grid 2022-11-03 17:05:23 -06:00
1a271b4870 add mention of Nlimit variable support 2022-11-03 11:21:16 -04:00
eb01f816ec rate_limit docs 2022-11-03 11:09:44 -04:00
8af384243f support for more caller options in Grid2d/3d 2022-11-02 15:01:58 -06:00
7346aee4ad logic for all callers to use new Grid3d/Grid2d 2022-11-02 11:46:26 -06:00
076f55dbca Update Ta example 2022-11-02 09:20:20 -04:00
d75fd564a1 update grid2d to match grid3d 2022-11-01 16:11:14 -06:00
736b420a49 reaction rate limit option 2022-11-01 18:03:30 -04:00
4c29457351 more classes use Grid3d 2022-11-01 15:53:39 -06:00
202fc44e86 Merge branch 'lammps-develop3' into per-bond_custom_constraint
rebase
2022-11-01 15:52:12 -04:00
189f803ef6 correct, simplify rxnbond example 2022-11-01 15:51:37 -04:00
ed6fe96909 simplify, formatting 2022-11-01 15:51:37 -04:00
f0a421eb25 bond:react per-bond custom constraint docs 2022-11-01 15:51:36 -04:00
23353208f2 check that bond is actually in map 2022-11-01 15:11:19 -04:00
fe6cf36101 prevent multiple compute evaluations on a timestep 2022-11-01 15:11:19 -04:00
5e9b4d8678 actually evaluate bond/local compute value
(even when not printed on that timestep)
2022-11-01 15:11:19 -04:00
d090fce262 bond/react: per-bond custom constraint 2022-11-01 15:11:19 -04:00
9e79a1ef76 non-'bond/react ' changes 2022-11-01 15:06:06 -04:00
335bacebb7 more doc in *.h file 2022-10-31 15:34:58 -06:00
94024475c1 allow for centered grid cells in proc mapping 2022-10-31 15:29:02 -06:00
aa777a2196 allow for centered grid cells in proc mapping 2022-10-31 15:28:39 -06:00
19fad284af more on shift factors 2022-10-28 18:03:08 -06:00
861e3b5876 shift factors 2022-10-28 17:46:19 -06:00
b6e29fd5d7 debugging of grid remap 2022-10-27 16:40:53 -06:00
7bf4c8d54a more debugging 2022-10-26 15:14:06 -06:00
a4a10e970e sync output formats 2022-10-25 17:06:24 -06:00
b8b25225d4 start debugging 2022-10-25 17:04:34 -06:00
ac3dde957d Review old todos 2022-10-24 14:05:34 +02:00
0654d6c8d6 Refactor A-matrix in INTEL (and base package) 2022-10-21 08:24:19 +00:00
9d962363a6 Enforced net induced charges to be zero 2022-10-21 00:12:40 -05:00
5639820702 Fixed an issue with fieldforce_ad() in pppm/dielectric 2022-10-20 23:35:56 -05:00
a1b915e469 Merge branch 'upstream' into dielectric-updates 2022-10-20 23:28:58 -05:00
ec5b344a9f read/write from/to file for grid data 2022-10-20 17:18:48 -06:00
45c1c1e53b add regular grid remap logic 2022-10-19 14:12:57 -06:00
bf64deb2c2 finish initial version of remap functions for 2d/3d 2022-10-18 17:10:16 -06:00
deb137db8a Refactor amatrix
Computation of long-range A matrix with pppm is optimized.
2022-10-18 07:27:05 +00:00
f338b5a106 sync 2022-10-17 15:26:36 -06:00
ed838f1a48 flesh out remap operation 2022-10-17 15:24:44 -06:00
0383de2beb more work on remap 2022-10-14 16:39:38 -06:00
37f4b557d9 remove algo keyword from in.conp 2022-10-14 08:20:41 +00:00
264d9c4aae Piston example for ELECTRODE 2022-10-13 09:11:05 +02:00
21ad9c7b55 update pair_pod 2022-10-12 21:54:28 -04:00
edb7889bd8 update pair_pod.h 2022-10-12 21:49:51 -04:00
440724f73a Merge branch 'pod' of https://github.com/cesmix-mit/lammps into pod 2022-10-12 21:24:46 -04:00
5fbedfb492 update 2022-10-12 21:11:29 -04:00
ab51c53dfd add identical check between 2 grids 2022-10-12 17:34:42 -06:00
6658b95dac add cleanup note 2022-10-12 16:40:12 -06:00
a55fd6c53b Merge branch 'distributed-grids' of github.com:lammps/lammps into distributed-grids 2022-10-12 16:38:50 -06:00
84282a3c75 ditto for Grid2d 2022-10-12 16:38:35 -06:00
8313a8aa49 calling structure for Grid3d remap 2022-10-12 16:34:34 -06:00
4f2c6586e7 whitespace 2022-10-12 11:39:42 -06:00
a218c2ad9c Fix CMake build 2022-10-12 11:33:55 -06:00
ffdfae4784 Port grid3d changes to Kokkos 2022-10-12 11:28:22 -06:00
a0d859933c Update from master 2022-10-12 09:49:55 -06:00
5f285e6aa3 Update documentation
Make documentation of ELECTRODE fixes more complete by listing more warnings and describing options more fully.
Use utils::logical for toggle (on/off) options.
With the changes in etypes to auto-detect electrode types it makes more sense to make it an on/off toggle as well, so that we don't have inconsistent keyword types.
2022-10-12 12:00:46 +00:00
ea7e0fbb6c Madelung benchmark 2022-10-12 07:01:44 +00:00
812fa50196 Apply 1 suggestion(s) to 1 file(s) 2022-10-10 06:31:03 +00:00
00f46120c7 Removed max_cus() from Device, used device->gpu->cus() instead 2022-10-07 15:50:30 -05:00
928bbee97c Use etaij for electrode-electrode interaction 2022-10-07 11:36:42 +02:00
7344d546bc Merge branch 'electrode' into safer_management 2022-10-07 15:34:43 +10:00
758412fd46 Electrostatic potential removed from ecoul 2022-10-07 05:12:19 +00:00
bfaaf1b82c Merge branch 'electrode' into safer_management 2022-10-07 15:10:57 +10:00
9303732171 fix-whitespace 2022-10-07 15:08:40 +10:00
0932434f55 Apply 1 suggestion(s) to 1 file(s) 2022-10-07 04:23:27 +00:00
6b9e83fe20 Added timing for the induced dipole spreading part, computed the block size to ensure all the CUs are occupied by the fphi_uind and fphi_mpole kernels 2022-10-06 15:03:58 -05:00
009ed36301 Updated src/GPU Install.sh to include amoeba_convolution_gpu.* 2022-10-01 11:16:30 -05:00
2ef6a59c0a Merge branch 'develop' into amoeba-gpu 2022-10-01 00:38:24 -05:00
9a1f23a079 Cosmetic changes and cleanup 2022-09-30 17:32:25 -05:00
1d75ca3b20 Moved precompute() out of the terms in amoeba and hippo, to be involed in the first term in a time step: multipole for amoeba and repulsion for hippo 2022-09-30 16:31:13 -05:00
2c9396fb25 Clean up pair style 2022-09-30 12:58:43 -06:00
98fce11d07 Only use training data in compute 2022-09-30 12:10:34 -06:00
af3fbeb7d4 Don't use iostream 2022-09-30 11:41:16 -06:00
e6d2582642 Updated fphi_mpole, renamed precompute_induce to precompute_kspace 2022-09-28 15:08:18 -05:00
560df20a68 Fixing math syntax in bpm/rotational documenation 2022-09-28 10:00:59 -06:00
0b8142e12e Merge remote-tracking branch 'upstream/develop' into develop 2022-09-28 09:25:00 -06:00
d7c799a09a Merge pull request #2 from aliehlen/dielectric-docs
update of DIELECTRIC package documentation and examples
2022-09-27 14:29:58 -05:00
6b74d04a57 Merge branch 'dielectric-updates' into dielectric-docs 2022-09-27 14:29:10 -05:00
e73a0e522f Check if multiple electrode fixes 2022-09-27 14:41:30 +02:00
ee611d8cf7 update pod documentation 2022-09-26 09:55:12 -04:00
6b8eada9f0 Merge branch 'pod' of https://github.com/cesmix-mit/lammps into pod 2022-09-25 00:15:53 -04:00
12e0681ec6 simplify inputs and normalize quadratic potential 2022-09-25 00:15:49 -04:00
166701f13a Fixed missing commas in the argument list of the macros in amoeba and hippo cu files, added amoeba_convolution_gpu.cpp and .h to the source file list in GPU.cmake 2022-09-23 11:53:09 -05:00
39f81fa49b Merge branch 'distributed-grids' of github.com:lammps/lammps into distributed-grids 2022-09-22 15:41:16 -06:00
88c92119d3 starting to add remap to Grid3d 2022-09-22 14:37:52 -06:00
b1afa8b767 Bugfix allocation for matrix algo in fix electrode 2022-09-21 14:24:26 +02:00
785131932c Added fphi_mpole in amoeba/gpu, fixed a bug in the kernel when indexing grid 2022-09-20 13:58:17 -05:00
387829a661 Update cmake/CMakeLists.txt
Co-authored-by: Christoph Junghans <christoph.junghans@gmail.com>
2022-09-18 21:48:38 -04:00
2aec158c57 Update cmake/Modules/StyleHeaderUtils.cmake
Co-authored-by: Christoph Junghans <christoph.junghans@gmail.com>
2022-09-18 21:47:31 -04:00
65fdeb279d Update cmake/CMakeLists.txt
Co-authored-by: Christoph Junghans <christoph.junghans@gmail.com>
2022-09-18 21:46:20 -04:00
356c46c913 Replaced mem allocation/deallocation inside moduli() with using member variables and mem resize if needed 2022-09-18 16:28:30 -05:00
caa66d904e Cleaned up GPU lib functions 2022-09-18 15:54:12 -05:00
f9f777b099 Refactored precompute_induce to overlap data transfers with kernel launches 2022-09-18 15:09:26 -05:00
4acdc55a8a Fix cmake 2022-09-17 13:29:30 -06:00
4f69ce152e pair_pod formatting 2022-09-17 11:22:01 -06:00
71a025c1d1 Merge conflict 2022-09-17 10:56:05 -06:00
064dcddd48 Clean up 2022-09-17 10:00:11 -06:00
4b8d3f7393 Merge branch 'pod' of https://github.com/cesmix-mit/lammps into pod 2022-09-17 10:34:55 -04:00
2185dd837d clean up CMakeLists.txt 2022-09-17 10:34:21 -04:00
697ccc0e2c Working Ta example 2022-09-17 08:31:21 -06:00
c72797c7c6 Ta example XYZ files 2022-09-17 07:10:35 -06:00
413f3f8ee7 Complete docs 2022-09-17 06:53:03 -06:00
28fa59e908 Merge and include in compute list 2022-09-17 06:25:47 -06:00
97584784d3 Fix sources 2022-09-17 06:20:34 -06:00
dadafa50cf Merge branch 'pod' of https://github.com/cesmix-mit/lammps into pod 2022-09-16 22:37:36 -04:00
fa226f58c3 revise pod documentation 2022-09-16 22:34:29 -04:00
fe0541fde7 End rst doc files with transition 2022-09-16 17:41:05 -06:00
ade6d84bdd Revert snap examples 2022-09-16 17:20:24 -06:00
02f2824f4b Revert src changes 2022-09-16 17:17:55 -06:00
13c76e4b3a Delete compute.snap.dat 2022-09-16 17:16:27 -06:00
84eaf1037f Delete install.txt 2022-09-16 17:15:46 -06:00
d5b112112e Merge branch 'pod' of https://github.com/cesmix-mit/lammps into pod 2022-09-16 19:00:00 -04:00
95816c5eab formating comments 2022-09-16 18:59:31 -04:00
cef0583883 Merge branch 'lammps:develop' into pod 2022-09-16 18:52:02 -04:00
e08296f171 Revert pair changes 2022-09-16 16:34:37 -06:00
47556e05e5 pair pod formatting 2022-09-16 16:23:58 -06:00
1d6cc4533e Move examples and clean up 2022-09-16 15:53:27 -06:00
62ecf98cda Enabled fphi_uind in hippo/gpu, really need to refactor hippo and amoeba in the GPU lib to remove kernel duplicates 2022-09-16 14:47:16 -05:00
ed76c3f047 Update pod.h and pair_pod.h 2022-09-16 14:54:04 -04:00
ec5f5ff057 Merge branch 'pod' of https://github.com/cesmix-mit/lammps into pod 2022-09-16 14:26:27 -04:00
750b6f5193 update pod 2022-09-16 10:51:08 -04:00
da78a18754 fixed elastance matrix writing 2022-09-16 16:21:59 +10:00
e88ceabb83 improved read/write matrix logic 2022-09-16 16:18:21 +10:00
fbaeb09516 fix whitespace 2022-09-16 15:46:59 +10:00
4e2168119f Merge branch 'electrode' into safer_management 2022-09-16 15:37:22 +10:00
880f20c285 Cleaned up kernels 2022-09-15 15:29:14 -05:00
0ed1e841ed README 2022-09-14 22:35:02 -06:00
32a33e627d Merge branch 'develop' into pod 2022-09-14 22:32:48 -06:00
91655ea63a Move README to examples 2022-09-14 22:17:53 -06:00
7e1de1ac71 Formatting and clean up 2022-09-14 22:14:10 -06:00
3f9e17df6c Working Ta MD example 2022-09-14 21:40:18 -06:00
0359d40580 Added interpolation timing for the cpu version 2022-09-14 16:11:43 -05:00
cd3a00c2c4 Added timing breakdown for fphi_uind 2022-09-14 15:28:44 -05:00
9c4d3db558 Cleaned up and converted arrays to ucl_vector of numtyp4 2022-09-13 16:48:39 -05:00
31047b4a31 Removed mem alloc in precompute_induce, used buffer for packing, and switched to using ucl_vector 2022-09-13 12:53:48 -05:00
e2df4ed2a7 Merge branch 'develop' into distributed-grids
# Conflicts:
#	doc/src/Developer_utils.rst
#	doc/src/dump.rst
#	doc/src/fix_ave_chunk.rst
#	src/utils.h
2022-09-12 18:31:29 -04:00
17e54c9390 Updated the GPU API in the gpu pair style 2022-09-11 19:00:40 -05:00
7f4efa380a Re-arranged memory allocation for cgrid_brick, some issues need to be fixed 2022-09-11 18:58:34 -05:00
5e59c95be4 Moved temp variables inside loops 2022-09-10 02:45:06 -05:00
363b6c51d0 Used local arrays and re-arranged for coalesced global memory writes 2022-09-10 02:31:39 -05:00
ali
47e33002ef first attempt at adding a default kspaceflag to gmres 2022-09-09 15:09:38 -05:00
ali
6f3bac3336 quick doc updates 2022-09-09 14:56:55 -05:00
c58343b2e2 Cleaned up debugging stuffs, need more refactoring and add to hippo 2022-09-09 13:50:41 -05:00
b72b71837e Moved first_induce_iteration in induce() to the right place 2022-09-09 13:34:57 -05:00
4b8caac727 Made some progress with fphi_uind in the gpu pair style 2022-09-09 12:14:36 -05:00
a0af9627e5 Fixed memory bugs with device array allocations 2022-09-06 16:19:17 -05:00
21b7fb2fcf Exposing fphi_uind to the gpu pair style, still keeping the part not ready though 2022-09-02 14:55:20 -05:00
cad7e1b364 Moved fphi_uind up to BaseAmoeba 2022-09-02 10:18:59 -05:00
62ac080736 Conjugate gradient 2022-09-02 14:06:04 +00:00
54543f45db Debugging pair.cpp 2022-09-01 11:17:58 -06:00
ae7ba30545 Small changes to get MD working 2022-09-01 11:16:28 -06:00
e3d45b0df6 clean up 2022-09-01 16:35:43 +10:00
aac264f2e2 Working on the fphi_uind kernel and array allocations 2022-08-30 23:40:04 -05:00
b8ec8f0778 Merge remote-tracking branch 'origin/electrode' into safer_management 2022-08-31 14:15:39 +10:00
0c4583a267 Merge branch 'develop' into distributed-grids 2022-08-30 18:25:49 -04:00
e7a5fe20c7 whitespace 2022-08-30 18:24:56 -04:00
41cb3dc328 Merge branch 'distributed-grids' of github.com:lammps/lammps into distributed-grids 2022-08-30 16:07:40 -06:00
14a5f757c5 update ttm log files 2022-08-30 16:07:22 -06:00
f2b6027b02 disable certain options in fix ttm/grid for distributed grids 2022-08-30 16:00:13 -06:00
ac2cf8c4ed add support for discard yes/no of out-of-bin atoms 2022-08-30 12:49:09 -06:00
6b093cb80a more doc page updates 2022-08-30 11:50:15 -06:00
a4126af4e9 changes to fix ave/grid doc page 2022-08-30 08:44:26 -06:00
14a03d84c7 whitespace 2022-08-29 21:53:44 -04:00
3e21738698 finish merge of develop 2022-08-29 17:07:49 -06:00
d67eed7e43 enable triclinic for fix ave/grid 2022-08-29 16:46:26 -06:00
0388913241 Automatic detection for electrode etypes 2022-08-29 13:11:30 +02:00
8edcc3381e Citation strings in ELECTRODE package
Cite new paper in fix electrode and its documentation. Add citation
string to kspace sytle pppm/electrode.
2022-08-29 09:48:14 +02:00
c5c3c697df Adding fphi_uind kernel, working on the arrays allocation 2022-08-29 00:13:30 -05:00
9e7bbad4d4 Working on fphi_uind in the GPU lib 2022-08-27 13:19:52 -05:00
2f8075ae77 adjust doc page 2022-08-26 17:05:01 -06:00
5c5441c8cc more debugging on fix ave/grid 2022-08-26 16:46:58 -06:00
b160460dcc Added preprocessors to comment out cufft entirely for now 2022-08-26 12:55:46 -05:00
b19f40a855 correct, simplify rxnbond example 2022-08-26 13:43:47 -04:00
b2d6df5bfb Re-arranged some for loops in umutual1 to improve cache-friendly memory access; made placeholder for grid_uind on the GPU lib, maybe FFT is not that heavy to be put on the device. 2022-08-25 23:18:13 -05:00
12fbaa8591 more debug 2022-08-24 10:17:29 -06:00
f4a90c62c0 First attempt to port the forward FFT in the k-space induce term to the GPU, not working yet 2022-08-23 15:42:05 -05:00
b6583eb681 debug of fix ave/grid 2022-08-23 09:58:58 -06:00
37e9bf54ab debugging fixes 2022-08-22 17:13:59 -06:00
b26ee6d75d more normalization code 2022-08-19 17:13:04 -06:00
06e6a168f6 more normalization 2022-08-19 14:05:41 -06:00
77c0ad4d26 adding support for normflag and aveflag 2022-08-19 10:59:25 -06:00
d10dbb9cb9 Merge branch 'distributed-grids' of github.com:lammps/lammps into distributed-grids 2022-08-19 09:42:30 -06:00
75933f1965 comment tweaks 2022-08-19 09:42:27 -06:00
9e6deb1a95 remove unused variables 2022-08-19 06:13:34 -04:00
8292a23f94 fix array indexing bugs flagged by compiler warnings 2022-08-19 06:13:22 -04:00
6bc48f0882 improve error messages and apply clang-format 2022-08-19 06:11:51 -04:00
7639d57657 update unit test for utils::parse_gridid() 2022-08-18 17:48:59 -04:00
3e6b78b256 fix documentation issues 2022-08-18 17:39:11 -04:00
8196745562 update utils::expand_args() to it can handle gridIDs 2022-08-18 17:34:40 -04:00
2f026e12c0 update grid data interface for fix ttm/grid 2022-08-18 17:34:04 -04:00
e4e7272c22 rename utils::gridid_parse() to utils::parse_gridid() 2022-08-18 17:33:29 -04:00
ccf6c2d55a Merge remote-tracking branch 'github/develop' into distributed-grids 2022-08-18 15:18:27 -04:00
da3e723351 Merge branch 'develop' into distributed-grids 2022-08-18 15:10:44 -04:00
c1b664b4be improve error message and update unit tests accordingly 2022-08-17 13:25:47 -04:00
c8f379dbab whitespace 2022-08-17 13:18:55 -04:00
763fff27ec Merge branch 'distributed-grids' of github.com:lammps/lammps into distributed-grids 2022-08-17 13:18:17 -04:00
22a9bfebe5 reimplement utils::gridid_parse() function and update related code 2022-08-17 13:18:12 -04:00
eeb9209af8 bug fix 2022-08-17 10:55:28 -06:00
e2f2663df2 more changes from GridComm to Grid3d in packages 2022-08-17 10:08:34 -06:00
a6a37021a9 Merge branch 'distributed-grids' of github.com:lammps/lammps into distributed-grids 2022-08-17 08:52:13 -06:00
f8d119b073 change GridComm to Grid3d in DIELECTRIC package 2022-08-17 08:51:57 -06:00
7a0636ca0c whitespace fixes 2022-08-17 10:15:30 -04:00
9109677eb3 tweak to doc page 2022-08-16 17:17:15 -06:00
5e935519bf finished first draft of doc pages 2022-08-16 15:42:48 -06:00
921796a15f Cleaned up unused variables in the hippo kernels 2022-08-16 16:29:38 -05:00
28dabb9687 Cleaned up unused variables in the amoeba kernels, made room for convolution gpu 2022-08-16 15:37:49 -05:00
206ab141c9 more doc info for per-grid commands 2022-08-16 11:33:55 -06:00
e6e9e1b59c initial doc pages 2022-08-15 17:29:11 -06:00
ce4ca06035 support for density, mass, temperature values 2022-08-15 16:02:46 -06:00
46b8b00a4f Working on fft on the device 2022-08-15 15:51:43 -05:00
f1112ab6b6 Working on the gpu kspace induce term: dipole spreading and/or fft calls 2022-08-15 14:28:46 -05:00
9750c72822 output of fix ave/grid 2022-08-12 10:50:19 -06:00
8b637b5b70 error check for particle mapping to grid 2022-08-11 13:51:42 -06:00
58800b5191 enable relancing to work with distributed grids 2022-08-11 13:28:50 -06:00
0e1463fdaa change AMOEBA grids to Grid3d from GridComm 2022-08-11 10:32:09 -06:00
faa225d658 Merge branch 'develop' into distributed-grids 2022-08-11 09:44:43 -06:00
c13f825648 Added AmoebaConvolutionGPU class: need to replace fft compute with the GPU-accelerated backend 2022-08-10 16:24:20 -05:00
538aa13693 Only transfer data that is needed for umutual2b; allowed convolution and kspace term umutual1 to be overridden by the gpu counterparts 2022-08-10 16:21:30 -05:00
591fc4383b update doc 2022-08-10 08:21:14 -04:00
ali
b05dc17c09 update of DIELECTRIC package documentation and examples 2022-08-05 11:25:03 -05:00
c44794730b debugging fixes 2022-08-03 17:43:04 -06:00
c3d563ca39 more enhancments 2022-08-03 13:32:11 -06:00
aad4e417f9 Moved temp variables inside neighbor loops 2022-08-03 12:33:48 -05:00
a54f0b684d Moved temp variables inside the loop over neighbors 2022-08-03 10:56:52 -05:00
7a4f5344bd more functionality for fix ave/grid 2022-08-02 17:46:03 -06:00
e980838ae2 Added timings for real-space and k-space portions for the terms 2022-08-02 16:45:06 -05:00
02b8804457 add grid freq to fix ttm/grid 2022-08-01 10:03:04 -06:00
b1b778b45b first version of fix ave/grid 2022-08-01 10:02:12 -06:00
3e7ef39d64 simplify, formatting 2022-07-29 23:34:37 -04:00
1b59a83ff3 bond:react per-bond custom constraint docs 2022-07-29 17:24:07 -04:00
dae20a2f1f Merge branch 'lammps-develop2' into per-bond_custom_constraint
rebase
2022-07-29 16:40:39 -04:00
07ab4dd5da check that bond is actually in map 2022-07-29 16:37:50 -04:00
32406aab06 prevent multiple compute evaluations on a timestep 2022-07-29 16:37:50 -04:00
deb892d7cd actually evaluate bond/local compute value
(even when not printed on that timestep)
2022-07-29 16:37:50 -04:00
930d0d756b bond/react: per-bond custom constraint 2022-07-29 16:37:50 -04:00
dc378b8ffb non-'bond/react ' changes 2022-07-29 16:31:53 -04:00
a6066bab4d Called the induce real-space term before the kspace term 2022-07-29 13:01:57 -05:00
41fb8acf9e tweak doc for new utils function 2022-07-29 10:59:26 -06:00
3e81cfb217 refactoring 2022-07-29 10:13:23 -06:00
729191835a Merge branch 'develop' into distributed-grids 2022-07-28 17:24:32 -06:00
abeec99673 update pod documentation for lammps 2022-07-27 02:33:04 +07:00
93784f35e3 Added ucl_erfc to the opencl, cuda and hip backends; reverted to using erfc instead of approximation to ensure double-precision matches 2022-07-25 15:34:44 -05:00
dff206f297 more work on grid classes 2022-07-25 13:56:28 -06:00
4a0c0661eb update pod 2022-07-22 11:09:41 +07:00
1a1426eb2e Fixed conflicts 2022-07-21 18:59:00 -06:00
6aa4ffddfc Merge branch 'pod' of https://github.com/cesmix-mit/lammps into pod 2022-07-22 06:46:04 +07:00
c583a17aa2 uodate POD 2022-07-22 06:45:59 +07:00
4a7daaa5d1 tweak to dump grid 2022-07-21 17:34:41 -06:00
22b6a49fba compute property/grid additions 2022-07-21 17:33:34 -06:00
10eb07462e fix ttm changes 2022-07-21 15:09:46 -06:00
d819c890b6 dump grid and compute property/grid 2022-07-21 15:08:44 -06:00
b7a491089c Algorithm as input keyword 2022-07-21 11:23:13 +02:00
465ac275db more in dump grid 2022-07-20 13:20:15 -06:00
d5113edc87 interface between dump grid and fixes 2022-07-20 10:53:34 -06:00
288fd5add4 Updated the python scripts under tools/tinker to the latest version in develop 2022-07-19 15:18:17 -05:00
f69be2791b hooks from dump grid to fix 2022-07-19 14:02:05 -06:00
7dc478e201 remove unneeded info from dump custom header 2022-07-19 11:35:50 -06:00
5c81ba81d7 initial version of dump grid 2022-07-19 11:03:44 -06:00
68d5b3e3d9 grid2d class 2022-07-19 09:46:16 -06:00
5cb95cc032 grid3d file as well 2022-07-18 17:25:04 -06:00
e2352bc65e grid class name changes 2022-07-18 17:24:40 -06:00
b5c079ff91 Merge remote-tracking branch 'upstream/develop' into develop 2022-07-15 16:40:56 -06:00
8b40ecff4c Debugging prints 2022-07-15 16:39:02 -06:00
597e3b7729 use array output for fix electrode instead of fix_modify 2022-07-15 10:28:35 +02:00
66ee2bf989 Cleaned up 2022-07-14 11:01:30 -05:00
a6bfcf838a First attempt 2022-07-08 15:43:06 -06:00
0c44bd1086 Rearranged the order of real-space and kspace part of ufield0c(), delayed device-host transfer from umutual2b() to overlap with kspace part 2022-07-08 14:45:31 -05:00
78d6df5ba9 Removed temporary arrays in hippo/gpu induce, flipped sign of the viriral terms in torque2force in hippo/gpu 2022-07-06 11:17:08 -05:00
c1ae5d0ce1 Merge remote-tracking branch 'upstream/develop' into develop 2022-07-06 08:56:19 -06:00
675c2d38a3 Flipped sign of forces and virial terms in the hippo kernels 2022-07-05 14:37:26 -05:00
8328866611 Added checks for the gpu variant of pair amoeba/hippo in improper/amoeba and fix amoeba/bitorsion 2022-07-05 11:02:31 -05:00
ee5afdc146 Updated all the gpu ready terms 2022-07-04 23:24:31 -05:00
5dab809522 Flipped force sign in polar_real, made sure that multipole_real is true for precompute() to be invoked, ubdirect2b() is segfault and needs work 2022-07-04 01:38:22 -05:00
59db526401 Update README 2022-07-02 17:45:53 -04:00
f4900d131a Working on the multipole term on the gpu side, incorrect virials 2022-07-01 16:26:25 -05:00
feff2ab4a8 Update README 2022-07-01 13:25:24 -04:00
eae8721b95 Update README 2022-07-01 13:23:02 -04:00
8aae91b916 Update README 2022-07-01 13:19:56 -04:00
d737acf677 Update pod examples 2022-07-01 13:13:22 -04:00
ff5267e7c2 update pod 2022-07-01 12:55:57 -04:00
9fbcce5277 update pod 2022-07-01 12:55:41 -04:00
90d4768d68 commit pod 2022-07-01 12:54:43 -04:00
97b39d8a36 update pod 2022-07-01 12:53:50 -04:00
3ae84a3b3f pod update 2022-07-01 12:49:28 -04:00
efae876dfa Updated timestamp for local array 2022-06-30 11:27:56 -06:00
a14f0cfd6c Merge branch 'amoeba' into amoeba-gpu, update the gpu pair styles with the base class 2022-06-28 12:54:27 -05:00
aadd6b9f27 Merge branch 'electrode' into safer_management 2022-06-17 14:12:18 +10:00
0bb04fb0b5 update pod 2022-06-10 14:13:37 -04:00
5273031e68 use array output for fix electrode instead of fix_modify 2022-06-08 13:35:47 +00:00
3f87b88d57 check that bond is actually in map 2022-05-29 10:43:36 -04:00
d06774ac3b localise file opening and closing 2022-05-30 00:19:48 +10:00
392b2c86dc unique_ptr for accelerator interface 2022-05-29 23:16:21 +10:00
f0f39ced6f prevent multiple compute evaluations on a timestep 2022-05-28 22:51:52 -04:00
7bbae300c8 actually evaluate bond/local compute value
(even when not printed on that timestep)
2022-05-28 22:02:13 -04:00
6b9b5daa0d bond/react: per-bond custom constraint 2022-05-28 15:50:27 -04:00
1b1cb5568d non-'bond/react ' changes 2022-05-28 14:48:47 -04:00
272afc953e output scalar, vector and array; updated docs and examples 2022-05-28 08:18:47 +10:00
0855d62bfd implement compute_array 2022-05-02 23:24:00 +10:00
531e553162 Merge branch 'amoeba' into amoeba-gpu 2022-04-22 16:10:24 -05:00
81bf2eb9b2 Merge branch 'amoeba' into amoeba-gpu 2022-03-16 00:16:48 -05:00
79fbbd4f33 Cleaned up the API of amoeba and hippo to remove unncessary arguments 2021-10-04 14:40:58 -05:00
0f0f6a51de Renamed sp_polar to sp_amoeba, and replaced special_wscale with special_hal for amoeba 2021-10-02 16:02:44 -05:00
5a6426bf96 Only transfer data arrays that are needed in each kernel 2021-10-02 00:56:15 -05:00
f4d3d3a2b5 Gradually cleaned up and removed redundancy in amoeba and hippo 2021-10-02 00:09:53 -05:00
f126f785a4 Removed duplicates in the amoeba kernels 2021-10-01 10:19:17 -05:00
3328ac0df2 Attempted to remove some redundancy in data transfers in the amoeba kernels; keeping HIPPO independent of AMOEBA for now 2021-10-01 09:58:21 -05:00
e0f91b96fe Cleaned up and added necessary comments 2021-09-29 13:07:20 -05:00
ad9d45639e Fixed bugs with damprep where ucl_powr in mixed precision failed with a negative single-reprecision base 2021-09-29 12:32:08 -05:00
01381b7f54 Fixed bugs in the repulsion kernel, now working correctly with the double precision mode 2021-09-29 11:57:25 -05:00
4be44c386f Added necessary arguments to the hippo repulsion kernel 2021-09-29 09:40:33 -05:00
17edd797a7 Adding API for the repulsion term to hippo/gpu 2021-09-28 23:42:04 -05:00
b95508125b Adding the repulsion kernel for hippo 2021-09-28 23:24:34 -05:00
6286a119b3 Removed precompute() in hippo 2021-09-28 23:12:07 -05:00
98a2b67292 Changed to the API of BaseAmoeba to reduce duplicates in hippo 2021-09-28 17:39:55 -05:00
b874feb127 Removed trailing spaces 2021-09-28 17:28:33 -05:00
bf88ab77fa Cleaned up unused variables in kernel (to be continued) 2021-09-28 15:06:30 -05:00
e80eea56ba Added udirect2b and umutual2b for hippo 2021-09-28 14:59:39 -05:00
8d54547bc0 Commented out debugging commands in the hippo kernels, added (numtyp) to numerics in hippo_extra, replaced fabs with explicit func 2021-09-28 00:50:33 -05:00
d27836952a Fixed a bug in neighbor.cpp to make special_flag consistent between amoeba and hippo (to be 2 instead of 0), that caused missing neighbors with hippo 2021-09-27 16:12:49 -05:00
c6148938e5 Debugging the neighbor list in hippo vs amoeba 2021-09-27 12:36:11 -05:00
136cf581d6 Merge remote-tracking branch 'origin/amoeba' into amoeba-gpu 2021-09-27 12:22:33 -05:00
2efd841a7e Trying to find the difference in the neighbor list build in hippo vs amoeba 2021-09-27 11:35:35 -05:00
7437c98628 Fixed bugs in the polar real kernel in hippo, getting closer.. 2021-09-26 09:11:09 -05:00
5193dcf8c5 Working on the polar real-space term of hippo 2021-09-26 00:56:29 -05:00
edbed9c9c9 Fixed bugs in HippoT::compute_dispersion_real and compute_multipole_real to ensure that answers only get copied back from device in the last kernel activated. 2021-09-26 00:13:40 -05:00
f8bc091cb8 Kept working on the multipole real-space term of hippo 2021-09-25 13:17:06 -05:00
78ef0d631f Working on the multipole real-space term of hippo 2021-09-25 12:25:34 -05:00
e77df80ce2 Working hippo multipole real-space term, added helper functions in a separate file 2021-09-24 16:44:43 -05:00
ad8164dfc0 Fixed bugs in the dispersion real-space term for hippo. NOTE: CPU version filter out neighbors with zero special_disp 2021-09-24 00:21:25 -05:00
830b5fa2dd Started working on hippo/gpu 2021-09-23 09:21:55 -05:00
2428f1f4d5 Updated hippo kernels 2021-09-22 11:44:41 -05:00
bebef18495 Cleaned up and minor changes 2021-09-21 23:46:21 -05:00
d77d5b7f0a Added classes for hippo/gpu, refactored BaseAmoeba and made room for the dispersion real-space term in hippo 2021-09-21 15:40:06 -05:00
a2fd784034 Added the dispersion real space term, which is for HIPPO. 2021-09-21 10:55:38 -05:00
42034bd1c9 Fixed bugs for undefined tagint and ucl_powr ambiguity in kernels for OpenCL builds 2021-09-20 12:48:29 -05:00
4e88cd158e Fixed bugs with _tep and _fieldp to allow mixed-precision builds, being defensive with acctyp for these variables 2021-09-20 11:38:50 -05:00
0228867d8e Added the dispersion real space kernel and transfer special coeffs to the device 2021-09-19 23:40:43 -05:00
1166845fcf Prepared data structure for the dispersion real-space term 2021-09-18 10:22:22 -05:00
5d801e985f More cleanup 2021-09-17 23:24:23 -05:00
78045d8f76 Cleaned up debugging stuffs and unused variables 2021-09-17 23:13:51 -05:00
f5713a52b3 Added another kernel to accumulate forces, energies and virial on the device (similar to the tersoff kernels) as multiple kernels all added to those quantities; also only copy answers back to the host in the last kernel in a time step; cleaned up debugging messages 2021-09-17 16:39:57 -05:00
2e6df83b9b Fixed bugs in the multipole real-space part on the GPU; separately multipole real and polar real work correctly (along with udirect2b and umutual2b), but
together they are conflicting due to the use of ans to copy forces back from device to host. The other 2 kernels (induce part) do not touch forces and energies.
2021-09-17 15:24:36 -05:00
d926705950 Short neighbor list for multipole real-space should be built with off2_mpole 2021-09-17 01:32:00 -05:00
003bebd31e Working on the multipole real-space term, not ready yet 2021-09-17 01:19:33 -05:00
6293da7661 Cleaned up a bit 2021-09-16 17:30:56 -05:00
c0b967054e Fixed bugs with zero local atoms (similar to what has been done to PPPM interp) 2021-09-16 17:27:44 -05:00
98c1a0178c Refactored the API so that different off2 values are used for different kernels 2021-09-16 17:14:36 -05:00
a21095fded More cleaning up 2021-09-13 13:47:15 -05:00
76794bef58 Removed some of the debugging stuffs 2021-09-13 01:16:42 -05:00
bc665999d5 Fixed bugs with the umutual2b kernel, now the field and fieldp seems correct 2021-09-13 01:11:03 -05:00
edd76733a1 Working on umutual2b, tdipdip are correct, but incorrect results for field and fieldp 2021-09-12 00:51:48 -05:00
94d6f7219c Attempted to reduce the memory footprint of the per-atom arrays 2021-09-11 11:22:17 -05:00
c765861851 Cleaned up and re-arranged the functions to reflect the order of calling in a time step 2021-09-11 01:00:58 -05:00
7f5a82dc54 Switched to the short neighbor list implementation in the pre-10Feb21 version (the recent version enforces tpa = 1 for short nbor) 2021-09-11 00:34:43 -05:00
4ebe5833d3 Working on short nbor list for the amoeba kernels (based on what has been done with tersoff and ellipsod, nbor dev_packed needs to be allocated properly) 2021-09-10 16:51:16 -05:00
a22923aee2 Added the API for the umutual kernel, needs work for storing the tdiptdip array 2021-09-09 17:22:09 -05:00
b654f293ee Working on the umutual2b kernel, the tdipdip values are computed on the fly for now, maybe a seprate neigh list as in the CPU version will be more efficient 2021-09-09 16:52:27 -05:00
efe0bf593f Adding the umutual2b kernel, need to create another array for tdipdip on the GPU 2021-09-09 15:19:43 -05:00
4a75a9bdd2 Removed dfield0c from ameoba/gpu (no need to override this one) 2021-09-09 14:47:29 -05:00
6f6fd0999c Both udirect2b and polar_real are working correctly on the GPU 2021-09-09 00:57:21 -05:00
8c5a116d30 Made dfield0c work to compute uind and uinp correctly; need to make sure they are correct for polar_real() 2021-09-08 16:43:33 -05:00
1c5d235f12 Working on the field and fieldp values from GPU back to the host for dfield0c 2021-09-07 16:15:08 -05:00
4e346c2de6 Refactored neighbor list builds and per-atom reallocation parts 2021-09-07 13:05:57 -05:00
be5aa46df8 Re-arranged the binsize call from the GPU lib in Atom so that the box bounds and bininv[xyz] are computed on the CPU side intact 2021-09-03 17:32:41 -05:00
8f5f65e68d Declared virtual to relevant functions in PairAmoeba, added the overridden versions in PairAmoebaGPU 2021-09-03 16:42:58 -05:00
7d69a870a4 Reverted the binsize function call from the GPU package in Atom, instead added atom_modify sort with a binsize to ensure matching virial values, enabled the udirect2b kernel, need more work to override dfield0c, and induce() to bypass reverse_comm() for field and fieldp (line amoeba_induce.cpp:111-112) 2021-09-03 13:43:22 -05:00
745c7089f0 Temporarily commented out the section in the Atom class where FixGPU finds the optimal bin size. This section makes ev_tally4() in Angle different from CPU-only runs, even with a single command "package gpu 1" without any gpu pair style. Need more effort to understand why. 2021-09-03 01:00:29 -05:00
7e0c77f1cb Added fallback flags to indicate which terms are ready from the GPU lib 2021-09-01 14:51:36 -05:00
785a794d39 Added and renamed API to make room for additional kernels (udirect2b only computes the field and fieldp, not accumulating forces, energies, nor virials) 2021-09-01 14:37:11 -05:00
07b60827c4 Working on the udirect2b kernel for the induce real space term, need to add the API for the GPU library 2021-09-01 12:30:41 -05:00
5ffae6ed23 Limited to neigh yes for amoeba/gpu for now 2021-08-30 09:14:46 -05:00
03a96521a3 Merge latest chages from branch 'amoeba' into amoeba-gpu 2021-08-26 16:22:28 -05:00
42048ee73f Activated the fix store/state commands in one of the example input scripts 2021-08-26 11:23:21 -05:00
6a998fcb8e Added fix store/state commands to the example input scripts 2021-08-26 11:17:49 -05:00
88f3dd334c Some changes in PPPMGPU due to the API changes in the GridComm class 2021-08-26 09:35:43 -05:00
91317b2879 Added changes to Atom and Device classes for allocation of extra fields and SBBITS15 and NEIGHMASK15 2021-08-26 09:33:20 -05:00
db92844228 Added recent changes to FixGPU to enable newton_pair on 2021-08-25 23:22:23 -05:00
3825fee8e9 Added work on amoeba/gpu, some minor changes to PairAmoeba to allow function overriding in PairAmoebaGPU, added the package AMOEBA to cmake/CMakeLists.txt 2021-08-25 22:57:37 -05:00
2555 changed files with 338710 additions and 199268 deletions

64
.github/CODEOWNERS vendored
View File

@ -13,40 +13,45 @@ lib/kim/* @ellio167
lib/mesont/* @iafoss
# whole packages
src/ADIOS/* @pnorbert
src/AMOEBA/* @sjplimp
src/COMPRESS/* @rbberger
src/GPU/* @ndtrung81
src/KOKKOS/* @stanmoore1
src/KIM/* @ellio167
src/LATTE/* @cnegre
src/MLIAP/* @athomps
src/SNAP/* @athomps
src/SPIN/* @julient31
src/BPM/* @jtclemm
src/BROWNIAN/* @samueljmcameron
src/CG-DNA/* @ohenrich
src/CG-SPICA/* @yskmiyazaki
src/COLVARS/* @giacomofiorin
src/COMPRESS/* @rbberger
src/DIELECTRIC/* @ndtrung81
src/ELECTRODE/* @ludwig-ahrens
src/FEP/* @agiliopadua
src/ML-HDNNP/* @singraber
src/GPU/* @ndtrung81
src/GRANULAR/* @jtclemm @dsbolin
src/INTEL/* @wmbrownintel
src/KIM/* @ellio167
src/KOKKOS/* @stanmoore1
src/LATTE/* @cnegre
src/MANIFOLD/* @Pakketeretet2
src/MDI/* @taylor-a-barnes
src/MDI/* @taylor-a-barnes @sjplimp
src/MEAM/* @martok
src/MESONT/* @iafoss
src/ML-HDNNP/* @singraber
src/ML-IAP/* @athomps
src/ML-PACE/* @yury-lysogorskiy
src/ML-POD/* @exapde @rohskopf
src/MOFFF/* @hheenen
src/MOLFILE/* @akohlmey
src/NETCDF/* @pastewka
src/ML-PACE/* @yury-lysogorskiy
src/PLUMED/* @gtribello
src/PHONON/* @lingtikong
src/PTM/* @pmla
src/OPENMP/* @akohlmey
src/PHONON/* @lingtikong
src/PLUGIN/* @akohlmey
src/PLUMED/* @gtribello
src/PTM/* @pmla
src/QMMM/* @akohlmey
src/REAXFF/* @hasanmetin @stanmoore1
src/REACTION/* @jrgissing
src/REAXFF/* @hasanmetin @stanmoore1
src/SCAFACOS/* @rhalver
src/SNAP/* @athomps
src/SPIN/* @julient31
src/TALLY/* @akohlmey
src/UEF/* @danicholson
src/VTK/* @rbberger
@ -58,7 +63,10 @@ src/MANYBODY/pair_vashishta_table.* @andeplane
src/MANYBODY/pair_atm.* @sergeylishchuk
src/REPLICA/*_grem.* @dstelter92
src/EXTRA-COMPUTE/compute_stress_mop*.* @RomainVermorel
src/EXTRA-COMPUTE/compute_born_matrix.* @Bibobu @athomps
src/MISC/*_tracker.* @jtclemm
src/MC/fix_gcmc.* @athomps
src/MC/fix_sgcmc.* @athomps
# core LAMMPS classes
src/lammps.* @sjplimp
@ -120,27 +128,32 @@ src/dump_movie.* @akohlmey
src/exceptions.h @rbberger
src/fix_nh.* @athomps
src/info.* @akohlmey @rbberger
src/timer.* @akohlmey
src/min* @sjplimp @stanmoore1
src/platform.* @akohlmey
src/timer.* @akohlmey
src/utils.* @akohlmey @rbberger
src/verlet.* @sjplimp @stanmoore1
src/math_eigen_impl.h @jewettaij
# tools
tools/msi2lmp/* @akohlmey
tools/coding_standard/* @akohlmey @rbberger
tools/emacs/* @HaoZeke
tools/singularity/* @akohlmey @rbberger
tools/coding_standard/* @rbberger
tools/valgrind/* @akohlmey
tools/swig/* @akohlmey
tools/lammps-shell/* @akohlmey
tools/msi2lmp/* @akohlmey
tools/offline/* @rbberger
tools/singularity/* @akohlmey @rbberger
tools/swig/* @akohlmey
tools/valgrind/* @akohlmey
tools/vim/* @hammondkd
# tests
unittest/* @akohlmey @rbberger
unittest/* @akohlmey
# cmake
cmake/* @junghans @rbberger
cmake/Modules/LAMMPSInterfacePlugin.cmake @akohlmey
cmake/Modules/MPI4WIN.cmake @akohlmey
cmake/Modules/OpenCLLoader.cmake @akohlmey
cmake/Modules/Packages/COLVARS.cmake @junghans @rbberger @giacomofiorin
cmake/Modules/Packages/KIM.cmake @junghans @rbberger @ellio167
cmake/presets/*.cmake @akohlmey
@ -149,13 +162,12 @@ cmake/presets/*.cmake @akohlmey
python/* @rbberger
# fortran
fortran/* @akohlmey
fortran/* @akohlmey @hammondkd
# docs
doc/utils/*/* @rbberger
doc/Makefile @rbberger
doc/README @rbberger
doc/* @akohlmey
examples/plugin/* @akohlmey
examples/PACKAGES/pace/plugin/* @akohlmey
# for releases
src/version.h @sjplimp

View File

@ -49,7 +49,9 @@ jobs:
shell: bash
working-directory: build
run: |
cmake -C ../cmake/presets/most.cmake ../cmake
cmake -C ../cmake/presets/most.cmake \
-D DOWNLOAD_POTENTIALS=off \
../cmake
cmake --build . --parallel 2
- name: Perform CodeQL Analysis

View File

@ -26,20 +26,25 @@ jobs:
- name: Select Python version
uses: actions/setup-python@v4
with:
python-version: '3.10'
python-version: '3.11'
- name: Building LAMMPS via CMake
shell: bash
run: |
python3 -m pip install numpy
python3 -m pip install pyyaml
nuget install MSMPIsdk
nuget install MSMPIDIST
cmake -C cmake/presets/windows.cmake \
-D DOWNLOAD_POTENTIALS=off \
-D PKG_PYTHON=on \
-D WITH_PNG=off \
-D WITH_JPEG=off \
-S cmake -B build \
-D BUILD_SHARED_LIBS=on \
-D LAMMPS_EXCEPTIONS=on \
-D ENABLE_TESTING=on
cmake --build build --config Release
cmake --build build --config Release --parallel 2
- name: Run LAMMPS executable
shell: bash
@ -50,4 +55,4 @@ jobs:
- name: Run Unit Tests
working-directory: build
shell: bash
run: ctest -V -C Release
run: ctest -V -C Release -E FixTimestep:python_move_nve

View File

@ -47,6 +47,7 @@ jobs:
python3 -m pip install pyyaml
cmake -C ../cmake/presets/clang.cmake \
-C ../cmake/presets/most.cmake \
-D DOWNLOAD_POTENTIALS=off \
-D CMAKE_CXX_COMPILER_LAUNCHER=ccache \
-D CMAKE_C_COMPILER_LAUNCHER=ccache \
-D ENABLE_TESTING=on \

2
.gitignore vendored
View File

@ -55,3 +55,5 @@ out/RelWithDebInfo
out/Release
out/x86
out/x64
src/Makefile.package-e
src/Makefile.package.settings-e

View File

@ -30,18 +30,19 @@ for unicode characters and only all-ASCII source code is accepted.
# Version Updates
LAMMPS follows continuous release development model. We aim to keep to
keep the development version (develop branch) always fully functional
and employ a variety of automatic testing procedures to detect failures
LAMMPS follows a continuous release development model. We aim to keep
the development version (`develop` branch) always fully functional and
employ a variety of automatic testing procedures to detect failures
of existing functionality from adding or modifying features. Most of
those tests are run on pull requests *before* merging to the development
branch. The develop branch is protected, so all changes *must* be
those tests are run on pull requests *before* merging to the `develop`
branch. The `develop` branch is protected, so all changes *must* be
submitted as a pull request and thus cannot avoid the automated tests.
Additional tests are run *after* merging. Before releases are made
*all* tests must have cleared. Then a release tag is applied and the
release branch fast-forwarded to that tag. Bug fixes and updates are
applied to the current development branch and thus will be available in
the next (patch) release. For stable releases, selected bug fixes are
back-ported and occasionally published as update releases. There are
only updates to the latest stable release.
`release` branch is fast-forwarded to that tag. This is often referred
to as a patch release. Bug fixes and updates are
applied first to the `develop` branch. Later, they appear in the `release`
branch when the next patch release occurs.
For stable releases, selected bug fixes, updates, and new functionality
are pushed to the `stable` branch and a new stable tag is applied.

View File

@ -3,6 +3,7 @@
# This file is part of LAMMPS
# Created by Christoph Junghans and Richard Berger
cmake_minimum_required(VERSION 3.10)
########################################
# set policy to silence warnings about ignoring <PackageName>_ROOT but use it
if(POLICY CMP0074)
cmake_policy(SET CMP0074 NEW)
@ -20,7 +21,13 @@ endif()
if(POLICY CMP0135)
cmake_policy(SET CMP0135 OLD)
endif()
########################################
# Use CONFIGURE_DEPENDS as option for file(GLOB...) when available
if(CMAKE_VERSION VERSION_LESS 3.12)
unset(CONFIGURE_DEPENDS)
else()
set(CONFIGURE_DEPENDS CONFIGURE_DEPENDS)
endif()
########################################
project(lammps CXX)
@ -161,8 +168,8 @@ endif()
########################################################################
# User input options #
########################################################################
# set path to python interpreter and thus enforcing python version if
# when in a virtual environment and PYTHON_EXECUTABLE is not set on command line
# set path to python interpreter and thus enforcing python version when
# in a virtual environment and PYTHON_EXECUTABLE is not set on command line
if(DEFINED ENV{VIRTUAL_ENV} AND NOT PYTHON_EXECUTABLE)
if(CMAKE_HOST_SYSTEM_NAME STREQUAL "Windows")
set(PYTHON_EXECUTABLE "$ENV{VIRTUAL_ENV}/Scripts/python.exe")
@ -195,8 +202,8 @@ else()
endif()
include(GNUInstallDirs)
file(GLOB ALL_SOURCES ${LAMMPS_SOURCE_DIR}/[^.]*.cpp)
file(GLOB MAIN_SOURCES ${LAMMPS_SOURCE_DIR}/main.cpp)
file(GLOB ALL_SOURCES ${CONFIGURE_DEPENDS} ${LAMMPS_SOURCE_DIR}/[^.]*.cpp)
file(GLOB MAIN_SOURCES ${CONFIGURE_DEPENDS} ${LAMMPS_SOURCE_DIR}/main.cpp)
list(REMOVE_ITEM ALL_SOURCES ${MAIN_SOURCES})
add_library(lammps ${ALL_SOURCES})
@ -251,6 +258,7 @@ set(STANDARD_PACKAGES
KSPACE
LATBOLTZ
LATTE
LEPTON
MACHDYN
MANIFOLD
MANYBODY
@ -266,6 +274,7 @@ set(STANDARD_PACKAGES
ML-QUIP
ML-RANN
ML-SNAP
ML-POD
MOFFF
MOLECULE
MOLFILE
@ -316,6 +325,15 @@ if(PKG_ADIOS)
# script that defines the MPI::MPI_C target
enable_language(C)
find_package(ADIOS2 REQUIRED)
if(BUILD_MPI)
if(NOT ADIOS2_HAVE_MPI)
message(FATAL_ERROR "ADIOS2 must be built with MPI support when LAMMPS has MPI enabled")
endif()
else()
if(ADIOS2_HAVE_MPI)
message(FATAL_ERROR "ADIOS2 must be built without MPI support when LAMMPS has MPI disabled")
endif()
endif()
target_link_libraries(lammps PRIVATE adios2::adios2)
endif()
@ -423,23 +441,19 @@ if(BUILD_OMP)
target_link_libraries(lmp PRIVATE OpenMP::OpenMP_CXX)
endif()
if(PKG_MSCG OR PKG_ATC OR PKG_AWPMD OR PKG_ML-QUIP OR PKG_LATTE OR PKG_ELECTRODE)
if(PKG_MSCG OR PKG_ATC OR PKG_AWPMD OR PKG_ML-QUIP OR PKG_ML-POD OR PKG_LATTE OR PKG_ELECTRODE)
enable_language(C)
if (NOT USE_INTERNAL_LINALG)
find_package(LAPACK)
find_package(BLAS)
endif()
if(NOT LAPACK_FOUND OR NOT BLAS_FOUND OR USE_INTERNAL_LINALG)
include(CheckGeneratorSupport)
if(NOT CMAKE_GENERATOR_SUPPORT_FORTRAN)
status(FATAL_ERROR "Cannot build internal linear algebra library as CMake build tool lacks Fortran support")
endif()
enable_language(Fortran)
file(GLOB LAPACK_SOURCES ${LAMMPS_LIB_SOURCE_DIR}/linalg/[^.]*.[fF])
add_library(linalg STATIC ${LAPACK_SOURCES})
file(GLOB LINALG_SOURCES ${CONFIGURE_DEPENDS} ${LAMMPS_LIB_SOURCE_DIR}/linalg/[^.]*.cpp)
add_library(linalg STATIC ${LINALG_SOURCES})
set_target_properties(linalg PROPERTIES OUTPUT_NAME lammps_linalg${LAMMPS_MACHINE})
set(BLAS_LIBRARIES "$<TARGET_FILE:linalg>")
set(LAPACK_LIBRARIES "$<TARGET_FILE:linalg>")
target_link_libraries(lammps PRIVATE linalg)
else()
list(APPEND LAPACK_LIBRARIES ${BLAS_LIBRARIES})
endif()
@ -507,7 +521,7 @@ else()
endif()
foreach(PKG_WITH_INCL KSPACE PYTHON ML-IAP VORONOI COLVARS ML-HDNNP MDI MOLFILE NETCDF
PLUMED QMMM ML-QUIP SCAFACOS MACHDYN VTK KIM LATTE MSCG COMPRESS ML-PACE)
PLUMED QMMM ML-QUIP SCAFACOS MACHDYN VTK KIM LATTE MSCG COMPRESS ML-PACE LEPTON)
if(PKG_${PKG_WITH_INCL})
include(Packages/${PKG_WITH_INCL})
endif()
@ -552,6 +566,8 @@ RegisterStyles(${LAMMPS_SOURCE_DIR})
########################################################
# Fetch missing external files and archives for packages
########################################################
option(DOWNLOAD_POTENTIALS "Automatically download large potential files" ON)
mark_as_advanced(DOWNLOAD_POTENTIALS)
foreach(PKG ${STANDARD_PACKAGES} ${SUFFIX_PACKAGES})
if(PKG_${PKG})
FetchPotentials(${LAMMPS_SOURCE_DIR}/${PKG} ${LAMMPS_POTENTIALS_DIR})
@ -564,8 +580,8 @@ endforeach()
foreach(PKG ${STANDARD_PACKAGES})
set(${PKG}_SOURCES_DIR ${LAMMPS_SOURCE_DIR}/${PKG})
file(GLOB ${PKG}_SOURCES ${${PKG}_SOURCES_DIR}/[^.]*.cpp)
file(GLOB ${PKG}_HEADERS ${${PKG}_SOURCES_DIR}/[^.]*.h)
file(GLOB ${PKG}_SOURCES ${CONFIGURE_DEPENDS} ${${PKG}_SOURCES_DIR}/[^.]*.cpp)
file(GLOB ${PKG}_HEADERS ${CONFIGURE_DEPENDS} ${${PKG}_SOURCES_DIR}/[^.]*.h)
# check for package files in src directory due to old make system
DetectBuildSystemConflict(${LAMMPS_SOURCE_DIR} ${${PKG}_SOURCES} ${${PKG}_HEADERS})
@ -592,8 +608,8 @@ endforeach()
foreach(PKG ${SUFFIX_PACKAGES})
set(${PKG}_SOURCES_DIR ${LAMMPS_SOURCE_DIR}/${PKG})
file(GLOB ${PKG}_SOURCES ${${PKG}_SOURCES_DIR}/[^.]*.cpp)
file(GLOB ${PKG}_HEADERS ${${PKG}_SOURCES_DIR}/[^.]*.h)
file(GLOB ${PKG}_SOURCES ${CONFIGURE_DEPENDS} ${${PKG}_SOURCES_DIR}/[^.]*.cpp)
file(GLOB ${PKG}_HEADERS ${CONFIGURE_DEPENDS} ${${PKG}_SOURCES_DIR}/[^.]*.h)
# check for package files in src directory due to old make system
DetectBuildSystemConflict(${LAMMPS_SOURCE_DIR} ${${PKG}_SOURCES} ${${PKG}_HEADERS})
@ -604,18 +620,11 @@ endforeach()
##############################################
# add lib sources of (simple) enabled packages
############################################
foreach(PKG_LIB POEMS ATC AWPMD H5MD MESONT)
foreach(PKG_LIB POEMS ATC AWPMD H5MD)
if(PKG_${PKG_LIB})
string(TOLOWER "${PKG_LIB}" PKG_LIB)
if(PKG_LIB STREQUAL "mesont")
enable_language(Fortran)
file(GLOB_RECURSE ${PKG_LIB}_SOURCES
${LAMMPS_LIB_SOURCE_DIR}/${PKG_LIB}/[^.]*.f90)
else()
file(GLOB_RECURSE ${PKG_LIB}_SOURCES
${LAMMPS_LIB_SOURCE_DIR}/${PKG_LIB}/[^.]*.c
${LAMMPS_LIB_SOURCE_DIR}/${PKG_LIB}/[^.]*.cpp)
endif()
file(GLOB_RECURSE ${PKG_LIB}_SOURCES ${CONFIGURE_DEPENDS}
${LAMMPS_LIB_SOURCE_DIR}/${PKG_LIB}/[^.]*.c ${LAMMPS_LIB_SOURCE_DIR}/${PKG_LIB}/[^.]*.cpp)
add_library(${PKG_LIB} STATIC ${${PKG_LIB}_SOURCES})
set_target_properties(${PKG_LIB} PROPERTIES OUTPUT_NAME lammps_${PKG_LIB}${LAMMPS_MACHINE})
target_link_libraries(lammps PRIVATE ${PKG_LIB})
@ -629,7 +638,7 @@ foreach(PKG_LIB POEMS ATC AWPMD H5MD MESONT)
endif()
endforeach()
if(PKG_ELECTRODE)
if(PKG_ELECTRODE OR PKG_ML-POD)
target_link_libraries(lammps PRIVATE ${LAPACK_LIBRARIES})
endif()
@ -658,7 +667,7 @@ endif()
# packages which selectively include variants based on enabled styles
# e.g. accelerator packages
######################################################################
foreach(PKG_WITH_INCL CORESHELL DPD-SMOOTH MISC PHONON QEQ OPENMP KOKKOS OPT INTEL GPU)
foreach(PKG_WITH_INCL CORESHELL DPD-SMOOTH MC MISC PHONON QEQ OPENMP KOKKOS OPT INTEL GPU)
if(PKG_${PKG_WITH_INCL})
include(Packages/${PKG_WITH_INCL})
endif()
@ -884,6 +893,23 @@ if(ClangFormat_FOUND)
WORKING_DIRECTORY ${LAMMPS_SOURCE_DIR})
endif()
# extract Kokkos compilation settings
get_cmake_property(_allvars VARIABLES)
foreach(_var ${_allvars})
if(${_var})
string(REGEX MATCH "Kokkos_ENABLE_(SERIAL|THREADS|OPENMP|CUDA|HIP|SYCL|OPENMPTARGET|HPX)" _match ${_var})
if(_match)
string(REGEX REPLACE "Kokkos_ENABLE_(OPENMP|SERIAL|CUDA|HIP|SYCL)" "\\1" _match ${_var})
list(APPEND KOKKOS_DEVICE ${_match})
endif()
string(REGEX MATCH "Kokkos_ARCH" _match ${_var})
if(_match)
string(REGEX REPLACE "Kokkos_ARCH_(.*)" "\\1" _match ${_var})
list(APPEND KOKKOS_ARCH ${_match})
endif()
endif()
endforeach()
get_target_property(DEFINES lammps COMPILE_DEFINITIONS)
if(BUILD_IS_MULTI_CONFIG)
set(LAMMPS_BUILD_TYPE "Multi-Config")
@ -895,6 +921,7 @@ feature_summary(DESCRIPTION "The following tools and libraries have been found a
message(STATUS "<<< Build configuration >>>
LAMMPS Version: ${PROJECT_VERSION}
Operating System: ${CMAKE_SYSTEM_NAME} ${CMAKE_LINUX_DISTRO} ${CMAKE_DISTRO_VERSION}
CMake Version: ${CMAKE_VERSION}
Build type: ${LAMMPS_BUILD_TYPE}
Install path: ${CMAKE_INSTALL_PREFIX}
Generator: ${CMAKE_GENERATOR} using ${CMAKE_MAKE_PROGRAM}")
@ -980,6 +1007,12 @@ if(PKG_GPU)
endif()
message(STATUS "GPU precision: ${GPU_PREC}")
endif()
if(PKG_KOKKOS)
message(STATUS "Kokkos Devices: ${KOKKOS_DEVICE}")
if(KOKKOS_ARCH)
message(STATUS "Kokkos Architecture: ${KOKKOS_ARCH}")
endif()
endif()
if(PKG_KSPACE)
message(STATUS "<<< FFT settings >>>
-- Primary FFT lib: ${FFT}")

View File

@ -72,7 +72,7 @@
"configurationType": "Debug",
"buildRoot": "${workspaceRoot}\\build\\${name}",
"installRoot": "${workspaceRoot}\\install\\${name}",
"cmakeCommandArgs": "-C ${workspaceRoot}\\cmake\\presets\\windows.cmake -DCMAKE_C_COMPILER=clang-cl.exe -DCMAKE_CXX_COMPILER=clang-cl.exe",
"cmakeCommandArgs": "-C ${workspaceRoot}\\cmake\\presets\\windows.cmake -DCMAKE_C_COMPILER=clang-cl.exe -DCMAKE_CXX_COMPILER=clang-cl.exe -DBUILD_MPI=off",
"buildCommandArgs": "",
"ctestCommandArgs": "",
"inheritEnvironments": [ "clang_cl_x64" ],
@ -105,7 +105,7 @@
"configurationType": "Release",
"buildRoot": "${workspaceRoot}\\build\\${name}",
"installRoot": "${workspaceRoot}\\install\\${name}",
"cmakeCommandArgs": "-C ${workspaceRoot}\\cmake\\presets\\windows.cmake -DCMAKE_C_COMPILER=clang-cl.exe -DCMAKE_CXX_COMPILER=clang-cl.exe",
"cmakeCommandArgs": "-C ${workspaceRoot}\\cmake\\presets\\windows.cmake -DCMAKE_C_COMPILER=clang-cl.exe -DCMAKE_CXX_COMPILER=clang-cl.exe -DBUILD_MPI=off",
"buildCommandArgs": "",
"ctestCommandArgs": "-V",
"inheritEnvironments": [ "clang_cl_x64" ],
@ -305,4 +305,4 @@
]
}
]
}
}

View File

@ -17,7 +17,7 @@ if(BUILD_DOC)
endif()
find_package(Doxygen 1.8.10 REQUIRED)
file(GLOB DOC_SOURCES ${LAMMPS_DOC_DIR}/src/[^.]*.rst)
file(GLOB DOC_SOURCES ${CONFIGURE_DEPENDS} ${LAMMPS_DOC_DIR}/src/[^.]*.rst)
add_custom_command(
@ -56,16 +56,27 @@ if(BUILD_DOC)
)
set(MATHJAX_URL "https://github.com/mathjax/MathJax/archive/3.1.3.tar.gz" CACHE STRING "URL for MathJax tarball")
set(MATHJAX_MD5 "d1c98c746888bfd52ca8ebc10704f92f" CACHE STRING "MD5 checksum of MathJax tarball")
set(MATHJAX_MD5 "b81661c6e6ba06278e6ae37b30b0c492" CACHE STRING "MD5 checksum of MathJax tarball")
mark_as_advanced(MATHJAX_URL)
GetFallbackURL(MATHJAX_URL MATHJAX_FALLBACK)
# download mathjax distribution and unpack to folder "mathjax"
if(NOT EXISTS ${DOC_BUILD_STATIC_DIR}/mathjax/es5)
file(DOWNLOAD ${MATHJAX_URL}
"${CMAKE_CURRENT_BINARY_DIR}/mathjax.tar.gz"
EXPECTED_MD5 ${MATHJAX_MD5})
if(EXISTS ${CMAKE_CURRENT_BINARY_DIR}/mathjax.tar.gz)
file(MD5 ${CMAKE_CURRENT_BINARY_DIR}/mathjax.tar.gz)
endif()
if(NOT "${DL_MD5}" STREQUAL "${MATHJAX_MD5}")
file(DOWNLOAD ${MATHJAX_URL} "${CMAKE_CURRENT_BINARY_DIR}/mathjax.tar.gz" STATUS DL_STATUS SHOW_PROGRESS)
file(MD5 ${CMAKE_CURRENT_BINARY_DIR}/mathjax.tar.gz DL_MD5)
if((NOT DL_STATUS EQUAL 0) OR (NOT "${DL_MD5}" STREQUAL "${MATHJAX_MD5}"))
message(WARNING "Download from primary URL ${MATHJAX_URL} failed\nTrying fallback URL ${MATHJAX_FALLBACK}")
file(DOWNLOAD ${MATHJAX_FALLBACK} ${CMAKE_BINARY_DIR}/libpace.tar.gz EXPECTED_HASH MD5=${MATHJAX_MD5} SHOW_PROGRESS)
endif()
else()
message(STATUS "Using already downloaded archive ${CMAKE_BINARY_DIR}/libpace.tar.gz")
endif()
execute_process(COMMAND ${CMAKE_COMMAND} -E tar xzf mathjax.tar.gz WORKING_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR})
file(GLOB MATHJAX_VERSION_DIR ${CMAKE_CURRENT_BINARY_DIR}/MathJax-*)
file(GLOB MATHJAX_VERSION_DIR ${CONFIGURE_DEPENDS} ${CMAKE_CURRENT_BINARY_DIR}/MathJax-*)
execute_process(COMMAND ${CMAKE_COMMAND} -E rename ${MATHJAX_VERSION_DIR} ${DOC_BUILD_STATIC_DIR}/mathjax)
endif()

View File

@ -9,8 +9,22 @@ function(ExternalCMakeProject target url hash basedir cmakedir cmakefile)
get_filename_component(archive ${url} NAME)
file(MAKE_DIRECTORY ${CMAKE_BINARY_DIR}/_deps/src)
message(STATUS "Downloading ${url}")
file(DOWNLOAD ${url} ${CMAKE_BINARY_DIR}/_deps/${archive} EXPECTED_HASH MD5=${hash} SHOW_PROGRESS)
if(EXISTS ${CMAKE_BINARY_DIR}/_deps/${archive})
file(MD5 ${CMAKE_BINARY_DIR}/_deps/${archive} DL_MD5)
endif()
if(NOT "${DL_MD5}" STREQUAL "${hash}")
message(STATUS "Downloading ${url}")
file(DOWNLOAD ${url} ${CMAKE_BINARY_DIR}/_deps/${archive} STATUS DL_STATUS SHOW_PROGRESS)
file(MD5 ${CMAKE_BINARY_DIR}/_deps/${archive} DL_MD5)
if((NOT DL_STATUS EQUAL 0) OR (NOT "${DL_MD5}" STREQUAL "${hash}"))
set(${target}_URL ${url})
GetFallbackURL(${target}_URL fallback)
message(WARNING "Download from primary URL ${url} failed\nTrying fallback URL ${fallback}")
file(DOWNLOAD ${fallback} ${CMAKE_BINARY_DIR}/_deps/${archive} EXPECTED_HASH MD5=${hash} SHOW_PROGRESS)
endif()
else()
message(STATUS "Using already downloaded archive ${CMAKE_BINARY_DIR}/_deps/${archive}")
endif()
message(STATUS "Unpacking and configuring ${archive}")
execute_process(COMMAND ${CMAKE_COMMAND} -E tar xzf ${CMAKE_BINARY_DIR}/_deps/${archive}
WORKING_DIRECTORY ${CMAKE_BINARY_DIR}/_deps/src)

View File

@ -1,19 +0,0 @@
find_path(ZMQ_INCLUDE_DIR zmq.h)
find_library(ZMQ_LIBRARY NAMES zmq)
include(FindPackageHandleStandardArgs)
find_package_handle_standard_args(ZMQ DEFAULT_MSG ZMQ_LIBRARY ZMQ_INCLUDE_DIR)
# Copy the results to the output variables and target.
if(ZMQ_FOUND)
set(ZMQ_LIBRARIES ${ZMQ_LIBRARY})
set(ZMQ_INCLUDE_DIRS ${ZMQ_INCLUDE_DIR})
if(NOT TARGET ZMQ::ZMQ)
add_library(ZMQ::ZMQ UNKNOWN IMPORTED)
set_target_properties(ZMQ::ZMQ PROPERTIES
IMPORTED_LINK_INTERFACE_LANGUAGES "C"
IMPORTED_LOCATION "${ZMQ_LIBRARY}"
INTERFACE_INCLUDE_DIRECTORIES "${ZMQ_INCLUDE_DIR}")
endif()
endif()

View File

@ -65,7 +65,7 @@ endfunction(validate_option)
# helper function for getting the most recently modified file or folder from a glob pattern
function(get_newest_file path variable)
file(GLOB _dirs ${path})
file(GLOB _dirs ${CONFIGURE_DEPENDS} ${path})
set(_besttime 2000-01-01T00:00:00)
set(_bestfile "<unknown>")
foreach(_dir ${_dirs})
@ -112,45 +112,76 @@ if(BUILD_MPI)
set(MPI_CXX_SKIP_MPICXX TRUE)
# We use a non-standard procedure to cross-compile with MPI on Windows
if((CMAKE_SYSTEM_NAME STREQUAL "Windows") AND CMAKE_CROSSCOMPILING)
# Download and configure custom MPICH files for Windows
message(STATUS "Downloading and configuring MPICH-1.4.1 for Windows")
set(MPICH2_WIN64_DEVEL_URL "${LAMMPS_THIRDPARTY_URL}/mpich2-win64-devel.tar.gz" CACHE STRING "URL for MPICH2 (win64) tarball")
set(MPICH2_WIN32_DEVEL_URL "${LAMMPS_THIRDPARTY_URL}/mpich2-win32-devel.tar.gz" CACHE STRING "URL for MPICH2 (win32) tarball")
set(MPICH2_WIN64_DEVEL_MD5 "4939fdb59d13182fd5dd65211e469f14" CACHE STRING "MD5 checksum of MPICH2 (win64) tarball")
set(MPICH2_WIN32_DEVEL_MD5 "a61d153500dce44e21b755ee7257e031" CACHE STRING "MD5 checksum of MPICH2 (win32) tarball")
mark_as_advanced(MPICH2_WIN64_DEVEL_URL)
mark_as_advanced(MPICH2_WIN32_DEVEL_URL)
mark_as_advanced(MPICH2_WIN64_DEVEL_MD5)
mark_as_advanced(MPICH2_WIN32_DEVEL_MD5)
# Download and configure MinGW compatible MPICH development files for Windows
option(USE_MSMPI "Use Microsoft's MS-MPI SDK instead of MPICH2-1.4.1" OFF)
if(USE_MSMPI)
message(STATUS "Downloading and configuring MS-MPI 10.1 for Windows cross-compilation")
set(MPICH2_WIN64_DEVEL_URL "${LAMMPS_THIRDPARTY_URL}/msmpi-win64-devel.tar.gz" CACHE STRING "URL for MS-MPI (win64) tarball")
set(MPICH2_WIN64_DEVEL_MD5 "86314daf1bffb809f1fcbefb8a547490" CACHE STRING "MD5 checksum of MS-MPI (win64) tarball")
mark_as_advanced(MPICH2_WIN64_DEVEL_URL)
mark_as_advanced(MPICH2_WIN64_DEVEL_MD5)
include(ExternalProject)
if(CMAKE_SYSTEM_PROCESSOR STREQUAL "x86_64")
ExternalProject_Add(mpi4win_build
URL ${MPICH2_WIN64_DEVEL_URL}
URL_MD5 ${MPICH2_WIN64_DEVEL_MD5}
CONFIGURE_COMMAND "" BUILD_COMMAND "" INSTALL_COMMAND ""
BUILD_BYPRODUCTS <SOURCE_DIR>/lib/libmpi.a)
include(ExternalProject)
if(CMAKE_SYSTEM_PROCESSOR STREQUAL "x86_64")
ExternalProject_Add(mpi4win_build
URL ${MPICH2_WIN64_DEVEL_URL}
URL_MD5 ${MPICH2_WIN64_DEVEL_MD5}
CONFIGURE_COMMAND "" BUILD_COMMAND "" INSTALL_COMMAND ""
BUILD_BYPRODUCTS <SOURCE_DIR>/lib/libmsmpi.a)
else()
message(FATAL_ERROR "Only x86 64-bit builds are supported with MS-MPI")
endif()
ExternalProject_get_property(mpi4win_build SOURCE_DIR)
file(MAKE_DIRECTORY "${SOURCE_DIR}/include")
add_library(MPI::MPI_CXX UNKNOWN IMPORTED)
set_target_properties(MPI::MPI_CXX PROPERTIES
IMPORTED_LOCATION "${SOURCE_DIR}/lib/libmsmpi.a"
INTERFACE_INCLUDE_DIRECTORIES "${SOURCE_DIR}/include"
INTERFACE_COMPILE_DEFINITIONS "MPICH_SKIP_MPICXX")
add_dependencies(MPI::MPI_CXX mpi4win_build)
# set variables for status reporting at the end of CMake run
set(MPI_CXX_INCLUDE_PATH "${SOURCE_DIR}/include")
set(MPI_CXX_COMPILE_DEFINITIONS "MPICH_SKIP_MPICXX")
set(MPI_CXX_LIBRARIES "${SOURCE_DIR}/lib/libmsmpi.a")
else()
ExternalProject_Add(mpi4win_build
URL ${MPICH2_WIN32_DEVEL_URL}
URL_MD5 ${MPICH2_WIN32_DEVEL_MD5}
CONFIGURE_COMMAND "" BUILD_COMMAND "" INSTALL_COMMAND ""
BUILD_BYPRODUCTS <SOURCE_DIR>/lib/libmpi.a)
# Download and configure custom MPICH files for Windows
message(STATUS "Downloading and configuring MPICH-1.4.1 for Windows")
set(MPICH2_WIN64_DEVEL_URL "${LAMMPS_THIRDPARTY_URL}/mpich2-win64-devel.tar.gz" CACHE STRING "URL for MPICH2 (win64) tarball")
set(MPICH2_WIN64_DEVEL_MD5 "4939fdb59d13182fd5dd65211e469f14" CACHE STRING "MD5 checksum of MPICH2 (win64) tarball")
mark_as_advanced(MPICH2_WIN64_DEVEL_URL)
mark_as_advanced(MPICH2_WIN64_DEVEL_MD5)
include(ExternalProject)
if(CMAKE_SYSTEM_PROCESSOR STREQUAL "x86_64")
ExternalProject_Add(mpi4win_build
URL ${MPICH2_WIN64_DEVEL_URL}
URL_MD5 ${MPICH2_WIN64_DEVEL_MD5}
CONFIGURE_COMMAND "" BUILD_COMMAND "" INSTALL_COMMAND ""
BUILD_BYPRODUCTS <SOURCE_DIR>/lib/libmpi.a)
else()
ExternalProject_Add(mpi4win_build
URL ${MPICH2_WIN32_DEVEL_URL}
URL_MD5 ${MPICH2_WIN32_DEVEL_MD5}
CONFIGURE_COMMAND "" BUILD_COMMAND "" INSTALL_COMMAND ""
BUILD_BYPRODUCTS <SOURCE_DIR>/lib/libmpi.a)
endif()
ExternalProject_get_property(mpi4win_build SOURCE_DIR)
file(MAKE_DIRECTORY "${SOURCE_DIR}/include")
add_library(MPI::MPI_CXX UNKNOWN IMPORTED)
set_target_properties(MPI::MPI_CXX PROPERTIES
IMPORTED_LOCATION "${SOURCE_DIR}/lib/libmpi.a"
INTERFACE_INCLUDE_DIRECTORIES "${SOURCE_DIR}/include"
INTERFACE_COMPILE_DEFINITIONS "MPICH_SKIP_MPICXX")
add_dependencies(MPI::MPI_CXX mpi4win_build)
# set variables for status reporting at the end of CMake run
set(MPI_CXX_INCLUDE_PATH "${SOURCE_DIR}/include")
set(MPI_CXX_COMPILE_DEFINITIONS "MPICH_SKIP_MPICXX")
set(MPI_CXX_LIBRARIES "${SOURCE_DIR}/lib/libmpi.a")
endif()
ExternalProject_get_property(mpi4win_build SOURCE_DIR)
file(MAKE_DIRECTORY "${SOURCE_DIR}/include")
add_library(MPI::MPI_CXX UNKNOWN IMPORTED)
set_target_properties(MPI::MPI_CXX PROPERTIES
IMPORTED_LOCATION "${SOURCE_DIR}/lib/libmpi.a"
INTERFACE_INCLUDE_DIRECTORIES "${SOURCE_DIR}/include"
INTERFACE_COMPILE_DEFINITIONS "MPICH_SKIP_MPICXX")
add_dependencies(MPI::MPI_CXX mpi4win_build)
# set variables for status reporting at the end of CMake run
set(MPI_CXX_INCLUDE_PATH "${SOURCE_DIR}/include")
set(MPI_CXX_COMPILE_DEFINITIONS "MPICH_SKIP_MPICXX")
set(MPI_CXX_LIBRARIES "${SOURCE_DIR}/lib/libmpi.a")
else()
find_package(MPI REQUIRED)
option(LAMMPS_LONGLONG_TO_LONG "Workaround if your system or MPI version does not recognize 'long long' data types" OFF)

View File

@ -41,7 +41,7 @@ endfunction()
# helper function for getting the most recently modified file or folder from a glob pattern
function(get_newest_file path variable)
file(GLOB _dirs ${path})
file(GLOB _dirs ${CONFIGURE_DEPENDS} ${path})
set(_besttime 2000-01-01T00:00:00)
set(_bestfile "<unknown>")
foreach(_dir ${_dirs})
@ -80,8 +80,8 @@ endfunction()
function(check_for_autogen_files source_dir)
message(STATUS "Running check for auto-generated files from make-based build system")
file(GLOB SRC_AUTOGEN_FILES ${source_dir}/style_*.h)
file(GLOB SRC_AUTOGEN_PACKAGES ${source_dir}/packages_*.h)
file(GLOB SRC_AUTOGEN_FILES ${CONFIGURE_DEPENDS} ${source_dir}/style_*.h)
file(GLOB SRC_AUTOGEN_PACKAGES ${CONFIGURE_DEPENDS} ${source_dir}/packages_*.h)
list(APPEND SRC_AUTOGEN_FILES ${SRC_AUTOGEN_PACKAGES} ${source_dir}/lmpinstalledpkgs.h ${source_dir}/lmpgitversion.h)
list(APPEND SRC_AUTOGEN_FILES ${SRC_AUTOGEN_PACKAGES} ${source_dir}/mliap_model_python_couple.h ${source_dir}/mliap_model_python_couple.cpp)
foreach(_SRC ${SRC_AUTOGEN_FILES})
@ -99,8 +99,15 @@ function(check_for_autogen_files source_dir)
endfunction()
macro(pkg_depends PKG1 PKG2)
if(PKG_${PKG1} AND NOT (PKG_${PKG2} OR BUILD_${PKG2}))
message(FATAL_ERROR "The ${PKG1} package needs LAMMPS to be build with the ${PKG2} package")
if(DEFINED BUILD_${PKG2})
if(PKG_${PKG1} AND NOT BUILD_${PKG2})
message(FATAL_ERROR "The ${PKG1} package needs LAMMPS to be built with -D BUILD_${PKG2}=ON")
endif()
elseif(DEFINED PKG_${PKG2})
if(PKG_${PKG1} AND NOT PKG_${PKG2})
message(WARNING "The ${PKG1} package depends on the ${PKG2} package. Enabling it.")
set(PKG_${PKG2} ON CACHE BOOL "" FORCE)
endif()
endif()
endmacro()
@ -118,25 +125,27 @@ endfunction(GenerateBinaryHeader)
# fetch missing potential files
function(FetchPotentials pkgfolder potfolder)
if(EXISTS "${pkgfolder}/potentials.txt")
file(STRINGS "${pkgfolder}/potentials.txt" linelist REGEX "^[^#].")
foreach(line ${linelist})
string(FIND ${line} " " blank)
math(EXPR plusone "${blank}+1")
string(SUBSTRING ${line} 0 ${blank} pot)
string(SUBSTRING ${line} ${plusone} -1 sum)
if(EXISTS "${LAMMPS_POTENTIALS_DIR}/${pot}")
file(MD5 "${LAMMPS_POTENTIALS_DIR}/${pot}" oldsum)
endif()
if(NOT sum STREQUAL oldsum)
message(STATUS "Downloading external potential ${pot} from ${LAMMPS_POTENTIALS_URL}")
string(MD5 TMP_EXT "${CMAKE_BINARY_DIR}")
file(DOWNLOAD "${LAMMPS_POTENTIALS_URL}/${pot}.${sum}" "${CMAKE_BINARY_DIR}/${pot}.${TMP_EXT}"
EXPECTED_HASH MD5=${sum} SHOW_PROGRESS)
file(COPY "${CMAKE_BINARY_DIR}/${pot}.${TMP_EXT}" DESTINATION "${LAMMPS_POTENTIALS_DIR}")
file(RENAME "${LAMMPS_POTENTIALS_DIR}/${pot}.${TMP_EXT}" "${LAMMPS_POTENTIALS_DIR}/${pot}")
endif()
endforeach()
if(DOWNLOAD_POTENTIALS)
if(EXISTS "${pkgfolder}/potentials.txt")
file(STRINGS "${pkgfolder}/potentials.txt" linelist REGEX "^[^#].")
foreach(line ${linelist})
string(FIND ${line} " " blank)
math(EXPR plusone "${blank}+1")
string(SUBSTRING ${line} 0 ${blank} pot)
string(SUBSTRING ${line} ${plusone} -1 sum)
if(EXISTS "${LAMMPS_POTENTIALS_DIR}/${pot}")
file(MD5 "${LAMMPS_POTENTIALS_DIR}/${pot}" oldsum)
endif()
if(NOT sum STREQUAL oldsum)
message(STATUS "Downloading external potential ${pot} from ${LAMMPS_POTENTIALS_URL}")
string(RANDOM LENGTH 10 TMP_EXT)
file(DOWNLOAD "${LAMMPS_POTENTIALS_URL}/${pot}.${sum}" "${CMAKE_BINARY_DIR}/${pot}.${TMP_EXT}"
EXPECTED_HASH MD5=${sum} SHOW_PROGRESS)
file(COPY "${CMAKE_BINARY_DIR}/${pot}.${TMP_EXT}" DESTINATION "${LAMMPS_POTENTIALS_DIR}")
file(RENAME "${LAMMPS_POTENTIALS_DIR}/${pot}.${TMP_EXT}" "${LAMMPS_POTENTIALS_DIR}/${pot}")
endif()
endforeach()
endif()
endif()
endfunction(FetchPotentials)
@ -149,3 +158,14 @@ if((CMAKE_SYSTEM_NAME STREQUAL "Linux") AND (EXISTS /etc/os-release))
set(CMAKE_LINUX_DISTRO ${distro})
set(CMAKE_DISTRO_VERSION ${disversion})
endif()
function(GetFallbackURL input output)
string(REPLACE "_URL" "" _tmp ${input})
string(TOLOWER ${_tmp} libname)
string(REGEX REPLACE "^https://.*/([^/]+gz)" "${LAMMPS_THIRDPARTY_URL}/${libname}-\\1" newurl "${${input}}")
if ("${newurl}" STREQUAL "${${input}}")
set(${output} "" PARENT_SCOPE)
else()
set(${output} ${newurl} PARENT_SCOPE)
endif()
endfunction(GetFallbackURL)

View File

@ -1,39 +1,74 @@
# Download and configure custom MPICH files for Windows
message(STATUS "Downloading and configuring MPICH-1.4.1 for Windows")
set(MPICH2_WIN64_DEVEL_URL "${LAMMPS_THIRDPARTY_URL}/mpich2-win64-devel.tar.gz" CACHE STRING "URL for MPICH2 (win64) tarball")
set(MPICH2_WIN32_DEVEL_URL "${LAMMPS_THIRDPARTY_URL}/mpich2-win32-devel.tar.gz" CACHE STRING "URL for MPICH2 (win32) tarball")
set(MPICH2_WIN64_DEVEL_MD5 "4939fdb59d13182fd5dd65211e469f14" CACHE STRING "MD5 checksum of MPICH2 (win64) tarball")
set(MPICH2_WIN32_DEVEL_MD5 "a61d153500dce44e21b755ee7257e031" CACHE STRING "MD5 checksum of MPICH2 (win32) tarball")
mark_as_advanced(MPICH2_WIN64_DEVEL_URL)
mark_as_advanced(MPICH2_WIN32_DEVEL_URL)
mark_as_advanced(MPICH2_WIN64_DEVEL_MD5)
mark_as_advanced(MPICH2_WIN32_DEVEL_MD5)
# Download and configure MinGW compatible MPICH development files for Windows
option(USE_MSMPI "Use Microsoft's MS-MPI SDK instead of MPICH2-1.4.1" OFF)
include(ExternalProject)
if(CMAKE_SYSTEM_PROCESSOR STREQUAL "x86_64")
ExternalProject_Add(mpi4win_build
URL ${MPICH2_WIN64_DEVEL_URL}
URL_MD5 ${MPICH2_WIN64_DEVEL_MD5}
CONFIGURE_COMMAND "" BUILD_COMMAND "" INSTALL_COMMAND ""
BUILD_BYPRODUCTS <SOURCE_DIR>/lib/libmpi.a)
if(USE_MSMPI)
message(STATUS "Downloading and configuring MS-MPI 10.1 for Windows cross-compilation")
set(MPICH2_WIN64_DEVEL_URL "${LAMMPS_THIRDPARTY_URL}/msmpi-win64-devel.tar.gz" CACHE STRING "URL for MS-MPI (win64) tarball")
set(MPICH2_WIN64_DEVEL_MD5 "86314daf1bffb809f1fcbefb8a547490" CACHE STRING "MD5 checksum of MS-MPI (win64) tarball")
mark_as_advanced(MPICH2_WIN64_DEVEL_URL)
mark_as_advanced(MPICH2_WIN64_DEVEL_MD5)
include(ExternalProject)
if(CMAKE_SYSTEM_PROCESSOR STREQUAL "x86_64")
ExternalProject_Add(mpi4win_build
URL ${MPICH2_WIN64_DEVEL_URL}
URL_MD5 ${MPICH2_WIN64_DEVEL_MD5}
CONFIGURE_COMMAND "" BUILD_COMMAND "" INSTALL_COMMAND ""
BUILD_BYPRODUCTS <SOURCE_DIR>/lib/libmsmpi.a)
else()
message(FATAL_ERROR "Only x86 64-bit builds are supported with MS-MPI")
endif()
ExternalProject_get_property(mpi4win_build SOURCE_DIR)
file(MAKE_DIRECTORY "${SOURCE_DIR}/include")
add_library(MPI::MPI_CXX UNKNOWN IMPORTED)
set_target_properties(MPI::MPI_CXX PROPERTIES
IMPORTED_LOCATION "${SOURCE_DIR}/lib/libmsmpi.a"
INTERFACE_INCLUDE_DIRECTORIES "${SOURCE_DIR}/include"
INTERFACE_COMPILE_DEFINITIONS "MPICH_SKIP_MPICXX")
add_dependencies(MPI::MPI_CXX mpi4win_build)
# set variables for status reporting at the end of CMake run
set(MPI_CXX_INCLUDE_PATH "${SOURCE_DIR}/include")
set(MPI_CXX_COMPILE_DEFINITIONS "MPICH_SKIP_MPICXX")
set(MPI_CXX_LIBRARIES "${SOURCE_DIR}/lib/libmsmpi.a")
else()
ExternalProject_Add(mpi4win_build
URL ${MPICH2_WIN32_DEVEL_URL}
URL_MD5 ${MPICH2_WIN32_DEVEL_MD5}
CONFIGURE_COMMAND "" BUILD_COMMAND "" INSTALL_COMMAND ""
BUILD_BYPRODUCTS <SOURCE_DIR>/lib/libmpi.a)
message(STATUS "Downloading and configuring MPICH2-1.4.1 for Windows cross-compilation")
set(MPICH2_WIN64_DEVEL_URL "${LAMMPS_THIRDPARTY_URL}/mpich2-win64-devel.tar.gz" CACHE STRING "URL for MPICH2 (win64) tarball")
set(MPICH2_WIN32_DEVEL_URL "${LAMMPS_THIRDPARTY_URL}/mpich2-win32-devel.tar.gz" CACHE STRING "URL for MPICH2 (win32) tarball")
set(MPICH2_WIN64_DEVEL_MD5 "4939fdb59d13182fd5dd65211e469f14" CACHE STRING "MD5 checksum of MPICH2 (win64) tarball")
set(MPICH2_WIN32_DEVEL_MD5 "a61d153500dce44e21b755ee7257e031" CACHE STRING "MD5 checksum of MPICH2 (win32) tarball")
mark_as_advanced(MPICH2_WIN64_DEVEL_URL)
mark_as_advanced(MPICH2_WIN32_DEVEL_URL)
mark_as_advanced(MPICH2_WIN64_DEVEL_MD5)
mark_as_advanced(MPICH2_WIN32_DEVEL_MD5)
include(ExternalProject)
if(CMAKE_SYSTEM_PROCESSOR STREQUAL "x86_64")
ExternalProject_Add(mpi4win_build
URL ${MPICH2_WIN64_DEVEL_URL}
URL_MD5 ${MPICH2_WIN64_DEVEL_MD5}
CONFIGURE_COMMAND "" BUILD_COMMAND "" INSTALL_COMMAND ""
BUILD_BYPRODUCTS <SOURCE_DIR>/lib/libmpi.a)
else()
ExternalProject_Add(mpi4win_build
URL ${MPICH2_WIN32_DEVEL_URL}
URL_MD5 ${MPICH2_WIN32_DEVEL_MD5}
CONFIGURE_COMMAND "" BUILD_COMMAND "" INSTALL_COMMAND ""
BUILD_BYPRODUCTS <SOURCE_DIR>/lib/libmpi.a)
endif()
ExternalProject_get_property(mpi4win_build SOURCE_DIR)
file(MAKE_DIRECTORY "${SOURCE_DIR}/include")
add_library(MPI::MPI_CXX UNKNOWN IMPORTED)
set_target_properties(MPI::MPI_CXX PROPERTIES
IMPORTED_LOCATION "${SOURCE_DIR}/lib/libmpi.a"
INTERFACE_INCLUDE_DIRECTORIES "${SOURCE_DIR}/include"
INTERFACE_COMPILE_DEFINITIONS "MPICH_SKIP_MPICXX")
add_dependencies(MPI::MPI_CXX mpi4win_build)
# set variables for status reporting at the end of CMake run
set(MPI_CXX_INCLUDE_PATH "${SOURCE_DIR}/include")
set(MPI_CXX_COMPILE_DEFINITIONS "MPICH_SKIP_MPICXX")
set(MPI_CXX_LIBRARIES "${SOURCE_DIR}/lib/libmpi.a")
endif()
ExternalProject_get_property(mpi4win_build SOURCE_DIR)
file(MAKE_DIRECTORY "${SOURCE_DIR}/include")
add_library(MPI::MPI_CXX UNKNOWN IMPORTED)
set_target_properties(MPI::MPI_CXX PROPERTIES
IMPORTED_LOCATION "${SOURCE_DIR}/lib/libmpi.a"
INTERFACE_INCLUDE_DIRECTORIES "${SOURCE_DIR}/include"
INTERFACE_COMPILE_DEFINITIONS "MPICH_SKIP_MPICXX")
add_dependencies(MPI::MPI_CXX mpi4win_build)
# set variables for status reporting at the end of CMake run
set(MPI_CXX_INCLUDE_PATH "${SOURCE_DIR}/include")
set(MPI_CXX_COMPILE_DEFINITIONS "MPICH_SKIP_MPICXX")
set(MPI_CXX_LIBRARIES "${SOURCE_DIR}/lib/libmpi.a")

View File

@ -1,20 +1,15 @@
set(COLVARS_SOURCE_DIR ${LAMMPS_LIB_SOURCE_DIR}/colvars)
file(GLOB COLVARS_SOURCES ${COLVARS_SOURCE_DIR}/[^.]*.cpp)
file(GLOB COLVARS_SOURCES ${CONFIGURE_DEPENDS} ${COLVARS_SOURCE_DIR}/[^.]*.cpp)
option(COLVARS_DEBUG "Debugging messages for Colvars (quite verbose)" OFF)
option(COLVARS_DEBUG "Enable debugging messages for Colvars (quite verbose)" OFF)
# Build Lepton by default
option(COLVARS_LEPTON "Build and link the Lepton library" ON)
option(COLVARS_LEPTON "Use the Lepton library for custom expressions" ON)
if(COLVARS_LEPTON)
set(LEPTON_DIR ${LAMMPS_LIB_SOURCE_DIR}/colvars/lepton)
file(GLOB LEPTON_SOURCES ${LEPTON_DIR}/src/[^.]*.cpp)
add_library(lepton STATIC ${LEPTON_SOURCES})
# Change the define below to LEPTON_BUILDING_SHARED_LIBRARY when linking Lepton as a DLL with MSVC
target_compile_definitions(lepton PRIVATE -DLEPTON_BUILDING_STATIC_LIBRARY)
set_target_properties(lepton PROPERTIES OUTPUT_NAME lammps_lepton${LAMMPS_MACHINE})
target_include_directories(lepton PRIVATE ${LEPTON_DIR}/include)
if(NOT LEPTON_SOURCE_DIR)
include(Packages/LEPTON)
endif()
endif()
add_library(colvars STATIC ${COLVARS_SOURCES})
@ -30,14 +25,11 @@ target_include_directories(colvars PRIVATE ${LAMMPS_SOURCE_DIR})
target_link_libraries(lammps PRIVATE colvars)
if(COLVARS_DEBUG)
# Need to export the macro publicly to also affect the proxy
# Need to export the define publicly to be valid in interface code
target_compile_definitions(colvars PUBLIC -DCOLVARS_DEBUG)
endif()
if(COLVARS_LEPTON)
target_link_libraries(lammps PRIVATE lepton)
target_compile_definitions(colvars PRIVATE -DLEPTON)
# Disable the line below when linking Lepton as a DLL with MSVC
target_compile_definitions(colvars PRIVATE -DLEPTON_USE_STATIC_LIBRARIES)
target_include_directories(colvars PUBLIC ${LEPTON_DIR}/include)
target_link_libraries(colvars PUBLIC lepton)
endif()

View File

@ -1,4 +1,9 @@
find_package(ZLIB REQUIRED)
find_package(ZLIB)
if(NOT ZLIB_FOUND)
message(WARNING "No Zlib development support found. Disabling COMPRESS package...")
set(PKG_COMPRESS OFF CACHE BOOL "" FORCE)
return()
endif()
target_link_libraries(lammps PRIVATE ZLIB::ZLIB)
find_package(PkgConfig QUIET)

View File

@ -26,7 +26,20 @@ elseif(GPU_PREC STREQUAL "SINGLE")
set(GPU_PREC_SETTING "SINGLE_SINGLE")
endif()
file(GLOB GPU_LIB_SOURCES ${LAMMPS_LIB_SOURCE_DIR}/gpu/[^.]*.cpp)
option(GPU_DEBUG "Enable debugging code of the GPU package" OFF)
mark_as_advanced(GPU_DEBUG)
if(PKG_AMOEBA AND FFT_SINGLE)
message(FATAL_ERROR "GPU acceleration of AMOEBA is not (yet) compatible with single precision FFT")
endif()
if (PKG_AMOEBA)
list(APPEND GPU_SOURCES
${GPU_SOURCES_DIR}/amoeba_convolution_gpu.h
${GPU_SOURCES_DIR}/amoeba_convolution_gpu.cpp)
endif()
file(GLOB GPU_LIB_SOURCES ${CONFIGURE_DEPENDS} ${LAMMPS_LIB_SOURCE_DIR}/gpu/[^.]*.cpp)
file(MAKE_DIRECTORY ${LAMMPS_LIB_BINARY_DIR}/gpu)
if(GPU_API STREQUAL "CUDA")
@ -55,7 +68,7 @@ if(GPU_API STREQUAL "CUDA")
set(GPU_ARCH "sm_50" CACHE STRING "LAMMPS GPU CUDA SM primary architecture (e.g. sm_60)")
# ensure that no *cubin.h files exist from a compile in the lib/gpu folder
file(GLOB GPU_LIB_OLD_CUBIN_HEADERS ${LAMMPS_LIB_SOURCE_DIR}/gpu/*_cubin.h)
file(GLOB GPU_LIB_OLD_CUBIN_HEADERS ${CONFIGURE_DEPENDS} ${LAMMPS_LIB_SOURCE_DIR}/gpu/*_cubin.h)
if(GPU_LIB_OLD_CUBIN_HEADERS)
message(FATAL_ERROR "########################################################################\n"
"Found file(s) generated by the make-based build system in lib/gpu\n"
@ -65,15 +78,15 @@ if(GPU_API STREQUAL "CUDA")
"########################################################################")
endif()
file(GLOB GPU_LIB_CU ${LAMMPS_LIB_SOURCE_DIR}/gpu/[^.]*.cu ${CMAKE_CURRENT_SOURCE_DIR}/gpu/[^.]*.cu)
file(GLOB GPU_LIB_CU ${CONFIGURE_DEPENDS} ${LAMMPS_LIB_SOURCE_DIR}/gpu/[^.]*.cu ${CMAKE_CURRENT_SOURCE_DIR}/gpu/[^.]*.cu)
list(REMOVE_ITEM GPU_LIB_CU ${LAMMPS_LIB_SOURCE_DIR}/gpu/lal_pppm.cu)
cuda_include_directories(${LAMMPS_LIB_SOURCE_DIR}/gpu ${LAMMPS_LIB_BINARY_DIR}/gpu)
if(CUDPP_OPT)
cuda_include_directories(${LAMMPS_LIB_SOURCE_DIR}/gpu/cudpp_mini)
file(GLOB GPU_LIB_CUDPP_SOURCES ${LAMMPS_LIB_SOURCE_DIR}/gpu/cudpp_mini/[^.]*.cpp)
file(GLOB GPU_LIB_CUDPP_CU ${LAMMPS_LIB_SOURCE_DIR}/gpu/cudpp_mini/[^.]*.cu)
file(GLOB GPU_LIB_CUDPP_SOURCES ${CONFIGURE_DEPENDS} ${LAMMPS_LIB_SOURCE_DIR}/gpu/cudpp_mini/[^.]*.cpp)
file(GLOB GPU_LIB_CUDPP_CU ${CONFIGURE_DEPENDS} ${LAMMPS_LIB_SOURCE_DIR}/gpu/cudpp_mini/[^.]*.cu)
endif()
# build arch/gencode commands for nvcc based on CUDA toolkit version and use choice
@ -82,6 +95,7 @@ if(GPU_API STREQUAL "CUDA")
# apply the following to build "fat" CUDA binaries only for known CUDA toolkits since version 8.0
# only the Kepler achitecture and beyond is supported
# comparison chart according to: https://en.wikipedia.org/wiki/CUDA#GPUs_supported
if(CUDA_VERSION VERSION_LESS 8.0)
message(FATAL_ERROR "CUDA Toolkit version 8.0 or later is required")
elseif(CUDA_VERSION VERSION_GREATER_EQUAL "12.0")
@ -120,14 +134,14 @@ if(GPU_API STREQUAL "CUDA")
if(CUDA_VERSION VERSION_GREATER_EQUAL "11.1")
string(APPEND GPU_CUDA_GENCODE " -gencode arch=compute_86,code=[sm_86,compute_86]")
endif()
# Hopper (GPU Arch 9.0) is supported by CUDA 12.0? and later
# Lovelace (GPU Arch 8.9) is supported by CUDA 11.8 and later
if(CUDA_VERSION VERSION_GREATER_EQUAL "11.8")
string(APPEND GPU_CUDA_GENCODE " -gencode arch=compute_90,code=[sm_90,compute_90]")
endif()
# Hopper (GPU Arch 9.0) is supported by CUDA 12.0 and later
if(CUDA_VERSION VERSION_GREATER_EQUAL "12.0")
string(APPEND GPU_CUDA_GENCODE " -gencode arch=compute_90,code=[sm_90,compute_90]")
endif()
# # Lovelace (GPU Arch 9.x) is supported by CUDA 12.0? and later
#if(CUDA_VERSION VERSION_GREATER_EQUAL "12.0")
# string(APPEND GPU_CUDA_GENCODE " -gencode arch=compute_9x,code=[sm_9x,compute_9x]")
#endif()
endif()
cuda_compile_fatbin(GPU_GEN_OBJS ${GPU_LIB_CU} OPTIONS ${CUDA_REQUEST_PIC}
@ -150,7 +164,12 @@ if(GPU_API STREQUAL "CUDA")
add_library(gpu STATIC ${GPU_LIB_SOURCES} ${GPU_LIB_CUDPP_SOURCES} ${GPU_OBJS})
target_link_libraries(gpu PRIVATE ${CUDA_LIBRARIES} ${CUDA_CUDA_LIBRARY})
target_include_directories(gpu PRIVATE ${LAMMPS_LIB_BINARY_DIR}/gpu ${CUDA_INCLUDE_DIRS})
target_compile_definitions(gpu PRIVATE -DUSE_CUDA -D_${GPU_PREC_SETTING} -DMPI_GERYON -DUCL_NO_EXIT ${GPU_CUDA_MPS_FLAGS})
target_compile_definitions(gpu PRIVATE -DUSE_CUDA -D_${GPU_PREC_SETTING} ${GPU_CUDA_MPS_FLAGS})
if(GPU_DEBUG)
target_compile_definitions(gpu PRIVATE -DUCL_DEBUG -DGERYON_KERNEL_DUMP)
else()
target_compile_definitions(gpu PRIVATE -DMPI_GERYON -DUCL_NO_EXIT)
endif()
if(CUDPP_OPT)
target_include_directories(gpu PRIVATE ${LAMMPS_LIB_SOURCE_DIR}/gpu/cudpp_mini)
target_compile_definitions(gpu PRIVATE -DUSE_CUDPP)
@ -182,7 +201,7 @@ elseif(GPU_API STREQUAL "OPENCL")
include(OpenCLUtils)
set(OCL_COMMON_HEADERS ${LAMMPS_LIB_SOURCE_DIR}/gpu/lal_preprocessor.h ${LAMMPS_LIB_SOURCE_DIR}/gpu/lal_aux_fun1.h)
file(GLOB GPU_LIB_CU ${LAMMPS_LIB_SOURCE_DIR}/gpu/[^.]*.cu)
file(GLOB GPU_LIB_CU ${CONFIGURE_DEPENDS} ${LAMMPS_LIB_SOURCE_DIR}/gpu/[^.]*.cu)
list(REMOVE_ITEM GPU_LIB_CU
${LAMMPS_LIB_SOURCE_DIR}/gpu/lal_gayberne.cu
${LAMMPS_LIB_SOURCE_DIR}/gpu/lal_gayberne_lj.cu
@ -191,6 +210,7 @@ elseif(GPU_API STREQUAL "OPENCL")
${LAMMPS_LIB_SOURCE_DIR}/gpu/lal_tersoff.cu
${LAMMPS_LIB_SOURCE_DIR}/gpu/lal_tersoff_zbl.cu
${LAMMPS_LIB_SOURCE_DIR}/gpu/lal_tersoff_mod.cu
${LAMMPS_LIB_SOURCE_DIR}/gpu/lal_hippo.cu
)
foreach(GPU_KERNEL ${GPU_LIB_CU})
@ -207,6 +227,7 @@ elseif(GPU_API STREQUAL "OPENCL")
GenerateOpenCLHeader(tersoff ${CMAKE_CURRENT_BINARY_DIR}/gpu/tersoff_cl.h ${OCL_COMMON_HEADERS} ${LAMMPS_LIB_SOURCE_DIR}/gpu/lal_tersoff_extra.h ${LAMMPS_LIB_SOURCE_DIR}/gpu/lal_tersoff.cu)
GenerateOpenCLHeader(tersoff_zbl ${CMAKE_CURRENT_BINARY_DIR}/gpu/tersoff_zbl_cl.h ${OCL_COMMON_HEADERS} ${LAMMPS_LIB_SOURCE_DIR}/gpu/lal_tersoff_zbl_extra.h ${LAMMPS_LIB_SOURCE_DIR}/gpu/lal_tersoff_zbl.cu)
GenerateOpenCLHeader(tersoff_mod ${CMAKE_CURRENT_BINARY_DIR}/gpu/tersoff_mod_cl.h ${OCL_COMMON_HEADERS} ${LAMMPS_LIB_SOURCE_DIR}/gpu/lal_tersoff_mod_extra.h ${LAMMPS_LIB_SOURCE_DIR}/gpu/lal_tersoff_mod.cu)
GenerateOpenCLHeader(hippo ${CMAKE_CURRENT_BINARY_DIR}/gpu/hippo_cl.h ${OCL_COMMON_HEADERS} ${LAMMPS_LIB_SOURCE_DIR}/gpu/lal_hippo_extra.h ${LAMMPS_LIB_SOURCE_DIR}/gpu/lal_hippo.cu)
list(APPEND GPU_LIB_SOURCES
${CMAKE_CURRENT_BINARY_DIR}/gpu/gayberne_cl.h
@ -216,14 +237,18 @@ elseif(GPU_API STREQUAL "OPENCL")
${CMAKE_CURRENT_BINARY_DIR}/gpu/tersoff_cl.h
${CMAKE_CURRENT_BINARY_DIR}/gpu/tersoff_zbl_cl.h
${CMAKE_CURRENT_BINARY_DIR}/gpu/tersoff_mod_cl.h
${CMAKE_CURRENT_BINARY_DIR}/gpu/hippo_cl.h
)
add_library(gpu STATIC ${GPU_LIB_SOURCES})
target_link_libraries(gpu PRIVATE OpenCL::OpenCL)
target_include_directories(gpu PRIVATE ${CMAKE_CURRENT_BINARY_DIR}/gpu)
target_compile_definitions(gpu PRIVATE -D_${GPU_PREC_SETTING} -DMPI_GERYON -DGERYON_NUMA_FISSION -DUCL_NO_EXIT)
target_compile_definitions(gpu PRIVATE -DUSE_OPENCL)
target_compile_definitions(gpu PRIVATE -DUSE_OPENCL -D_${GPU_PREC_SETTING})
if(GPU_DEBUG)
target_compile_definitions(gpu PRIVATE -DUCL_DEBUG -DGERYON_KERNEL_DUMP)
else()
target_compile_definitions(gpu PRIVATE -DMPI_GERYON -DGERYON_NUMA_FISSION -DUCL_NO_EXIT)
endif()
target_link_libraries(lammps PRIVATE gpu)
add_executable(ocl_get_devices ${LAMMPS_LIB_SOURCE_DIR}/gpu/geryon/ucl_get_devices.cpp)
@ -276,6 +301,7 @@ elseif(GPU_API STREQUAL "HIP")
else()
# build arch/gencode commands for nvcc based on CUDA toolkit version and use choice
# --arch translates directly instead of JIT, so this should be for the preferred or most common architecture
# comparison chart according to: https://en.wikipedia.org/wiki/CUDA#GPUs_supported
set(HIP_CUDA_GENCODE "-arch=${HIP_ARCH}")
# Kepler (GPU Arch 3.0) is supported by CUDA 5 to CUDA 10.2
if((CUDA_VERSION VERSION_GREATER_EQUAL "5.0") AND (CUDA_VERSION VERSION_LESS "11.0"))
@ -305,14 +331,22 @@ elseif(GPU_API STREQUAL "HIP")
if(CUDA_VERSION VERSION_GREATER_EQUAL "11.0")
string(APPEND HIP_CUDA_GENCODE " -gencode arch=compute_80,code=[sm_80,compute_80]")
endif()
# Hopper (GPU Arch 9.0) is supported by CUDA 12.0? and later
# Ampere (GPU Arch 8.6) is supported by CUDA 11.1 and later
if(CUDA_VERSION VERSION_GREATER_EQUAL "11.1")
string(APPEND HIP_CUDA_GENCODE " -gencode arch=compute_86,code=[sm_86,compute_86]")
endif()
# Lovelace (GPU Arch 8.9) is supported by CUDA 11.8 and later
if(CUDA_VERSION VERSION_GREATER_EQUAL "11.8")
string(APPEND HIP_CUDA_GENCODE " -gencode arch=compute_90,code=[sm_90,compute_90]")
endif()
# Hopper (GPU Arch 9.0) is supported by CUDA 12.0 and later
if(CUDA_VERSION VERSION_GREATER_EQUAL "12.0")
string(APPEND GPU_CUDA_GENCODE " -gencode arch=compute_90,code=[sm_90,compute_90]")
string(APPEND HIP_CUDA_GENCODE " -gencode arch=compute_90,code=[sm_90,compute_90]")
endif()
endif()
endif()
file(GLOB GPU_LIB_CU ${LAMMPS_LIB_SOURCE_DIR}/gpu/[^.]*.cu ${CMAKE_CURRENT_SOURCE_DIR}/gpu/[^.]*.cu)
file(GLOB GPU_LIB_CU ${CONFIGURE_DEPENDS} ${LAMMPS_LIB_SOURCE_DIR}/gpu/[^.]*.cu ${CMAKE_CURRENT_SOURCE_DIR}/gpu/[^.]*.cu)
list(REMOVE_ITEM GPU_LIB_CU ${LAMMPS_LIB_SOURCE_DIR}/gpu/lal_pppm.cu)
set(GPU_LIB_CU_HIP "")
@ -364,8 +398,12 @@ elseif(GPU_API STREQUAL "HIP")
add_library(gpu STATIC ${GPU_LIB_SOURCES})
target_include_directories(gpu PRIVATE ${LAMMPS_LIB_BINARY_DIR}/gpu)
target_compile_definitions(gpu PRIVATE -D_${GPU_PREC_SETTING} -DMPI_GERYON -DUCL_NO_EXIT)
target_compile_definitions(gpu PRIVATE -DUSE_HIP)
target_compile_definitions(gpu PRIVATE -DUSE_HIP -D_${GPU_PREC_SETTING})
if(GPU_DEBUG)
target_compile_definitions(gpu PRIVATE -DUCL_DEBUG -DGERYON_KERNEL_DUMP)
else()
target_compile_definitions(gpu PRIVATE -DMPI_GERYON -DUCL_NO_EXIT)
endif()
target_link_libraries(gpu PRIVATE hip::host)
if(HIP_USE_DEVICE_SORT)
@ -390,15 +428,17 @@ elseif(GPU_API STREQUAL "HIP")
if(DOWNLOAD_CUB)
message(STATUS "CUB download requested")
set(CUB_URL "https://github.com/NVlabs/cub/archive/1.12.0.tar.gz" CACHE STRING "URL for CUB tarball")
# TODO: test update to current version 1.17.2
set(CUB_URL "https://github.com/nvidia/cub/archive/1.12.0.tar.gz" CACHE STRING "URL for CUB tarball")
set(CUB_MD5 "1cf595beacafff104700921bac8519f3" CACHE STRING "MD5 checksum of CUB tarball")
mark_as_advanced(CUB_URL)
mark_as_advanced(CUB_MD5)
GetFallbackURL(CUB_URL CUB_FALLBACK)
include(ExternalProject)
ExternalProject_Add(CUB
URL ${CUB_URL}
URL ${CUB_URL} ${CUB_FALLBACK}
URL_MD5 ${CUB_MD5}
PREFIX "${CMAKE_CURRENT_BINARY_DIR}"
CONFIGURE_COMMAND ""

View File

@ -112,9 +112,5 @@ if(PKG_KSPACE)
RegisterIntegrateStyle(${INTEL_SOURCES_DIR}/verlet_lrt_intel.h)
endif()
if(PKG_ELECTRODE)
list(APPEND INTEL_SOURCES ${INTEL_SOURCES_DIR}/electrode_accel_intel.cpp)
endif()
target_sources(lammps PRIVATE ${INTEL_SOURCES})
target_include_directories(lammps PRIVATE ${INTEL_SOURCES_DIR})

View File

@ -3,6 +3,7 @@
if(CMAKE_CXX_STANDARD LESS 14)
message(FATAL_ERROR "The KOKKOS package requires the C++ standard to be set to at least C++14")
endif()
########################################################################
# consistency checks and Kokkos options/settings required by LAMMPS
if(Kokkos_ENABLE_CUDA)
@ -48,12 +49,14 @@ if(DOWNLOAD_KOKKOS)
list(APPEND KOKKOS_LIB_BUILD_ARGS "-DCMAKE_CXX_EXTENSIONS=${CMAKE_CXX_EXTENSIONS}")
list(APPEND KOKKOS_LIB_BUILD_ARGS "-DCMAKE_TOOLCHAIN_FILE=${CMAKE_TOOLCHAIN_FILE}")
include(ExternalProject)
set(KOKKOS_URL "https://github.com/kokkos/kokkos/archive/3.7.00.tar.gz" CACHE STRING "URL for KOKKOS tarball")
set(KOKKOS_MD5 "84991eca9f066383abe119a5bc7a11c4" CACHE STRING "MD5 checksum of KOKKOS tarball")
set(KOKKOS_URL "https://github.com/kokkos/kokkos/archive/3.7.01.tar.gz" CACHE STRING "URL for KOKKOS tarball")
set(KOKKOS_MD5 "f140e02b826223b1045207d9bc10d404" CACHE STRING "MD5 checksum of KOKKOS tarball")
mark_as_advanced(KOKKOS_URL)
mark_as_advanced(KOKKOS_MD5)
GetFallbackURL(KOKKOS_URL KOKKOS_FALLBACK)
ExternalProject_Add(kokkos_build
URL ${KOKKOS_URL}
URL ${KOKKOS_URL} ${KOKKOS_FALLBACK}
URL_MD5 ${KOKKOS_MD5}
CMAKE_ARGS ${KOKKOS_LIB_BUILD_ARGS}
BUILD_BYPRODUCTS <INSTALL_DIR>/lib/libkokkoscore.a <INSTALL_DIR>/lib/libkokkoscontainers.a
@ -73,7 +76,7 @@ if(DOWNLOAD_KOKKOS)
add_dependencies(LAMMPS::KOKKOSCORE kokkos_build)
add_dependencies(LAMMPS::KOKKOSCONTAINERS kokkos_build)
elseif(EXTERNAL_KOKKOS)
find_package(Kokkos 3.7.00 REQUIRED CONFIG)
find_package(Kokkos 3.7.01 REQUIRED CONFIG)
target_link_libraries(lammps PRIVATE Kokkos::kokkos)
target_link_libraries(lmp PRIVATE Kokkos::kokkos)
else()
@ -89,7 +92,6 @@ else()
endif()
add_subdirectory(${LAMMPS_LIB_KOKKOS_SRC_DIR} ${LAMMPS_LIB_KOKKOS_BIN_DIR})
set(Kokkos_INCLUDE_DIRS ${LAMMPS_LIB_KOKKOS_SRC_DIR}/core/src
${LAMMPS_LIB_KOKKOS_SRC_DIR}/containers/src
${LAMMPS_LIB_KOKKOS_SRC_DIR}/algorithms/src
@ -124,7 +126,7 @@ set(KOKKOS_PKG_SOURCES ${KOKKOS_PKG_SOURCES_DIR}/kokkos.cpp
if(PKG_KSPACE)
list(APPEND KOKKOS_PKG_SOURCES ${KOKKOS_PKG_SOURCES_DIR}/fft3d_kokkos.cpp
${KOKKOS_PKG_SOURCES_DIR}/gridcomm_kokkos.cpp
${KOKKOS_PKG_SOURCES_DIR}/grid3d_kokkos.cpp
${KOKKOS_PKG_SOURCES_DIR}/remap_kokkos.cpp)
if(Kokkos_ENABLE_CUDA)
if(NOT (FFT STREQUAL "KISS"))
@ -143,7 +145,24 @@ if(PKG_ML-IAP)
list(APPEND KOKKOS_PKG_SOURCES ${KOKKOS_PKG_SOURCES_DIR}/mliap_data_kokkos.cpp
${KOKKOS_PKG_SOURCES_DIR}/mliap_descriptor_so3_kokkos.cpp
${KOKKOS_PKG_SOURCES_DIR}/mliap_model_linear_kokkos.cpp
${KOKKOS_PKG_SOURCES_DIR}/mliap_model_python_kokkos.cpp
${KOKKOS_PKG_SOURCES_DIR}/mliap_unified_kokkos.cpp
${KOKKOS_PKG_SOURCES_DIR}/mliap_so3_kokkos.cpp)
# Add KOKKOS version of ML-IAP Python coupling if non-KOKKOS version is included
if(MLIAP_ENABLE_PYTHON AND Cythonize_EXECUTABLE)
file(GLOB MLIAP_KOKKOS_CYTHON_SRC ${CONFIGURE_DEPENDS} ${LAMMPS_SOURCE_DIR}/KOKKOS/*.pyx)
foreach(MLIAP_CYTHON_FILE ${MLIAP_KOKKOS_CYTHON_SRC})
get_filename_component(MLIAP_CYTHON_BASE ${MLIAP_CYTHON_FILE} NAME_WE)
add_custom_command(OUTPUT ${MLIAP_BINARY_DIR}/${MLIAP_CYTHON_BASE}.cpp ${MLIAP_BINARY_DIR}/${MLIAP_CYTHON_BASE}.h
COMMAND ${CMAKE_COMMAND} -E copy_if_different ${MLIAP_CYTHON_FILE} ${MLIAP_BINARY_DIR}/${MLIAP_CYTHON_BASE}.pyx
COMMAND ${Cythonize_EXECUTABLE} -3 ${MLIAP_BINARY_DIR}/${MLIAP_CYTHON_BASE}.pyx
WORKING_DIRECTORY ${MLIAP_BINARY_DIR}
MAIN_DEPENDENCY ${MLIAP_CYTHON_FILE}
COMMENT "Generating C++ sources with cythonize...")
list(APPEND KOKKOS_PKG_SOURCES ${MLIAP_BINARY_DIR}/${MLIAP_CYTHON_BASE}.cpp)
endforeach()
endif()
endif()
if(PKG_PHONON)

View File

@ -19,6 +19,7 @@ if(DOWNLOAD_LATTE)
set(LATTE_MD5 "820e73a457ced178c08c71389a385de7" CACHE STRING "MD5 checksum of LATTE tarball")
mark_as_advanced(LATTE_URL)
mark_as_advanced(LATTE_MD5)
GetFallbackURL(LATTE_URL LATTE_FALLBACK)
# CMake cannot pass BLAS or LAPACK library variable to external project if they are a list
list(LENGTH BLAS_LIBRARIES} NUM_BLAS)
@ -30,7 +31,7 @@ if(DOWNLOAD_LATTE)
include(ExternalProject)
ExternalProject_Add(latte_build
URL ${LATTE_URL}
URL ${LATTE_URL} ${LATTE_FALLBACK}
URL_MD5 ${LATTE_MD5}
SOURCE_SUBDIR cmake
CMAKE_ARGS -DCMAKE_INSTALL_PREFIX=<INSTALL_DIR> ${CMAKE_REQUEST_PIC} -DCMAKE_INSTALL_LIBDIR=lib

View File

@ -0,0 +1,35 @@
# avoid including this file twice
if(LEPTON_SOURCE_DIR)
return()
endif()
set(LEPTON_SOURCE_DIR ${LAMMPS_LIB_SOURCE_DIR}/lepton)
file(GLOB LEPTON_SOURCES ${CONFIGURE_DEPENDS} ${LEPTON_SOURCE_DIR}/src/[^.]*.cpp)
if((CMAKE_HOST_SYSTEM_PROCESSOR STREQUAL "amd64") OR
(CMAKE_HOST_SYSTEM_PROCESSOR STREQUAL "AMD64") OR
(CMAKE_HOST_SYSTEM_PROCESSOR STREQUAL "x86_64"))
option(LEPTON_ENABLE_JIT "Enable Just-In-Time compiler for Lepton" ON)
else()
option(LEPTON_ENABLE_JIT "Enable Just-In-Time compiler for Lepton" OFF)
endif()
if(LEPTON_ENABLE_JIT)
file(GLOB ASMJIT_SOURCES ${CONFIGURE_DEPENDS} ${LEPTON_SOURCE_DIR}/asmjit/*/[^.]*.cpp)
endif()
add_library(lepton STATIC ${LEPTON_SOURCES} ${ASMJIT_SOURCES})
set_target_properties(lepton PROPERTIES OUTPUT_NAME lammps_lepton${LAMMPS_MACHINE})
target_compile_definitions(lepton PUBLIC LEPTON_BUILDING_STATIC_LIBRARY=1)
target_include_directories(lepton PUBLIC ${LEPTON_SOURCE_DIR}/include)
if(CMAKE_SYSTEM_NAME STREQUAL "Linux")
find_library(LIB_RT rt QUIET)
target_link_libraries(lepton PUBLIC ${LIB_RT})
endif()
if(LEPTON_ENABLE_JIT)
target_compile_definitions(lepton PUBLIC "LEPTON_USE_JIT=1;ASMJIT_BUILD_X86=1;ASMJIT_STATIC=1;ASMJIT_BUILD_RELEASE=1")
target_include_directories(lepton PUBLIC ${LEPTON_SOURCE_DIR})
endif()
target_link_libraries(lammps PRIVATE lepton)

View File

@ -0,0 +1,9 @@
# fix sgcmc may only be installed if also the EAM pair style from MANYBODY is installed
if(NOT PKG_MANYBODY)
get_property(LAMMPS_FIX_HEADERS GLOBAL PROPERTY FIX)
list(REMOVE_ITEM LAMMPS_FIX_HEADERS ${LAMMPS_SOURCE_DIR}/MC/fix_sgcmc.h)
set_property(GLOBAL PROPERTY FIX "${LAMMPS_FIX_HEADERS}")
get_target_property(LAMMPS_SOURCES lammps SOURCES)
list(REMOVE_ITEM LAMMPS_SOURCES ${LAMMPS_SOURCE_DIR}/MC/fix_sgcmc.cpp)
set_property(TARGET lammps PROPERTY SOURCES "${LAMMPS_SOURCES}")
endif()

View File

@ -12,6 +12,7 @@ if(DOWNLOAD_MDI)
set(MDI_MD5 "7a222353ae8e03961d5365e6cd48baee" CACHE STRING "MD5 checksum for MDI tarball")
mark_as_advanced(MDI_URL)
mark_as_advanced(MDI_MD5)
GetFallbackURL(MDI_URL MDI_FALLBACK)
enable_language(C)
# only ON/OFF are allowed for "mpi" flag when building MDI library
@ -63,7 +64,7 @@ if(DOWNLOAD_MDI)
# support cross-compilation and ninja-build
include(ExternalProject)
ExternalProject_Add(mdi_build
URL ${MDI_URL}
URL ${MDI_URL} ${MDI_FALLBACK}
URL_MD5 ${MDI_MD5}
PREFIX ${CMAKE_CURRENT_BINARY_DIR}/mdi_build_ext
CMAKE_ARGS

View File

@ -6,10 +6,11 @@ else()
endif()
option(DOWNLOAD_N2P2 "Download n2p2 library instead of using an already installed one)" ${DOWNLOAD_N2P2_DEFAULT})
if(DOWNLOAD_N2P2)
set(N2P2_URL "https://github.com/CompPhysVienna/n2p2/archive/v2.1.4.tar.gz" CACHE STRING "URL for n2p2 tarball")
set(N2P2_MD5 "9595b066636cd6b90b0fef93398297a5" CACHE STRING "MD5 checksum of N2P2 tarball")
set(N2P2_URL "https://github.com/CompPhysVienna/n2p2/archive/v2.2.0.tar.gz" CACHE STRING "URL for n2p2 tarball")
set(N2P2_MD5 "a2d9ab7f676b3a74a324fc1eda0a911d" CACHE STRING "MD5 checksum of N2P2 tarball")
mark_as_advanced(N2P2_URL)
mark_as_advanced(N2P2_MD5)
GetFallbackURL(N2P2_URL N2P2_FALLBACK)
# adjust settings from detected compiler to compiler platform in n2p2 library
# set compiler specific flag to turn on C++11 syntax (required on macOS and CentOS 7)
@ -72,7 +73,7 @@ if(DOWNLOAD_N2P2)
# download compile n2p2 library. much patch MPI calls in LAMMPS interface to accommodate MPI-2 (e.g. for cross-compiling)
include(ExternalProject)
ExternalProject_Add(n2p2_build
URL ${N2P2_URL}
URL ${N2P2_URL} ${N2P2_FALLBACK}
URL_MD5 ${N2P2_MD5}
UPDATE_COMMAND ""
CONFIGURE_COMMAND ""

View File

@ -34,7 +34,7 @@ if(MLIAP_ENABLE_PYTHON)
endif()
set(MLIAP_BINARY_DIR ${CMAKE_BINARY_DIR}/cython)
file(GLOB MLIAP_CYTHON_SRC ${LAMMPS_SOURCE_DIR}/ML-IAP/*.pyx)
file(GLOB MLIAP_CYTHON_SRC ${CONFIGURE_DEPENDS} ${LAMMPS_SOURCE_DIR}/ML-IAP/*.pyx)
file(MAKE_DIRECTORY ${MLIAP_BINARY_DIR})
foreach(MLIAP_CYTHON_FILE ${MLIAP_CYTHON_SRC})
get_filename_component(MLIAP_CYTHON_BASE ${MLIAP_CYTHON_FILE} NAME_WE)

View File

@ -1,11 +1,25 @@
set(PACELIB_URL "https://github.com/ICAMS/lammps-user-pace/archive/refs/tags/v.2022.10.15.tar.gz" CACHE STRING "URL for PACE evaluator library sources")
set(PACELIB_URL "https://github.com/ICAMS/lammps-user-pace/archive/refs/tags/v.2023.01.3.fix.tar.gz" CACHE STRING "URL for PACE evaluator library sources")
set(PACELIB_MD5 "848ad6a6cc79fa82745927001fb1c9b5" CACHE STRING "MD5 checksum of PACE evaluator library tarball")
set(PACELIB_MD5 "4f0b3b5b14456fe9a73b447de3765caa" CACHE STRING "MD5 checksum of PACE evaluator library tarball")
mark_as_advanced(PACELIB_URL)
mark_as_advanced(PACELIB_MD5)
GetFallbackURL(PACELIB_URL PACELIB_FALLBACK)
# download library sources to build folder
file(DOWNLOAD ${PACELIB_URL} ${CMAKE_BINARY_DIR}/libpace.tar.gz EXPECTED_HASH MD5=${PACELIB_MD5}) #SHOW_PROGRESS
if(EXISTS ${CMAKE_BINARY_DIR}/libpace.tar.gz)
file(MD5 ${CMAKE_BINARY_DIR}/libpace.tar.gz DL_MD5)
endif()
if(NOT "${DL_MD5}" STREQUAL "${PACELIB_MD5}")
message(STATUS "Downloading ${PACELIB_URL}")
file(DOWNLOAD ${PACELIB_URL} ${CMAKE_BINARY_DIR}/libpace.tar.gz STATUS DL_STATUS SHOW_PROGRESS)
file(MD5 ${CMAKE_BINARY_DIR}/libpace.tar.gz DL_MD5)
if((NOT DL_STATUS EQUAL 0) OR (NOT "${DL_MD5}" STREQUAL "${PACELIB_MD5}"))
message(WARNING "Download from primary URL ${PACELIB_URL} failed\nTrying fallback URL ${PACELIB_FALLBACK}")
file(DOWNLOAD ${PACELIB_FALLBACK} ${CMAKE_BINARY_DIR}/libpace.tar.gz EXPECTED_HASH MD5=${PACELIB_MD5} SHOW_PROGRESS)
endif()
else()
message(STATUS "Using already downloaded archive ${CMAKE_BINARY_DIR}/libpace.tar.gz")
endif()
# uncompress downloaded sources
execute_process(

View File

@ -16,6 +16,7 @@ if(DOWNLOAD_QUIP)
set(temp "${temp}DEFINES += -DGETARG_F2003 -DFORTRAN_UNDERSCORE\n")
set(temp "${temp}F95FLAGS += -fpp -free -fPIC\n")
set(temp "${temp}F77FLAGS += -fpp -fixed -fPIC\n")
set(temp "${temp}F95_PRE_FILENAME_FLAG = -Tf\n")
elseif(CMAKE_Fortran_COMPILER_ID STREQUAL GNU)
set(temp "${temp}FPP=${CMAKE_Fortran_COMPILER} -E -x f95-cpp-input\nOPTIM=${CMAKE_Fortran_FLAGS_${BTYPE}}\n")
set(temp "${temp}DEFINES += -DGETARG_F2003 -DGETENV_F2003 -DGFORTRAN -DFORTRAN_UNDERSCORE\n")

View File

@ -59,10 +59,11 @@ if(DOWNLOAD_PLUMED)
mark_as_advanced(PLUMED_URL)
mark_as_advanced(PLUMED_MD5)
GetFallbackURL(PLUMED_URL PLUMED_FALLBACK)
include(ExternalProject)
ExternalProject_Add(plumed_build
URL ${PLUMED_URL}
URL ${PLUMED_URL} ${PLUMED_FALLBACK}
URL_MD5 ${PLUMED_MD5}
BUILD_IN_SOURCE 1
CONFIGURE_COMMAND <SOURCE_DIR>/configure --prefix=<INSTALL_DIR>

View File

@ -18,6 +18,8 @@ if(DOWNLOAD_SCAFACOS)
set(SCAFACOS_MD5 "bd46d74e3296bd8a444d731bb10c1738" CACHE STRING "MD5 checksum of SCAFACOS tarball")
mark_as_advanced(SCAFACOS_URL)
mark_as_advanced(SCAFACOS_MD5)
GetFallbackURL(SCAFACOS_URL SCAFACOS_FALLBACK)
# version 1.0.1 needs a patch to compile and linke cleanly with GCC 10 and later.
file(DOWNLOAD ${LAMMPS_THIRDPARTY_URL}/scafacos-1.0.1-fix.diff ${CMAKE_CURRENT_BINARY_DIR}/scafacos-1.0.1.fix.diff
@ -30,7 +32,7 @@ if(DOWNLOAD_SCAFACOS)
include(ExternalProject)
ExternalProject_Add(scafacos_build
URL ${SCAFACOS_URL}
URL ${SCAFACOS_URL} ${SCAFACOS_FALLBACK}
URL_MD5 ${SCAFACOS_MD5}
PATCH_COMMAND patch -p1 < ${CMAKE_CURRENT_BINARY_DIR}/scafacos-1.0.1.fix.diff
CONFIGURE_COMMAND <SOURCE_DIR>/configure --prefix=<INSTALL_DIR> --disable-doc

View File

@ -1,5 +1,5 @@
function(FindStyleHeaders path style_class file_pattern headers)
file(GLOB files "${path}/${file_pattern}*.h")
file(GLOB files ${CONFIGURE_DEPENDS} "${path}/${file_pattern}*.h")
get_property(hlist GLOBAL PROPERTY ${headers})
foreach(file_name ${files})
@ -184,7 +184,7 @@ endfunction(DetectBuildSystemConflict)
function(FindPackagesHeaders path style_class file_pattern headers)
file(GLOB files "${path}/${file_pattern}*.h")
file(GLOB files ${CONFIGURE_DEPENDS} "${path}/${file_pattern}*.h")
get_property(plist GLOBAL PROPERTY ${headers})
foreach(file_name ${files})

View File

@ -6,7 +6,7 @@ if(ENABLE_TESTING)
find_program(VALGRIND_BINARY NAMES valgrind)
# generate custom suppression file
file(WRITE ${CMAKE_CURRENT_BINARY_DIR}/lammps.supp "\n")
file(GLOB VALGRIND_SUPPRESSION_FILES ${LAMMPS_TOOLS_DIR}/valgrind/[^.]*.supp)
file(GLOB VALGRIND_SUPPRESSION_FILES ${CONFIGURE_DEPENDS} ${LAMMPS_TOOLS_DIR}/valgrind/[^.]*.supp)
foreach(SUPP ${VALGRIND_SUPPRESSION_FILES})
file(READ ${SUPP} SUPPRESSIONS)
file(APPEND ${CMAKE_CURRENT_BINARY_DIR}/lammps.supp "${SUPPRESSIONS}")

View File

@ -26,7 +26,7 @@ if(BUILD_TOOLS)
enable_language(C)
get_filename_component(MSI2LMP_SOURCE_DIR ${LAMMPS_TOOLS_DIR}/msi2lmp/src ABSOLUTE)
file(GLOB MSI2LMP_SOURCES ${MSI2LMP_SOURCE_DIR}/[^.]*.c)
file(GLOB MSI2LMP_SOURCES ${CONFIGURE_DEPENDS} ${MSI2LMP_SOURCE_DIR}/[^.]*.c)
add_executable(msi2lmp ${MSI2LMP_SOURCES})
if(STANDARD_MATH_LIB)
target_link_libraries(msi2lmp PRIVATE ${STANDARD_MATH_LIB})
@ -50,12 +50,16 @@ if(BUILD_LAMMPS_SHELL)
add_executable(lammps-shell ${LAMMPS_TOOLS_DIR}/lammps-shell/lammps-shell.cpp ${ICON_RC_FILE})
target_include_directories(lammps-shell PRIVATE ${LAMMPS_TOOLS_DIR}/lammps-shell)
target_link_libraries(lammps-shell PRIVATE lammps PkgConfig::READLINE)
# workaround for broken readline pkg-config file on FreeBSD
if(CMAKE_SYSTEM_NAME STREQUAL "FreeBSD")
target_include_directories(lammps-shell PRIVATE /usr/local/include)
endif()
target_link_libraries(lammps-shell PRIVATE lammps PkgConfig::READLINE)
if(CMAKE_SYSTEM_NAME STREQUAL "LinuxMUSL")
pkg_check_modules(TERMCAP IMPORTED_TARGET REQUIRED termcap)
target_link_libraries(lammps-shell PRIVATE lammps PkgConfig::TERMCAP)
endif()
install(TARGETS lammps-shell EXPORT LAMMPS_Targets DESTINATION ${CMAKE_INSTALL_BINDIR})
install(DIRECTORY ${LAMMPS_TOOLS_DIR}/lammps-shell/icons DESTINATION ${CMAKE_INSTALL_DATAROOTDIR}/)
install(FILES ${LAMMPS_TOOLS_DIR}/lammps-shell/lammps-shell.desktop DESTINATION ${CMAKE_INSTALL_DATAROOTDIR}/applications/)

View File

@ -44,6 +44,7 @@ set(ALL_PACKAGES
KSPACE
LATBOLTZ
LATTE
LEPTON
MACHDYN
MANIFOLD
MANYBODY
@ -56,6 +57,7 @@ set(ALL_PACKAGES
ML-HDNNP
ML-IAP
ML-PACE
ML-POD
ML-QUIP
ML-RANN
ML-SNAP

View File

@ -46,6 +46,7 @@ set(ALL_PACKAGES
KSPACE
LATBOLTZ
LATTE
LEPTON
MACHDYN
MANIFOLD
MANYBODY
@ -58,6 +59,7 @@ set(ALL_PACKAGES
ML-HDNNP
ML-IAP
ML-PACE
ML-POD
ML-QUIP
ML-RANN
ML-SNAP

View File

@ -36,6 +36,7 @@ set(WIN_PACKAGES
INTERLAYER
KSPACE
LATTE
LEPTON
MACHDYN
MANIFOLD
MANYBODY
@ -47,6 +48,7 @@ set(WIN_PACKAGES
MISC
ML-HDNNP
ML-IAP
ML-POD
ML-RANN
ML-SNAP
MOFFF

View File

@ -35,12 +35,15 @@ set(ALL_PACKAGES
GRANULAR
INTERLAYER
KSPACE
LEPTON
MACHDYN
MANYBODY
MC
MEAM
MESONT
MISC
ML-IAP
ML-POD
ML-SNAP
MOFFF
MOLECULE

View File

@ -13,9 +13,9 @@ set(PACKAGES_WITH_LIB
KOKKOS
LATBOLTZ
LATTE
LEPTON
MACHDYN
MDI
MESONT
ML-HDNNP
ML-PACE
ML-QUIP

View File

@ -1,6 +1,7 @@
set(WIN_PACKAGES
AMOEBA
ASPHERE
AWPMD
BOCS
BODY
BPM
@ -20,6 +21,7 @@ set(WIN_PACKAGES
DPD-SMOOTH
DRUDE
EFF
ELECTRODE
EXTRA-COMPUTE
EXTRA-DUMP
EXTRA-FIX
@ -29,12 +31,15 @@ set(WIN_PACKAGES
GRANULAR
INTERLAYER
KSPACE
LEPTON
MANIFOLD
MANYBODY
MC
MEAM
MESONT
MISC
ML-IAP
ML-POD
ML-SNAP
MOFFF
MOLECULE

View File

@ -45,7 +45,7 @@ SPHINXEXTRA = -j $(shell $(PYTHON) -c 'import multiprocessing;print(multiprocess
# we only want to use explicitly listed files.
DOXYFILES = $(shell sed -n -e 's/\#.*$$//' -e '/^ *INPUT \+=/,/^[A-Z_]\+ \+=/p' doxygen/Doxyfile.in | sed -e 's/@LAMMPS_SOURCE_DIR@/..\/src/g' -e 's/\\//g' -e 's/ \+/ /' -e 's/[A-Z_]\+ \+= *\(YES\|NO\|\)//')
.PHONY: help clean-all clean clean-spelling epub mobi html pdf spelling anchor_check style_check char_check xmlgen fasthtml
.PHONY: help clean-all clean clean-spelling epub mobi html pdf spelling anchor_check style_check char_check role_check xmlgen fasthtml
# ------------------------------------------
@ -86,16 +86,17 @@ html: xmlgen $(VENV) $(SPHINXCONFIG)/conf.py $(ANCHORCHECK) $(MATHJAX)
@if [ "$(HAS_BASH)" == "NO" ] ; then echo "bash was not found at $(OSHELL)! Please use: $(MAKE) SHELL=/path/to/bash" 1>&2; exit 1; fi
@$(MAKE) $(MFLAGS) -C graphviz all
@(\
. $(VENV)/bin/activate ; env PYTHONWARNINGS= \
. $(VENV)/bin/activate ; env PYTHONWARNINGS= PYTHONDONTWRITEBYTECODE=1 \
sphinx-build -E $(SPHINXEXTRA) -b html -c $(SPHINXCONFIG) -d $(BUILDDIR)/doctrees $(RSTDIR) html ;\
touch $(RSTDIR)/Fortran.rst ;\
touch $(RSTDIR)/Fortran.rst ; env PYTHONWARNINGS= PYTHONDONTWRITEBYTECODE=1 \
sphinx-build $(SPHINXEXTRA) -b html -c $(SPHINXCONFIG) -d $(BUILDDIR)/doctrees $(RSTDIR) html ;\
ln -sf Manual.html html/index.html;\
rm -f $(BUILDDIR)/doxygen/xml/run.stamp;\
echo "############################################" ;\
echo "############################################" ; env PYTHONWARNINGS= PYTHONDONTWRITEBYTECODE=1 \
rst_anchor_check src/*.rst ;\
python $(BUILDDIR)/utils/check-packages.py -s ../src -d src ;\
env LC_ALL=C grep -n '[^ -~]' $(RSTDIR)/*.rst ;\
env LC_ALL=C grep -n ' :[a-z]\+`' $(RSTDIR)/*.rst ;\
python $(BUILDDIR)/utils/check-styles.py -s ../src -d src ;\
echo "############################################" ;\
deactivate ;\
@ -113,9 +114,9 @@ fasthtml: xmlgen $(VENV) $(SPHINXCONFIG)/conf.py $(ANCHORCHECK) $(MATHJAX)
@$(MAKE) $(MFLAGS) -C graphviz all
@mkdir -p fasthtml
@(\
. $(VENV)/bin/activate ; env PYTHONWARNINGS= \
. $(VENV)/bin/activate ; env PYTHONWARNINGS= PYTHONDONTWRITEBYTECODE=1 \
sphinx-build $(SPHINXEXTRA) -b html -c $(SPHINXCONFIG) -d $(BUILDDIR)/fasthtml/doctrees $(RSTDIR) fasthtml ;\
touch $(RSTDIR)/Fortran.rst ;\
touch $(RSTDIR)/Fortran.rst ; env PYTHONWARNINGS= PYTHONDONTWRITEBYTECODE=1 \
sphinx-build $(SPHINXEXTRA) -b html -c $(SPHINXCONFIG) -d $(BUILDDIR)/fasthtml/doctrees $(RSTDIR) fasthtml ;\
deactivate ;\
)
@ -130,8 +131,8 @@ fasthtml: xmlgen $(VENV) $(SPHINXCONFIG)/conf.py $(ANCHORCHECK) $(MATHJAX)
spelling: xmlgen $(SPHINXCONFIG)/conf.py $(VENV) $(SPHINXCONFIG)/false_positives.txt
@if [ "$(HAS_BASH)" == "NO" ] ; then echo "bash was not found at $(OSHELL)! Please use: $(MAKE) SHELL=/path/to/bash" 1>&2; exit 1; fi
@(\
. $(VENV)/bin/activate ; env PYTHONWARNINGS= \
cp $(SPHINXCONFIG)/false_positives.txt $(RSTDIR)/ ; env PYTHONWARNINGS= \
. $(VENV)/bin/activate ; \
cp $(SPHINXCONFIG)/false_positives.txt $(RSTDIR)/; env PYTHONWARNINGS= PYTHONDONTWRITEBYTECODE=1 \
sphinx-build -b spelling -c $(SPHINXCONFIG) -d $(BUILDDIR)/doctrees $(RSTDIR) spelling ;\
rm -f $(BUILDDIR)/doxygen/xml/run.stamp;\
deactivate ;\
@ -145,9 +146,9 @@ epub: xmlgen $(VENV) $(SPHINXCONFIG)/conf.py $(ANCHORCHECK)
@rm -f LAMMPS.epub
@cp src/JPG/*.* epub/JPG
@(\
. $(VENV)/bin/activate ;\
. $(VENV)/bin/activate ; env PYTHONWARNINGS= PYTHONDONTWRITEBYTECODE=1 \
sphinx-build -E $(SPHINXEXTRA) -b epub -c $(SPHINXCONFIG) -d $(BUILDDIR)/doctrees $(RSTDIR) epub ;\
touch $(RSTDIR)/Fortran.rst ;\
touch $(RSTDIR)/Fortran.rst ; env PYTHONWARNINGS= PYTHONDONTWRITEBYTECODE=1 \
sphinx-build $(SPHINXEXTRA) -b epub -c $(SPHINXCONFIG) -d $(BUILDDIR)/doctrees $(RSTDIR) epub ;\
rm -f $(BUILDDIR)/doxygen/xml/run.stamp;\
deactivate ;\
@ -166,15 +167,16 @@ pdf: xmlgen $(VENV) $(SPHINXCONFIG)/conf.py $(ANCHORCHECK)
@$(MAKE) $(MFLAGS) -C graphviz all
@if [ "$(HAS_PDFLATEX)" == "NO" ] ; then echo "PDFLaTeX or latexmk were not found! Please check README for further instructions" 1>&2; exit 1; fi
@(\
. $(VENV)/bin/activate ; env PYTHONWARNINGS= \
. $(VENV)/bin/activate ; env PYTHONWARNINGS= PYTHONDONTWRITEBYTECODE=1 \
sphinx-build -E $(SPHINXEXTRA) -b latex -c $(SPHINXCONFIG) -d $(BUILDDIR)/doctrees $(RSTDIR) latex ;\
touch $(RSTDIR)/Fortran.rst ;\
touch $(RSTDIR)/Fortran.rst ; env PYTHONWARNINGS= PYTHONDONTWRITEBYTECODE=1 \
sphinx-build $(SPHINXEXTRA) -b latex -c $(SPHINXCONFIG) -d $(BUILDDIR)/doctrees $(RSTDIR) latex ;\
rm -f $(BUILDDIR)/doxygen/xml/run.stamp;\
echo "############################################" ;\
echo "############################################" ; env PYTHONWARNINGS= PYTHONDONTWRITEBYTECODE=1 \
rst_anchor_check src/*.rst ;\
python utils/check-packages.py -s ../src -d src ;\
env LC_ALL=C grep -n '[^ -~]' $(RSTDIR)/*.rst ;\
env LC_ALL=C grep -n ' :[a-z]\+`' $(RSTDIR)/*.rst ;\
python utils/check-styles.py -s ../src -d src ;\
echo "############################################" ;\
deactivate ;\
@ -198,21 +200,21 @@ pdf: xmlgen $(VENV) $(SPHINXCONFIG)/conf.py $(ANCHORCHECK)
anchor_check : $(ANCHORCHECK)
@(\
. $(VENV)/bin/activate ;\
. $(VENV)/bin/activate ; env PYTHONWARNINGS= PYTHONDONTWRITEBYTECODE=1 \
rst_anchor_check src/*.rst ;\
deactivate ;\
)
style_check : $(VENV)
@(\
. $(VENV)/bin/activate ;\
. $(VENV)/bin/activate ; env PYTHONWARNINGS= PYTHONDONTWRITEBYTECODE=1 \
python utils/check-styles.py -s ../src -d src ;\
deactivate ;\
)
package_check : $(VENV)
@(\
. $(VENV)/bin/activate ;\
. $(VENV)/bin/activate ; env PYTHONWARNINGS= PYTHONDONTWRITEBYTECODE=1 \\
python utils/check-packages.py -s ../src -d src ;\
deactivate ;\
)
@ -220,6 +222,9 @@ package_check : $(VENV)
char_check :
@( env LC_ALL=C grep -n '[^ -~]' $(RSTDIR)/*.rst && exit 1 || : )
role_check :
@( env LC_ALL=C grep -n ' :[a-z]\+`' $(RSTDIR)/*.rst && exit 1 || : )
xmlgen : doxygen/xml/index.xml
doxygen/Doxyfile: doxygen/Doxyfile.in
@ -247,7 +252,7 @@ $(MATHJAX):
$(ANCHORCHECK): $(VENV)
@( \
. $(VENV)/bin/activate; \
. $(VENV)/bin/activate; env PYTHONWARNINGS= PYTHONDONTWRITEBYTECODE=1 \
pip $(PIP_OPTIONS) install -e utils/converters;\
deactivate;\
)

View File

@ -40,8 +40,9 @@ environment and local folders.
Installing prerequisites for the documentation build
To run the HTML documention build toolchain, python 3.x, doxygen, git,
and virtualenv have to be installed. Also internet access is initially
required to download external files and tools.
and the venv python module have to be installed if not already available.
Also internet access is initially required to download external files
and tools.
Building the PDF format manual requires in addition a compatible LaTeX
installation with support for PDFLaTeX and several add-on LaTeX packages

View File

@ -4,45 +4,44 @@ This purpose of this document is to provide a point of reference
for LAMMPS developers and contributors as to what conventions
should be used to structure and format files in the LAMMPS manual.
Last change: 2020-04-23
Last change: 2022-12-30
## File format and tools
In fall 2019, the LAMMPS documentation file format has changed from
a home grown minimal markup designed to generate HTML format files
from a mostly plain text format to using the reStructuredText file
format. For a transition period all files in the old .txt format
were transparently converted to .rst and then processed. The txt2rst
tool is still included in the distribution to obtain an initial .rst
file for integration into the manual. Since the transition to
reStructured text as source format, many of the artifacts or the
translation have been removed though and parts of the documentation
refactored and expanded to take advantage of the capabilities
reStructuredText and associated tools. The conversion from the
source to the final formats (HTML, PDF, and optionally e-book
reader formats ePUB and MOBI) is mostly automated and controlled
by a Makefile in the `doc` folder. This makefile assumes that the
processing is done on a Unix-like machine and Python 3.5 or later
and a matching virtualenv module are available. Additional Python
packages (like the Sphinx tool and several extensions) are
transparently installed into a virtual environment over the
internet using the `pip` package manager. Further requirements
and details are discussed in the manual.
In fall 2019, the LAMMPS documentation file format has changed from a
home grown markup designed to generate HTML format files only, to
[reStructuredText](https://docutils.sourceforge.io/rst.html>. For a
transition period all files in the old .txt format were transparently
converted to .rst and then processed. The `txt2rst tool` is still
included in the distribution to obtain an initial .rst file for legacy
integration into the manual. Since that transition to reStructured
text, many of the artifacts of the translation have been removed though,
and parts of the documentation refactored and expanded to take advantage
of the capabilities reStructuredText and associated tools. The
conversion from the source to the final formats (HTML, PDF, and
optionally e-book reader formats ePUB and MOBI) is mostly automated and
controlled by a Makefile in the `doc` folder. This makefile assumes that
the processing is done on a Unix-like machine and Python 3.5 or later
and a matching venv module are available. Additional Python
packages (like the Sphinx tool and several extensions) are transparently
installed into a virtual environment over the internet using the `pip`
package manager. Further requirements and details are discussed in the
manual.
## Work in progress
The refactoring and improving of the documentation is an ongoing
process, so statements in this document may not always be fully
up-to-date. If in doubt, contact the LAMMPS developers.
up-to-date. When in doubt, contact the LAMMPS developers.
## General structure
The layout and formatting of added files should follow the example
of the existing files. Since those are directly derived from their
former .txt format versions and the manual has been maintained in
The layout and formatting of added files should follow the example of
the existing files. Since many of those were initially derived from
their former .txt format versions and the manual has been maintained in
that format for many years, there is a large degree of consistency
already, so comparison with similar files should give you a good
idea what kind of information and sections are needed.
already, so comparison with similar files should give you a good idea
what kind of information and sections are needed.
## Formatting conventions
@ -52,21 +51,27 @@ It seems to be sufficient to have this consistent only within
any single file and it is not (yet) enforced strictly, but making
this globally consistent makes it easier to move sections around.
Filenames, folders, paths, (shell) commands, definitions, makefile
File names, folders, paths, (shell) commands, definitions, makefile
settings and similar should be formatted as "literals" with
double backward quotes bracketing the item: \`\`path/to/some/file\`\`
Keywords and options are formatted in italics: \*option\*
Mathematical expressions, equations, symbols are typeset using
either a `.. math:`` block or the `:math:` role.
either a `.. math:` block or the `:math:` role.
Groups of shell commands or LAMMPS input script or C/C++ source
Groups of shell commands or LAMMPS input script or C/C++/Python source
code should be typeset into a `.. code-block::` section. A syntax
highlighting extension for LAMMPS input scripts is provided, so
`LAMMPS` can be used to indicate the language in the code block
in addition to `bash`, `c`, or `python`. When no syntax style
is indicated, no syntax highlighting is performed.
highlighting extension for LAMMPS input scripts is provided, so `LAMMPS`
can be used to indicate the language in the code block in addition to
`bash`, `c`, `c++`, `console`, `csh`, `diff', `fortran`, `json`, `make`,
`perl`, `powershell`, `python`, `sh`, or `tcl`, `text`, or `yaml`. When
no syntax style is indicated, no syntax highlighting is performed. When
typesetting commands executed on the shell, please do not prefix
commands with a shell prompt and use `bash` highlighting, except when
the block also shows the output from that command. In the latter case,
please use a dollar sign as the shell prompt and `console` for syntax
highlighting.
As an alternative, e.g. to typeset the syntax of file formats
a `.. parsed-literal::` block can be used, which allows some
@ -89,22 +94,30 @@ by ` :class: note`.
## Required steps when adding a custom style to LAMMPS
When adding a new style (e.g. pair style or a compute or a fix)
or a new command, it is **required** to include the corresponding
documentation. Those are often new files that need to be added.
In order to be included in the documentation, those new files
need to be reference in a `.. toctree::` block. Most of those
use patterns with wildcards, so the addition will be automatic.
However, those additions also need to be added to some lists of
styles or commands. The `make style\_check` command will perform
a test and report any missing entries and list the affected files.
Any references defined with `.. \_refname:` have to be unique
across all documentation files and this can be checked for with
`make anchor\_check`. Finally, a spell-check should be done,
which is triggered via `make spelling`. Any offenses need to
be corrected and false positives should be added to the file
`utils/sphinx-config/false\_positives.txt`.
When adding a new style (e.g. pair style or a compute or a fix) or a new
command, it is **required** to include the **corresponding documentation**
in [reStructuredText format](https://docutils.sourceforge.io/rst.html).
Those are often new files that need to be added. In order to be
included in the documentation, those new files need to be referenced in a
`.. toctree::` block. Most of those use patterns with wild cards, so the
addition will be automatic. However, those additions also need to be
added to some lists of styles or commands. The `make style\_check`
command when executed in the `doc` folder will perform a test and report
any missing entries and list the affected files. Any references defined
with `.. \_refname:` have to be unique across all documentation files
and this can be checked for with `make anchor\_check`. Finally, a
spell-check should be done, which is triggered via `make spelling`. Any
offenses need to be corrected and false positives should be added to the
file `utils/sphinx-config/false\_positives.txt`.
## Required additional steps when adding a new package to LAMMPS
TODO
When adding a new package, the package must be added to the list of
packages in the `Packages_list.rst` file. If additional build instructions
need to be followed, a corresponding section should be added to the
`Build_extras.rst` file and linked from the list at the top of the
file as well as the equivalent list in the `Build_packages.rst` file.
A detailed description of the package and pointers to configuration,
included commands and examples, external pages, author information and
more should be added to the `Packages_details.rst` file.

View File

@ -1,7 +1,7 @@
.TH LAMMPS "1" "3 November 2022" "2022-11-3"
.TH LAMMPS "1" "8 February 2023" "2023-02-08"
.SH NAME
.B LAMMPS
\- Molecular Dynamics Simulator. Version 3 November 2022
\- Molecular Dynamics Simulator. Version 8 February 2023
.SH SYNOPSIS
.B lmp

View File

@ -63,7 +63,7 @@ In the src directory, there is one top-level Makefile and several
low-level machine-specific files named Makefile.xxx where xxx = the
machine name. If a low-level Makefile exists for your platform, you do
not need to edit the top-level Makefile. However you should check the
system-specific section of the low-level Makefile to insure the
system-specific section of the low-level Makefile to ensure the
various paths are correct for your environment. If a low-level
Makefile does not exist for your platform, you will need to add a
suitable target to the top-level Makefile. You will also need to

View File

@ -1206,7 +1206,7 @@ this command is not typically needed if the &quot;nonbond style&quot; and &quot;
an exception to this is if a short cutoff is used initially,
but a longer cutoff will be used for a subsequent run (in the same
input script), in this case the &quot;maximum cutoff&quot; command should be
used to insure enough memory is allocated for the later run
used to ensure enough memory is allocated for the later run
note that a restart file contains nonbond cutoffs (so it is not necessary
to use a &quot;nonbond style&quot; command before &quot;read restart&quot;), but LAMMPS
still needs to know what the maximum cutoff will be before the

View File

@ -6,9 +6,9 @@ either traditional makefiles for use with GNU make (which may require
manual editing), or using a build environment generated by CMake (Unix
Makefiles, Ninja, Xcode, Visual Studio, KDevelop, CodeBlocks and more).
As an alternative you can download a package with pre-built executables
or automated build trees as described on the :doc:`Install <Install>`
page.
As an alternative, you can download a package with pre-built executables
or automated build trees, as described in the :doc:`Install <Install>`
section of the manual.
.. toctree::
:maxdepth: 1

View File

@ -44,7 +44,7 @@ standard. A more detailed discussion of that is below.
The executable created by CMake (after running make) is named
``lmp`` unless the ``LAMMPS_MACHINE`` option is set. When setting
``LAMMPS_MACHINE=name`` the executable will be called
``LAMMPS_MACHINE=name``, the executable will be called
``lmp_name``. Using ``BUILD_MPI=no`` will enforce building a
serial executable using the MPI STUBS library.
@ -60,7 +60,7 @@ standard. A more detailed discussion of that is below.
Any ``make machine`` command will look up the make settings from a
file ``Makefile.machine`` in the folder ``src/MAKE`` or one of its
sub-directories ``MINE``, ``MACHINES``, or ``OPTIONS``, create a
subdirectories ``MINE``, ``MACHINES``, or ``OPTIONS``, create a
folder ``Obj_machine`` with all objects and generated files and an
executable called ``lmp_machine``\ . The standard parallel build
with ``make mpi`` assumes a standard MPI installation with MPI
@ -107,9 +107,9 @@ MPI and OpenMP support in LAMMPS
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
If you are installing MPI yourself to build a parallel LAMMPS
executable, we recommend either MPICH or OpenMPI which are regularly
executable, we recommend either MPICH or OpenMPI, which are regularly
used and tested with LAMMPS by the LAMMPS developers. MPICH can be
downloaded from the `MPICH home page <https://www.mpich.org>`_ and
downloaded from the `MPICH home page <https://www.mpich.org>`_, and
OpenMPI can be downloaded correspondingly from the `OpenMPI home page
<https://www.open-mpi.org>`_. Other MPI packages should also work. No
specific vendor provided and standard compliant MPI library is currently
@ -130,12 +130,12 @@ package can be compiled to include OpenMP threading.
In addition, there are a few commands in LAMMPS that have native OpenMP
support included as well. These are commands in the ``MPIIO``,
``ML-SNAP``, ``DIFFRACTION``, and ``DPD-REACT`` packages. In addition
``ML-SNAP``, ``DIFFRACTION``, and ``DPD-REACT`` packages. Furthermore,
some packages support OpenMP threading indirectly through the libraries
they interface to: e.g. ``LATTE``, ``KSPACE``, and ``COLVARS``.
See the :doc:`Packages details <Packages_details>` page for more
info on these packages and the pages for their respective commands
for OpenMP threading info.
they interface to: e.g. ``LATTE``, ``KSPACE``, and ``COLVARS``. See the
:doc:`Packages details <Packages_details>` page for more info on these
packages, and the pages for their respective commands for OpenMP
threading info.
For CMake, if you use ``BUILD_OMP=yes``, you can use these packages
and turn on their native OpenMP support and turn on their native OpenMP
@ -144,9 +144,9 @@ variable before you launch LAMMPS.
For building via conventional make, the ``CCFLAGS`` and ``LINKFLAGS``
variables in Makefile.machine need to include the compiler flag that
enables OpenMP. For GNU compilers it is ``-fopenmp``\ . For (recent) Intel
compilers it is ``-qopenmp``\ . If you are using a different compiler,
please refer to its documentation.
enables OpenMP. For the GNU compilers or Clang, it is ``-fopenmp``\ .
For (recent) Intel compilers, it is ``-qopenmp``\ . If you are using a
different compiler, please refer to its documentation.
.. _default-none-issues:
@ -174,15 +174,16 @@ Choice of compiler and compile/link options
The choice of compiler and compiler flags can be important for maximum
performance. Vendor provided compilers for a specific hardware can
produce faster code than open-source compilers like the GNU compilers.
On the most common x86 hardware most popular C++ compilers are quite
similar in performance of C/C++ code at high optimization levels. When
using the ``INTEL`` package, there is a distinct advantage in using
the `Intel C++ compiler <intel_>`_ due to much improved vectorization
through SSE and AVX instructions on compatible hardware as the source
code includes changes and Intel compiler specific directives to enable
high degrees of vectorization. This may change over time as equivalent
vectorization directives are included into OpenMP standard revisions and
other compilers adopt them.
On the most common x86 hardware, the most popular C++ compilers are
quite similar in their ability to optimize regular C/C++ source code at
high optimization levels. When using the ``INTEL`` package, there is a
distinct advantage in using the `Intel C++ compiler <intel_>`_ due to
much improved vectorization through SSE and AVX instructions on
compatible hardware. The source code in that package conditionally
includes compiler specific directives to enable these high degrees of
vectorization. This may change over time as equivalent vectorization
directives are included into the OpenMP standard and other compilers
adopt them.
.. _intel: https://software.intel.com/en-us/intel-compilers
@ -196,7 +197,7 @@ LAMMPS.
.. tab:: CMake build
By default CMake will use the compiler it finds according to
internal preferences and it will add optimization flags
internal preferences, and it will add optimization flags
appropriate to that compiler and any :doc:`accelerator packages
<Speed_packages>` you have included in the build. CMake will
check if the detected or selected compiler is compatible with the
@ -250,9 +251,9 @@ LAMMPS.
and `-C ../cmake/presets/pgi.cmake`
will switch the compiler to the PGI compilers.
In addition you can set ``CMAKE_TUNE_FLAGS`` to specifically add
compiler flags to tune for optimal performance on given hosts. By
default this variable is empty.
Furthermore, you can set ``CMAKE_TUNE_FLAGS`` to specifically add
compiler flags to tune for optimal performance on given hosts.
This variable is empty by default.
.. note::
@ -276,7 +277,7 @@ LAMMPS.
Parallel build (see ``src/MAKE/Makefile.mpi``):
.. code-block:: bash
.. code-block:: make
CC = mpicxx
CCFLAGS = -g -O3
@ -296,7 +297,7 @@ LAMMPS.
If compilation stops with a message like the following:
.. code-block::
.. code-block:: output
g++ -g -O3 -DLAMMPS_GZIP -DLAMMPS_MEMALIGN=64 -I../STUBS -c ../main.cpp
In file included from ../pointers.h:24:0,
@ -368,10 +369,10 @@ running LAMMPS from Python via its library interface.
# no default value
The compilation will always produce a LAMMPS library and an
executable linked to it. By default this will be a static library
named ``liblammps.a`` and an executable named ``lmp`` Setting
``BUILD_SHARED_LIBS=yes`` will instead produce a shared library
called ``liblammps.so`` (or ``liblammps.dylib`` or
executable linked to it. By default, this will be a static
library named ``liblammps.a`` and an executable named ``lmp``
Setting ``BUILD_SHARED_LIBS=yes`` will instead produce a shared
library called ``liblammps.so`` (or ``liblammps.dylib`` or
``liblammps.dll`` depending on the platform) If
``LAMMPS_MACHINE=name`` is set in addition, the name of the
generated libraries will be changed to either ``liblammps_name.a``
@ -429,7 +430,7 @@ You may need to use ``sudo make install`` in place of the last line if
you do not have write privileges for ``/usr/local/lib`` or use the
``--prefix`` configuration option to select an installation folder,
where you do have write access. The end result should be the file
``/usr/local/lib/libmpich.so``. On many Linux installations the folder
``/usr/local/lib/libmpich.so``. On many Linux installations, the folder
``${HOME}/.local`` is an alternative to using ``/usr/local`` and does
not require superuser or sudo access. In that case the configuration
step becomes:
@ -438,9 +439,10 @@ step becomes:
./configure --enable-shared --prefix=${HOME}/.local
Avoiding to use "sudo" for custom software installation (i.e. from source
and not through a package manager tool provided by the OS) is generally
recommended to ensure the integrity of the system software installation.
Avoiding the use of "sudo" for custom software installation (i.e. from
source and not through a package manager tool provided by the OS) is
generally recommended to ensure the integrity of the system software
installation.
----------
@ -514,11 +516,11 @@ using CMake or Make.
Install LAMMPS after a build
------------------------------------------
After building LAMMPS, you may wish to copy the LAMMPS executable of
library, along with other LAMMPS files (library header, doc files) to
a globally visible place on your system, for others to access. Note
that you may need super-user privileges (e.g. sudo) if the directory
you want to copy files to is protected.
After building LAMMPS, you may wish to copy the LAMMPS executable or
library, along with other LAMMPS files (library header, doc files), to a
globally visible place on your system, for others to access. Note that
you may need super-user privileges (e.g. sudo) if the directory you want
to copy files to is protected.
.. tabs::
@ -536,7 +538,7 @@ you want to copy files to is protected.
environment variable, if you are installing LAMMPS into a non-system
location and/or are linking to libraries in a non-system location that
depend on such runtime path settings.
As an alternative you may set the CMake variable ``LAMMPS_INSTALL_RPATH``
As an alternative, you may set the CMake variable ``LAMMPS_INSTALL_RPATH``
to ``on`` and then the runtime paths for any linked shared libraries
and the library installation folder for the LAMMPS library will be
embedded and thus the requirement to set environment variables is avoided.

View File

@ -9,10 +9,10 @@ page.
The following text assumes some familiarity with CMake and focuses on
using the command line tool ``cmake`` and what settings are supported
for building LAMMPS. A more detailed tutorial on how to use ``cmake``
itself, the text mode or graphical user interface, change the generated
output files for different build tools and development environments is
on a :doc:`separate page <Howto_cmake>`.
for building LAMMPS. A more detailed tutorial on how to use CMake
itself, the text mode or graphical user interface, to change the
generated output files for different build tools and development
environments is on a :doc:`separate page <Howto_cmake>`.
.. note::
@ -22,12 +22,12 @@ on a :doc:`separate page <Howto_cmake>`.
.. warning::
You must not mix the :doc:`traditional make based <Build_make>`
LAMMPS build procedure with using CMake. Thus no packages may be
LAMMPS build procedure with using CMake. No packages may be
installed or a build been previously attempted in the LAMMPS source
directory by using ``make <machine>``. CMake will detect if this is
the case and generate an error. To remove conflicting files from the
``src`` you can use the command ``make no-all purge`` which will
un-install all packages and delete all auto-generated files.
uninstall all packages and delete all auto-generated files.
Advantages of using CMake
@ -44,9 +44,9 @@ software or for people that want to modify or extend LAMMPS.
and adapt the LAMMPS default build configuration accordingly.
- CMake can generate files for different build tools and integrated
development environments (IDE).
- CMake supports customization of settings with a text mode or graphical
user interface. No knowledge of file formats or and complex command
line syntax required.
- CMake supports customization of settings with a command line, text
mode, or graphical user interface. No knowledge of file formats or
complex command line syntax is required.
- All enabled components are compiled in a single build operation.
- Automated dependency tracking for all files and configuration options.
- Support for true out-of-source compilation. Multiple configurations
@ -55,23 +55,23 @@ software or for people that want to modify or extend LAMMPS.
source tree.
- Simplified packaging of LAMMPS for Linux distributions, environment
modules, or automated build tools like `Homebrew <https://brew.sh/>`_.
- Integration of automated regression testing (the LAMMPS side for that
is still under development).
- Integration of automated unit and regression testing (the LAMMPS side
of this is still under active development).
.. _cmake_build:
Getting started
^^^^^^^^^^^^^^^
Building LAMMPS with CMake is a two-step process. First you use CMake
to generate a build environment in a new directory. For that purpose
you can use either the command-line utility ``cmake`` (or ``cmake3``),
the text-mode UI utility ``ccmake`` (or ``ccmake3``) or the graphical
utility ``cmake-gui``, or use them interchangeably. The second step is
then the compilation and linking of all objects, libraries, and
executables. Here is a minimal example using the command line version of
CMake to build LAMMPS with no add-on packages enabled and no
customization:
Building LAMMPS with CMake is a two-step process. In the first step,
you use CMake to generate a build environment in a new directory. For
that purpose you can use either the command-line utility ``cmake`` (or
``cmake3``), the text-mode UI utility ``ccmake`` (or ``ccmake3``) or the
graphical utility ``cmake-gui``, or use them interchangeably. The
second step is then the compilation and linking of all objects,
libraries, and executables using the selected build tool. Here is a
minimal example using the command line version of CMake to build LAMMPS
with no add-on packages enabled and no customization:
.. code-block:: bash
@ -96,17 +96,17 @@ Compilation can take a long time, since LAMMPS is a large project with
many features. If your machine has multiple CPU cores (most do these
days), you can speed this up by compiling sources in parallel with
``make -j N`` (with N being the maximum number of concurrently executed
tasks). Also installation of the `ccache <https://ccache.dev/>`_ (=
Compiler Cache) software may speed up repeated compilation even more,
e.g. during code development.
tasks). Installation of the `ccache <https://ccache.dev/>`_ (= Compiler
Cache) software may speed up repeated compilation even more, e.g. during
code development, especially when repeatedly switching between branches.
After the initial build, whenever you edit LAMMPS source files, enable
or disable packages, change compiler flags or build options, you must
re-compile and relink the LAMMPS executable with ``cmake --build .`` (or
``make``). If the compilation fails for some reason, try running
``cmake .`` and then compile again. The included dependency tracking
should make certain that only the necessary subset of files are
re-compiled. You can also delete compiled objects, libraries and
should make certain that only the necessary subset of files is
re-compiled. You can also delete compiled objects, libraries, and
executables with ``cmake --build . --target clean`` (or ``make clean``).
After compilation, you may optionally install the LAMMPS executable into
@ -132,12 +132,12 @@ file called ``CMakeLists.txt`` (for LAMMPS it is located in the
``CMakeCache.txt``, which is generated at the end of the CMake
configuration step. The cache file contains all current CMake settings.
To modify settings, enable or disable features, you need to set *variables*
with either the *-D* command line flag (``-D VARIABLE1_NAME=value``) or
change them in the text mode of graphical user interface. The *-D* flag
can be used several times in one command.
To modify settings, enable or disable features, you need to set
*variables* with either the *-D* command line flag (``-D
VARIABLE1_NAME=value``) or change them in the text mode of the graphical
user interface. The *-D* flag can be used several times in one command.
For your convenience we provide :ref:`CMake presets <cmake_presets>`
For your convenience, we provide :ref:`CMake presets <cmake_presets>`
that combine multiple settings to enable optional LAMMPS packages or use
a different compiler tool chain. Those are loaded with the *-C* flag
(``-C ../cmake/presets/basic.cmake``). This step would only be needed
@ -155,22 +155,23 @@ specific CMake version is given when running ``cmake --help``.
Multi-configuration build systems
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
Throughout this manual it is mostly assumed that LAMMPS is being built
Throughout this manual, it is mostly assumed that LAMMPS is being built
on a Unix-like operating system with "make" as the underlying "builder",
since this is the most common case. In this case the build "configuration"
is chose using ``-D CMAKE_BUILD_TYPE=<configuration>`` with ``<configuration>``
being one of "Release", "Debug", "RelWithDebInfo", or "MinSizeRel".
Some build tools, however, can also use or even require to have a so-called
multi-configuration build system setup. For those the built type (or
configuration) is chosen at compile time using the same build files. E.g.
with:
since this is the most common case. In this case the build
"configuration" is chose using ``-D CMAKE_BUILD_TYPE=<configuration>``
with ``<configuration>`` being one of "Release", "Debug",
"RelWithDebInfo", or "MinSizeRel". Some build tools, however, can also
use or even require having a so-called multi-configuration build system
setup. For a multi-configuration build, the built type (or
configuration) is selected at compile time using the same build
files. E.g. with:
.. code-block:: bash
cmake --build build-multi --config Release
In that case the resulting binaries are not in the build folder directly
but in sub-directories corresponding to the build type (i.e. Release in
but in subdirectories corresponding to the build type (i.e. Release in
the example from above). Similarly, for running unit tests the
configuration is selected with the *-C* flag:
@ -184,7 +185,7 @@ particular applicable to compiling packages that require additional libraries
that would be downloaded and compiled by CMake. The "windows" preset file
tries to keep track of which packages can be compiled natively with the
MSVC compilers out-of-the box. Not all of those external libraries are
portable to Windows either.
portable to Windows, either.
Installing CMake

View File

@ -46,7 +46,7 @@ It can be enabled for all C++ code with the following CMake flag
With this flag enabled all source files will be processed twice, first to
be compiled and then to be analyzed. Please note that the analysis can be
significantly more time consuming than the compilation itself.
significantly more time-consuming than the compilation itself.
----------
@ -154,32 +154,48 @@ for implementing the tests.
framework are more strict than for the main part of LAMMPS. For
example the default GNU C++ and Fortran compilers of RHEL/CentOS 7.x
(version 4.8.x) are not sufficient. The CMake configuration will try
to detect compatible versions and either skip incompatible tests or
stop with an error.
to detect incompatible versions and either skip incompatible tests or
stop with an error. Also the number of tests will depend on
installed LAMMPS packages, development environment, operating system,
and configuration settings.
After compilation is complete, the unit testing is started in the build
folder using the ``ctest`` command, which is part of the CMake software.
The output of this command will be looking something like this::
The output of this command will be looking something like this:
[...]$ ctest
Test project /home/akohlmey/compile/lammps/build-testing
Start 1: MolPairStyle:hybrid-overlay
1/109 Test #1: MolPairStyle:hybrid-overlay ......... Passed 0.02 sec
Start 2: MolPairStyle:hybrid
2/109 Test #2: MolPairStyle:hybrid ................. Passed 0.01 sec
Start 3: MolPairStyle:lj_class2
[...]
Start 107: PotentialFileReader
107/109 Test #107: PotentialFileReader ................ Passed 0.04 sec
Start 108: EIMPotentialFileReader
108/109 Test #108: EIMPotentialFileReader ............. Passed 0.03 sec
Start 109: TestSimpleCommands
109/109 Test #109: TestSimpleCommands ................. Passed 0.02 sec
.. code-block:: console
100% tests passed, 0 tests failed out of 26
$ ctest
Test project /home/akohlmey/compile/lammps/build-testing
Start 1: RunLammps
1/563 Test #1: RunLammps .......................................... Passed 0.28 sec
Start 2: HelpMessage
2/563 Test #2: HelpMessage ........................................ Passed 0.06 sec
Start 3: InvalidFlag
3/563 Test #3: InvalidFlag ........................................ Passed 0.06 sec
Start 4: Tokenizer
4/563 Test #4: Tokenizer .......................................... Passed 0.05 sec
Start 5: MemPool
5/563 Test #5: MemPool ............................................ Passed 0.05 sec
Start 6: ArgUtils
6/563 Test #6: ArgUtils ........................................... Passed 0.05 sec
[...]
Start 561: ImproperStyle:zero
561/563 Test #561: ImproperStyle:zero ................................. Passed 0.07 sec
Start 562: TestMliapPyUnified
562/563 Test #562: TestMliapPyUnified ................................. Passed 0.16 sec
Start 563: TestPairList
563/563 Test #563: TestPairList ....................................... Passed 0.06 sec
Total Test time (real) = 25.57 sec
100% tests passed, 0 tests failed out of 563
Label Time Summary:
generated = 0.85 sec*proc (3 tests)
noWindows = 4.16 sec*proc (2 tests)
slow = 78.33 sec*proc (67 tests)
unstable = 28.23 sec*proc (34 tests)
Total Test time (real) = 132.34 sec
The ``ctest`` command has many options, the most important ones are:
@ -210,11 +226,13 @@ Fortran) and testing different aspects of the LAMMPS software and its features.
The tests will adapt to the compilation settings of LAMMPS, so that tests
will be skipped if prerequisite features are not available in LAMMPS.
.. note::
.. admonition:: Work in Progress
:class: note
The unit test framework was added in spring 2020 and is under active
development. The coverage is not complete and will be expanded over
time.
time. Preference is given to parts of the code base that are easy to
test or commonly used.
Tests for styles of the same kind of style (e.g. pair styles or bond
styles) are performed with the same test executable using different
@ -248,9 +266,9 @@ the CMake option ``-D BUILD_MPI=off`` can significantly speed up testing,
since this will skip the MPI initialization for each test run.
Below is an example command and output:
.. parsed-literal::
.. code-block:: console
[tests]$ test_pair_style mol-pair-lj_cut.yaml
$ test_pair_style mol-pair-lj_cut.yaml
[==========] Running 6 tests from 1 test suite.
[----------] Global test environment set-up.
[----------] 6 tests from PairStyle
@ -530,7 +548,7 @@ commands like the following:
.. code-block:: bash
$ clang-format -i some_file.cpp
clang-format -i some_file.cpp
The following target are available for both, GNU make and CMake:
@ -539,3 +557,19 @@ The following target are available for both, GNU make and CMake:
make format-src # apply clang-format to all files in src and the package folders
make format-tests # apply clang-format to all files in the unittest tree
----------
.. _gh-cli:
GitHub command line interface
-----------------------------
GitHub is developing a `tool for the command line
<https://cli.github.com>`_ that interacts with the GitHub website via a
command called ``gh``. This can be extremely convenient when working
with a Git repository hosted on GitHub (like LAMMPS). It is thus highly
recommended to install it when doing LAMMPS development.
The capabilities of the ``gh`` command is continually expanding, so
please see the documentation at https://cli.github.com/manual/

View File

@ -12,11 +12,11 @@ in addition to
- Traditional make
* - .. code-block:: bash
$ cmake -D PKG_NAME=yes
cmake -D PKG_NAME=yes
- .. code-block:: bash
- .. code-block:: console
$ make yes-name
make yes-name
as described on the :doc:`Build_package <Build_package>` page.
@ -28,26 +28,29 @@ You may need to tell LAMMPS where it is found on your system.
This is the list of packages that may require additional steps.
.. this list must be kept in sync with its counterpart in Build_package.rst
.. table_from_list::
:columns: 6
* :ref:`ADIOS <adios>`
* :ref:`ATC <atc>`
* :ref:`AWPMD <awpmd>`
* :ref:`COLVARS <colvars>`
* :ref:`COLVARS <colvar>`
* :ref:`COMPRESS <compress>`
* :ref:`ELECTRODE <electrode>`
* :ref:`GPU <gpu>`
* :ref:`H5MD <h5md>`
* :ref:`INTEL <intel>`
* :ref:`KIM <kim>`
* :ref:`KOKKOS <kokkos>`
* :ref:`LATTE <latte>`
* :ref:`LEPTON <lepton>`
* :ref:`MACHDYN <machdyn>`
* :ref:`MDI <mdi>`
* :ref:`MESONT <mesont>`
* :ref:`ML-HDNNP <ml-hdnnp>`
* :ref:`ML-IAP <mliap>`
* :ref:`ML-PACE <ml-pace>`
* :ref:`ML-POD <ml-pod>`
* :ref:`ML-QUIP <ml-quip>`
* :ref:`MOLFILE <molfile>`
* :ref:`MSCG <mscg>`
@ -123,10 +126,11 @@ CMake build
-D GPU_API=value # value = opencl (default) or cuda or hip
-D GPU_PREC=value # precision setting
# value = double or mixed (default) or single
-D HIP_PATH # path to HIP installation. Must be set if GPU_API=HIP
-D GPU_ARCH=value # primary GPU hardware choice for GPU_API=cuda
# value = sm_XX, see below
# default is sm_50
# value = sm_XX (see below, default is sm_50)
-D GPU_DEBUG=value # enable debug code in the GPU package library, mostly useful for developers
# value = yes or no (default)
-D HIP_PATH=value # value = path to HIP installation. Must be set if GPU_API=HIP
-D HIP_ARCH=value # primary GPU hardware choice for GPU_API=hip
# value depends on selected HIP_PLATFORM
# default is 'gfx906' for HIP_PLATFORM=amd and 'sm_50' for HIP_PLATFORM=nvcc
@ -148,7 +152,9 @@ CMake build
* sm_60 or sm_61 for Pascal (supported since CUDA 8)
* sm_70 for Volta (supported since CUDA 9)
* sm_75 for Turing (supported since CUDA 10)
* sm_80 for Ampere (supported since CUDA 11)
* sm_80 or sm_86 for Ampere (supported since CUDA 11, sm_86 since CUDA 11.1)
* sm_89 for Lovelace (supported since CUDA 11.8)
* sm_90 for Hopper (supported since CUDA 12.0)
A more detailed list can be found, for example,
at `Wikipedia's CUDA article <https://en.wikipedia.org/wiki/CUDA#GPUs_supported>`_
@ -239,10 +245,10 @@ script with the specified args:
.. code-block:: bash
$ make lib-gpu # print help message
$ make lib-gpu args="-b" # build GPU library with default Makefile.linux
$ make lib-gpu args="-m xk7 -p single -o xk7.single" # create new Makefile.xk7.single, altered for single-precision
$ make lib-gpu args="-m mpi -a sm_60 -p mixed -b" # build GPU library with mixed precision and P100 using other settings in Makefile.mpi
make lib-gpu # print help message
make lib-gpu args="-b" # build GPU library with default Makefile.linux
make lib-gpu args="-m xk7 -p single -o xk7.single" # create new Makefile.xk7.single, altered for single-precision
make lib-gpu args="-m mpi -a sm_60 -p mixed -b" # build GPU library with mixed precision and P100 using other settings in Makefile.mpi
Note that this procedure starts with a Makefile.machine in lib/gpu, as
specified by the "-m" switch. For your convenience, machine makefiles
@ -282,7 +288,7 @@ your machine are not correct, the LAMMPS build will fail, and
.. note::
If you re-build the GPU library in ``lib/gpu``, you should always
un-install the GPU package in ``lammps/src``, then re-install it and
uninstall the GPU package in ``lammps/src``, then re-install it and
re-build LAMMPS. This is because the compilation of files in the GPU
package uses the library settings from the ``lib/gpu/Makefile.machine``
used to build the GPU library.
@ -355,13 +361,13 @@ minutes to hours) to build. Of course you only need to do that once.)
.. code-block:: bash
$ make lib-kim # print help message
$ make lib-kim args="-b " # (re-)install KIM API lib with only example models
$ make lib-kim args="-b -a Glue_Ercolessi_Adams_Al__MO_324507536345_001" # ditto plus one model
$ make lib-kim args="-b -a everything" # install KIM API lib with all models
$ make lib-kim args="-n -a EAM_Dynamo_Ackland_W__MO_141627196590_002" # add one model or model driver
$ make lib-kim args="-p /usr/local" # use an existing KIM API installation at the provided location
$ make lib-kim args="-p /usr/local -a EAM_Dynamo_Ackland_W__MO_141627196590_002" # ditto but add one model or driver
make lib-kim # print help message
make lib-kim args="-b " # (re-)install KIM API lib with only example models
make lib-kim args="-b -a Glue_Ercolessi_Adams_Al__MO_324507536345_001" # ditto plus one model
make lib-kim args="-b -a everything" # install KIM API lib with all models
make lib-kim args="-n -a EAM_Dynamo_Ackland_W__MO_141627196590_002" # add one model or model driver
make lib-kim args="-p /usr/local" # use an existing KIM API installation at the provided location
make lib-kim args="-p /usr/local -a EAM_Dynamo_Ackland_W__MO_141627196590_002" # ditto but add one model or driver
When using the "-b " option, the KIM library is built using its native
cmake build system. The ``lib/kim/Install.py`` script supports a
@ -373,7 +379,7 @@ minutes to hours) to build. Of course you only need to do that once.)
.. code-block:: bash
$ CMAKE=cmake3 CXX=g++-11 CC=gcc-11 FC=gfortran-11 make lib-kim args="-b " # (re-)install KIM API lib using cmake3 and gnu v11 compilers with only example models
CMAKE=cmake3 CXX=g++-11 CC=gcc-11 FC=gfortran-11 make lib-kim args="-b " # (re-)install KIM API lib using cmake3 and gnu v11 compilers with only example models
Settings for debugging OpenKIM web queries discussed below need to
be applied by adding them to the ``LMP_INC`` variable through
@ -600,6 +606,12 @@ They must be specified in uppercase.
* - AMPERE86
- GPU
- NVIDIA Ampere generation CC 8.6 GPU
* - ADA89
- GPU
- NVIDIA Ada Lovelace generation CC 8.9 GPU
* - HOPPER90
- GPU
- NVIDIA Hopper generation CC 9.0 GPU
* - VEGA900
- GPU
- AMD GPU MI25 GFX900
@ -634,7 +646,7 @@ They must be specified in uppercase.
- GPU
- Intel GPU Ponte Vecchio
This list was last updated for version 3.7.0 of the Kokkos library.
This list was last updated for version 3.7.1 of the Kokkos library.
.. tabs::
@ -856,11 +868,11 @@ library.
.. code-block:: bash
$ make lib-latte # print help message
$ make lib-latte args="-b" # download and build in lib/latte/LATTE-master
$ make lib-latte args="-p $HOME/latte" # use existing LATTE installation in $HOME/latte
$ make lib-latte args="-b -m gfortran" # download and build in lib/latte and
# copy Makefile.lammps.gfortran to Makefile.lammps
make lib-latte # print help message
make lib-latte args="-b" # download and build in lib/latte/LATTE-master
make lib-latte args="-p $HOME/latte" # use existing LATTE installation in $HOME/latte
make lib-latte args="-b -m gfortran" # download and build in lib/latte and
# copy Makefile.lammps.gfortran to Makefile.lammps
Note that 3 symbolic (soft) links, ``includelink`` and ``liblink``
and ``filelink.o``, are created in ``lib/latte`` to point to
@ -871,6 +883,55 @@ library.
----------
.. _lepton:
LEPTON package
--------------
To build with this package, you must build the Lepton library which is
included in the LAMMPS source distribution in the ``lib/lepton`` folder.
.. tabs::
.. tab:: CMake build
This is the recommended build procedure for using Lepton in
LAMMPS. No additional settings are normally needed besides
``-D PKG_LEPTON=yes``.
On x86 hardware the Lepton library will also include a just-in-time
compiler for faster execution. This is auto detected but can
be explicitly disabled by setting ``-D LEPTON_ENABLE_JIT=no``
(or enabled by setting it to yes).
.. tab:: Traditional make
Before building LAMMPS, one must build the Lepton library in lib/lepton.
This can be done manually in the same folder by using or adapting
one of the provided Makefiles: for example, ``Makefile.serial`` for
the GNU C++ compiler, or ``Makefile.mpi`` for the MPI compiler wrapper.
The Lepton library is written in C++-11 and thus the C++ compiler
may need to be instructed to enable support for that.
In general, it is safer to use build setting consistent with the
rest of LAMMPS. This is best carried out from the LAMMPS src
directory using a command like these, which simply invokes the
``lib/lepton/Install.py`` script with the specified args:
.. code-block:: bash
make lib-lepton # print help message
make lib-lepton args="-m serial" # build with GNU g++ compiler (settings as with "make serial")
make lib-lepton args="-m mpi" # build with default MPI compiler (settings as with "make mpi")
The "machine" argument of the "-m" flag is used to find a
Makefile.machine to use as build recipe.
The build should produce a ``build`` folder and the library ``lib/lepton/liblmplepton.a``
----------
.. _mliap:
ML-IAP package
@ -959,12 +1020,12 @@ more details.
.. code-block:: bash
$ make lib-mscg # print help message
$ make lib-mscg args="-b -m serial" # download and build in lib/mscg/MSCG-release-master
# with the settings compatible with "make serial"
$ make lib-mscg args="-b -m mpi" # download and build in lib/mscg/MSCG-release-master
# with the settings compatible with "make mpi"
$ make lib-mscg args="-p /usr/local/mscg-release" # use the existing MS-CG installation in /usr/local/mscg-release
make lib-mscg # print help message
make lib-mscg args="-b -m serial" # download and build in lib/mscg/MSCG-release-master
# with the settings compatible with "make serial"
make lib-mscg args="-b -m mpi" # download and build in lib/mscg/MSCG-release-master
# with the settings compatible with "make mpi"
make lib-mscg args="-p /usr/local/mscg-release" # use the existing MS-CG installation in /usr/local/mscg-release
Note that 2 symbolic (soft) links, ``includelink`` and ``liblink``,
will be created in ``lib/mscg`` to point to the MS-CG
@ -1016,10 +1077,10 @@ POEMS package
.. code-block:: bash
$ make lib-poems # print help message
$ make lib-poems args="-m serial" # build with GNU g++ compiler (settings as with "make serial")
$ make lib-poems args="-m mpi" # build with default MPI C++ compiler (settings as with "make mpi")
$ make lib-poems args="-m icc" # build with Intel icc compiler
make lib-poems # print help message
make lib-poems args="-m serial" # build with GNU g++ compiler (settings as with "make serial")
make lib-poems args="-m mpi" # build with default MPI C++ compiler (settings as with "make mpi")
make lib-poems args="-m icc" # build with Intel icc compiler
The build should produce two files: ``lib/poems/libpoems.a`` and
``lib/poems/Makefile.lammps``. The latter is copied from an
@ -1105,10 +1166,10 @@ binary package provided by your operating system.
.. code-block:: bash
$ make lib-voronoi # print help message
$ make lib-voronoi args="-b" # download and build the default version in lib/voronoi/voro++-<version>
$ make lib-voronoi args="-p $HOME/voro++" # use existing Voro++ installation in $HOME/voro++
$ make lib-voronoi args="-b -v voro++0.4.6" # download and build the 0.4.6 version in lib/voronoi/voro++-0.4.6
make lib-voronoi # print help message
make lib-voronoi args="-b" # download and build the default version in lib/voronoi/voro++-<version>
make lib-voronoi args="-p $HOME/voro++" # use existing Voro++ installation in $HOME/voro++
make lib-voronoi args="-b -v voro++0.4.6" # download and build the 0.4.6 version in lib/voronoi/voro++-0.4.6
Note that 2 symbolic (soft) links, ``includelink`` and
``liblink``, are created in lib/voronoi to point to the Voro++
@ -1149,13 +1210,13 @@ systems.
.. code-block:: bash
$ make yes-adios
make yes-adios
otherwise, set ADIOS2_DIR environment variable when turning on the package:
.. code-block:: bash
$ ADIOS2_DIR=path make yes-adios # path is where ADIOS 2.x is installed
ADIOS2_DIR=path make yes-adios # path is where ADIOS 2.x is installed
----------
@ -1184,10 +1245,10 @@ The ATC package requires the MANYBODY package also be installed.
.. code-block:: bash
$ make lib-atc # print help message
$ make lib-atc args="-m serial" # build with GNU g++ compiler and MPI STUBS (settings as with "make serial")
$ make lib-atc args="-m mpi" # build with default MPI compiler (settings as with "make mpi")
$ make lib-atc args="-m icc" # build with Intel icc compiler
make lib-atc # print help message
make lib-atc args="-m serial" # build with GNU g++ compiler and MPI STUBS (settings as with "make serial")
make lib-atc args="-m mpi" # build with default MPI compiler (settings as with "make mpi")
make lib-atc args="-m icc" # build with Intel icc compiler
The build should produce two files: ``lib/atc/libatc.a`` and
``lib/atc/Makefile.lammps``. The latter is copied from an
@ -1206,17 +1267,17 @@ The ATC package requires the MANYBODY package also be installed.
.. code-block:: bash
$ make lib-linalg # print help message
$ make lib-linalg args="-m serial" # build with GNU Fortran compiler (settings as with "make serial")
$ make lib-linalg args="-m mpi" # build with default MPI Fortran compiler (settings as with "make mpi")
$ make lib-linalg args="-m gfortran" # build with GNU Fortran compiler
make lib-linalg # print help message
make lib-linalg args="-m serial" # build with GNU C++ compiler (settings as with "make serial")
make lib-linalg args="-m mpi" # build with default MPI C++ compiler (settings as with "make mpi")
make lib-linalg args="-m g++" # build with GNU Fortran compiler
----------
.. _awpmd:
AWPMD package
------------------
-------------
.. tabs::
@ -1235,10 +1296,10 @@ AWPMD package
.. code-block:: bash
$ make lib-awpmd # print help message
$ make lib-awpmd args="-m serial" # build with GNU g++ compiler and MPI STUBS (settings as with "make serial")
$ make lib-awpmd args="-m mpi" # build with default MPI compiler (settings as with "make mpi")
$ make lib-awpmd args="-m icc" # build with Intel icc compiler
make lib-awpmd # print help message
make lib-awpmd args="-m serial" # build with GNU g++ compiler and MPI STUBS (settings as with "make serial")
make lib-awpmd args="-m mpi" # build with default MPI compiler (settings as with "make mpi")
make lib-awpmd args="-m icc" # build with Intel icc compiler
The build should produce two files: ``lib/awpmd/libawpmd.a`` and
``lib/awpmd/Makefile.lammps``. The latter is copied from an
@ -1257,21 +1318,20 @@ AWPMD package
.. code-block:: bash
$ make lib-linalg # print help message
$ make lib-linalg args="-m serial" # build with GNU Fortran compiler (settings as with "make serial")
$ make lib-linalg args="-m mpi" # build with default MPI Fortran compiler (settings as with "make mpi")
$ make lib-linalg args="-m gfortran" # build with GNU Fortran compiler
make lib-linalg # print help message
make lib-linalg args="-m serial" # build with GNU C++ compiler (settings as with "make serial")
make lib-linalg args="-m mpi" # build with default MPI C++ compiler (settings as with "make mpi")
make lib-linalg args="-m g++" # build with GNU C++ compiler
----------
.. _colvars:
.. _colvar:
COLVARS package
---------------------------------------
---------------
This package includes the `Colvars library
<https://colvars.github.io/>`_ into the LAMMPS distribution, which can
be built for the most part with all major versions of the C++ language.
This package enables the use of the `Colvars <https://colvars.github.io/>`_
module included in the LAMMPS source distribution.
.. tabs::
@ -1284,42 +1344,45 @@ be built for the most part with all major versions of the C++ language.
.. tab:: Traditional make
Before building LAMMPS, one must build the Colvars library in lib/colvars.
As with other libraries distributed with LAMMPS, the Colvars library
needs to be built before building the LAMMPS program with the COLVARS
package enabled.
This can be done manually in the same folder by using or adapting
one of the provided Makefiles: for example, ``Makefile.g++`` for
the GNU C++ compiler. C++11 compatibility may need to be enabled
for some older compilers (as is done in the example makefile).
In general, it is safer to use build setting consistent with the
rest of LAMMPS. This is best carried out from the LAMMPS src
directory using a command like these, which simply invokes the
``lib/colvars/Install.py`` script with the specified args:
From the LAMMPS ``src`` directory, this is most easily and safely done
via one of the following commands, which implicitly rely on the
``lib/colvars/Install.py`` script with optional arguments:
.. code-block:: bash
$ make lib-colvars # print help message
$ make lib-colvars args="-m serial" # build with GNU g++ compiler (settings as with "make serial")
$ make lib-colvars args="-m mpi" # build with default MPI compiler (settings as with "make mpi")
$ make lib-colvars args="-m g++-debug" # build with GNU g++ compiler and colvars debugging enabled
make lib-colvars # print help message
make lib-colvars args="-m serial" # build with GNU g++ compiler (settings as with "make serial")
make lib-colvars args="-m mpi" # build with default MPI compiler (settings as with "make mpi")
make lib-colvars args="-m g++-debug" # build with GNU g++ compiler and colvars debugging enabled
The "machine" argument of the "-m" flag is used to find a
Makefile.machine to use as build recipe. If it does not already
exist in ``lib/colvars``, it will be auto-generated by using
compiler flags consistent with those parsed from the core LAMMPS
makefiles.
``Makefile.machine`` file to use as build recipe. If such recipe does
not already exist in ``lib/colvars``, suitable settings will be
auto-generated consistent with those used in the core LAMMPS makefiles.
.. versionchanged:: 8Feb2023
Please note that Colvars uses the Lepton library, which is now
included with the LEPTON package; if you use anything other than
the ``make lib-colvars`` command, please make sure to :ref:`build
Lepton beforehand <lepton>`.
Optional flags may be specified as environment variables:
.. code-block:: bash
$ COLVARS_DEBUG=yes make lib-colvars args="-m machine" # Build with debug code (much slower)
$ COLVARS_LEPTON=no make lib-colvars args="-m machine" # Build without Lepton (included otherwise)
COLVARS_DEBUG=yes make lib-colvars args="-m machine" # Build with debug code (much slower)
COLVARS_LEPTON=no make lib-colvars args="-m machine" # Build without Lepton (included otherwise)
The build should produce two files: the library ``lib/colvars/libcolvars.a``
(which also includes Lepton objects if enabled) and the specification file
``lib/colvars/Makefile.lammps``. The latter is auto-generated, and normally does
not need to be edited.
The build should produce two files: the library
``lib/colvars/libcolvars.a`` and the specification file
``lib/colvars/Makefile.lammps``. The latter is auto-generated,
and normally does not need to be edited.
----------
@ -1334,8 +1397,21 @@ This package depends on the KSPACE package.
.. tab:: CMake build
No additional settings are needed besides ``-D PKG_KSPACE=yes`` and
``-D PKG_ELECTRODE=yes``.
.. code-block:: bash
-D PKG_ELECTRODE=yes # enable the package itself
-D PKG_KSPACE=yes # the ELECTRODE package requires KSPACE
-D USE_INTERNAL_LINALG=value #
Features in the ELECTRODE package are dependent on code in the
KSPACE package so the latter one *must* be enabled.
The ELECTRODE package also requires LAPACK (and BLAS) and CMake
can identify their locations and pass that info to the LATTE build
script. But on some systems this may cause problems when linking
or the dependency is not desired. Try enabling
``USE_INTERNAL_LINALG`` in those cases to use the bundled linear
algebra library and work around the limitation.
.. tab:: Traditional make
@ -1348,9 +1424,9 @@ This package depends on the KSPACE package.
.. code-block:: bash
$ make lib-electrode # print help message
$ make lib-electrode args="-m serial" # build with GNU g++ compiler and MPI STUBS (settings as with "make serial")
$ make lib-electrode args="-m mpi" # build with default MPI compiler (settings as with "make mpi")
make lib-electrode # print help message
make lib-electrode args="-m serial" # build with GNU g++ compiler and MPI STUBS (settings as with "make serial")
make lib-electrode args="-m mpi" # build with default MPI compiler (settings as with "make mpi")
Note that the ``Makefile.lammps`` file has settings for the BLAS
@ -1361,10 +1437,10 @@ This package depends on the KSPACE package.
.. code-block:: bash
$ make lib-linalg # print help message
$ make lib-linalg args="-m serial" # build with GNU Fortran compiler (settings as with "make serial")
$ make lib-linalg args="-m mpi" # build with default MPI Fortran compiler (settings as with "make mpi")
$ make lib-linalg args="-m gfortran" # build with GNU Fortran compiler
make lib-linalg # print help message
make lib-linalg args="-m serial" # build with GNU C++ compiler (settings as with "make serial")
make lib-linalg args="-m mpi" # build with default MPI C++ compiler (settings as with "make mpi")
make lib-linalg args="-m g++" # build with GNU C++ compiler
The package itself is activated with ``make yes-KSPACE`` and
``make yes-ELECTRODE``
@ -1404,13 +1480,56 @@ at: `https://github.com/ICAMS/lammps-user-pace/ <https://github.com/ICAMS/lammps
.. code-block:: bash
$ make lib-pace # print help message
$ make lib-pace args="-b" # download and build the default version in lib/pace
make lib-pace # print help message
make lib-pace args="-b" # download and build the default version in lib/pace
You should not need to edit the ``lib/pace/Makefile.lammps`` file.
----------
.. _ml-pod:
ML-POD package
-----------------------------
.. tabs::
.. tab:: CMake build
No additional settings are needed besides ``-D PKG_ML-POD=yes``.
.. tab:: Traditional make
Before building LAMMPS, you must configure the ML-POD support
settings in ``lib/mlpod``. You can do this manually, if you
prefer, or do it in one step from the ``lammps/src`` dir, using a
command like the following, which simply invoke the
``lib/mlpod/Install.py`` script with the specified args:
.. code-block:: bash
make lib-mlpod # print help message
make lib-mlpod args="-m serial" # build with GNU g++ compiler and MPI STUBS (settings as with "make serial")
make lib-mlpod args="-m mpi" # build with default MPI compiler (settings as with "make mpi")
make lib-mlpod args="-m mpi -e linalg" # same as above but use the bundled linalg lib
Note that the ``Makefile.lammps`` file has settings to use the BLAS
and LAPACK linear algebra libraries. These can either exist on
your system, or you can use the files provided in ``lib/linalg``.
In the latter case you also need to build the library in
``lib/linalg`` with a command like these:
.. code-block:: bash
make lib-linalg # print help message
make lib-linalg args="-m serial" # build with GNU C++ compiler (settings as with "make serial")
make lib-linalg args="-m mpi" # build with default MPI C++ compiler (settings as with "make mpi")
make lib-linalg args="-m g++" # build with GNU C++ compiler
The package itself is activated with ``make yes-ML-POD``.
----------
.. _plumed:
PLUMED package
@ -1504,10 +1623,10 @@ LAMMPS build.
.. code-block:: bash
$ make lib-plumed # print help message
$ make lib-plumed args="-b" # download and build PLUMED in lib/plumed/plumed2
$ make lib-plumed args="-p $HOME/.local" # use existing PLUMED installation in $HOME/.local
$ make lib-plumed args="-p /usr/local -m shared" # use existing PLUMED installation in
make lib-plumed # print help message
make lib-plumed args="-b" # download and build PLUMED in lib/plumed/plumed2
make lib-plumed args="-p $HOME/.local" # use existing PLUMED installation in $HOME/.local
make lib-plumed args="-p /usr/local -m shared" # use existing PLUMED installation in
# /usr/local and use shared linkage mode
Note that 2 symbolic (soft) links, ``includelink`` and ``liblink``
@ -1520,8 +1639,8 @@ LAMMPS build.
.. code-block:: bash
$ make yes-plumed
$ make machine
make yes-plumed
make machine
Once this compilation completes you should be able to run LAMMPS
in the usual way. For shared linkage mode, libplumed.so must be
@ -1573,8 +1692,8 @@ the HDF5 library.
.. code-block:: bash
$ make lib-h5md # print help message
$ make lib-h5md args="-m h5cc" # build with h5cc compiler
make lib-h5md # print help message
make lib-h5md args="-m h5cc" # build with h5cc compiler
The build should produce two files: ``lib/h5md/libch5md.a`` and
``lib/h5md/Makefile.lammps``. The latter is copied from an
@ -1628,10 +1747,10 @@ details please see ``lib/hdnnp/README`` and the `n2p2 build documentation
.. code-block:: bash
$ make lib-hdnnp # print help message
$ make lib-hdnnp args="-b" # download and build in lib/hdnnp/n2p2-...
$ make lib-hdnnp args="-b -v 2.1.4" # download and build specific version
$ make lib-hdnnp args="-p /usr/local/n2p2" # use the existing n2p2 installation in /usr/local/n2p2
make lib-hdnnp # print help message
make lib-hdnnp args="-b" # download and build in lib/hdnnp/n2p2-...
make lib-hdnnp args="-b -v 2.1.4" # download and build specific version
make lib-hdnnp args="-p /usr/local/n2p2" # use the existing n2p2 installation in /usr/local/n2p2
Note that 3 symbolic (soft) links, ``includelink``, ``liblink`` and
``Makefile.lammps``, will be created in ``lib/hdnnp`` to point to
@ -1731,56 +1850,14 @@ MDI package
.. code-block:: bash
$ python Install.py -m gcc # build using gcc compiler
$ python Install.py -m icc # build using icc compiler
python Install.py -m gcc # build using gcc compiler
python Install.py -m icc # build using icc compiler
The build should produce two files: ``lib/mdi/includelink/mdi.h``
and ``lib/mdi/liblink/libmdi.so``\ .
----------
.. _mesont:
MESONT package
-------------------------
This package includes a library written in Fortran 90 in the
``lib/mesont`` folder, so a working Fortran 90 compiler is required to
compile it. Also, the files with the force field data for running the
bundled examples are not included in the source distribution. Instead
they will be downloaded the first time this package is installed.
.. tabs::
.. tab:: CMake build
No additional settings are needed besides ``-D PKG_MESONT=yes``
.. tab:: Traditional make
Before building LAMMPS, you must build the *mesont* library in
``lib/mesont``\ . You can also do it in one step from the
``lammps/src`` dir, using a command like these, which simply
invokes the ``lib/mesont/Install.py`` script with the specified
args:
.. code-block:: bash
$ make lib-mesont # print help message
$ make lib-mesont args="-m gfortran" # build with GNU g++ compiler (settings as with "make serial")
$ make lib-mesont args="-m ifort" # build with Intel icc compiler
The build should produce two files: ``lib/mesont/libmesont.a`` and
``lib/mesont/Makefile.lammps``\ . The latter is copied from an
existing ``Makefile.lammps.\*`` and has settings needed to build
LAMMPS with the *mesont* library (though typically the settings
contain only the Fortran runtime library). If necessary, you can
edit/create a new ``lib/mesont/Makefile.machine`` file for your
system, which should define an ``EXTRAMAKE`` variable to specify a
corresponding ``Makefile.lammps.machine`` file.
----------
.. _molfile:
MOLFILE package
@ -1881,6 +1958,22 @@ OPENMP package
For other platforms and compilers, please consult the
documentation about OpenMP support for your compiler.
.. admonition:: Adding OpenMP support on macOS
:class: note
Apple offers the `Xcode package and IDE
<https://developer.apple.com/xcode/>`_ for compiling software on
macOS, so you have likely installed it to compile LAMMPS. Their
compiler is based on `Clang <https://clang.llvm.org/>`, but while it
is capable of processing OpenMP directives, the necessary header
files and OpenMP runtime library are missing. The `R developers
<https://www.r-project.org/>` have figured out a way to build those
in a compatible fashion. One can download them from
`https://mac.r-project.org/openmp/
<https://mac.r-project.org/openmp/>`_. Simply adding those files as
instructed enables the Xcode C++ compiler to compile LAMMPS with ``-D
BUILD_OMP=yes``.
----------
.. _qmmm:
@ -1935,10 +2028,10 @@ verified to work in February 2020 with Quantum Espresso versions 6.3 to
.. code-block:: bash
$ make lib-qmmm # print help message
$ make lib-qmmm args="-m serial" # build with GNU Fortran compiler (settings as in "make serial")
$ make lib-qmmm args="-m mpi" # build with default MPI compiler (settings as in "make mpi")
$ make lib-qmmm args="-m gfortran" # build with GNU Fortran compiler
make lib-qmmm # print help message
make lib-qmmm args="-m serial" # build with GNU Fortran compiler (settings as in "make serial")
make lib-qmmm args="-m mpi" # build with default MPI compiler (settings as in "make mpi")
make lib-qmmm args="-m gfortran" # build with GNU Fortran compiler
The build should produce two files: ``lib/qmmm/libqmmm.a`` and
``lib/qmmm/Makefile.lammps``. The latter is copied from an
@ -2087,9 +2180,9 @@ Eigen3 is a template library, so you do not need to build it.
.. code-block:: bash
$ make lib-smd # print help message
$ make lib-smd args="-b" # download to lib/smd/eigen3
$ make lib-smd args="-p /usr/include/eigen3" # use existing Eigen installation in /usr/include/eigen3
make lib-smd # print help message
make lib-smd args="-b" # download to lib/smd/eigen3
make lib-smd args="-p /usr/include/eigen3" # use existing Eigen installation in /usr/include/eigen3
Note that a symbolic (soft) link named ``includelink`` is created
in ``lib/smd`` to point to the Eigen dir. When LAMMPS builds it

View File

@ -1,33 +1,32 @@
Link LAMMPS as a library to another code
========================================
LAMMPS is designed as a library of C++ objects that can be
integrated into other applications including Python scripts.
The files ``src/library.cpp`` and ``src/library.h`` define a
C-style API for using LAMMPS as a library. See the
:doc:`Howto_library` page
for a description of the interface and how to use it for your needs.
LAMMPS is designed as a library of C++ objects that can be integrated
into other applications, including Python scripts. The files
``src/library.cpp`` and ``src/library.h`` define a C-style API for using
LAMMPS as a library. See the :doc:`Howto_library` page for a
description of the interface and how to use it for your needs.
The :doc:`Build_basics` page explains how to build
LAMMPS as either a shared or static library. This results in a file
in the compilation folder called ``liblammps.a`` or ``liblammps_<name>.a``
in case of building a static library. In case of a shared library
the name is the same only that the suffix is going to be either ``.so``
or ``.dylib`` or ``.dll`` instead of ``.a`` depending on the OS.
In some cases the ``.so`` file may be a symbolic link to a file with
the suffix ``.so.0`` (or some other number).
The :doc:`Build_basics` page explains how to build LAMMPS as either a
shared or static library. This results in a file in the compilation
folder called ``liblammps.a`` or ``liblammps_<name>.a`` in case of
building a static library. In case of a shared library, the name is the
same only that the suffix is going to be either ``.so`` or ``.dylib`` or
``.dll`` instead of ``.a`` depending on the OS. In some cases, the
``.so`` file may be a symbolic link to a file with the suffix ``.so.0``
(or some other number).
.. note::
Care should be taken to use the same MPI library for the calling code
and the LAMMPS library unless LAMMPS is to be compiled without (real)
MPI support using the include STUBS MPI library.
and the LAMMPS library, unless LAMMPS is to be compiled without (real)
MPI support using the included STUBS MPI library.
Link with LAMMPS as a static library
------------------------------------
The calling application can link to LAMMPS as a static library with
compilation and link commands as in the examples shown below. These
compilation and link commands, as in the examples shown below. These
are examples for a code written in C in the file ``caller.c``.
The benefit of linking to a static library is, that the resulting
executable is independent of that library since all required
@ -142,10 +141,10 @@ Link with LAMMPS as a shared library
When linking to LAMMPS built as a shared library, the situation becomes
much simpler, as all dependent libraries and objects are either included
in the shared library or registered as a dependent library in the shared
library file. Thus those libraries need not to be specified when
linking the calling executable. Only the *-I* flags are needed. So the
example case from above of the serial version static LAMMPS library with
the POEMS package installed becomes:
library file. Thus, those libraries need not be specified when linking
the calling executable. Only the *-I* flags are needed. So the example
case from above of the serial version static LAMMPS library with the
POEMS package installed becomes:
.. tabs::
@ -209,7 +208,7 @@ You can verify whether all required shared libraries are found with the
.. code-block:: bash
$ LD_LIBRARY_PATH=/home/user/lammps/src ldd caller
LD_LIBRARY_PATH=/home/user/lammps/src ldd caller
linux-vdso.so.1 (0x00007ffe729e0000)
liblammps.so => /home/user/lammps/src/liblammps.so (0x00007fc91bb9e000)
libstdc++.so.6 => /lib64/libstdc++.so.6 (0x00007fc91b984000)
@ -222,7 +221,7 @@ If a required library is missing, you would get a 'not found' entry:
.. code-block:: bash
$ ldd caller
ldd caller
linux-vdso.so.1 (0x00007ffd672fe000)
liblammps.so => not found
libstdc++.so.6 => /usr/lib64/libstdc++.so.6 (0x00007fb7c7e86000)

View File

@ -20,21 +20,22 @@ with :doc:`CMake <Build_cmake>`. The makefiles of the traditional
make based build process and the scripts they are calling expect a few
additional tools to be available and functioning.
* a working C/C++ compiler toolchain supporting the C++11 standard; on
Linux these are often the GNU compilers. Some older compilers
* A working C/C++ compiler toolchain supporting the C++11 standard; on
Linux, these are often the GNU compilers. Some older compiler versions
require adding flags like ``-std=c++11`` to enable the C++11 mode.
* a Bourne shell compatible "Unix" shell program (often this is ``bash``)
* a few shell utilities: ``ls``, ``mv``, ``ln``, ``rm``, ``grep``, ``sed``, ``tr``, ``cat``, ``touch``, ``diff``, ``dirname``
* python (optional, required for ``make lib-<pkg>`` in the src folder).
python scripts are currently tested with python 2.7 and 3.6. The procedure
for :doc:`building the documentation <Build_manual>` requires python 3.5 or later.
* A Bourne shell compatible "Unix" shell program (frequently this is ``bash``)
* A few shell utilities: ``ls``, ``mv``, ``ln``, ``rm``, ``grep``, ``sed``, ``tr``, ``cat``, ``touch``, ``diff``, ``dirname``
* Python (optional, required for ``make lib-<pkg>`` in the src
folder). Python scripts are currently tested with python 2.7 and
3.6 to 3.11. The procedure for :doc:`building the documentation
<Build_manual>` *requires* Python 3.5 or later.
Getting started
^^^^^^^^^^^^^^^
To include LAMMPS packages (i.e. optional commands and styles) you must
enable (or "install") them first, as discussed on the :doc:`Build
package <Build_package>` page. If a packages requires (provided or
package <Build_package>` page. If a package requires (provided or
external) libraries, you must configure and build those libraries
**before** building LAMMPS itself and especially **before** enabling
such a package with ``make yes-<package>``. :doc:`Building LAMMPS with
@ -56,36 +57,36 @@ Compilation can take a long time, since LAMMPS is a large project with
many features. If your machine has multiple CPU cores (most do these
days), you can speed this up by compiling sources in parallel with
``make -j N`` (with N being the maximum number of concurrently executed
tasks). Also installation of the `ccache <https://ccache.dev/>`_ (=
Compiler Cache) software may speed up repeated compilation even more,
e.g. during code development.
tasks). Installation of the `ccache <https://ccache.dev/>`_ (= Compiler
Cache) software may speed up repeated compilation even more, e.g. during
code development, especially when repeatedly switching between branches.
After the initial build, whenever you edit LAMMPS source files, or add
or remove new files to the source directory (e.g. by installing or
uninstalling packages), you must re-compile and relink the LAMMPS
executable with the same ``make <machine>`` command. The makefile's
dependency tracking should insure that only the necessary subset of
files are re-compiled. If you change settings in the makefile, you have
to recompile *everything*. To delete all objects you can use ``make
dependency tracking should ensure that only the necessary subset of
files is re-compiled. If you change settings in the makefile, you have
to recompile *everything*. To delete all objects, you can use ``make
clean-<machine>``.
.. note::
Before the actual compilation starts, LAMMPS will perform several
steps to collect information from the configuration and setup that
is then embedded into the executable. When you build LAMMPS for
the first time, it will also compile a tool to quickly assemble
a list of dependencies, that are required for the make program to
correctly detect which parts need to be recompiled after changes
were made to the sources.
steps to collect information from the configuration and setup that is
then embedded into the executable. When you build LAMMPS for the
first time, it will also compile a tool to quickly determine a list
of dependencies. Those are required for the make program to
correctly detect, which files need to be recompiled or relinked
after changes were made to the sources.
Customized builds and alternate makefiles
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
The ``src/MAKE`` directory tree contains the ``Makefile.<machine>``
files included in the LAMMPS distribution. Typing ``make example`` uses
``Makefile.example`` from one of those folders, if available. Thus the
``make serial`` and ``make mpi`` lines above use
``Makefile.example`` from one of those folders, if available. The
``make serial`` and ``make mpi`` lines above, for example, use
``src/MAKE/Makefile.serial`` and ``src/MAKE/Makefile.mpi``,
respectively. Other makefiles are in these directories:
@ -106,12 +107,13 @@ a new name, please edit the first line with the description and machine
name, so you will not confuse yourself, when looking at the machine
summary.
Makefiles you may wish to try include these (some require a package
first be installed). Many of these include specific compiler flags
for optimized performance. Please note, however, that some of these
customized machine Makefile are contributed by users. Since both
compilers, OS configurations, and LAMMPS itself keep changing, their
settings may become outdated:
Makefiles you may wish to try out, include those listed below (some
require a package first be installed). Many of these include specific
compiler flags for optimized performance. Please note, however, that
some of these customized machine Makefile are contributed by users, and
thus may have modifications specific to the systems of those users.
Since compilers, OS configurations, and LAMMPS itself keep changing,
their settings may become outdated, too:
.. code-block:: bash

View File

@ -2,7 +2,7 @@ Build the LAMMPS documentation
==============================
Depending on how you obtained LAMMPS and whether you have built the
manual yourself, this directory has a number of sub-directories and
manual yourself, this directory has a number of subdirectories and
files. Here is a list with descriptions:
.. code-block:: bash
@ -125,38 +125,29 @@ common setups:
.. code-block:: bash
sudo apt-get install python-virtualenv git doxygen
sudo apt-get install git doxygen
.. tab:: RHEL or CentOS (Version 7.x)
.. code-block:: bash
sudo yum install python3-virtualenv git doxygen
sudo yum install git doxygen
.. tab:: Fedora or RHEL/CentOS (8.x or later)
.. code-block:: bash
sudo dnf install python3-virtualenv git doxygen
sudo dnf install git doxygen
.. tab:: MacOS X
.. tab:: macOS
*Python 3*
Download the latest Python 3 MacOS X package from
If Python 3 is not available on your macOS system, you can
download the latest Python 3 macOS package from
`https://www.python.org <https://www.python.org>`_ and install it.
This will install both Python 3 and pip3.
*virtualenv*
Once Python 3 is installed, open a Terminal and type
.. code-block:: bash
pip3 install virtualenv
This will install virtualenv from the Python Package Index.
Prerequisites for PDF
---------------------

View File

@ -4,13 +4,14 @@ Include packages in build
In LAMMPS, a package is a group of files that enable a specific set of
features. For example, force fields for molecular systems or
rigid-body constraints are in packages. In the src directory, each
package is a sub-directory with the package name in capital letters.
package is a subdirectory with the package name in capital letters.
An overview of packages is given on the :doc:`Packages <Packages>` doc
page. Brief overviews of each package are on the :doc:`Packages details <Packages_details>` page.
page. Brief overviews of each package are on the :doc:`Packages details
<Packages_details>` page.
When building LAMMPS, you can choose to include or exclude each
package. In general there is no need to include a package if you
package. Generally, there is no need to include a package if you
never plan to use its features.
If you get a run-time error that a LAMMPS command or style is
@ -30,23 +31,29 @@ steps, as explained on the :doc:`Build extras <Build_extras>` page.
These links take you to the extra instructions for those select
packages:
.. this list must be kept in sync with its counterpart in Build_extras.rst
.. table_from_list::
:columns: 6
* :ref:`ADIOS <adios>`
* :ref:`ATC <atc>`
* :ref:`AWPMD <awpmd>`
* :ref:`COLVARS <colvars>`
* :ref:`COLVARS <colvar>`
* :ref:`COMPRESS <compress>`
* :ref:`ELECTRODE <electrode>`
* :ref:`GPU <gpu>`
* :ref:`H5MD <h5md>`
* :ref:`INTEL <intel>`
* :ref:`KIM <kim>`
* :ref:`KOKKOS <kokkos>`
* :ref:`LATTE <latte>`
* :ref:`LEPTON <lepton>`
* :ref:`MACHDYN <machdyn>`
* :ref:`MDI <mdi>`
* :ref:`ML-HDNNP <ml-hdnnp>`
* :ref:`ML-IAP <mliap>`
* :ref:`ML-PACE <ml-pace>`
* :ref:`ML-POD <ml-pod>`
* :ref:`ML-QUIP <ml-quip>`
* :ref:`MOLFILE <molfile>`
* :ref:`MSCG <mscg>`
@ -87,7 +94,7 @@ versus make.
If you switch between building with CMake and make builds, no
packages in the src directory can be installed when you invoke
``cmake``. CMake will give an error if that is not the case,
indicating how you can un-install all packages in the src dir.
indicating how you can uninstall all packages in the src dir.
.. tab:: Traditional make
@ -96,7 +103,7 @@ versus make.
cd lammps/src
make ps # check which packages are currently installed
make yes-name # install a package with name
make no-name # un-install a package with name
make no-name # uninstall a package with name
make mpi # build LAMMPS with whatever packages are now installed
Examples:
@ -112,13 +119,13 @@ versus make.
.. note::
You must always re-build LAMMPS (via make) after installing or
un-installing a package, for the action to take effect. The
uninstalling a package, for the action to take effect. The
included dependency tracking will make certain only files that
are required to be rebuilt are recompiled.
.. note::
You cannot install or un-install packages and build LAMMPS in a
You cannot install or uninstall packages and build LAMMPS in a
single make command with multiple targets, e.g. ``make
yes-colloid mpi``. This is because the make procedure creates
a list of source files that will be out-of-date for the build
@ -143,7 +150,7 @@ other files dependent on that package are also excluded.
if you downloaded a tarball, 3 packages (KSPACE, MANYBODY, MOLECULE)
were pre-installed via the traditional make procedure in the ``src``
directory. That is no longer the case, so that CMake will build
as-is without needing to un-install those packages.
as-is without needing to uninstall those packages.
----------
@ -160,9 +167,9 @@ control flow constructs for more complex operations.
LAMMPS includes several of these files to define configuration
"presets", similar to the options that exist for the Make based
system. Using these files you can enable/disable portions of the
available packages in LAMMPS. If you need a custom preset you can take
one of them as a starting point and customize it to your needs.
system. Using these files, you can enable/disable portions of the
available packages in LAMMPS. If you need a custom preset, you can
make a copy of one of them and modify it to suit your needs.
.. code-block:: bash
@ -176,7 +183,7 @@ one of them as a starting point and customize it to your needs.
cmake -C ../cmake/presets/pgi.cmake [OPTIONS] ../cmake # change settings to use the PGI compilers by default
cmake -C ../cmake/presets/all_on.cmake [OPTIONS] ../cmake # enable all packages
cmake -C ../cmake/presets/all_off.cmake [OPTIONS] ../cmake # disable all packages
mingw64-cmake -C ../cmake/presets/mingw-cross.cmake [OPTIONS] ../cmake # compile with MinGW cross compilers
mingw64-cmake -C ../cmake/presets/mingw-cross.cmake [OPTIONS] ../cmake # compile with MinGW cross-compilers
Presets that have names starting with "windows" are specifically for
compiling LAMMPS :doc:`natively on Windows <Build_windows>` and
@ -220,7 +227,7 @@ The following commands are useful for managing package source files
and their installation when building LAMMPS via traditional make.
Just type ``make`` in lammps/src to see a one-line summary.
These commands install/un-install sets of packages:
These commands install/uninstall sets of packages:
.. code-block:: bash
@ -236,40 +243,40 @@ These commands install/un-install sets of packages:
make yes-ext # install packages that require external libraries
make no-ext # uninstall packages that require external libraries
which install/un-install various sets of packages. Typing ``make
which install/uninstall various sets of packages. Typing ``make
package`` will list all the these commands.
.. note::
Installing or un-installing a package for the make based build process
Installing or uninstalling a package for the make based build process
works by simply copying files back and forth between the main source
directory src and the sub-directories with the package name (e.g.
directory src and the subdirectories with the package name (e.g.
src/KSPACE, src/ATC), so that the files are included or excluded
when LAMMPS is built. Only source files in the src folder will be
compiled.
The following make commands help manage files that exist in both the
src directory and in package sub-directories. You do not normally
src directory and in package subdirectories. You do not normally
need to use these commands unless you are editing LAMMPS files or are
updating LAMMPS via git.
Type ``make package-status`` or ``make ps`` to show which packages are
currently installed. For those that are installed, it will list any
files that are different in the src directory and package
sub-directory.
subdirectory.
Type ``make package-installed`` or ``make pi`` to show which packages are
currently installed, without listing the status of packages that are
not installed.
Type ``make package-update`` or ``make pu`` to overwrite src files with
files from the package sub-directories if the package is installed. It
files from the package subdirectories if the package is installed. It
should be used after the checkout has been :doc:`updated or changed
withy git <Install_git>`, this will only update the files in the package
sub-directories, but not the copies in the src folder.
with git <Install_git>`, this will only update the files in the package
subdirectories, but not the copies in the src folder.
Type ``make package-overwrite`` to overwrite files in the package
sub-directories with src files.
subdirectories with src files.
Type ``make package-diff`` to list all differences between pairs of
files in both the source directory and the package directory.

View File

@ -1,8 +1,8 @@
Optional build settings
=======================
LAMMPS can be built with several optional settings. Each sub-section
explain how to do this for building both with CMake and make.
LAMMPS can be built with several optional settings. Each subsection
explains how to do this for building both with CMake and make.
* `C++11 standard compliance`_ when building all of LAMMPS
* `FFT library`_ for use with the :doc:`kspace_style pppm <kspace_style>` command
@ -41,7 +41,7 @@ FFT library
When the KSPACE package is included in a LAMMPS build, the
:doc:`kspace_style pppm <kspace_style>` command performs 3d FFTs which
require use of an FFT library to compute 1d FFTs. The KISS FFT
library is included with LAMMPS but other libraries can be faster.
library is included with LAMMPS, but other libraries can be faster.
LAMMPS can use them if they are available on your system.
.. tabs::
@ -63,9 +63,9 @@ LAMMPS can use them if they are available on your system.
Usually these settings are all that is needed. If FFTW3 is
selected, then CMake will try to detect, if threaded FFTW
libraries are available and enable them by default. This setting
is independent of whether OpenMP threads are enabled and a
packages like KOKKOS or OPENMP is used. If CMake cannot detect
the FFT library, you can set these variables to assist:
is independent of whether OpenMP threads are enabled and a package
like KOKKOS or OPENMP is used. If CMake cannot detect the FFT
library, you can set these variables to assist:
.. code-block:: bash
@ -141,18 +141,18 @@ The Intel MKL math library is part of the Intel compiler suite. It
can be used with the Intel or GNU compiler (see the ``FFT_LIB`` setting
above).
Performing 3d FFTs in parallel can be time consuming due to data
access and required communication. This cost can be reduced by
performing single-precision FFTs instead of double precision. Single
precision means the real and imaginary parts of a complex datum are
4-byte floats. Double precision means they are 8-byte doubles. Note
that Fourier transform and related PPPM operations are somewhat less
sensitive to floating point truncation errors and thus the resulting
error is less than the difference in precision. Using the ``-DFFT_SINGLE``
setting trades off a little accuracy for reduced memory use and
parallel communication costs for transposing 3d FFT data.
Performing 3d FFTs in parallel can be time-consuming due to data access
and required communication. This cost can be reduced by performing
single-precision FFTs instead of double precision. Single precision
means the real and imaginary parts of a complex datum are 4-byte floats.
Double precision means they are 8-byte doubles. Note that Fourier
transform and related PPPM operations are somewhat less sensitive to
floating point truncation errors, and thus the resulting error is
generally less than the difference in precision. Using the
``-DFFT_SINGLE`` setting trades off a little accuracy for reduced memory
use and parallel communication costs for transposing 3d FFT data.
When using ``-DFFT_SINGLE`` with FFTW3 you may need to build the FFTW
When using ``-DFFT_SINGLE`` with FFTW3, you may need to build the FFTW
library a second time with support for single-precision.
For FFTW3, do the following, which should produce the additional
@ -177,11 +177,11 @@ ARRAY mode.
Size of LAMMPS integer types and size limits
--------------------------------------------
LAMMPS has a few integer data types which can be defined as either
4-byte (= 32-bit) or 8-byte (= 64-bit) integers at compile time.
This has an impact on the size of a system that can be simulated
or how large counters can become before "rolling over".
The default setting of "smallbig" is almost always adequate.
LAMMPS uses a few custom integer data types, which can be defined as
either 4-byte (= 32-bit) or 8-byte (= 64-bit) integers at compile time.
This has an impact on the size of a system that can be simulated, or how
large counters can become before "rolling over". The default setting of
"smallbig" is almost always adequate.
.. tabs::
@ -254,7 +254,7 @@ topology information, though IDs are enabled by default. The
:doc:`atom_modify id no <atom_modify>` command will turn them off. Atom
IDs are required for molecular systems with bond topology (bonds,
angles, dihedrals, etc). Similarly, some force or compute or fix styles
require atom IDs. Thus if you model a molecular system or use one of
require atom IDs. Thus, if you model a molecular system or use one of
those styles with more than 2 billion atoms, you need the "bigbig"
setting.
@ -264,7 +264,7 @@ systems and 500 million for systems with bonds (the additional
restriction is due to using the 2 upper bits of the local atom index
in neighbor lists for storing special bonds info).
Image flags store 3 values per atom in a single integer which count the
Image flags store 3 values per atom in a single integer, which count the
number of times an atom has moved through the periodic box in each
dimension. See the :doc:`dump <dump>` manual page for a discussion. If
an atom moves through the periodic box more than this limit, the value
@ -285,7 +285,7 @@ Output of JPG, PNG, and movie files
--------------------------------------------------
The :doc:`dump image <dump_image>` command has options to output JPEG or
PNG image files. Likewise the :doc:`dump movie <dump_image>` command
PNG image files. Likewise, the :doc:`dump movie <dump_image>` command
outputs movie files in a variety of movie formats. Using these options
requires the following settings:
@ -354,7 +354,7 @@ Read or write compressed files
If this option is enabled, large files can be read or written with
compression by ``gzip`` or similar tools by several LAMMPS commands,
including :doc:`read_data <read_data>`, :doc:`rerun <rerun>`, and
:doc:`dump <dump>`. Currently supported compression tools are:
:doc:`dump <dump>`. Supported compression tools are currently
``gzip``, ``bzip2``, ``zstd``, and ``lzma``.
.. tabs::
@ -394,7 +394,7 @@ Memory allocation alignment
---------------------------------------
This setting enables the use of the "posix_memalign()" call instead of
"malloc()" when LAMMPS allocates large chunks or memory. Vector
"malloc()" when LAMMPS allocates large chunks of memory. Vector
instructions on CPUs may become more efficient, if dynamically allocated
memory is aligned on larger-than-default byte boundaries. On most
current operating systems, the "malloc()" implementation returns
@ -496,7 +496,7 @@ Trigger selected floating-point exceptions
------------------------------------------
Many kinds of CPUs have the capability to detect when a calculation
results in an invalid math operation like a division by zero or calling
results in an invalid math operation, like a division by zero or calling
the square root with a negative argument. The default behavior on
most operating systems is to continue and have values for ``NaN`` (= not
a number) or ``Inf`` (= infinity). This allows software to detect and

View File

@ -24,6 +24,7 @@ table above.
* :doc:`angle_coeff <angle_coeff>`
* :doc:`angle_style <angle_style>`
* :doc:`angle_write <angle_write>`
* :doc:`atom_modify <atom_modify>`
* :doc:`atom_style <atom_style>`
* :doc:`balance <balance>`
@ -31,7 +32,6 @@ table above.
* :doc:`bond_style <bond_style>`
* :doc:`bond_write <bond_write>`
* :doc:`boundary <boundary>`
* :doc:`box <box>`
* :doc:`change_box <change_box>`
* :doc:`clear <clear>`
* :doc:`comm_modify <comm_modify>`
@ -46,6 +46,7 @@ table above.
* :doc:`dielectric <dielectric>`
* :doc:`dihedral_coeff <dihedral_coeff>`
* :doc:`dihedral_style <dihedral_style>`
* :doc:`dihedral_write <dihedral_write>`
* :doc:`dimension <dimension>`
* :doc:`displace_atoms <displace_atoms>`
* :doc:`dump <dump>`
@ -90,8 +91,7 @@ table above.
* :doc:`region <region>`
* :doc:`replicate <replicate>`
* :doc:`rerun <rerun>`
* :doc:`reset_atom_ids <reset_atom_ids>`
* :doc:`reset_mol_ids <reset_mol_ids>`
* :doc:`reset_atoms <reset_atoms>`
* :doc:`reset_timestep <reset_timestep>`
* :doc:`restart <restart>`
* :doc:`run <run>`
@ -127,6 +127,7 @@ additional letter in parenthesis: k = KOKKOS.
* :doc:`group2ndx <group2ndx>`
* :doc:`hyper <hyper>`
* :doc:`kim <kim_commands>`
* :doc:`fitpod <fitpod_command>`
* :doc:`mdi <mdi>`
* :doc:`ndx2group <group2ndx>`
* :doc:`neb <neb>`

View File

@ -44,6 +44,7 @@ OPT.
* :doc:`harmonic (iko) <bond_harmonic>`
* :doc:`harmonic/shift (o) <bond_harmonic_shift>`
* :doc:`harmonic/shift/cut (o) <bond_harmonic_shift_cut>`
* :doc:`lepton (o) <bond_lepton>`
* :doc:`mesocnt <bond_mesocnt>`
* :doc:`mm3 <bond_mm3>`
* :doc:`morse (o) <bond_morse>`
@ -93,6 +94,7 @@ OPT.
* :doc:`fourier/simple (o) <angle_fourier_simple>`
* :doc:`gaussian <angle_gaussian>`
* :doc:`harmonic (iko) <angle_harmonic>`
* :doc:`lepton (o) <angle_lepton>`
* :doc:`mesocnt <angle_mesocnt>`
* :doc:`mm3 <angle_mm3>`
* :doc:`quartic (o) <angle_quartic>`
@ -127,6 +129,7 @@ OPT.
* :doc:`fourier (io) <dihedral_fourier>`
* :doc:`harmonic (iko) <dihedral_harmonic>`
* :doc:`helix (o) <dihedral_helix>`
* :doc:`lepton (o) <dihedral_lepton>`
* :doc:`multi/harmonic (o) <dihedral_multi_harmonic>`
* :doc:`nharmonic (o) <dihedral_nharmonic>`
* :doc:`opls (iko) <dihedral_opls>`

View File

@ -25,7 +25,6 @@ Setup simulation box:
:columns: 4
* :doc:`boundary <boundary>`
* :doc:`box <box>`
* :doc:`change_box <change_box>`
* :doc:`create_box <create_box>`
* :doc:`dimension <dimension>`

View File

@ -57,6 +57,7 @@ KOKKOS, o = OPENMP, t = OPT.
* :doc:`dpd/atom <compute_dpd_atom>`
* :doc:`edpd/temp/atom <compute_edpd_temp_atom>`
* :doc:`efield/atom <compute_efield_atom>`
* :doc:`efield/wolf/atom <compute_efield_wolf_atom>`
* :doc:`entropy/atom <compute_entropy_atom>`
* :doc:`erotate/asphere <compute_erotate_asphere>`
* :doc:`erotate/rigid <compute_erotate_rigid>`
@ -87,7 +88,6 @@ KOKKOS, o = OPENMP, t = OPT.
* :doc:`ke/atom/eff <compute_ke_atom_eff>`
* :doc:`ke/eff <compute_ke_eff>`
* :doc:`ke/rigid <compute_ke_rigid>`
* :doc:`mesont <compute_mesont>`
* :doc:`mliap <compute_mliap>`
* :doc:`momentum <compute_momentum>`
* :doc:`msd <compute_msd>`
@ -107,6 +107,7 @@ KOKKOS, o = OPENMP, t = OPT.
* :doc:`pressure/uef <compute_pressure_uef>`
* :doc:`property/atom <compute_property_atom>`
* :doc:`property/chunk <compute_property_chunk>`
* :doc:`property/grid <compute_property_grid>`
* :doc:`property/local <compute_property_local>`
* :doc:`ptm/atom <compute_ptm_atom>`
* :doc:`rdf <compute_rdf>`

View File

@ -36,7 +36,8 @@ An alphabetic list of all LAMMPS :doc:`dump <dump>` commands.
* :doc:`custom/mpiio <dump>`
* :doc:`custom/zstd <dump>`
* :doc:`dcd <dump>`
* :doc:`deprecated <dump>`
* :doc:`grid <dump>`
* :doc:`grid/vtk <dump>`
* :doc:`h5md <dump_h5md>`
* :doc:`image <dump_image>`
* :doc:`local <dump>`

View File

@ -38,14 +38,12 @@ OPT.
* :doc:`ave/chunk <fix_ave_chunk>`
* :doc:`ave/correlate <fix_ave_correlate>`
* :doc:`ave/correlate/long <fix_ave_correlate_long>`
* :doc:`ave/grid <fix_ave_grid>`
* :doc:`ave/histo <fix_ave_histo>`
* :doc:`ave/histo/weight <fix_ave_histo>`
* :doc:`ave/time <fix_ave_time>`
* :doc:`aveforce <fix_aveforce>`
* :doc:`balance <fix_balance>`
* :doc:`brownian <fix_brownian>`
* :doc:`brownian/asphere <fix_brownian>`
* :doc:`brownian/sphere <fix_brownian>`
* :doc:`bocs <fix_bocs>`
* :doc:`bond/break <fix_bond_break>`
* :doc:`bond/create <fix_bond_create>`
@ -53,6 +51,9 @@ OPT.
* :doc:`bond/react <fix_bond_react>`
* :doc:`bond/swap <fix_bond_swap>`
* :doc:`box/relax <fix_box_relax>`
* :doc:`brownian <fix_brownian>`
* :doc:`brownian/asphere <fix_brownian>`
* :doc:`brownian/sphere <fix_brownian>`
* :doc:`charge/regulation <fix_charge_regulation>`
* :doc:`cmap <fix_cmap>`
* :doc:`colvars <fix_colvars>`
@ -65,13 +66,13 @@ OPT.
* :doc:`drude <fix_drude>`
* :doc:`drude/transform/direct <fix_drude_transform>`
* :doc:`drude/transform/inverse <fix_drude_transform>`
* :doc:`dt/reset <fix_dt_reset>`
* :doc:`dt/reset (k) <fix_dt_reset>`
* :doc:`edpd/source <fix_dpd_source>`
* :doc:`efield <fix_efield>`
* :doc:`ehex <fix_ehex>`
* :doc:`electrode/conp (i) <fix_electrode_conp>`
* :doc:`electrode/conq (i) <fix_electrode_conp>`
* :doc:`electrode/thermo (i) <fix_electrode_conp>`
* :doc:`electrode/conp (i) <fix_electrode>`
* :doc:`electrode/conq (i) <fix_electrode>`
* :doc:`electrode/thermo (i) <fix_electrode>`
* :doc:`electron/stopping <fix_electron_stopping>`
* :doc:`electron/stopping/fit <fix_electron_stopping>`
* :doc:`enforce2d (k) <fix_enforce2d>`
@ -213,6 +214,7 @@ OPT.
* :doc:`saed/vtk <fix_saed_vtk>`
* :doc:`setforce (k) <fix_setforce>`
* :doc:`setforce/spin <fix_setforce>`
* :doc:`sgcmc <fix_sgcmc>`
* :doc:`shake (k) <fix_shake>`
* :doc:`shardlow (k) <fix_shardlow>`
* :doc:`smd <fix_smd>`
@ -249,7 +251,7 @@ OPT.
* :doc:`tune/kspace <fix_tune_kspace>`
* :doc:`vector <fix_vector>`
* :doc:`viscosity <fix_viscosity>`
* :doc:`viscous <fix_viscous>`
* :doc:`viscous (k) <fix_viscous>`
* :doc:`viscous/sphere <fix_viscous_sphere>`
* :doc:`wall/body/polygon <fix_wall_body_polygon>`
* :doc:`wall/body/polyhedron <fix_wall_body_polyhedron>`

View File

@ -39,7 +39,7 @@ OPT.
* :doc:`agni (o) <pair_agni>`
* :doc:`airebo (io) <pair_airebo>`
* :doc:`airebo/morse (io) <pair_airebo>`
* :doc:`amoeba <pair_amoeba>`
* :doc:`amoeba (g) <pair_amoeba>`
* :doc:`atm <pair_atm>`
* :doc:`awpmd/cut <pair_awpmd>`
* :doc:`beck (go) <pair_beck>`
@ -93,8 +93,8 @@ OPT.
* :doc:`coul/wolf/cs <pair_cs>`
* :doc:`dpd (giko) <pair_dpd>`
* :doc:`dpd/fdt <pair_dpd_fdt>`
* :doc:`dpd/ext (k) <pair_dpd_ext>`
* :doc:`dpd/ext/tstat (k) <pair_dpd_ext>`
* :doc:`dpd/ext (ko) <pair_dpd_ext>`
* :doc:`dpd/ext/tstat (ko) <pair_dpd_ext>`
* :doc:`dpd/fdt/energy (k) <pair_dpd_fdt>`
* :doc:`dpd/tstat (gko) <pair_dpd>`
* :doc:`dsmc <pair_dsmc>`
@ -126,7 +126,7 @@ OPT.
* :doc:`hbond/dreiding/lj (o) <pair_hbond_dreiding>`
* :doc:`hbond/dreiding/morse (o) <pair_hbond_dreiding>`
* :doc:`hdnnp <pair_hdnnp>`
* :doc:`hippo <pair_amoeba>`
* :doc:`hippo (g) <pair_amoeba>`
* :doc:`ilp/graphene/hbn (t) <pair_ilp_graphene_hbn>`
* :doc:`ilp/tmd (t) <pair_ilp_tmd>`
* :doc:`kolmogorov/crespi/full <pair_kolmogorov_crespi_full>`
@ -134,6 +134,8 @@ OPT.
* :doc:`lcbop <pair_lcbop>`
* :doc:`lebedeva/z <pair_lebedeva_z>`
* :doc:`lennard/mdf <pair_mdf>`
* :doc:`lepton (o) <pair_lepton>`
* :doc:`lepton/coul (o) <pair_lepton>`
* :doc:`line/lj <pair_line_lj>`
* :doc:`lj/charmm/coul/charmm (giko) <pair_charmm>`
* :doc:`lj/charmm/coul/charmm/implicit (ko) <pair_charmm>`
@ -164,7 +166,7 @@ OPT.
* :doc:`lj/cut/coul/msm (go) <pair_lj_cut_coul>`
* :doc:`lj/cut/coul/msm/dielectric <pair_dielectric>`
* :doc:`lj/cut/coul/wolf (o) <pair_lj_cut_coul>`
* :doc:`lj/cut/dipole/cut (go) <pair_dipole>`
* :doc:`lj/cut/dipole/cut (gko) <pair_dipole>`
* :doc:`lj/cut/dipole/long (g) <pair_dipole>`
* :doc:`lj/cut/dipole/sf (go) <pair_dipole>`
* :doc:`lj/cut/soft (o) <pair_fep_soft>`
@ -173,7 +175,7 @@ OPT.
* :doc:`lj/cut/tip4p/long (got) <pair_lj_cut_tip4p>`
* :doc:`lj/cut/tip4p/long/soft (o) <pair_fep_soft>`
* :doc:`lj/expand (gko) <pair_lj_expand>`
* :doc:`lj/expand/coul/long (g) <pair_lj_expand>`
* :doc:`lj/expand/coul/long (gk) <pair_lj_expand>`
* :doc:`lj/gromacs (gko) <pair_gromacs>`
* :doc:`lj/gromacs/coul/gromacs (ko) <pair_gromacs>`
* :doc:`lj/long/coul/long (iot) <pair_lj_long>`
@ -198,11 +200,11 @@ OPT.
* :doc:`mdpd <pair_mesodpd>`
* :doc:`mdpd/rhosum <pair_mesodpd>`
* :doc:`meam (k) <pair_meam>`
* :doc:`meam/ms (k) <pair_meam>`
* :doc:`meam/spline (o) <pair_meam_spline>`
* :doc:`meam/sw/spline <pair_meam_sw_spline>`
* :doc:`mesocnt <pair_mesocnt>`
* :doc:`mesocnt/viscous <pair_mesocnt>`
* :doc:`mesont/tpm <pair_mesont_tpm>`
* :doc:`mgpt <pair_mgpt>`
* :doc:`mie/cut (g) <pair_mie>`
* :doc:`mliap (k) <pair_mliap>`
@ -236,7 +238,8 @@ OPT.
* :doc:`oxrna2/xstk <pair_oxrna2>`
* :doc:`oxrna2/coaxstk <pair_oxrna2>`
* :doc:`pace (k) <pair_pace>`
* :doc:`pace/extrapolation <pair_pace>`
* :doc:`pace/extrapolation (k) <pair_pace>`
* :doc:`pod <pair_pod>`
* :doc:`peri/eps <pair_peri>`
* :doc:`peri/lps (o) <pair_peri>`
* :doc:`peri/pmb (o) <pair_peri>`

View File

@ -2,14 +2,17 @@ Removed commands and packages
=============================
This page lists LAMMPS commands and packages that have been removed from
the distribution and provides suggestions for alternatives or replacements.
LAMMPS has special dummy styles implemented, that will stop LAMMPS and
print a suitable error message in most cases, when a style/command is used
that has been removed.
the distribution and provides suggestions for alternatives or
replacements. LAMMPS has special dummy styles implemented, that will
stop LAMMPS and print a suitable error message in most cases, when a
style/command is used that has been removed or will replace the command
with the direct alternative (if available) and print a warning.
Fix ave/spatial and fix ave/spatial/sphere
------------------------------------------
.. deprecated:: 11Dec2015
The fixes ave/spatial and ave/spatial/sphere have been removed from LAMMPS
since they were superseded by the more general and extensible "chunk
infrastructure". Here the system is partitioned in one of many possible
@ -17,10 +20,23 @@ ways through the :doc:`compute chunk/atom <compute_chunk_atom>` command
and then averaging is done using :doc:`fix ave/chunk <fix_ave_chunk>`.
Please refer to the :doc:`chunk HOWTO <Howto_chunk>` section for an overview.
Reset_ids command
-----------------
Box command
-----------
The reset_ids command has been renamed to :doc:`reset_atom_ids <reset_atom_ids>`.
.. deprecated:: 22Dec2022
The *box* command has been removed and the LAMMPS code changed so it won't
be needed. If present, LAMMPS will ignore the command and print a warning.
Reset_ids, reset_atom_ids, reset_mol_ids commands
-------------------------------------------------
.. deprecated:: 22Dec2022
The *reset_ids*, *reset_atom_ids*, and *reset_mol_ids* commands have
been folded into the :doc:`reset_atoms <reset_atoms>` command. If
present, LAMMPS will replace the commands accordingly and print a
warning.
MEAM package
------------
@ -30,18 +46,42 @@ The code in the :ref:`MEAM package <PKG-MEAM>` is a translation of the
Fortran code of MEAM into C++, which removes several restrictions
(e.g. there can be multiple instances in hybrid pair styles) and allows
for some optimizations leading to better performance. The pair style
:doc:`meam <pair_meam>` has the exact same syntax.
:doc:`meam <pair_meam>` has the exact same syntax. For a transition
period the C++ version of MEAM was called USER-MEAMC so it could
coexist with the Fortran version.
Minimize style fire/old
-----------------------
.. deprecated:: 8Feb2023
Minimize style *fire/old* has been removed. Its functionality can be
reproduced with *fire* with specific options. Please see the
:doc:`min_modify command <min_modify>` documentation for details.
Pair style mesont/tpm, compute style mesont, atom style mesont
--------------------------------------------------------------
.. deprecated:: 8Feb2023
Pair style *mesont/tpm*, compute style *mesont*, and atom style
*mesont* have been removed from the :ref:`MESONT package <PKG-MESONT>`.
The same functionality is available through
:doc:`pair style mesocnt <pair_mesocnt>`,
:doc:`bond style mesocnt <bond_mesocnt>` and
:doc:`angle style mesocnt <angle_mesocnt>`.
REAX package
------------
The REAX package has been removed since it was superseded by the
:ref:`REAXFF package <PKG-REAXFF>`. The REAXFF
package has been tested to yield equivalent results to the REAX package,
offers better performance, supports OpenMP multi-threading via OPENMP,
and GPU and threading parallelization through KOKKOS. The new pair styles
are not syntax compatible with the removed reax pair style, so input
files will have to be adapted.
:ref:`REAXFF package <PKG-REAXFF>`. The REAXFF package has been tested
to yield equivalent results to the REAX package, offers better
performance, supports OpenMP multi-threading via OPENMP, and GPU and
threading parallelization through KOKKOS. The new pair styles are not
syntax compatible with the removed reax pair style, so input files will
have to be adapted. The REAXFF package was originally called
USER-REAXC.
USER-CUDA package
-----------------
@ -60,5 +100,6 @@ restart2data tool
The functionality of the restart2data tool has been folded into the
LAMMPS executable directly instead of having a separate tool. A
combination of the commands :doc:`read_restart <read_restart>` and
:doc:`write_data <write_data>` can be used to the same effect. For added
convenience this conversion can also be triggered by :doc:`command line flags <Run_options>`
:doc:`write_data <write_data>` can be used to the same effect. For
added convenience this conversion can also be triggered by
:doc:`command line flags <Run_options>`

View File

@ -23,3 +23,4 @@ of time and requests from the LAMMPS user community.
Classes
Developer_platform
Developer_utils
Developer_grid

View File

@ -1,56 +1,57 @@
Code design
-----------
This section explains some of the code design choices in LAMMPS with
the goal of helping developers write new code similar to the existing
code. Please see the section on :doc:`Requirements for contributed
code <Modify_style>` for more specific recommendations and guidelines.
While that section is organized more in the form of a checklist for
code contributors, the focus here is on overall code design strategy,
choices made between possible alternatives, and discussing some
relevant C++ programming language constructs.
This section explains some code design choices in LAMMPS with the goal
of helping developers write new code similar to the existing code.
Please see the section on :doc:`Requirements for contributed code
<Modify_style>` for more specific recommendations and guidelines. While
that section is organized more in the form of a checklist for code
contributors, the focus here is on overall code design strategy, choices
made between possible alternatives, and discussing some relevant C++
programming language constructs.
Historically, the basic design philosophy of the LAMMPS C++ code was a
"C with classes" style. The motivation was to make it easy to modify
LAMMPS for people without significant training in C++ programming.
Data structures and code constructs were used that resemble the
previous implementation(s) in Fortran. A contributing factor to this
choice also was that at the time, C++ compilers were often not mature
and some of the advanced features contained bugs or did not function
as the standard required. There were also disagreements between
compiler vendors as to how to interpret the C++ standard documents.
LAMMPS for people without significant training in C++ programming. Data
structures and code constructs were used that resemble the previous
implementation(s) in Fortran. A contributing factor to this choice was
that at the time, C++ compilers were often not mature and some advanced
features contained bugs or did not function as the standard required.
There were also disagreements between compiler vendors as to how to
interpret the C++ standard documents.
However, C++ compilers have now advanced significantly. In 2020 we
decided to to require the C++11 standard as the minimum C++ language
standard for LAMMPS. Since then we have begun to also replace some of
the C-style constructs with equivalent C++ functionality, either from
the C++ standard library or as custom classes or functions, in order
to improve readability of the code and to increase code reuse through
abstraction of commonly used functionality.
However, C++ compilers and the C++ programming language have advanced
significantly. In 2020, the LAMMPS developers decided to require the
C++11 standard as the minimum C++ language standard for LAMMPS. Since
then, we have begun to replace C-style constructs with equivalent C++
functionality. This was taken either from the C++ standard library or
implemented as custom classes or functions. The goal is to improve
readability of the code and to increase code reuse through abstraction
of commonly used functionality.
.. note::
Please note that as of spring 2022 there is still a sizable chunk
of legacy code in LAMMPS that has not yet been refactored to
reflect these style conventions in full. LAMMPS has a large code
base and many different contributors and there also is a hierarchy
of precedence in which the code is adapted. Highest priority has
been the code in the ``src`` folder, followed by code in packages
in order of their popularity and complexity (simpler code is
adapted sooner), followed by code in the ``lib`` folder. Source
code that is downloaded from external packages or libraries during
compilation is not subject to the conventions discussed here.
Please note that as of spring 2023 there is still a sizable chunk of
legacy code in LAMMPS that has not yet been refactored to reflect
these style conventions in full. LAMMPS has a large code base and
many contributors. There is also a hierarchy of precedence in which
the code is adapted. Highest priority has been the code in the
``src`` folder, followed by code in packages in order of their
popularity and complexity (simpler code gets adapted sooner), followed
by code in the ``lib`` folder. Source code that is downloaded from
external packages or libraries during compilation is not subject to
the conventions discussed here.
Object oriented code
Object-oriented code
^^^^^^^^^^^^^^^^^^^^
LAMMPS is designed to be an object oriented code. Each simulation is
LAMMPS is designed to be an object-oriented code. Each simulation is
represented by an instance of the LAMMPS class. When running in
parallel each MPI process creates such an instance. This can be seen
parallel, each MPI process creates such an instance. This can be seen
in the ``main.cpp`` file where the core steps of running a LAMMPS
simulation are the following 3 lines of code:
.. code-block:: C++
.. code-block:: c++
LAMMPS *lammps = new LAMMPS(argc, argv, lammps_comm);
lammps->input->file();
@ -67,29 +68,29 @@ other special features.
The basic LAMMPS class hierarchy which is created by the LAMMPS class
constructor is shown in :ref:`class-topology`. When input commands
are processed, additional class instances are created, or deleted, or
replaced. Likewise specific member functions of specific classes are
replaced. Likewise, specific member functions of specific classes are
called to trigger actions such creating atoms, computing forces,
computing properties, time-propagating the system, or writing output.
Compositing and Inheritance
===========================
LAMMPS makes extensive use of the object oriented programming (OOP)
LAMMPS makes extensive use of the object-oriented programming (OOP)
principles of *compositing* and *inheritance*. Classes like the
``LAMMPS`` class are a **composite** containing pointers to instances
of other classes like ``Atom``, ``Comm``, ``Force``, ``Neighbor``,
``Modify``, and so on. Each of these classes implement certain
``Modify``, and so on. Each of these classes implements certain
functionality by storing and manipulating data related to the
simulation and providing member functions that trigger certain
actions. Some of those classes like ``Force`` are themselves
composites, containing instances of classes describing different force
interactions. Similarly the ``Modify`` class contains a list of
interactions. Similarly, the ``Modify`` class contains a list of
``Fix`` and ``Compute`` classes. If the input commands that
correspond to these classes include the word *style*, then LAMMPS
stores only a single instance of that class. E.g. *atom_style*,
*comm_style*, *pair_style*, *bond_style*. It the input command does
not include the word *style*, there can be many instances of that
class defined. E.g. *region*, *fix*, *compute*, *dump*.
*comm_style*, *pair_style*, *bond_style*. If the input command does
**not** include the word *style*, then there may be many instances of
that class defined, for example *region*, *fix*, *compute*, *dump*.
**Inheritance** enables creation of *derived* classes that can share
common functionality in their base class while providing a consistent
@ -100,19 +101,18 @@ derived class variant was instantiated. In LAMMPS these derived
classes are often referred to as "styles", e.g. pair styles, fix
styles, atom styles and so on.
This is the origin of the flexibility of LAMMPS. For example pair
This is the origin of the flexibility of LAMMPS. For example, pair
styles implement a variety of different non-bonded interatomic
potentials functions. All details for the implementation of a
potential are stored and executed in a single class.
As mentioned above, there can be multiple instances of classes derived
from the ``Fix`` or ``Compute`` base classes. They represent a
different facet of LAMMPS flexibility as they provide methods which
can be called at different points in time within a timestep, as
explained in `Developer_flow`. This allows the input script to tailor
how a specific simulation is run, what diagnostic computations are
performed, and how the output of those computations is further
processed or output.
different facet of LAMMPS' flexibility, as they provide methods which
can be called at different points within a timestep, as explained in
`Developer_flow`. This allows the input script to tailor how a specific
simulation is run, what diagnostic computations are performed, and how
the output of those computations is further processed or output.
Additional code sharing is possible by creating derived classes from the
derived classes (e.g., to implement an accelerated version of a pair
@ -164,15 +164,15 @@ The difference in behavior of the ``normal()`` and the ``poly()`` member
functions is which of the two member functions is called when executing
`base1->call()` versus `base2->call()`. Without polymorphism, a
function within the base class can only call member functions within the
same scope, that is ``Base::call()`` will always call
``Base::normal()``. But for the `base2->call()` case the call of the
same scope: that is, ``Base::call()`` will always call
``Base::normal()``. But for the `base2->call()` case, the call of the
virtual member function will be dispatched to ``Derived::poly()``
instead. This mechanism means that functions are called within the
scope of the class type that was used to *create* the class instance are
invoked; even if they are assigned to a pointer using the type of a base
class. This is the desired behavior and this way LAMMPS can even use
styles that are loaded at runtime from a shared object file with the
:doc:`plugin command <plugin>`.
instead. This mechanism results in calling functions that are within
the scope of the class that was used to *create* the instance, even if
they are assigned to a pointer for their base class. This is the
desired behavior, and this way LAMMPS can even use styles that are loaded
at runtime from a shared object file with the :doc:`plugin command
<plugin>`.
A special case of virtual functions are so-called pure functions. These
are virtual functions that are initialized to 0 in the class declaration
@ -189,12 +189,12 @@ This has the effect that an instance of the base class cannot be
created and that derived classes **must** implement these functions.
Many of the functions listed with the various class styles in the
section :doc:`Modify` are pure functions. The motivation for this is
to define the interface or API of the functions but defer their
to define the interface or API of the functions, but defer their
implementation to the derived classes.
However, there are downsides to this. For example, calls to virtual
functions from within a constructor, will not be in the scope of the
derived class and thus it is good practice to either avoid calling them
functions from within a constructor, will *not* be in the scope of the
derived class, and thus it is good practice to either avoid calling them
or to provide an explicit scope such as ``Base::poly()`` or
``Derived::poly()``. Furthermore, any destructors in classes containing
virtual functions should be declared virtual too, so they will be
@ -208,8 +208,8 @@ dispatch.
that are intended to replace a virtual or pure function use the
``override`` property keyword. For the same reason, the use of
overloads or default arguments for virtual functions should be
avoided as they lead to confusion over which function is supposed to
override which and which arguments need to be declared.
avoided, as they lead to confusion over which function is supposed to
override which, and which arguments need to be declared.
Style Factories
===============
@ -219,10 +219,10 @@ uses a programming pattern called `Factory`. Those are functions that
create an instance of a specific derived class, say ``PairLJCut`` and
return a pointer to the type of the common base class of that style,
``Pair`` in this case. To associate the factory function with the
style keyword, an ``std::map`` class is used with function pointers
style keyword, a ``std::map`` class is used with function pointers
indexed by their keyword (for example "lj/cut" for ``PairLJCut`` and
"morse" for ``PairMorse``). A couple of typedefs help keep the code
readable and a template function is used to implement the actual
readable, and a template function is used to implement the actual
factory functions for the individual classes. Below is an example
of such a factory function from the ``Force`` class as declared in
``force.h`` and implemented in ``force.cpp``. The file ``style_pair.h``
@ -232,7 +232,7 @@ macro ``PairStyle()`` will associate the style name "lj/cut"
with a factory function creating an instance of the ``PairLJCut``
class.
.. code-block:: C++
.. code-block:: c++
// from force.h
typedef Pair *(*PairCreator)(LAMMPS *);
@ -279,26 +279,26 @@ from and writing to files and console instead of C++ "iostreams".
This is mainly motivated by better performance, better control over
formatting, and less effort to achieve specific formatting.
Since mixing "stdio" and "iostreams" can lead to unexpected
behavior. use of the latter is strongly discouraged. Also output to
the screen should not use the predefined ``stdout`` FILE pointer, but
rather the ``screen`` and ``logfile`` FILE pointers managed by the
LAMMPS class. Furthermore, output should generally only be done by
MPI rank 0 (``comm->me == 0``). Output that is sent to both
``screen`` and ``logfile`` should use the :cpp:func:`utils::logmesg()
convenience function <LAMMPS_NS::utils::logmesg>`.
Since mixing "stdio" and "iostreams" can lead to unexpected behavior,
use of the latter is strongly discouraged. Output to the screen should
*not* use the predefined ``stdout`` FILE pointer, but rather the
``screen`` and ``logfile`` FILE pointers managed by the LAMMPS class.
Furthermore, output should generally only be done by MPI rank 0
(``comm->me == 0``). Output that is sent to both ``screen`` and
``logfile`` should use the :cpp:func:`utils::logmesg() convenience
function <LAMMPS_NS::utils::logmesg>`.
We also discourage the use of stringstreams because the bundled {fmt}
library and the customized tokenizer classes can provide the same
functionality in a cleaner way with better performance. This also
helps maintain a consistent programming syntax with code from many
different contributors.
We discourage the use of stringstreams because the bundled {fmt} library
and the customized tokenizer classes provide the same functionality in a
cleaner way with better performance. This also helps maintain a
consistent programming syntax with code from many different
contributors.
Formatting with the {fmt} library
===================================
The LAMMPS source code includes a copy of the `{fmt} library
<https://fmt.dev>`_ which is preferred over formatting with the
<https://fmt.dev>`_, which is preferred over formatting with the
"printf()" family of functions. The primary reason is that it allows
a typesafe default format for any type of supported data. This is
particularly useful for formatting integers of a given size (32-bit or
@ -313,17 +313,16 @@ been included into the C++20 language standard, so changes to adopt it
are future-proof.
Formatted strings are frequently created by calling the
``fmt::format()`` function which will return a string as a
``std::string`` class instance. In contrast to the ``%`` placeholder
in ``printf()``, the {fmt} library uses ``{}`` to embed format
descriptors. In the simplest case, no additional characters are
needed as {fmt} will choose the default format based on the data type
of the argument. Otherwise the ``fmt::print()`` function may be
used instead of ``printf()`` or ``fprintf()``. In addition, several
LAMMPS output functions, that originally accepted a single string as
argument have been overloaded to accept a format string with optional
arguments as well (e.g., ``Error::all()``, ``Error::one()``,
``utils::logmesg()``).
``fmt::format()`` function, which will return a string as a
``std::string`` class instance. In contrast to the ``%`` placeholder in
``printf()``, the {fmt} library uses ``{}`` to embed format descriptors.
In the simplest case, no additional characters are needed, as {fmt} will
choose the default format based on the data type of the argument.
Otherwise, the ``fmt::print()`` function may be used instead of
``printf()`` or ``fprintf()``. In addition, several LAMMPS output
functions, that originally accepted a single string as argument have
been overloaded to accept a format string with optional arguments as
well (e.g., ``Error::all()``, ``Error::one()``, ``utils::logmesg()``).
Summary of the {fmt} format syntax
==================================
@ -332,10 +331,11 @@ The syntax of the format string is "{[<argument id>][:<format spec>]}",
where either the argument id or the format spec (separated by a colon
':') is optional. The argument id is usually a number starting from 0
that is the index to the arguments following the format string. By
default these are assigned in order (i.e. 0, 1, 2, 3, 4 etc.). The most
common case for using argument id would be to use the same argument in
multiple places in the format string without having to provide it as an
argument multiple times. In LAMMPS the argument id is rarely used.
default, these are assigned in order (i.e. 0, 1, 2, 3, 4 etc.). The
most common case for using argument id would be to use the same argument
in multiple places in the format string without having to provide it as
an argument multiple times. The argument id is rarely used in the LAMMPS
source code.
More common is the use of a format specifier, which starts with a colon.
This may optionally be followed by a fill character (default is ' '). If
@ -347,20 +347,21 @@ width, which may be followed by a dot '.' and a precision for floating
point numbers. The final character in the format string would be an
indicator for the "presentation", i.e. 'd' for decimal presentation of
integers, 'x' for hexadecimal, 'o' for octal, 'c' for character etc.
This mostly follows the "printf()" scheme but without requiring an
This mostly follows the "printf()" scheme, but without requiring an
additional length parameter to distinguish between different integer
widths. The {fmt} library will detect those and adapt the formatting
accordingly. For floating point numbers there are correspondingly, 'g'
for generic presentation, 'e' for exponential presentation, and 'f' for
fixed point presentation.
Thus "{:8}" would represent *any* type argument using at least 8
characters; "{:<8}" would do this as left aligned, "{:^8}" as centered,
"{:>8}" as right aligned. If a specific presentation is selected, the
argument type must be compatible or else the {fmt} formatting code will
throw an exception. Some format string examples are given below:
The format string "{:8}" would thus represent *any* type argument and be
replaced by at least 8 characters; "{:<8}" would do this as left
aligned, "{:^8}" as centered, "{:>8}" as right aligned. If a specific
presentation is selected, the argument type must be compatible or else
the {fmt} formatting code will throw an exception. Some format string
examples are given below:
.. code-block:: C
.. code-block:: c++
auto mesg = fmt::format(" CPU time: {:4d}:{:02d}:{:02d}\n", cpuh, cpum, cpus);
mesg = fmt::format("{:<8s}| {:<10.5g} | {:<10.5g} | {:<10.5g} |{:6.1f} |{:6.2f}\n",
@ -392,12 +393,12 @@ documentation <https://fmt.dev/latest/syntax.html>`_ website.
Memory management
^^^^^^^^^^^^^^^^^
Dynamical allocation of small data and objects can be done with the
the C++ commands "new" and "delete/delete[]. Large data should use
the member functions of the ``Memory`` class, most commonly,
``Memory::create()``, ``Memory::grow()``, and ``Memory::destroy()``,
which provide variants for vectors, 2d arrays, 3d arrays, etc.
These can also be used for small data.
Dynamical allocation of small data and objects can be done with the C++
commands "new" and "delete/delete[]". Large data should use the member
functions of the ``Memory`` class, most commonly, ``Memory::create()``,
``Memory::grow()``, and ``Memory::destroy()``, which provide variants
for vectors, 2d arrays, 3d arrays, etc. These can also be used for
small data.
The use of ``malloc()``, ``calloc()``, ``realloc()`` and ``free()``
directly is strongly discouraged. To simplify adapting legacy code
@ -408,26 +409,24 @@ perform additional error checks for safety.
Use of these custom memory allocation functions is motivated by the
following considerations:
- memory allocation failures on *any* MPI rank during a parallel run
will trigger an immediate abort of the entire parallel calculation
instead of stalling it
- a failing "new" will trigger an exception which is also captured by
LAMMPS and triggers a global abort
- allocation of multi-dimensional arrays will be done in a C compatible
fashion but so that the storage of the actual data is stored in one
large contiguous block. Thus when MPI communication is needed,
- Memory allocation failures on *any* MPI rank during a parallel run
will trigger an immediate abort of the entire parallel calculation.
- A failing "new" will trigger an exception, which is also captured by
LAMMPS and triggers a global abort.
- Allocation of multidimensional arrays will be done in a C compatible
fashion, but such that the storage of the actual data is stored in one
large contiguous block. Thus, when MPI communication is needed,
the data can be communicated directly (similar to Fortran arrays).
- the "destroy()" and "sfree()" functions may safely be called on NULL
pointers
- the "destroy()" functions will nullify the pointer variables making
"use after free" errors easy to detect
- it is possible to use a larger than default memory alignment (not on
- The "destroy()" and "sfree()" functions may safely be called on NULL
pointers.
- The "destroy()" functions will nullify the pointer variables, thus
making "use after free" errors easy to detect.
- It is possible to use a larger than default memory alignment (not on
all operating systems, since the allocated storage pointers must be
compatible with ``free()`` for technical reasons)
compatible with ``free()`` for technical reasons).
In the practical implementation of code this means that any pointer
variables that are class members should be initialized to a
``nullptr`` value in their respective constructors. That way it is
safe to call ``Memory::destroy()`` or ``delete[]`` on them before
*any* allocation outside the constructor. This helps prevent memory
leaks.
In the practical implementation of code this means, that any pointer
variables, that are class members should be initialized to a ``nullptr``
value in their respective constructors. That way, it is safe to call
``Memory::destroy()`` or ``delete[]`` on them before *any* allocation
outside the constructor. This helps prevent memory leaks.

View File

@ -14,8 +14,8 @@ Owned and ghost atoms
As described on the :doc:`parallel partitioning algorithms
<Developer_par_part>` page, LAMMPS spatially decomposes the simulation
domain, either in a *brick* or *tiled* manner. Each processor (MPI
task) owns atoms within its sub-domain and additionally stores ghost
atoms within a cutoff distance of its sub-domain.
task) owns atoms within its subdomain and additionally stores ghost
atoms within a cutoff distance of its subdomain.
Forward and reverse communication
=================================
@ -28,7 +28,7 @@ The need to do this communication arises when data from the owned atoms
is updated (e.g. their positions) and this updated information needs to
be **copied** to the corresponding ghost atoms.
And second, *reverse communication* which sends ghost atom information
And second, *reverse communication*, which sends ghost atom information
from each processor to the owning processor to **accumulate** (sum)
the values with the corresponding owned atoms. The need for this
arises when data is computed and also stored with ghost atoms
@ -58,7 +58,7 @@ embedded-atom method (EAM) which compute intermediate values in the
first part of the compute() function that need to be stored by both
owned and ghost atoms for the second part of the force computation.
The *Comm* class methods perform the MPI communication for buffers of
per-atom data. They "call back" to the *Pair* class so it can *pack*
per-atom data. They "call back" to the *Pair* class, so it can *pack*
or *unpack* the buffer with data the *Pair* class owns. There are 4
such methods that the *Pair* class must define, assuming it uses both
forward and reverse communication:
@ -70,7 +70,7 @@ forward and reverse communication:
The arguments to these methods include the buffer and a list of atoms
to pack or unpack. The *Pair* class also must set the *comm_forward*
and *comm_reverse* variables which store the number of values stored
and *comm_reverse* variables, which store the number of values stored
in the communication buffers for each operation. This means, if
desired, it can choose to store multiple per-atom values in the
buffer, and they will be communicated together to minimize
@ -81,11 +81,11 @@ containing ``double`` values. To correctly store integers that may be
The *Fix*, *Compute*, and *Dump* classes can also invoke the same kind
of forward and reverse communication operations using the same *Comm*
class methods. Likewise the same pack/unpack methods and
class methods. Likewise, the same pack/unpack methods and
comm_forward/comm_reverse variables must be defined by the calling
*Fix*, *Compute*, or *Dump* class.
For *Fix* classes there is an optional second argument to the
For *Fix* classes, there is an optional second argument to the
*forward_comm()* and *reverse_comm()* call which can be used when the
fix performs multiple modes of communication, with different numbers
of values per atom. The fix should set the *comm_forward* and
@ -150,7 +150,7 @@ latter case, when the *ring* operation is complete, each processor can
examine its original buffer to extract modified values.
Note that the *ring* operation is similar to an MPI_Alltoall()
operation where every processor effectively sends and receives data to
operation, where every processor effectively sends and receives data to
every other processor. The difference is that the *ring* operation
does it one step at a time, so the total volume of data does not need
to be stored by every processor. However, the *ring* operation is
@ -184,8 +184,8 @@ The *exchange_data()* method triggers the communication to be
performed. Each processor provides the vector of *N* datums to send,
and the size of each datum. All datums must be the same size.
The *create_atom()* and *exchange_atom()* methods are similar except
that the size of each datum can be different. Typically this is used
The *create_atom()* and *exchange_atom()* methods are similar, except
that the size of each datum can be different. Typically, this is used
to communicate atoms, each with a variable amount of per-atom data, to
other processors.

View File

@ -45,9 +45,9 @@ other methods in the class.
zero before each timestep, so that forces (torques, etc) can be
accumulated.
Now for the ``Verlet::run()`` method. Its basic structure in hi-level pseudo
code is shown below. In the actual code in ``src/verlet.cpp`` some of
these operations are conditionally invoked.
Now for the ``Verlet::run()`` method. Its basic structure in hi-level
pseudocode is shown below. In the actual code in ``src/verlet.cpp``
some of these operations are conditionally invoked.
.. code-block:: python
@ -105,17 +105,17 @@ need it. These flags are passed to the various methods that compute
particle interactions, so that they either compute and tally the
corresponding data or can skip the extra calculations if the energy and
virial are not needed. See the comments for the ``Integrate::ev_set()``
method which document the flag values.
method, which document the flag values.
At various points of the timestep, fixes are invoked,
e.g. ``fix->initial_integrate()``. In the code, this is actually done
via the Modify class which stores all the Fix objects and lists of which
via the Modify class, which stores all the Fix objects and lists of which
should be invoked at what point in the timestep. Fixes are the LAMMPS
mechanism for tailoring the operations of a timestep for a particular
simulation. As described elsewhere, each fix has one or more methods,
each of which is invoked at a specific stage of the timestep, as show in
the timestep pseudo-code. All the active fixes defined in an input
script, that are flagged to have an ``initial_integrate()`` method are
the timestep pseudocode. All the active fixes defined in an input
script, that are flagged to have an ``initial_integrate()`` method, are
invoked at the beginning of each timestep. Examples are :doc:`fix nve
<fix_nve>` or :doc:`fix nvt or fix npt <fix_nh>` which perform the
start-of-timestep velocity-Verlet integration operations to update
@ -131,15 +131,15 @@ can be changed using the :doc:`neigh_modify every/delay/check
<neigh_modify>` command. If not, coordinates of ghost atoms are
acquired by each processor via the ``forward_comm()`` method of the Comm
class. If neighbor lists need to be built, several operations within
the inner if clause of the pseudo-code are first invoked. The
the inner if clause of the pseudocode are first invoked. The
``pre_exchange()`` method of any defined fixes is invoked first.
Typically this inserts or deletes particles from the system.
Typically, this inserts or deletes particles from the system.
Periodic boundary conditions are then applied by the Domain class via
its ``pbc()`` method to remap particles that have moved outside the
simulation box back into the box. Note that this is not done every
timestep, but only when neighbor lists are rebuilt. This is so that
each processor's sub-domain will have consistent (nearby) atom
each processor's subdomain will have consistent (nearby) atom
coordinates for its owned and ghost atoms. It is also why dumped atom
coordinates may be slightly outside the simulation box if not dumped
on a step where the neighbor lists are rebuilt.
@ -148,15 +148,15 @@ The box boundaries are then reset (if needed) via the ``reset_box()``
method of the Domain class, e.g. if box boundaries are shrink-wrapped to
current particle coordinates. A change in the box size or shape
requires internal information for communicating ghost atoms (Comm class)
and neighbor list bins (Neighbor class) be updated. The ``setup()``
and neighbor list bins (Neighbor class) to be updated. The ``setup()``
method of the Comm class and ``setup_bins()`` method of the Neighbor
class perform the update.
The code is now ready to migrate atoms that have left a processor's
geometric sub-domain to new processors. The ``exchange()`` method of
geometric subdomain to new processors. The ``exchange()`` method of
the Comm class performs this operation. The ``borders()`` method of the
Comm class then identifies ghost atoms surrounding each processor's
sub-domain and communicates ghost atom information to neighboring
subdomain and communicates ghost atom information to neighboring
processors. It does this by looping over all the atoms owned by a
processor to make lists of those to send to each neighbor processor. On
subsequent timesteps, the lists are used by the ``Comm::forward_comm()``
@ -217,20 +217,21 @@ file, and restart files. See the :doc:`thermo_style <thermo_style>`,
:doc:`dump <dump>`, and :doc:`restart <restart>` commands for more
details.
The the flow of control during energy minimization iterations is
similar to that of a molecular dynamics timestep. Forces are computed,
neighbor lists are built as needed, atoms migrate to new processors, and
atom coordinates and forces are communicated to neighboring processors.
The only difference is what Fix class operations are invoked when. Only
a subset of LAMMPS fixes are useful during energy minimization, as
The flow of control during energy minimization iterations is similar to
that of a molecular dynamics timestep. Forces are computed, neighbor
lists are built as needed, atoms migrate to new processors, and atom
coordinates and forces are communicated to neighboring processors. The
only difference is what Fix class operations are invoked when. Only a
subset of LAMMPS fixes are useful during energy minimization, as
explained in their individual doc pages. The relevant Fix class methods
are ``min_pre_exchange()``, ``min_pre_force()``, and ``min_post_force()``.
Each fix is invoked at the appropriate place within the minimization
iteration. For example, the ``min_post_force()`` method is analogous to
the ``post_force()`` method for dynamics; it is used to alter or constrain
forces on each atom, which affects the minimization procedure.
are ``min_pre_exchange()``, ``min_pre_force()``, and
``min_post_force()``. Each fix is invoked at the appropriate place
within the minimization iteration. For example, the
``min_post_force()`` method is analogous to the ``post_force()`` method
for dynamics; it is used to alter or constrain forces on each atom,
which affects the minimization procedure.
After all iterations are completed there is a ``cleanup`` step which
After all iterations are completed, there is a ``cleanup`` step which
calls the ``post_run()`` method of fixes to perform operations only required
at the end of a calculations (like freeing temporary storage or creating
at the end of a calculation (like freeing temporary storage or creating
final outputs).

845
doc/src/Developer_grid.rst Normal file
View File

@ -0,0 +1,845 @@
Use of distributed grids within style classes
---------------------------------------------
.. versionadded:: 22Dec2022
The LAMMPS source code includes two classes which facilitate the
creation and use of distributed grids. These are the Grid2d and
Grid3d classes in the src/grid2d.cpp.h and src/grid3d.cpp.h files
respectively. As the names imply, they are used for 2d or 3d
simulations, as defined by the :doc:`dimension <dimension>` command.
The :doc:`Howto_grid <Howto_grid>` page gives an overview of how
distributed grids are defined from a user perspective, lists LAMMPS
commands which use them, and explains how grid cell data is referenced
from an input script. Please read that page first as it motivates the
coding details discussed here.
This doc page is for users who wish to write new styles (input script
commands) which use distributed grids. There are a variety of
material models and analysis methods which use atoms (or
coarse-grained particles) and grids in tandem.
A *distributed* grid means each processor owns a subset of the grid
cells. In LAMMPS, the subset for each processor will be a sub-block
of grid cells with low and high index bounds in each dimension of the
grid. The union of the sub-blocks across all processors is the global
grid.
More specifically, a grid point is defined for each cell (by default
the center point), and a processor owns a grid cell if its point is
within the processor's spatial subdomain. The union of processor
subdomains is the global simulation box. If a grid point is on the
boundary of two subdomains, the lower processor owns the grid cell. A
processor may also store copies of ghost cells which surround its
owned cells.
----------
Style commands
^^^^^^^^^^^^^^
Style commands which can define and use distributed grids include the
:doc:`compute <compute>`, :doc:`fix <fix>`, :doc:`pair <pair_style>`,
and :doc:`kspace <kspace_style>` styles. If you wish grid cell data
to persist across timesteps, then use a fix. If you wish grid cell
data to be accessible by other commands, then use a fix or compute.
Currently in LAMMPS, the :doc:`pair_style amoeba <pair_amoeba>`,
:doc:`kspace_style pppm <kspace_style>`, and :doc:`kspace_style msm
<kspace_style>` commands use distributed grids but do not require
either of these capabilities; they thus create and use distributed
grids internally. Note that a pair style which needs grid cell data
to persist could be coded to work in tandem with a fix style which
provides that capability.
The *size* of a grid is specified by the number of grid cells in each
dimension of the simulation domain. In any dimension the size can be
any value >= 1. Thus a 10x10x1 grid for a 3d simulation is
effectively a 2d grid, where each grid cell spans the entire
z-dimension. A 1x100x1 grid for a 3d simulation is effectively a 1d
grid, where grid cells are a series of thin xz slabs in the
y-dimension. It is even possible to define a 1x1x1 3d grid, though it
may be inefficient to use it in a computational sense.
Note that the choice of grid size is independent of the number of
processors or their layout in a grid of processor subdomains which
overlays the simulations domain. Depending on the distributed grid
size, a single processor may own many 1000s or no grid cells.
A command can define multiple grids, each of a different size. Each
grid is an instantiation of the Grid2d or Grid3d class.
The command also defines what data it will store for each grid it
creates and it allocates the multidimensional array(s) needed to
store the data. No grid cell data is stored within the Grid2d or
Grid3d classes.
If a single value per grid cell is needed, the data array will have
the same dimension as the grid, i.e. a 2d array for a 2d grid,
likewise for 3d. If multiple values per grid cell are needed, the
data array will have one more dimension than the grid, i.e. a 3d array
for a 2d grid, or 4d array for a 3d grid. A command can choose to
define multiple data arrays for each grid it defines.
----------
Grid data allocation and access
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
The simplest way for a command to allocate and access grid cell data
is to use the *create_offset()* methods provided by the Memory class.
Arguments for these methods can be values returned by the
*setup_grid()* method (described below), which define the extent of
the grid cells (owned+ghost) the processor owns. These 4 methods
allocate memory for 2d (first two) and 3d (second two) grid data. The
two methods that end in "_one" allocate an array which stores a single
value per grid cell. The two that end in "_multi" allocate an array
which stores *Nvalues* per grid cell.
.. code-block:: c++
// single value per cell for a 2d grid = 2d array
memory->create2d_offset(data2d_one, nylo_out, nyhi_out,
nxlo_out, nxhi_out, "data2d_one");
// nvalues per cell for a 2d grid = 3d array
memory->create3d_offset_last(data2d_multi, nylo_out, nyhi_out,
nxlo_out, nxhi_out, nvalues, "data2d_multi");
// single value per cell for a 3d grid = 3d array
memory->create3d_offset(data3d_one, nzlo_out, nzhi_out, nylo_out,
nyhi_out, nxlo_out, nxhi_out, "data3d_one");
// nvalues per cell for a 3d grid = 4d array
memory->create4d_offset_last(data3d_multi, nzlo_out, nzhi_out, nylo_out,
nyhi_out, nxlo_out, nxhi_out, nvalues,
"data3d_multi");
Note that these multidimensional arrays are allocated as contiguous
chunks of memory where the x-index of the grid varies fastest, then y,
and the z-index slowest. For multiple values per grid cell, the
Nvalues are contiguous, so their index varies even faster than the
x-index.
The key point is that the "offset" methods create arrays which are
indexed by the range of indices which are the bounds of the sub-block
of the global grid owned by this processor. This means loops like
these can be written in the caller code to loop over owned grid cells,
where the "i" loop bounds are the range of owned grid cells for the
processor. These are the bounds returned by the *setup_grid()*
method:
.. code-block:: c++
for (int iy = iylo; iy <= iyhi; iy++)
for (int ix = ixlo; ix <= ixhi; ix++)
data2d_one[iy][ix] = 0.0;
for (int iy = iylo; iy <= iyhi; iy++)
for (int ix = ixlo; ix <= ixhi; ix++)
for (int m = 0; m < nvalues; m++)
data2d_multi[iy][ix][m] = 0.0;
for (int iz = izlo; iz <= izhi; iz++)
for (int iy = iylo; iy <= iyhi; iy++)
for (int ix = ixlo; ix <= ixhi; ix++)
data3d_one[iz][iy][ix] = 0.0;
for (int iz = izlo; iz <= izhi; iz++)
for (int iy = iylo; iy <= iyhi; iy++)
for (int ix = ixlo; ix <= ixhi; ix++)
for (int m = 0; m < nvalues; m++)
data3d_multi[iz][iy][ix][m] = 0.0;
Simply replacing the "i" bounds with "o" bounds, also returned by the
*setup_grid()* method, would alter this code to loop over owned+ghost
cells (the entire allocated grid).
----------
Grid class constructors
^^^^^^^^^^^^^^^^^^^^^^^
The following subsections describe the public methods of the Grid3d
class which a style command can invoke. The Grid2d methods are
similar; simply remove arguments which refer to the z-dimension.
There are 2 constructors which can be used. They differ in the extra
i/o xyz lo/hi arguments:
.. code-block:: c++
Grid3d(class LAMMPS *lmp, MPI_Comm gcomm, int gnx, int gny, int gnz)
Grid3d(class LAMMPS *lmp, MPI_Comm gcomm, int gnx, int gny, int gnz,
int ixlo, int ixhi, int iylo, int iyhi, int izlo, int izhi,
int oxlo, int oxhi, int oylo, int oyhi, int ozlo, int ozhi)
Both constructors take the LAMMPS instance pointer and a communicator
over which the grid will be distributed. Typically this is the
*world* communicator the LAMMPS instance is using. The
:doc:`kspace_style msm <kspace_style>` command creates a series of
grids, each of different size, which are partitioned across different
sub-communicators of processors. Both constructors are also passed
the global grid size: *gnx* by *gny* by *gnz*.
The first constructor is used when the caller wants the Grid class to
partition the global grid across processors; the Grid class defines
which grid cells each processor owns and also which it stores as ghost
cells. A subsequent call to *setup_grid()*, discussed below, returns
this info to the caller.
The second constructor allows the caller to define the extent of owned
and ghost cells, and pass them to the Grid class. The 6 arguments
which start with "i" are the inclusive lower and upper index bounds of
the owned (inner) grid cells this processor owns in each of the 3
dimensions within the global grid. Owned grid cells are indexed from
0 to N-1 in each dimension.
The 6 arguments which start with "o" are the inclusive bounds of the
owned+ghost (outer) grid cells it stores. If the ghost cells are on
the other side of a periodic boundary, then these indices may be < 0
or >= N in any dimension, so that oxlo <= ixlo and ixhi >= ixhi is
always the case.
For example, if Nx = 100, then a processor might pass ixlo=50,
ixhi=60, oxlo=48, oxhi=62 to the Grid class. Or ixlo=0, ixhi=10,
oxlo=-2, oxhi=13. If a processor owns no grid cells in a dimension,
then the ihi value should be specified as one less than the ilo value.
Note that the only reason to use the second constructor is if the
logic for assigning ghost cells is too complex for the Grid class to
compute, using the various set() methods described next. Currently
only the kspace_style pppm/electrode and kspace_style msm commands use
the second constructor.
----------
Grid class set methods
^^^^^^^^^^^^^^^^^^^^^^
The following methods affect how the Grid class computes which owned
and ghost cells are assigned to each processor. *Set_shift_grid()* is
the only method which influences owned cell assignment; all the rest
influence ghost cell assignment. These methods are only used with the
first constructor; they are ignored if the second constructor is used.
These methods must be called before the *setup_grid()* method is
invoked, because they influence its operation.
.. code-block:: c++
void set_shift_grid(double shift);
void set_distance(double distance);
void set_stencil_atom(int lo, int hi);
void set_shift_atom(double shift_lo, double shift_hi);
void set_stencil_grid(int lo, int hi);
void set_zfactor(double factor);
Processors own a grid cell if a point within the grid cell is inside
the processor's subdomain. By default this is the center point of the
grid cell. The *set_shift_grid()* method can change this. The *shift*
argument is a value from 0.0 to 1.0 (inclusive) which is the offset of
the point within the grid cell in each dimension. The default is 0.5
for the center of the cell. A value of 0.0 is the lower left corner
point; a value of 1.0 is the upper right corner point. There is
typically no need to change the default as it is optimal for
minimizing the number of ghost cells needed.
If a processor maps its particles to grid cells, it needs to allow for
its particles being outside its subdomain between reneighboring. The
*distance* argument of the *set_distance()* method sets the furthest
distance outside a processor's subdomain which a particle can move.
Typically this is half the neighbor skin distance, assuming
reneighboring is done appropriately. This distance is used in
determining how many ghost cells a processor needs to store to enable
its particles to be mapped to grid cells. The default value is 0.0.
Some commands, like the :doc:`kspace_style pppm <kspace_style>`
command, map values (charge in the case of PPPM) to a stencil of grid
cells beyond the grid cell the particle is in. The stencil extent may
be different in the low and high directions. The *set_stencil_atom()*
method defines the maximum values of those 2 extents, assumed to be
the same in each of the 3 dimensions. Both the lo and hi values are
specified as positive integers. The default values are both 0.
Some commands, like the :doc:`kspace_style pppm <kspace_style>`
command, shift the position of an atom when mapping it to a grid cell,
based on the size of the stencil used to map values to the grid
(charge in the case of PPPM). The lo and hi arguments of the
*set_shift_atom()* method are the minimum shift in the low direction
and the maximum shift in the high direction, assumed to be the same in
each of the 3 dimensions. The shifts should be fractions of a grid
cell size with values between 0.0 and 1.0 inclusive. The default
values are both 0.0. See the src/pppm.cpp file for examples of these
lo/hi values for regular and staggered grids.
Some methods like the :doc:`fix ttm/grid <fix_ttm>` command, perform
finite difference kinds of operations on the grid, to diffuse electron
heat in the case of the two-temperature model (TTM). This operation
uses ghost grid values beyond the owned grid values the processor
updates. The *set_stencil_grid()* method defines the extent of this
stencil in both directions, assumed to be the same in each of the 3
dimensions. Both the lo and hi values are specified as positive
integers. The default values are both 0.
The kspace_style pppm commands allow a grid to be defined which
overlays a volume which extends beyond the simulation box in the z
dimension. This is for the purpose of modeling a 2d-periodic slab
(non-periodic in z) as if it were a larger 3d periodic system,
extended (with empty space) in the z dimension. The
:doc:`kspace_modify slab <kspace_modify>` command is used to specify
the ratio of the larger volume to the simulation volume; a volume
ratio of ~3 is typical. For this kind of model, the PPPM caller sets
the global grid size *gnz* ~3x larger than it would be otherwise.
This same ratio is passed by the PPPM caller as the *factor* argument
to the Grid class via the *set_zfactor()* method (*set_yfactor()* for
2d grids). The Grid class will then assign ownership of the 1/3 of
grid cells that overlay the simulation box to the processors which
also overlay the simulation box. The remaining 2/3 of the grid cells
are assigned to processors whose subdomains are adjacent to the upper
z boundary of the simulation box.
----------
Grid class setup_grid method
^^^^^^^^^^^^^^^^^^^^^^^^^^^^
The *setup_grid()* method is called after the first constructor
(above) to partition the grid across processors, which determines
which grid cells each processor owns. It also calculates how many
ghost grid cells in each dimension and each direction each processor
needs to store.
Note that this method is NOT called if the second constructor above is
used. In that case, the caller assigns owned and ghost cells to each
processor.
Also note that this method must be invoked after any *set_*()* methods have
been used, since they can influence the assignment of owned and ghost
cells.
.. code-block:: c++
void setup_grid(int &ixlo, int &ixhi, int &iylo, int &iyhi, int &izlo, int &izhi,
int &oxlo, int &oxhi, int &oylo, int &oyhi, int &ozlo, int &ozhi)
The 6 return arguments which start with "i" are the inclusive lower
and upper index bounds of the owned (inner) grid cells this processor
owns in each of the 3 dimensions within the global grid. Owned grid
cells are indexed from 0 to N-1 in each dimension.
The 6 return arguments which start with "o" are the inclusive bounds of
the owned+ghost cells it owns. If the ghost cells are on the other
side of a periodic boundary, then these indices may be < 0 or >= N in
any dimension, so that oxlo <= ixlo and ixhi >= ixhi is always the
case.
----------
More grid class set methods
^^^^^^^^^^^^^^^^^^^^^^^^^^^
The following 2 methods can be used to override settings made by the
constructors above. If used, they must be called called before the
*setup_comm()* method is invoked, since it uses the settings that
these methods override. In LAMMPS these methods are called by by the
:doc:`kspace_style msm <kspace_style>` command for the grids it
instantiates using the 2nd constructor above.
.. code-block:: c++
void set_proc_neighs(int pxlo, int pxhi, int pylo, int pyhi, int pzlo, int pzhi)
void set_caller_grid(int fxlo, int fxhi, int fylo, int fyhi, int fzlo, int fzhi)
The *set_proc_neighs()* method sets the processor IDs of the 6
neighboring processors for each processor. Normally these would match
the processor grid neighbors which LAMMPS creates to overlay the
simulation box (the default). However, MSM excludes non-participating
processors from coarse grid communication when less processors are
used. This method allows MSM to override the default values.
The *set_caller_grid()* method species the size of the data arrays the
caller allocates. Normally these would match the extent of the ghost
grid cells (the default). However the MSM caller allocates a larger
data array (more ghost cells) for its finest-level grid, for use in
other operations besides owned/ghost cell communication. This method
allows MSM to override the default values.
----------
Grid class get methods
^^^^^^^^^^^^^^^^^^^^^^
The following methods allow the caller to query the settings for a
specific grid, whether it created the grid or another command created
it.
.. code-block:: c++
void get_size(int &nxgrid, int &nygrid, int &nzgrid);
void get_bounds_owned(int &xlo, int &xhi, int &ylo, int &yhi, int &zlo, int &zhi)
void get_bounds_ghost(int &xlo, int &xhi, int &ylo, int &yhi, int &zlo, int &zhi)
The *get_size()* method returns the size of the global grid in each dimension.
The *get_bounds_owned()* method return the inclusive index bounds of
the grid cells this processor owns. The values range from 0 to N-1 in
each dimension. These values are the same as the "i" values returned
by *setup_grid()*.
The *get_bounds_ghost()* method return the inclusive index bounds of
the owned+ghost grid cells this processor stores. The owned cell
indices range from 0 to N-1, so these indices may be less than 0 or
greater than or equal to N in each dimension. These values are the
same as the "o" values returned by *setup_grid()*.
----------
Grid class owned/ghost communication
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
If needed by the command, the following methods setup and perform
communication of grid data to/from neighboring processors. The
*forward_comm()* method sends owned grid cell data to the
corresponding ghost grid cells on other processors. The
*reverse_comm()* method sends ghost grid cell data to the
corresponding owned grid cells on another processor. The caller can
choose to sum ghost grid cell data to the owned grid cell or simply
copy it.
.. code-block:: c++
void setup_comm(int &nbuf1, int &nbuf2)
void forward_comm(int caller, void *ptr, int which, int nper, int nbyte,
void *buf1, void *buf2, MPI_Datatype datatype);
void reverse_comm(int caller, void *ptr, int which, int nper, int nbyte,
void *buf1, void *buf2, MPI_Datatype datatype)
int ghost_adjacent();
The *setup_comm()* method must be called one time before performing
*forward* or *reverse* communication (multiple times if needed). It
returns two integers, which should be used to allocate two buffers.
The *nbuf1* and *nbuf2* values are the number of grid cells whose data
will be stored in two buffers by the Grid class when *forward* or
*reverse* communication is performed. The caller should thus allocate
them to a size large enough to hold all the data used in any single
forward or reverse communication operation it performs. Note that the
caller may allocate and communicate multiple data arrays for a grid it
instantiates. This size includes the bytes needed for the data type
of the grid data it stores, e.g. double precision values.
The *forward_comm()* and *reverse_comm()* methods send grid cell data
from owned to ghost cells, or ghost to owned cells, respectively, as
described above. The *caller* argument should be one of these values
-- Grid3d::COMPUTE, Grid3d::FIX, Grid3d::KSPACE, Grid3d::PAIR --
depending on the style of the caller class. The *ptr* argument is the
"this" pointer to the caller class. These 2 arguments are used to
call back to pack()/unpack() functions in the caller class, as
explained below.
The *which* argument is a flag the caller can set which is passed to
the caller's pack()/unpack() methods. This allows a single callback
method to pack/unpack data for several different flavors of
forward/reverse communication, e.g. operating on different grids or
grid data.
The *nper* argument is the number of values per grid cell to be
communicated. The *nbyte* argument is the number of bytes per value,
e.g. 8 for double-precision values. The *buf1* and *buf2* arguments
are the two allocated buffers described above. So long as they are
allocated for the maximum size communication, they can be re-used for
any *forward_comm()/reverse_comm()* call. The *datatype* argument is
the MPI_Datatype setting, which should match the buffer allocation and
the *nbyte* argument. E.g. MPI_DOUBLE for buffers storing double
precision values.
To use the *forward_grid()* method, the caller must provide two
callback functions; likewise for use of the *reverse_grid()* methods.
These are the 4 functions, their arguments are all the same.
.. code-block:: c++
void pack_forward_grid(int which, void *vbuf, int nlist, int *list);
void unpack_forward_grid(int which, void *vbuf, int nlist, int *list);
void pack_reverse_grid(int which, void *vbuf, int nlist, int *list);
void unpack_reverse_grid(int which, void *vbuf, int nlist, int *list);
The *which* argument is set to the *which* value of the
*forward_comm()* or *reverse_comm()* calls. It allows the pack/unpack
function to select what data values to pack/unpack. *Vbuf* is the
buffer to pack/unpack the data to/from. It is a void pointer so that
the caller can cast it to whatever data type it chooses, e.g. double
precision values. *Nlist* is the number of grid cells to pack/unpack
and *list* is a vector (nlist in length) of offsets to where the data
for each grid cell resides in the caller's data arrays, which is best
illustrated with an example from the src/EXTRA-FIX/fix_ttm_grid.cpp
class which stores the scalar electron temperature for 3d system in a
3d grid (one value per grid cell):
.. code-block:: c++
void FixTTMGrid::pack_forward_grid(int /*which*/, void *vbuf, int nlist, int *list)
{
auto buf = (double *) vbuf;
double *src = &T_electron[nzlo_out][nylo_out][nxlo_out];
for (int i = 0; i < nlist; i++) buf[i] = src[list[i]];
}
In this case, the *which* argument is not used, *vbuf* points to a
buffer of doubles, and the electron temperature is stored by the
FixTTMGrid class in a 3d array of owned+ghost cells called T_electron.
That array is allocated by the *memory->create_3d_offset()* method
described above so that the first grid cell it stores is indexed as
T_electron[nzlo_out][nylo_out][nxlo_out]. The *nlist* values in
*list* are integer offsets from that first grid cell. Setting *src*
to the address of the first cell allows those offsets to be used to
access the temperatures to pack into the buffer.
Here is a similar portion of code from the src/fix_ave_grid.cpp class
which can store two kinds of data, a scalar count of atoms in a grid
cell, and one or more grid-cell-averaged atom properties. The code
from its *unpack_reverse_grid()* function for 2d grids and multiple
per-atom properties per grid cell (*nvalues*) is shown here:
.. code-block:: c++
void FixAveGrid::unpack_reverse_grid(int /*which*/, void *vbuf, int nlist, int *list)
{
auto buf = (double *) vbuf;
double *count,*data,*values;
count = &count2d[nylo_out][nxlo_out];
data = &array2d[nylo_out][nxlo_out][0];
m = 0;
for (i = 0; i < nlist; i++) {
count[list[i]] += buf[m++];
values = &data[nvalues*list[i]];
for (j = 0; j < nvalues; j++)
values[j] += buf[m++];
}
}
Both the count and the multiple values per grid cell are communicated
in *vbuf*. Note that *data* is now a pointer to the first value in
the first grid cell. And *values* points to where the first value in
*data* is for an offset of grid cells, calculated by multiplying
*nvalues* by *list[i]*. Finally, because this is reverse
communication, the communicated buffer values are summed to the caller
values.
The *ghost_adjacent()* method returns a 1 if every processor can
perform the necessary owned/ghost communication with only its nearest
neighbor processors (4 in 2d, 6 in 3d). It returns a 0 if any
processor's ghost cells extend further than nearest neighbor
processors.
This can be checked by callers who have the option to change the
global grid size to ensure more efficient nearest-neighbor-only
communication if they wish. In this case, they instantiate a grid of
a given size (resolution), then invoke *setup_comm()* followed by
*ghost_adjacent()*. If the ghost cells are not adjacent, they destroy
the grid instance and start over with a higher-resolution grid.
Several of the :doc:`kspace_style pppm <kspace_style>` command
variants have this option.
----------
Grid class remap methods for load balancing
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
The following methods are used when a load-balancing operation,
triggered by the :doc:`balance <balance>` or :doc:`fix balance
<fix_balance>` commands, changes the partitioning of the simulation
domain into processor subdomains.
In order to work with load-balancing, any style command (compute, fix,
pair, or kspace style) which allocates a grid and stores per-grid data
should define a *reset_grid()* method; it takes no arguments. It will
be called by the two balance commands after they have reset processor
subdomains and migrated atoms (particles) to new owning processors.
The *reset_grid()* method will typically perform some or all of the
following operations. See the src/fix_ave_grid.cpp and
src/EXTRA_FIX/fix_ttm_grid.cpp files for examples of *reset_grid()*
methods, as well as the *pack_remap_grid()* and *unpack_remap_grid()*
functions.
First, the *reset_grid()* method can instantiate new grid(s) of the
same global size, then call *setup_grid()* to partition them via the
new processor subdomains. At this point, it can invoke the
*identical()* method which compares the owned and ghost grid cell
index bounds between two grids, the old grid passed as a pointer
argument, and the new grid whose *identical()* method is being called.
It returns 1 if the indices match on all processors, otherwise 0. If
they all match, then the new grids can be deleted; the command can
continue to use the old grids.
If not, then the command should allocate new grid data array(s) which
depend on the new partitioning. If the command does not need to
persist its grid data from the old partitioning to the new one, then
the command can simply delete the old data array(s) and grid
instance(s). It can then return.
If the grid data does need to persist, then the data for each grid
needs to be "remapped" from the old grid partitioning to the new grid
partitioning. The *setup_remap()* and *remap()* methods are used for
that purpose.
.. code-block:: c++
int identical(Grid3d *old);
void setup_remap(Grid3d *old, int &nremap_buf1, int &nremap_buf2)
void remap(int caller, void *ptr, int which, int nper, int nbyte,
void *buf1, void *buf2, MPI_Datatype datatype)
The arguments to these methods are identical to those for
the *setup_comm()* and *forward_comm()* or *reverse_comm()* methods.
However the returned *nremap_buf1* and *nremap2_buf* values will be
different than the *nbuf1* and *nbuf2* values. They should be used to
allocate two different remap buffers, separate from the owned/ghost
communication buffers.
To use the *remap()* method, the caller must provide two
callback functions:
.. code-block:: c++
void pack_remap_grid(int which, void *vbuf, int nlist, int *list);
void unpack_remap_grid(int which, void *vbuf, int list, int *list);
Their arguments are identical to those for the *pack_forward_grid()*
and *unpack_forward_grid()* callback functions (or the reverse
variants) discussed above. Normally, both these methods pack/unpack
all the data arrays for a given grid. The *which* argument of the
*remap()* method sets the *which* value for the pack/unpack functions.
If the command instantiates multiple grids (of different sizes), it
can be used within the pack/unpack methods to select which grid's data
is being remapped.
Note that the *pack_remap_grid()* function must copy values from the
OLD grid data arrays into the *vbuf* buffer. The *unpack_remap_grid()*
function must copy values from the *vbuf* buffer into the NEW grid
data arrays.
After the remap operation for grid cell data has been performed, the
*reset_grid()* method can deallocate the two remap buffers it created,
and can then exit.
----------
Grid class I/O methods
^^^^^^^^^^^^^^^^^^^^^^
There are two I/O methods in the Grid classes which can be used to
read and write grid cell data to files. The caller can decide on the
precise format of each file, e.g. whether header lines are prepended
or comment lines are allowed. Fundamentally, the file should contain
one line per grid cell for the entire global grid. Each line should
contain identifying info as to which grid cell it is, e.g. a unique
grid cell ID or the ix,iy,iz indices of the cell within a 3d grid.
The line should also contain one or more data values which are stored
within the grid data arrays created by the command
For grid cell IDs, the LAMMPS convention is that the IDs run from 1 to
N, where N = Nx * Ny for 2d grids and N = Nx * Ny * Nz for 3d grids.
The x-index of the grid cell varies fastest, then y, and the z-index
varies slowest. So for a 10x10x10 grid the cell IDs from 901-1000
would be in the top xy layer of the z dimension.
The *read_file()* method does something simple. It reads a chunk of
consecutive lines from the file and passes them back to the caller to
process. The caller provides a *unpack_read_grid()* function for this
purpose. The function checks the grid cell ID or indices and only
stores grid cell data for the grid cells it owns.
The *write_file()* method does something slightly more complex. Each
processor packs the data for its owned grid cells into a buffer. The
caller provides a *pack_write_grid()* function for this purpose. The
*write_file()* method then loops over all processors and each sends
its buffer one at a time to processor 0, along with the 3d (or 2d)
index bounds of its grid cell data within the global grid. Processor
0 calls back to the *unpack_write_grid()* function provided by the
caller with the buffer. The function writes one line per grid cell to
the file.
See the src/EXTRA_FIX/fix_ttm_grid.cpp file for examples of now both
these methods are used to read/write electron temperature values
from/to a file, as well as for implementations of the the pack/unpack
functions described below.
Here are the details of the two I/O methods and the 3 callback
functions. See the src/fix_ave_grid.cpp file for examples of all of
them.
.. code-block:: c++
void read_file(int caller, void *ptr, FILE *fp, int nchunk, int maxline)
void write_file(int caller, void *ptr, int which,
int nper, int nbyte, MPI_Datatype datatype
The *caller* argument in both methods should be one of these values --
Grid3d::COMPUTE, Grid3d::FIX, Grid3d::KSPACE, Grid3d::PAIR --
depending on the style of the caller class. The *ptr* argument in
both methods is the "this" pointer to the caller class. These 2
arguments are used to call back to pack()/unpack() functions in the
caller class, as explained below.
For the *read_file()* method, the *fp* argument is a file pointer to
the file to be read from, opened on processor 0 by the caller.
*Nchunk* is the number of lines to read per chunk, and *maxline* is
the maximum number of characters per line. The Grid class will
allocate a buffer for storing chunks of lines based on these values.
For the *write_file()* method, the *which* argument is a flag the
caller can set which is passed back to the caller's pack()/unpack()
methods. If the command instantiates multiple grids (of different
sizes), this flag can be used within the pack/unpack methods to select
which grid's data is being written out (presumably to different
files). the *nper* argument is the number of values per grid cell to
be written out. The *nbyte* argument is the number of bytes per
value, e.g. 8 for double-precision values. The *datatype* argument is
the MPI_Datatype setting, which should match the *nbyte* argument.
E.g. MPI_DOUBLE for double precision values.
To use the *read_grid()* method, the caller must provide one callback
function. To use the *write_grid()* method, it provides two callback
functions:
.. code-block:: c++
int unpack_read_grid(int nlines, char *buffer)
void pack_write_grid(int which, void *vbuf)
void unpack_write_grid(int which, void *vbuf, int *bounds)
For *unpack_read_grid()* the *nlines* argument is the number of lines
of character data read from the file and contained in *buffer*. The
lines each include a newline character at the end. When the function
processes the lines, it may choose to skip some of them (header or
comment lines). It returns an integer count of the number of grid
cell lines it processed. This enables the Grid class *read_file()*
method to know when it has read the correct number of lines.
For *pack_write_grid()* and *unpack_write_grid()*, the *vbuf* argument
is the buffer to pack/unpack data to/from. It is a void pointer so
that the caller can cast it to whatever data type it chooses,
e.g. double precision values. the *which* argument is set to the
*which* value of the *write_file()* method. It allows the caller to
choose which grid data to operate on.
For *unpack_write_grid()*, the *bounds* argument is a vector of 4 or 6
integer grid indices (4 for 2d, 6 for 3d). They are the
xlo,xhi,ylo,yhi,zlo,zhi index bounds of the portion of the global grid
which the *vbuf* holds owned grid cell data values for. The caller
should loop over the values in *vbuf* with a double loop (2d) or
triple loop (3d), similar to the code snippets listed above. The
x-index varies fastest, then y, and the z-index slowest. If there are
multiple values per grid cell, the index for those values varies
fastest of all. The caller can add the x,y,z indices of the grid cell
(or the corresponding grid cell ID) to the data value(s) written as
one line to the output file.
----------
Style class grid access methods
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
A style command can enable its grid cell data to be accessible from
other commands. For example :doc:`fix ave/grid <fix_ave_grid>` or
:doc:`dump grid <dump>` or :doc:`dump grid/vtk <dump>`. Those
commands access the grid cell data by using a *grid reference* in
their input script syntax, as described on the :doc:`Howto_grid
<Howto_grid>` doc page. They look like this:
* c_ID:gname:dname
* c_ID:gname:dname[I]
* f_ID:gname:dname
* f_ID:gname:dname[I]
Each grid command instantiates has a unique *gname*, defined by the
command. Likewise each grid cell data structure (scalar or vector)
associated with a grid has a unique *dname*, also defined by the
command.
To provide access to its grid cell data, a style command needs to
implement the following 4 methods:
.. code-block:: c++
int get_grid_by_name(const std::string &name, int &dim);
void *get_grid_by_index(int index);
int get_griddata_by_name(int igrid, const std::string &name, int &ncol);
void *get_griddata_by_index(int index);
Currently only computes and fixes can implement these methods. If it
does so, the compute of fix should also set the variable
*pergrid_flag* to 1. See any of the compute or fix commands which set
"pergrid_flag = 1" for examples of how these 4 functions can be
implemented.
The *get_grid_by_name()* method takes a grid name as input and returns
two values. The *dim* argument is returned as 2 or 3 for the
dimensionality of the grid. The function return is a grid index from
0 to G-1 where *G* is the number of grids the command instantiates. A
value of -1 is returned if the grid name is not recognized.
The *get_grid_by_index()* method is called after the
*get_grid_by_name()* method, using the grid index it returned as its
argument. This method will return a pointer to the Grid2d or Grid3d
class. The caller can use this to query grid attributes, such as the
global size of the grid, to ensure it is of the expected size.
The *get_griddata_by_name()* method takes a grid index *igrid* and a
data name as input. It returns two values. The *ncol* argument is
returned as a 0 if the grid data is a single value (scalar) per grid
cell, or an integer M > 0 if there are M values (vector) per grid
cell. Note that even if M = 1, it is still a 1-length vector, not a
scalar. The function return is a data index from 0 to D-1 where *D*
is the number of data sets associated with that grid by the command.
A value of -1 is returned if the data name is not recognized.
The *get_griddata_by_index()* method is called after the
*get_griddata_by_name()* method, using the data index it returned as
its argument. This method will return a pointer to the
multidimensional array which stores the requested data.
As in the discussion above of the Memory class *create_offset()*
methods, the dimensionality of the array associated with the returned
pointer depends on whether it is a 2d or 3d grid and whether there is
a single or multiple values stored for each grid cell:
* single value per cell for a 2d grid = 2d array pointer
* multiple values per cell for a 2d grid = 3d array pointer
* single value per cell for a 3d grid = 3d array pointer
* multiple values per cell for a 3d grid = 4d array pointer
The caller will typically access the data by casting the void pointer
to the corresponding array pointer and using nested loops in x,y,z
between owned or ghost index bounds returned by the
*get_bounds_owned()* or *get_bounds_ghost()* methods to index into the
array. Example code snippets with this logic were listed above,
----------
Final notes
^^^^^^^^^^^
Finally, here are some additional issues to pay attention to for
writing any style command which uses distributed grids via the Grid2d
or Grid3d class.
The command destructor should delete all instances of the Grid class,
any buffers it allocated for forward/reverse or remap communication,
and any data arrays it allocated to store grid cell data.
If a command is intended to work for either 2d or 3d simulations, then
it should have logic to instantiate either 2d or 3d grids and their
associated data arrays, depending on the dimension of the simulation
box. The :doc:`fix ave/grid <fix_ave_grid>` command is an example of
such a command.
When a command maps its particles to the grid and updates grid cell
values, it should check that it is not updating or accessing a grid
cell value outside the range of its owned+ghost cells, and generate an
error message if that is the case. This could happen, for example, if
a particle has moved further than half the neighbor skin distance,
because the neighbor list update criterion are not adequate to prevent
it from happening. See the src/KSPACE/pppm.cpp file and its
*particle_map()* method for an example of this kind of error check.

View File

@ -102,10 +102,10 @@ build is then :doc:`processed in parallel <Developer_par_neigh>`.
The most commonly required neighbor list is a so-called "half" neighbor
list, where each pair of atoms is listed only once (except when the
:doc:`newton command setting <newton>` for pair is off; in that case
pairs straddling sub-domains or periodic boundaries will be listed twice).
pairs straddling subdomains or periodic boundaries will be listed twice).
Thus these are the default settings when a neighbor list request is created in:
.. code-block:: C++
.. code-block:: c++
void Pair::init_style()
{
@ -129,7 +129,7 @@ neighbor list request to the specific needs of a style an additional
request flag is needed. The :doc:`tersoff <pair_tersoff>` pair style,
for example, needs a "full" neighbor list:
.. code-block:: C++
.. code-block:: c++
void PairTersoff::init_style()
{
@ -141,7 +141,7 @@ When a pair style supports r-RESPA time integration with different cutoff region
the request flag may depend on the corresponding r-RESPA settings. Here an example
from pair style lj/cut:
.. code-block:: C++
.. code-block:: c++
void PairLJCut::init_style()
{
@ -160,7 +160,7 @@ Granular pair styles need neighbor lists based on particle sizes and not cutoff
and also may require to have the list of previous neighbors available ("history").
For example with:
.. code-block:: C++
.. code-block:: c++
if (use_history) neighbor->add_request(this, NeighConst::REQ_SIZE | NeighConst::REQ_HISTORY);
else neighbor->add_request(this, NeighConst::REQ_SIZE);
@ -170,7 +170,7 @@ settings each request can set an id which is then used in the corresponding
``init_list()`` function to assign it to the suitable pointer variable. This is
done for example by the :doc:`pair style meam <pair_meam>`:
.. code-block:: C++
.. code-block:: c++
void PairMEAM::init_style()
{
@ -189,7 +189,7 @@ just once) and this can also be indicated by a flag. As an example here
is the request from the ``FixPeriNeigh`` class which is created
internally by :doc:`Peridynamics pair styles <pair_peri>`:
.. code-block:: C++
.. code-block:: c++
neighbor->add_request(this, NeighConst::REQ_FULL | NeighConst::REQ_OCCASIONAL);
@ -198,7 +198,7 @@ than what is usually inferred from the pair style settings (largest cutoff of
all pair styles plus neighbor list skin). The following is used in the
:doc:`compute rdf <compute_rdf>` command implementation:
.. code-block:: C++
.. code-block:: c++
if (cutflag)
neighbor->add_request(this, NeighConst::REQ_OCCASIONAL)->set_cutoff(mycutneigh);
@ -212,7 +212,7 @@ for printing the neighbor list summary the name of the requesting command
should be set. Below is the request from the :doc:`delete atoms <delete_atoms>`
command:
.. code-block:: C++
.. code-block:: c++
neighbor->add_request(this, "delete_atoms", NeighConst::REQ_FULL);
@ -361,7 +361,7 @@ allocated as a 1d vector or 3d array. Either way, the ordering of
values within contiguous memory x fastest, then y, z slowest.
For the ``3d decomposition`` of the grid, the global grid is
partitioned into bricks that correspond to the sub-domains of the
partitioned into bricks that correspond to the subdomains of the
simulation box that each processor owns. Often, this is a regular 3d
array (Px by Py by Pz) of bricks, where P = number of processors =
Px * Py * Pz. More generally it can be a tiled decomposition, where

View File

@ -7,7 +7,7 @@ but there are small a number of files in several other languages like C,
Fortran, Shell script, or Python.
The core of the code is located in the ``src`` folder and its
sub-directories. A sizable number of these files are in the ``src``
subdirectories. A sizable number of these files are in the ``src``
directory itself, but there are plenty of :doc:`packages <Packages>`,
which can be included or excluded when LAMMPS is built. See the
:doc:`Include packages in build <Build_package>` section of the manual
@ -15,42 +15,42 @@ for more information about that part of the build process. LAMMPS
currently supports building with :doc:`conventional makefiles
<Build_make>` and through :doc:`CMake <Build_cmake>`. Those procedures
differ in how packages are enabled or disabled for inclusion into a
LAMMPS binary so they cannot be mixed. The source files for each
package are in all-uppercase sub-directories of the ``src`` folder, for
LAMMPS binary, so they cannot be mixed. The source files for each
package are in all-uppercase subdirectories of the ``src`` folder, for
example ``src/MOLECULE`` or ``src/EXTRA-MOLECULE``. The ``src/STUBS``
sub-directory is not a package but contains a dummy MPI library, that is
subdirectory is not a package but contains a dummy MPI library, that is
used when building a serial version of the code. The ``src/MAKE``
directory and its sub-directories contain makefiles with settings and
directory and its subdirectories contain makefiles with settings and
flags for a variety of configuration and machines for the build process
with traditional makefiles.
The ``lib`` directory contains the source code for several supporting
libraries or files with configuration settings to use globally installed
libraries, that are required by some of the optional packages. They may
libraries, that are required by some optional packages. They may
include python scripts that can transparently download additional source
code on request. Each sub-directory, like ``lib/poems`` or ``lib/gpu``,
code on request. Each subdirectory, like ``lib/poems`` or ``lib/gpu``,
contains the source files, some of which are in different languages such
as Fortran or CUDA. These libraries included in the LAMMPS build,
if the corresponding package is installed.
as Fortran or CUDA. These libraries included in the LAMMPS build, if the
corresponding package is installed.
LAMMPS C++ source files almost always come in pairs, such as
``src/run.cpp`` (implementation file) and ``src/run.h`` (header file).
Each pair of files defines a C++ class, for example the
:cpp:class:`LAMMPS_NS::Run` class which contains the code invoked by the
:doc:`run <run>` command in a LAMMPS input script. As this example
:cpp:class:`LAMMPS_NS::Run` class, which contains the code invoked by
the :doc:`run <run>` command in a LAMMPS input script. As this example
illustrates, source file and class names often have a one-to-one
correspondence with a command used in a LAMMPS input script. Some
source files and classes do not have a corresponding input script
command, e.g. ``src/force.cpp`` and the :cpp:class:`LAMMPS_NS::Force`
command, for example ``src/force.cpp`` and the :cpp:class:`LAMMPS_NS::Force`
class. They are discussed in the next section.
The names of all source files are in lower case and may use the
underscore character '_' to separate words. Outside of bundled libraries
which may have different conventions, all C and C++ header files have a
``.h`` extension, all C++ files have a ``.cpp`` extension, and C files a
``.c`` extension. A small number of C++ classes and utility functions
are implemented with only a ``.h`` file. Examples are the Pointers and
Commands classes or the MathVec functions.
underscore character '_' to separate words. Apart from bundled,
externally maintained libraries, which may have different conventions,
all C and C++ header files have a ``.h`` extension, all C++ files have a
``.cpp`` extension, and C files a ``.c`` extension. A few C++ classes
and utility functions are implemented with only a ``.h`` file. Examples
are the Pointers and Commands classes or the MathVec functions.
Class topology
--------------
@ -62,35 +62,36 @@ associated source files in the ``src`` folder, for example the class
:cpp:class:`LAMMPS_NS::Memory` corresponds to the files ``memory.cpp``
and ``memory.h``, or the class :cpp:class:`LAMMPS_NS::AtomVec`
corresponds to the files ``atom_vec.cpp`` and ``atom_vec.h``. Full
lines in the figure represent compositing: that is the class at the base
of the arrow holds a pointer to an instance of the class at the tip.
Dashed lines instead represent inheritance: the class to the tip of the
arrow is derived from the class at the base. Classes with a red boundary
are not instantiated directly, but they represent the base classes for
"styles". Those "styles" make up the bulk of the LAMMPS code and only
a few representative examples are included in the figure so it remains
readable.
lines in the figure represent compositing: that is, the class at the
base of the arrow holds a pointer to an instance of the class at the
tip. Dashed lines instead represent inheritance: the class at the tip
of the arrow is derived from the class at the base. Classes with a red
boundary are not instantiated directly, but they represent the base
classes for "styles". Those "styles" make up the bulk of the LAMMPS
code and only a few representative examples are included in the figure,
so it remains readable.
.. _class-topology:
.. figure:: JPG/lammps-classes.png
LAMMPS class topology
This figure shows some of the relations of the base classes of the
LAMMPS simulation package. Full lines indicate that a class holds an
instance of the class it is pointing to; dashed lines point to
derived classes that are given as examples of what classes may be
instantiated during a LAMMPS run based on the input commands and
accessed through the API define by their respective base classes. At
the core is the :cpp:class:`LAMMPS <LAMMPS_NS::LAMMPS>` class, which
holds pointers to class instances with specific purposes. Those may
hold instances of other classes, sometimes directly, or only
temporarily, sometimes as derived classes or derived classes of
derived classes, which may also hold instances of other classes.
This figure shows relations of base classes of the LAMMPS
simulation package. Full lines indicate that a class holds an
instance of the class it is pointing to; dashed lines point to
derived classes that are given as examples of what classes may be
instantiated during a LAMMPS run based on the input commands and
accessed through the API define by their respective base classes.
At the core is the :cpp:class:`LAMMPS <LAMMPS_NS::LAMMPS>` class,
which holds pointers to class instances with specific purposes.
Those may hold instances of other classes, sometimes directly, or
only temporarily, sometimes as derived classes or derived classes
of derived classes, which may also hold instances of other
classes.
The :cpp:class:`LAMMPS_NS::LAMMPS` class is the topmost class and
represents what is generally referred to an "instance" of LAMMPS. It is
a composite holding pointers to instances of other core classes
represents what is generally referred to as an "instance of LAMMPS". It
is a composite holding pointers to instances of other core classes
providing the core functionality of the MD engine in LAMMPS and through
them abstractions of the required operations. The constructor of the
LAMMPS class will instantiate those instances, process the command line
@ -102,42 +103,44 @@ LAMMPS while passing it the command line flags and input script. It
deletes the LAMMPS instance after the method reading the input returns
and shuts down the MPI environment before it exits the executable.
The :cpp:class:`LAMMPS_NS::Pointers` is not shown in the
The :cpp:class:`LAMMPS_NS::Pointers` class is not shown in the
:ref:`class-topology` figure for clarity. It holds references to many
of the members of the `LAMMPS_NS::LAMMPS`, so that all classes derived
from :cpp:class:`LAMMPS_NS::Pointers` have direct access to those
reference. From the class topology all classes with blue boundary are
references. From the class topology all classes with blue boundary are
referenced in the Pointers class and all classes in the second and third
columns, that are not listed as derived classes are instead derived from
:cpp:class:`LAMMPS_NS::Pointers`. To initialize the pointer references
in Pointers, a pointer to the LAMMPS class instance needs to be passed
to the constructor and thus all constructors for classes derived from it
must do so and pass this pointer to the constructor for Pointers.
columns, that are not listed as derived classes, are instead derived
from :cpp:class:`LAMMPS_NS::Pointers`. To initialize the pointer
references in Pointers, a pointer to the LAMMPS class instance needs to
be passed to the constructor. All constructors for classes derived from
it, must do so and thus pass that pointer to the constructor for
:cpp:class:`LAMMPS_NS::Pointers`. The default constructor for
:cpp:class:`LAMMPS_NS::Pointers` is disabled to enforce this.
Since all storage is supposed to be encapsulated (there are a few
exceptions), the LAMMPS class can also be instantiated multiple times by
a calling code. Outside of the aforementioned exceptions, those LAMMPS
a calling code. Outside the aforementioned exceptions, those LAMMPS
instances can be used alternately. As of the time of this writing
(early 2021) LAMMPS is not yet sufficiently thread-safe for concurrent
(early 2023) LAMMPS is not yet sufficiently thread-safe for concurrent
execution. When running in parallel with MPI, care has to be taken,
that suitable copies of communicators are used to not create conflicts
between different instances.
The LAMMPS class currently (early 2021) holds instances of 19 classes
representing the core functionality. There are a handful of virtual
parent classes in LAMMPS that define what LAMMPS calls ``styles``. They
are shaded red in the :ref:`class-topology` figure. Each of these are
parents of a number of child classes that implement the interface
defined by the parent class. There are two main categories of these
``styles``: some may only have one instance active at a time (e.g. atom,
pair, bond, angle, dihedral, improper, kspace, comm) and there is a
dedicated pointer variable for each of them in the composite class.
The LAMMPS class currently holds instances of 19 classes representing
the core functionality. There are a handful of virtual parent classes
in LAMMPS that define what LAMMPS calls ``styles``. These are shaded
red in the :ref:`class-topology` figure. Each of these are parents of a
number of child classes that implement the interface defined by the
parent class. There are two main categories of these ``styles``: some
may only have one instance active at a time (e.g. atom, pair, bond,
angle, dihedral, improper, kspace, comm) and there is a dedicated
pointer variable for each of them in the corresponding composite class.
Setups that require a mix of different such styles have to use a
*hybrid* class that takes the place of the one allowed instance and then
manages and forwards calls to the corresponding sub-styles for the
designated subset of atoms or data. The composite class may also have
lists of class instances, e.g. Modify handles lists of compute and fix
styles, while Output handles a list of dump class instances.
*hybrid* class instance that acts as a proxy, and manages and forwards
calls to the corresponding sub-style class instances for the designated
subset of atoms or data. The composite class may also have lists of
class instances, e.g. ``Modify`` handles lists of compute and fix
styles, while ``Output`` handles a list of dump class instances.
The exception to this scheme are the ``command`` style classes. These
implement specific commands that can be invoked before, after, or in
@ -146,19 +149,19 @@ command() method called and then, after completion, the class instance
deleted. Examples for this are the create_box, create_atoms, minimize,
run, set, or velocity command styles.
For all those ``styles`` certain naming conventions are employed: for
For all those ``styles``, certain naming conventions are employed: for
the fix nve command the class is called FixNVE and the source files are
``fix_nve.h`` and ``fix_nve.cpp``. Similarly for fix ave/time we have
``fix_nve.h`` and ``fix_nve.cpp``. Similarly, for fix ave/time we have
FixAveTime and ``fix_ave_time.h`` and ``fix_ave_time.cpp``. Style names
are lower case and without spaces or special characters. A suffix or
words are appended with a forward slash '/' which denotes a variant of
the corresponding class without the suffix. To connect the style name
and the class name, LAMMPS uses macros like: ``AtomStyle()``,
``PairStyle()``, ``BondStyle()``, ``RegionStyle()``, and so on in the
corresponding header file. During configuration or compilation files
corresponding header file. During configuration or compilation, files
with the pattern ``style_<name>.h`` are created that consist of a list
of include statements including all headers of all styles of a given
type that are currently active (or "installed).
type that are currently enabled (or "installed").
More details on individual classes in the :ref:`class-topology` are as
@ -172,8 +175,8 @@ follows:
that one or multiple simulations can be run, on the processors
allocated for a run, e.g. by the mpirun command.
- The Input class reads and processes input input strings and files,
stores variables, and invokes :doc:`commands <Commands_all>`.
- The Input class reads and processes input (strings and files), stores
variables, and invokes :doc:`commands <Commands_all>`.
- Command style classes are derived from the Command class. They provide
input script commands that perform one-time operations
@ -192,7 +195,7 @@ follows:
- The Atom class stores per-atom properties associated with atom styles.
More precisely, they are allocated and managed by a class derived from
the AtomVec class, and the Atom class simply stores pointers to them.
The classes derived from AtomVec represent the different atom styles
The classes derived from AtomVec represent the different atom styles,
and they are instantiated through the :doc:`atom_style <atom_style>`
command.
@ -206,18 +209,22 @@ follows:
class stores a single list (for all atoms). A NeighRequest class
instance is created by pair, fix, or compute styles when they need a
particular kind of neighbor list and use the NeighRequest properties
to select the neighbor list settings for the given request. There can
be multiple instances of the NeighRequest class and the Neighbor class
will try to optimize how they are computed by creating copies or
sub-lists where possible.
to select the neighbor list settings for the given request. There can
be multiple instances of the NeighRequest class. The Neighbor class
will try to optimize how the requests are processed. Depending on the
NeighRequest properties, neighbor lists are constructed from scratch,
aliased, or constructed by post-processing an existing list into
sub-lists.
- The Comm class performs inter-processor communication, typically of
ghost atom information. This usually involves MPI message exchanges
with 6 neighboring processors in the 3d logical grid of processors
mapped to the simulation box. There are two :doc:`communication styles
<comm_style>` enabling different ways to do the domain decomposition.
Sometimes the Irregular class is used, when atoms may migrate to
arbitrary processors.
<comm_style>`, enabling different ways to perform the domain
decomposition.
- The Irregular class is used, when atoms may migrate to arbitrary
processors.
- The Domain class stores the simulation box geometry, as well as
geometric Regions and any user definition of a Lattice. The latter
@ -246,7 +253,7 @@ follows:
file, dump file snapshots, and restart files. These correspond to the
:doc:`Thermo <thermo_style>`, :doc:`Dump <dump>`, and
:doc:`WriteRestart <write_restart>` classes respectively. The Dump
class is a base class with several derived classes implementing
class is a base class, with several derived classes implementing
various dump style variants.
- The Timer class logs timing information, output at the end

View File

@ -1,22 +1,22 @@
Communication
^^^^^^^^^^^^^
Following the partitioning scheme in use all per-atom data is
Following the selected partitioning scheme, all per-atom data is
distributed across the MPI processes, which allows LAMMPS to handle very
large systems provided it uses a correspondingly large number of MPI
processes. Since The per-atom data (atom IDs, positions, velocities,
types, etc.) To be able to compute the short-range interactions MPI
processes need not only access to data of atoms they "own" but also
information about atoms from neighboring sub-domains, in LAMMPS referred
types, etc.) To be able to compute the short-range interactions, MPI
processes need not only access to the data of atoms they "own" but also
information about atoms from neighboring subdomains, in LAMMPS referred
to as "ghost" atoms. These are copies of atoms storing required
per-atom data for up to the communication cutoff distance. The green
dashed-line boxes in the :ref:`domain-decomposition` figure illustrate
the extended ghost-atom sub-domain for one processor.
the extended ghost-atom subdomain for one processor.
This approach is also used to implement periodic boundary
conditions: atoms that lie within the cutoff distance across a periodic
boundary are also stored as ghost atoms and taken from the periodic
replication of the sub-domain, which may be the same sub-domain, e.g. if
replication of the subdomain, which may be the same subdomain, e.g. if
running in serial. As a consequence of this, force computation in
LAMMPS is not subject to minimum image conventions and thus cutoffs may
be larger than half the simulation domain.
@ -28,10 +28,10 @@ be larger than half the simulation domain.
ghost atom communication
This figure shows the ghost atom communication patterns between
sub-domains for "brick" (left) and "tiled" communication styles for
subdomains for "brick" (left) and "tiled" communication styles for
2d simulations. The numbers indicate MPI process ranks. Here the
sub-domains are drawn spatially separated for clarity. The
dashed-line box is the extended sub-domain of processor 0 which
subdomains are drawn spatially separated for clarity. The
dashed-line box is the extended subdomain of processor 0 which
includes its ghost atoms. The red- and blue-shaded boxes are the
regions of communicated ghost atoms.
@ -42,7 +42,7 @@ atom communication is performed in two stages for a 2d simulation (three
in 3d) for both a regular and irregular partitioning of the simulation
box. For the regular case (left) atoms are exchanged first in the
*x*-direction, then in *y*, with four neighbors in the grid of processor
sub-domains.
subdomains.
In the *x* stage, processor ranks 1 and 2 send owned atoms in their
red-shaded regions to rank 0 (and vice versa). Then in the *y* stage,
@ -55,11 +55,11 @@ For the irregular case (right) the two stages are similar, but a
processor can have more than one neighbor in each direction. In the
*x* stage, MPI ranks 1,2,3 send owned atoms in their red-shaded regions to
rank 0 (and vice versa). These include only atoms between the lower
and upper *y*-boundary of rank 0's sub-domain. In the *y* stage, ranks
and upper *y*-boundary of rank 0's subdomain. In the *y* stage, ranks
4,5,6 send atoms in their blue-shaded regions to rank 0. This may
include ghost atoms they received in the *x* stage, but only if they
are needed by rank 0 to fill its extended ghost atom regions in the
+/-*y* directions (blue rectangles). Thus in this case, ranks 5 and
+/-*y* directions (blue rectangles). Thus, in this case, ranks 5 and
6 do not include ghost atoms they received from each other (in the *x*
stage) in the atoms they send to rank 0. The key point is that while
the pattern of communication is more complex in the irregular
@ -78,14 +78,14 @@ A "reverse" communication is when computed ghost atom attributes are
sent back to the processor who owns the atom. This is used (for
example) to sum partial forces on ghost atoms to the complete force on
owned atoms. The order of the two stages described in the
:ref:`ghost-atom-comm` figure is inverted and the same lists of atoms
:ref:`ghost-atom-comm` figure is inverted, and the same lists of atoms
are used to pack and unpack message buffers with per-atom forces. When
a received buffer is unpacked, the ghost forces are summed to owned atom
forces. As in forward communication, forces on atoms in the four blue
corners of the diagrams are sent, received, and summed twice (once at
each stage) before owning processors have the full force.
These two operations are used many places within LAMMPS aside from
These two operations are used in many places within LAMMPS aside from
exchange of coordinates and forces, for example by manybody potentials
to share intermediate per-atom values, or by rigid-body integrators to
enable each atom in a body to access body properties. Here are
@ -105,16 +105,16 @@ performed in LAMMPS:
atom pairs when building neighbor lists or computing forces.
- The cutoff distance for exchanging ghost atoms is typically equal to
the neighbor cutoff. But it can also chosen to be longer if needed,
the neighbor cutoff. But it can also set to a larger value if needed,
e.g. half the diameter of a rigid body composed of multiple atoms or
over 3x the length of a stretched bond for dihedral interactions. It
can also exceed the periodic box size. For the regular communication
pattern (left), if the cutoff distance extends beyond a neighbor
processor's sub-domain, then multiple exchanges are performed in the
processor's subdomain, then multiple exchanges are performed in the
same direction. Each exchange is with the same neighbor processor,
but buffers are packed/unpacked using a different list of atoms. For
forward communication, in the first exchange a processor sends only
forward communication, in the first exchange, a processor sends only
owned atoms. In subsequent exchanges, it sends ghost atoms received
in previous exchanges. For the irregular pattern (right) overlaps of
a processor's extended ghost-atom sub-domain with all other processors
a processor's extended ghost-atom subdomain with all other processors
in each dimension are detected.

View File

@ -20,7 +20,7 @@ e) electric field values from grid points near each atom are interpolated to com
For any of the spatial-decomposition partitioning schemes each processor
owns the brick-shaped portion of FFT grid points contained within its
sub-domain. The two interpolation operations use a stencil of grid
subdomain. The two interpolation operations use a stencil of grid
points surrounding each atom. To accommodate the stencil size, each
processor also stores a few layers of ghost grid points surrounding its
brick. Forward and reverse communication of grid point values is
@ -40,31 +40,31 @@ orthogonal boxes.
.. _fft-parallel:
.. figure:: img/fft-decomp-parallel.png
:align: center
parallel FFT in PPPM
Parallel FFT in PPPM
Stages of a parallel FFT for a simulation domain overlaid
with an 8x8x8 3d FFT grid, partitioned across 64 processors.
Within each of the 4 diagrams, grid cells of the same color are
owned by a single processor; for simplicity only cells owned by 4
or 8 of the 64 processors are colored. The two images on the left
illustrate brick-to-pencil communication. The two images on the
right illustrate pencil-to-pencil communication, which in this
case transposes the *y* and *z* dimensions of the grid.
Stages of a parallel FFT for a simulation domain overlaid with an
8x8x8 3d FFT grid, partitioned across 64 processors. Within each
of the 4 diagrams, grid cells of the same color are owned by a
single processor; for simplicity, only cells owned by 4 or 8 of
the 64 processors are colored. The two images on the left
illustrate brick-to-pencil communication. The two images on the
right illustrate pencil-to-pencil communication, which in this
case transposes the *y* and *z* dimensions of the grid.
Parallel 3d FFTs require substantial communication relative to their
computational cost. A 3d FFT is implemented by a series of 1d FFTs
along the *x-*, *y-*, and *z-*\ direction of the FFT grid. Thus the FFT
grid cannot be decomposed like atoms into 3 dimensions for parallel
along the *x-*, *y-*, and *z-*\ direction of the FFT grid. Thus, the
FFT grid cannot be decomposed like atoms into 3 dimensions for parallel
processing of the FFTs but only in 1 (as planes) or 2 (as pencils)
dimensions and in between the steps the grid needs to be transposed to
have the FFT grid portion "owned" by each MPI process complete in the
direction of the 1d FFTs it has to perform. LAMMPS uses the
pencil-decomposition algorithm as shown in the :ref:`fft-parallel` figure.
pencil-decomposition algorithm as shown in the :ref:`fft-parallel`
figure.
Initially (far left), each processor owns a brick of same-color grid
cells (actually grid points) contained within in its sub-domain. A
cells (actually grid points) contained within in its subdomain. A
brick-to-pencil communication operation converts this layout to 1d
pencils in the *x*-dimension (center left). Again, cells of the same
color are owned by the same processor. Each processor can then compute
@ -97,7 +97,7 @@ across all $P$ processors with a single call to ``MPI_Alltoall()``, but
this is typically much slower. However, for the specialized brick and
pencil tiling illustrated in :ref:`fft-parallel` figure, collective
communication across the entire MPI communicator is not required. In
the example an :math:`8^3` grid with 512 grid cells is partitioned
the example, an :math:`8^3` grid with 512 grid cells is partitioned
across 64 processors; each processor owns a 2x2x2 3d brick of grid
cells. The initial brick-to-pencil communication (upper left to upper
right) only requires collective communication within subgroups of 4
@ -132,7 +132,7 @@ grid/particle operations that LAMMPS supports:
- The fftMPI library allows each grid dimension to be a multiple of
small prime factors (2,3,5), and allows any number of processors to
perform the FFT. The resulting brick and pencil decompositions are
thus not always as well-aligned but the size of subgroups of
thus not always as well-aligned, but the size of subgroups of
processors for the two modes of communication (brick/pencil and
pencil/pencil) still scale as :math:`O(P^{\frac{1}{3}})` and
:math:`O(P^{\frac{1}{2}})`.
@ -143,26 +143,28 @@ grid/particle operations that LAMMPS supports:
in memory. This reordering can be done during the packing or
unpacking of buffers for MPI communication.
- For large systems and particularly a large number of MPI processes,
the dominant cost for parallel FFTs is often the communication, not
the computation of 1d FFTs, even though the latter scales as :math:`N
\log(N)` in the number of grid points *N* per grid direction. This is
due to the fact that only a 2d decomposition into pencils is possible
while atom data (and their corresponding short-range force and energy
computations) can be decomposed efficiently in 3d.
- For large systems and particularly many MPI processes, the dominant
cost for parallel FFTs is often the communication, not the computation
of 1d FFTs, even though the latter scales as :math:`N \log(N)` in the
number of grid points *N* per grid direction. This is due to the fact
that only a 2d decomposition into pencils is possible while atom data
(and their corresponding short-range force and energy computations)
can be decomposed efficiently in 3d.
This can be addressed by reducing the number of MPI processes involved
in the MPI communication by using :doc:`hybrid MPI + OpenMP
parallelization <Speed_omp>`. This will use OpenMP parallelization
inside the MPI domains and while that may have a lower parallel
efficiency, it reduces the communication overhead.
Reducing the number of MPI processes involved in the MPI communication
will reduce this kind of overhead. By using a :doc:`hybrid MPI +
OpenMP parallelization <Speed_omp>` it is still possible to use all
processes for parallel computation. It will use OpenMP
parallelization inside the MPI domains. While that may have a lower
parallel efficiency for some part of the computation, that can be less
than the communication overhead in the 3d FFTs.
As an alternative it is also possible to start a :ref:`multi-partition
As an alternative, it is also possible to start a :ref:`multi-partition
<partition>` calculation and then use the :doc:`verlet/split
integrator <run_style>` to perform the PPPM computation on a
dedicated, separate partition of MPI processes. This uses an integer
"1:*p*" mapping of *p* sub-domains of the atom decomposition to one
sub-domain of the FFT grid decomposition and where pairwise non-bonded
"1:*p*" mapping of *p* subdomains of the atom decomposition to one
subdomain of the FFT grid decomposition and where pairwise non-bonded
and bonded forces and energies are computed on the larger partition
and the PPPM kspace computation concurrently on the smaller partition.
@ -172,10 +174,10 @@ grid/particle operations that LAMMPS supports:
- LAMMPS implements a ``GridComm`` class which overlays the simulation
domain with a regular grid, partitions it across processors in a
manner consistent with processor sub-domains, and provides methods for
manner consistent with processor subdomains, and provides methods for
forward and reverse communication of owned and ghost grid point
values. It is used for PPPM as an FFT grid (as outlined above) and
also for the MSM algorithm which uses a cascade of grid sizes from
also for the MSM algorithm, which uses a cascade of grid sizes from
fine to coarse to compute long-range Coulombic forces. The GridComm
class is also useful for models where continuum fields interact with
particles. For example, the two-temperature model (TTM) defines heat

View File

@ -3,12 +3,12 @@ Neighbor lists
To compute forces efficiently, each processor creates a Verlet-style
neighbor list which enumerates all pairs of atoms *i,j* (*i* = owned,
*j* = owned or ghost) with separation less than the applicable
neighbor list cutoff distance. In LAMMPS the neighbor lists are stored
in a multiple-page data structure; each page is a contiguous chunk of
memory which stores vectors of neighbor atoms *j* for many *i* atoms.
This allows pages to be incrementally allocated or deallocated in blocks
as needed. Neighbor lists typically consume the most memory of any data
*j* = owned or ghost) with separation less than the applicable neighbor
list cutoff distance. In LAMMPS, the neighbor lists are stored in a
multiple-page data structure; each page is a contiguous chunk of memory
which stores vectors of neighbor atoms *j* for many *i* atoms. This
allows pages to be incrementally allocated or deallocated in blocks as
needed. Neighbor lists typically consume the most memory of any data
structure in LAMMPS. The neighbor list is rebuilt (from scratch) once
every few timesteps, then used repeatedly each step for force or other
computations. The neighbor cutoff distance is :math:`R_n = R_f +
@ -16,20 +16,20 @@ computations. The neighbor cutoff distance is :math:`R_n = R_f +
the interatomic potential for computing short-range pairwise or manybody
forces and :math:`\Delta_s` is a "skin" distance that allows the list to
be used for multiple steps assuming that atoms do not move very far
between consecutive time steps. Typically the code triggers
between consecutive time steps. Typically, the code triggers
reneighboring when any atom has moved half the skin distance since the
last reneighboring; this and other options of the neighbor list rebuild
can be adjusted with the :doc:`neigh_modify <neigh_modify>` command.
On steps when reneighboring is performed, atoms which have moved outside
their owning processor's sub-domain are first migrated to new processors
their owning processor's subdomain are first migrated to new processors
via communication. Periodic boundary conditions are also (only)
enforced on these steps to ensure each atom is re-assigned to the
correct processor. After migration, the atoms owned by each processor
are stored in a contiguous vector. Periodically each processor
are stored in a contiguous vector. Periodically, each processor
spatially sorts owned atoms within its vector to reorder it for improved
cache efficiency in force computations and neighbor list building. For
that atoms are spatially binned and then reordered so that atoms in the
that, atoms are spatially binned and then reordered so that atoms in the
same bin are adjacent in the vector. Atom sorting can be disabled or
its settings modified with the :doc:`atom_modify <atom_modify>` command.
@ -39,12 +39,12 @@ its settings modified with the :doc:`atom_modify <atom_modify>` command.
neighbor list stencils
A 2d simulation sub-domain (thick black line) and the corresponding
A 2d simulation subdomain (thick black line) and the corresponding
ghost atom cutoff region (dashed blue line) for both orthogonal
(left) and triclinic (right) domains. A regular grid of neighbor
bins (thin lines) overlays the entire simulation domain and need not
align with sub-domain boundaries; only the portion overlapping the
augmented sub-domain is shown. In the triclinic case it overlaps the
align with subdomain boundaries; only the portion overlapping the
augmented subdomain is shown. In the triclinic case, it overlaps the
bounding box of the tilted rectangle. The blue- and red-shaded bins
represent a stencil of bins searched to find neighbors of a particular
atom (black dot).
@ -52,13 +52,13 @@ its settings modified with the :doc:`atom_modify <atom_modify>` command.
To build a local neighbor list in linear time, the simulation domain is
overlaid (conceptually) with a regular 3d (or 2d) grid of neighbor bins,
as shown in the :ref:`neighbor-stencil` figure for 2d models and a
single MPI processor's sub-domain. Each processor stores a set of
neighbor bins which overlap its sub-domain extended by the neighbor
single MPI processor's subdomain. Each processor stores a set of
neighbor bins which overlap its subdomain, extended by the neighbor
cutoff distance :math:`R_n`. As illustrated, the bins need not align
with processor boundaries; an integer number in each dimension is fit to
the size of the entire simulation box.
Most often LAMMPS builds what it calls a "half" neighbor list where
Most often, LAMMPS builds what is called a "half" neighbor list where
each *i,j* neighbor pair is stored only once, with either atom *i* or
*j* as the central atom. The build can be done efficiently by using a
pre-computed "stencil" of bins around a central origin bin which
@ -67,18 +67,18 @@ is simply a list of integer offsets in *x,y,z* of nearby bins
surrounding the origin bin which are close enough to contain any
neighbor atom *j* within a distance :math:`R_n` from any atom *i* in the
origin bin. Note that for a half neighbor list, the stencil can be
asymmetric since each atom only need store half its nearby neighbors.
asymmetric, since each atom only need store half its nearby neighbors.
These stencils are illustrated in the figure for a half list and a bin
size of :math:`\frac{1}{2} R_n`. There are 13 red+blue stencil bins in
2d (for the orthogonal case, 15 for triclinic). In 3d there would be
63, 13 in the plane of bins that contain the origin bin and 25 in each
of the two planes above it in the *z* direction (75 for triclinic). The
reason the triclinic stencil has extra bins is because the bins tile the
bounding box of the entire triclinic domain and thus are not periodic
with respect to the simulation box itself. The stencil and logic for
determining which *i,j* pairs to include in the neighbor list are
altered slightly to account for this.
triclinic stencil has extra bins because the bins tile the bounding box
of the entire triclinic domain, and thus are not periodic with respect
to the simulation box itself. The stencil and logic for determining
which *i,j* pairs to include in the neighbor list are altered slightly
to account for this.
To build a neighbor list, a processor first loops over its "owned" plus
"ghost" atoms and assigns each to a neighbor bin. This uses an integer
@ -95,7 +95,7 @@ supports:
been found to be optimal for many typical cases. Smaller bins incur
additional overhead to loop over; larger bins require more distance
calculations. Note that for smaller bin sizes, the 2d stencil in the
figure would be more semi-circular in shape (hemispherical in 3d),
figure would be of a more semicircular shape (hemispherical in 3d),
with bins near the corners of the square eliminated due to their
distance from the origin bin.
@ -111,8 +111,8 @@ supports:
symmetric stencil. It also includes lists with partial enumeration of
ghost atom neighbors. The full and ghost-atom lists are used by
various manybody interatomic potentials. Lists may also use different
criteria for inclusion of a pair interaction. Typically this simply
depends only on the distance between two atoms and the cutoff
criteria for inclusion of a pairwise interaction. Typically, this
simply depends only on the distance between two atoms and the cutoff
distance. But for finite-size coarse-grained particles with
individual diameters (e.g. polydisperse granular particles), it can
also depend on the diameters of the two particles.
@ -121,11 +121,11 @@ supports:
of the master neighbor list for the full system need to be generated,
one for each sub-style, which contains only the *i,j* pairs needed to
compute interactions between subsets of atoms for the corresponding
potential. This means not all *i* or *j* atoms owned by a processor
potential. This means, not all *i* or *j* atoms owned by a processor
are included in a particular sub-list.
- Some models use different cutoff lengths for pairwise interactions
between different kinds of particles which are stored in a single
between different kinds of particles, which are stored in a single
neighbor list. One example is a solvated colloidal system with large
colloidal particles where colloid/colloid, colloid/solvent, and
solvent/solvent interaction cutoffs can be dramatically different.
@ -144,7 +144,7 @@ supports:
- For small and sparse systems and as a fallback method, LAMMPS also
supports neighbor list construction without binning by using a full
:math:`O(N^2)` loop over all *i,j* atom pairs in a sub-domain when
:math:`O(N^2)` loop over all *i,j* atom pairs in a subdomain when
using the :doc:`neighbor nsq <neighbor>` command.
- Dependent on the "pair" setting of the :doc:`newton <newton>` command,
@ -153,7 +153,7 @@ supports:
For the newton pair *on* setting the atom *j* is only added to the
list if its *z* coordinate is larger, or if equal the *y* coordinate
is larger, and that is equal, too, the *x* coordinate is larger. For
homogeneously dense systems that will result in picking neighbors from
homogeneously dense systems, that will result in picking neighbors from
a same size sector in always the same direction relative to the
"owned" atom and thus it should lead to similar length neighbor lists
and thus reduce the chance of a load imbalance.
"owned" atom, and thus it should lead to similar length neighbor lists
and reduce the chance of a load imbalance.

View File

@ -6,7 +6,7 @@ thread parallelism to predominantly distribute loops over local data
and thus follow an orthogonal parallelization strategy to the
decomposition into spatial domains used by the :doc:`MPI partitioning
<Developer_par_part>`. For clarity, this section discusses only the
implementation in the OPENMP package as it is the simplest. The INTEL
implementation in the OPENMP package, as it is the simplest. The INTEL
and KOKKOS package offer additional options and are more complex since
they support more features and different hardware like co-processors
or GPUs.
@ -14,7 +14,7 @@ or GPUs.
One of the key decisions when implementing the OPENMP package was to
keep the changes to the source code small, so that it would be easier to
maintain the code and keep it in sync with the non-threaded standard
implementation. this is achieved by a) making the OPENMP version a
implementation. This is achieved by a) making the OPENMP version a
derived class from the regular version (e.g. ``PairLJCutOMP`` from
``PairLJCut``) and overriding only methods that are multi-threaded or
need to be modified to support multi-threading (similar to what was done
@ -26,13 +26,13 @@ into three separate classes ``ThrOMP``, ``ThrData``, and ``FixOMP``.
available in the corresponding base class (e.g. ``Pair`` for
``PairLJCutOMP``) like multi-thread aware variants of the "tally"
functions. Those functions are made available through multiple
inheritance so those new functions have to have unique names to avoid
inheritance, so those new functions have to have unique names to avoid
ambiguities; typically ``_thr`` is appended to the name of the function.
``ThrData`` is a classes that manages per-thread data structures.
It is used instead of extending the corresponding storage to per-thread
arrays to avoid slowdowns due to "false sharing" when multiple threads
update adjacent elements in an array and thus force the CPU cache lines
to be reset and re-fetched. ``FixOMP`` finally manages the "multi-thread
``ThrData`` is a class that manages per-thread data structures. It is
used instead of extending the corresponding storage to per-thread arrays
to avoid slowdowns due to "false sharing" when multiple threads update
adjacent elements in an array and thus force the CPU cache lines to be
reset and re-fetched. ``FixOMP`` finally manages the "multi-thread
state" like settings and access to per-thread storage, it is activated
by the :doc:`package omp <package>` command.
@ -46,24 +46,24 @@ involve multiple atoms and thus there are race conditions when multiple
threads want to update per-atom data of the same atoms. Five possible
strategies have been considered to avoid this:
1) restructure the code so that there is no overlapping access possible
1. Restructure the code so that there is no overlapping access possible
when computing in parallel, e.g. by breaking lists into multiple
parts and synchronizing threads in between.
2) have each thread be "responsible" for a specific group of atoms and
2. Have each thread be "responsible" for a specific group of atoms and
compute these interactions multiple times, once on each thread that
is responsible for a given atom and then have each thread only update
is responsible for a given atom, and then have each thread only update
the properties of this atom.
3) use mutexes around functions and regions of code where the data race
could happen
4) use atomic operations when updating per-atom properties
5) use replicated per-thread data structures to accumulate data without
3. Use mutexes around functions and regions of code where the data race
could happen.
4. Use atomic operations when updating per-atom properties.
5. Use replicated per-thread data structures to accumulate data without
conflicts and then use a reduction to combine those results into the
data structures used by the regular style.
Option 5 was chosen for the OPENMP package because it would retain the
performance for the case of 1 thread and the code would be more
performance for the case of a single thread and the code would be more
maintainable. Option 1 would require extensive code changes,
particularly to the neighbor list code; options 2 would have incurred a
particularly to the neighbor list code; option 2 would have incurred a
2x or more performance penalty for the serial case; option 3 causes
significant overhead and would enforce serialization of operations in
inner loops and thus defeat the purpose of multi-threading; option 4
@ -80,7 +80,7 @@ equivalent to the number of CPU cores per CPU socket on high-end
supercomputers.
Thus arrays like the force array are dimensioned to the number of atoms
times the number of threads when enabling OpenMP support and inside the
times the number of threads when enabling OpenMP support, and inside the
compute functions a pointer to a different chunk is obtained by each thread.
Similarly, accumulators like potential energy or virial are kept in
per-thread instances of the ``ThrData`` class and then only reduced and
@ -91,7 +91,7 @@ Loop scheduling
"""""""""""""""
Multi-thread parallelization is applied by distributing (outer) loops
statically across threads. Typically this would be the loop over local
statically across threads. Typically, this would be the loop over local
atoms *i* when processing *i,j* pairs of atoms from a neighbor list.
The design of the neighbor list code results in atoms having a similar
number of neighbors for homogeneous systems and thus load imbalances

View File

@ -7,39 +7,39 @@ distributed-memory parallelism is set with the :doc:`comm_style command
.. _domain-decomposition:
.. figure:: img/domain-decomp.png
:align: center
domain decomposition
Domain decomposition schemes
This figure shows the different kinds of domain decomposition used
for MPI parallelization: "brick" on the left with an orthogonal
(left) and a triclinic (middle) simulation domain, and a "tiled"
decomposition (right). The black lines show the division into
sub-domains and the contained atoms are "owned" by the corresponding
MPI process. The green dashed lines indicate how sub-domains are
extended with "ghost" atoms up to the communication cutoff distance.
This figure shows the different kinds of domain decomposition used
for MPI parallelization: "brick" on the left with an orthogonal
(left) and a triclinic (middle) simulation domain, and a "tiled"
decomposition (right). The black lines show the division into
subdomains, and the contained atoms are "owned" by the
corresponding MPI process. The green dashed lines indicate how
subdomains are extended with "ghost" atoms up to the communication
cutoff distance.
The LAMMPS simulation box is a 3d or 2d volume, which can be orthogonal
or triclinic in shape, as illustrated in the :ref:`domain-decomposition`
figure for the 2d case. Orthogonal means the box edges are aligned with
the *x*, *y*, *z* Cartesian axes, and the box faces are thus all
rectangular. Triclinic allows for a more general parallelepiped shape
in which edges are aligned with three arbitrary vectors and the box
faces are parallelograms. In each dimension box faces can be periodic,
or non-periodic with fixed or shrink-wrapped boundaries. In the fixed
case, atoms which move outside the face are deleted; shrink-wrapped
means the position of the box face adjusts continuously to enclose all
the atoms.
The LAMMPS simulation box is a 3d or 2d volume, which can be of
orthogonal or triclinic shape, as illustrated in the
:ref:`domain-decomposition` figure for the 2d case. Orthogonal means
the box edges are aligned with the *x*, *y*, *z* Cartesian axes, and the
box faces are thus all rectangular. Triclinic allows for a more general
parallelepiped shape in which edges are aligned with three arbitrary
vectors and the box faces are parallelograms. In each dimension, box
faces can be periodic, or non-periodic with fixed or shrink-wrapped
boundaries. In the fixed case, atoms which move outside the face are
deleted; shrink-wrapped means the position of the box face adjusts
continuously to enclose all the atoms.
For distributed-memory MPI parallelism, the simulation box is spatially
decomposed (partitioned) into non-overlapping sub-domains which fill the
decomposed (partitioned) into non-overlapping subdomains which fill the
box. The default partitioning, "brick", is most suitable when atom
density is roughly uniform, as shown in the left-side images of the
:ref:`domain-decomposition` figure. The sub-domains comprise a regular
grid and all sub-domains are identical in size and shape. Both the
:ref:`domain-decomposition` figure. The subdomains comprise a regular
grid, and all subdomains are identical in size and shape. Both the
orthogonal and triclinic boxes can deform continuously during a
simulation, e.g. to compress a solid or shear a liquid, in which case
the processor sub-domains likewise deform.
the processor subdomains likewise deform.
For models with non-uniform density, the number of particles per
@ -50,14 +50,14 @@ load. For such models, LAMMPS supports multiple strategies to reduce
the load imbalance:
- The processor grid decomposition is by default based on the simulation
cell volume and tries to optimize the volume to surface ratio for the sub-domains.
cell volume and tries to optimize the volume to surface ratio for the subdomains.
This can be changed with the :doc:`processors command <processors>`.
- The parallel planes defining the size of the sub-domains can be shifted
- The parallel planes defining the size of the subdomains can be shifted
with the :doc:`balance command <balance>`. Which can be done in addition
to choosing a more optimal processor grid.
- The recursive bisectioning algorithm in combination with the "tiled"
communication style can produce a partitioning with equal numbers of
particles in each sub-domain.
particles in each subdomain.
.. |decomp1| image:: img/decomp-regular.png
@ -76,14 +76,14 @@ the load imbalance:
The pictures above demonstrate different decompositions for a 2d system
with 12 MPI ranks. The atom colors indicate the load imbalance of each
sub-domain with green being optimal and red the least optimal.
subdomain, with green being optimal and red the least optimal.
Due to the vacuum in the system, the default decomposition is unbalanced
with several MPI ranks without atoms (left). By forcing a 1x12x1
processor grid, every MPI rank does computations now, but number of
atoms per sub-domain is still uneven and the thin slice shape increases
the amount of communication between sub-domains (center left). With a
2x6x1 processor grid and shifting the sub-domain divisions, the load
imbalance is further reduced and the amount of communication required
between sub-domains is less (center right). And using the recursive
bisectioning leads to further improved decomposition (right).
Due to the vacuum in the system, the default decomposition is
unbalanced, with several MPI ranks without atoms (left). By forcing a
1x12x1 processor grid, every MPI rank does computations now, but the
number of atoms per subdomain is still uneven, and the thin slice shape
increases the amount of communication between subdomains (center
left). With a 2x6x1 processor grid and shifting the subdomain divisions,
the load imbalance is further reduced and the amount of communication
required between subdomains is less (center right). And using the
recursive bisectioning leads to further improved decomposition (right).

View File

@ -3,11 +3,11 @@ Parallel algorithms
LAMMPS is designed to enable running simulations in parallel using the
MPI parallel communication standard with distributed data via domain
decomposition. The parallelization aims to be efficient result in good
strong scaling (= good speedup for the same system) and good weak
scaling (= the computational cost of enlarging the system is
decomposition. The parallelization aims to be efficient, and resulting
in good strong scaling (= good speedup for the same system) and good
weak scaling (= the computational cost of enlarging the system is
proportional to the system size). Additional parallelization using GPUs
or OpenMP can also be applied within the sub-domain assigned to an MPI
or OpenMP can also be applied within the subdomain assigned to an MPI
process. For clarity, most of the following illustrations show the 2d
simulation case. The underlying algorithms in those cases, however,
apply to both 2d and 3d cases equally well.

View File

@ -95,7 +95,7 @@ a class ``PairMorse2`` in the files ``pair_morse2.h`` and
``pair_morse2.cpp`` with the factory function and initialization
function would look like this:
.. code-block:: C++
.. code-block:: c++
#include "lammpsplugin.h"
#include "version.h"
@ -141,7 +141,7 @@ list of argument strings), then the pointer type is ``lammpsplugin_factory2``
and it must be assigned to the *creator.v2* member of the plugin struct.
Below is an example for that:
.. code-block:: C++
.. code-block:: c++
#include "lammpsplugin.h"
#include "version.h"
@ -176,7 +176,7 @@ demonstrated in the following example, which also shows that the
implementation of the plugin class may be within the same source
file as the plugin interface code:
.. code-block:: C++
.. code-block:: c++
#include "lammpsplugin.h"

View File

@ -194,7 +194,7 @@ macro. These tests operate by capturing the screen output when executing
the failing command and then comparing that with a provided regular
expression string pattern. Example:
.. code-block:: C++
.. code-block:: c++
TEST_F(SimpleCommandsTest, UnknownCommand)
{
@ -226,9 +226,9 @@ The following test programs are currently available:
* - ``test_kim_commands.cpp``
- KimCommands
- Tests for several commands from the :ref:`KIM package <PKG-KIM>`
* - ``test_reset_ids.cpp``
- ResetIDs
- Tests to validate the :doc:`reset_atom_ids <reset_atom_ids>` and :doc:`reset_mol_ids <reset_mol_ids>` commands
* - ``test_reset_atoms.cpp``
- ResetAtoms
- Tests to validate the :doc:`reset_atoms <reset_atoms>` sub-commands
Tests for the C-style library interface
@ -249,7 +249,7 @@ MPI support. These include tests where LAMMPS is run in multi-partition
mode or only on a subset of the MPI world communicator. The CMake
script code for adding this kind of test looks like this:
.. code-block:: CMake
.. code-block:: cmake
if (BUILD_MPI)
add_executable(test_library_mpi test_library_mpi.cpp)
@ -489,7 +489,7 @@ to update the YAML files. Running a command like
.. code-block:: bash
$ test_pair_style mol-pair-lennard_mdf.yaml -g new.yaml
test_pair_style mol-pair-lennard_mdf.yaml -g new.yaml
will read the settings from the ``mol-pair-lennard_mdf.yaml`` file and then compute
the reference data and write a new file with to ``new.yaml``. If this step fails,
@ -500,13 +500,13 @@ It is also possible to do an update in place with:
.. code-block:: bash
$ test_pair_style mol-pair-lennard_mdf.yaml -u
test_pair_style mol-pair-lennard_mdf.yaml -u
And one can finally run the full set of tests with:
.. code-block:: bash
$ test_pair_style mol-pair-lennard_mdf.yaml
test_pair_style mol-pair-lennard_mdf.yaml
This will just print a summary of the groups of tests. When using the "-v" flag
the test will also keep any LAMMPS output and when using the "-s" flag, there

View File

@ -25,6 +25,7 @@ Available topics in mostly chronological order are:
- `Simplified and more compact neighbor list requests`_
- `Split of fix STORE into fix STORE/GLOBAL and fix STORE/PERATOM`_
- `Use Output::get_dump_by_id() instead of Output::find_dump()`_
- `Refactored grid communication using Grid3d/Grid2d classes instead of GridComm`_
----
@ -61,7 +62,7 @@ header file needs to be updated accordingly.
Old:
.. code-block:: C++
.. code-block:: c++
int PairEAM::pack_comm(int n, int *list, double *buf, int pbc_flag, int *pbc)
{
@ -75,7 +76,7 @@ Old:
New:
.. code-block:: C++
.. code-block:: c++
int PairEAM::pack_forward_comm(int n, int *list, double *buf, int pbc_flag, int *pbc)
{
@ -112,14 +113,14 @@ Example from a pair style:
Old:
.. code-block:: C++
.. code-block:: c++
if (eflag || vflag) ev_setup(eflag, vflag);
else evflag = vflag_fdotr = eflag_global = eflag_atom = 0;
New:
.. code-block:: C++
.. code-block:: c++
ev_init(eflag, vflag);
@ -142,14 +143,14 @@ when they are called from only one or a subset of the MPI processes.
Old:
.. code-block:: C++
.. code-block:: c++
val = force->numeric(FLERR, arg[1]);
num = force->inumeric(FLERR, arg[2]);
New:
.. code-block:: C++
.. code-block:: c++
val = utils::numeric(FLERR, true, arg[1], lmp);
num = utils::inumeric(FLERR, false, arg[2], lmp);
@ -183,14 +184,14 @@ copy them around for simulations.
Old:
.. code-block:: C++
.. code-block:: c++
fp = force->open_potential(filename);
fp = fopen(filename, "r");
New:
.. code-block:: C++
.. code-block:: c++
fp = utils::open_potential(filename, lmp);
@ -207,7 +208,7 @@ Example:
Old:
.. code-block:: C++
.. code-block:: c++
if (fptr == NULL) {
char str[128];
@ -217,7 +218,7 @@ Old:
New:
.. code-block:: C++
.. code-block:: c++
if (fptr == nullptr)
error->one(FLERR, "Cannot open AEAM potential file {}: {}", filename, utils::getsyserror());
@ -237,7 +238,7 @@ an example from the ``FixWallReflect`` class:
Old:
.. code-block:: C++
.. code-block:: c++
FixWallReflect(class LAMMPS *, int, char **);
virtual ~FixWallReflect();
@ -247,7 +248,7 @@ Old:
New:
.. code-block:: C++
.. code-block:: c++
FixWallReflect(class LAMMPS *, int, char **);
~FixWallReflect() override;
@ -271,7 +272,7 @@ the type of the "this" pointer argument.
Old:
.. code-block:: C++
.. code-block:: c++
comm->forward_comm_pair(this);
comm->forward_comm_fix(this);
@ -284,7 +285,7 @@ Old:
New:
.. code-block:: C++
.. code-block:: c++
comm->forward_comm(this);
comm->reverse_comm(this);
@ -304,7 +305,7 @@ requests can be :doc:`found here <Developer_notes>`. Example from the
Old:
.. code-block:: C++
.. code-block:: c++
int irequest = neighbor->request(this,instance_me);
neighbor->requests[irequest]->pair = 0;
@ -317,7 +318,7 @@ Old:
New:
.. code-block:: C++
.. code-block:: c++
auto req = neighbor->add_request(this, NeighConst::REQ_OCCASIONAL);
if (cutflag) req->set_cutoff(mycutneigh);
@ -340,7 +341,7 @@ these are internal fixes, there is no user visible change.
Old:
.. code-block:: C++
.. code-block:: c++
#include "fix_store.h"
@ -351,7 +352,7 @@ Old:
New:
.. code-block:: C++
.. code-block:: c++
#include "fix_store_peratom.h"
@ -362,7 +363,7 @@ New:
Old:
.. code-block:: C++
.. code-block:: c++
#include "fix_store.h"
@ -373,7 +374,7 @@ Old:
New:
.. code-block:: C++
.. code-block:: c++
#include "fix_store_global.h"
@ -396,7 +397,7 @@ the dump directly. Example:
Old:
.. code-block:: C++
.. code-block:: c++
int idump = output->find_dump(arg[iarg+1]);
if (idump < 0)
@ -412,7 +413,7 @@ Old:
New:
.. code-block:: C++
.. code-block:: c++
auto idump = output->get_dump_by_id(arg[iarg+1]);
if (!idump) error->all(FLERR,"Dump ID {} in hyper command does not exist", arg[iarg+1]);
@ -423,3 +424,56 @@ New:
if (dumpflag) for (auto idump : dumplist) idump->write();
This change is **required** or else the code will not compile.
Refactored grid communication using Grid3d/Grid2d classes instead of GridComm
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
.. versionchanged:: 22Dec2022
The ``GridComm`` class was for creating and communicating distributed
grids was replaced by the ``Grid3d`` class with added functionality.
A ``Grid2d`` class was also added for additional flexibility.
The new functionality and commands using the two grid classes are
discussed on the following documentation pages:
- :doc:`Howto_grid`
- :doc:`Developer_grid`
If you have custom LAMMPS code, which uses the GridComm class, here are some notes
on how to adapt it for using the Grid3d class.
(1) The constructor has changed to allow the ``Grid3d`` / ``Grid2d``
classes to partition the global grid across processors, both for
owned and ghost grid cells. Previously any class which called
``GridComm`` performed the partitioning itself and that information
was passed in the ``GridComm::GridComm()`` constructor. There are
several "set" functions which can be called to alter how ``Grid3d``
/ ``Grid2d`` perform the partitioning. They should be sufficient
for most use cases of the grid classes.
(2) The partitioning is triggered by the ``setup_grid()`` method.
(3) The ``setup()`` method of the ``GridComm`` class has been replaced
by the ``setup_comm()`` method in the new grid classes. The syntax
for the ``forward_comm()`` and ``reverse_comm()`` methods is
slightly altered as is the syntax of the associated pack/unpack
callback methods. But the functionality of these operations is the
same as before.
(4) The new ``Grid3d`` / ``Grid2d`` classes have additional
functionality for dynamic load-balancing of grids and their
associated data across processors. This did not exist in the
``GridComm`` class.
This and more is explained in detail on the :doc:`Developer_grid` page.
The following LAMMPS source files can be used as illustrative examples
for how the new grid classes are used by computes, fixes, and various
KSpace solvers which use distributed FFT grids:
- ``src/fix_ave_grid.cpp``
- ``src/compute_property_grid.cpp``
- ``src/EXTRA-FIX/fix_ttm_grid.cpp``
- ``src/KSPACE/pppm.cpp``
This change is **required** or else the code will not compile.

View File

@ -133,6 +133,9 @@ and parsing files or arguments.
.. doxygenfunction:: trim_comment
:project: progguide
.. doxygenfunction:: strip_style_suffix
:project: progguide
.. doxygenfunction:: star_subst
:project: progguide
@ -211,6 +214,9 @@ Argument processing
.. doxygenfunction:: expand_args
:project: progguide
.. doxygenfunction:: parse_grid_id
:project: progguide
.. doxygenfunction:: expand_type
:project: progguide
@ -317,7 +323,7 @@ are all "whitespace" characters, i.e. the space character, the tabulator
character, the carriage return character, the linefeed character, and
the form feed character.
.. code-block:: C++
.. code-block:: c++
:caption: Tokenizer class example listing entries of the PATH environment variable
#include "tokenizer.h"
@ -349,7 +355,7 @@ tokenizer into a ``try`` / ``catch`` block to handle errors. The
when a (type of) number is requested as next token that is not
compatible with the string representing the next word.
.. code-block:: C++
.. code-block:: c++
:caption: ValueTokenizer class example with exception handling
#include "tokenizer.h"
@ -427,7 +433,7 @@ one or two array indices "[<number>]" with numbers > 0.
A typical code segment would look like this:
.. code-block:: C++
.. code-block:: c++
:caption: Usage example for ArgInfo class
int nvalues = 0;
@ -476,7 +482,7 @@ open the file, and will call the :cpp:class:`LAMMPS_NS::Error` class in
case of failures to read or to convert numbers, so that LAMMPS will be
aborted.
.. code-block:: C++
.. code-block:: c++
:caption: Use of PotentialFileReader class in pair style coul/streitz
PotentialFileReader reader(lmp, file, "coul/streitz");
@ -555,7 +561,7 @@ chunk size needs to be known in advance, 2) with :cpp:func:`MyPage::vget()
its size is registered later with :cpp:func:`MyPage::vgot()
<LAMMPS_NS::MyPage::vgot>`.
.. code-block:: C++
.. code-block:: c++
:caption: Example of using :cpp:class:`MyPage <LAMMPS_NS::MyPage>`
#include "my_page.h"
@ -641,7 +647,7 @@ Communication buffer coding with *ubuf*
---------------------------------------
LAMMPS uses communication buffers where it collects data from various
class instances and then exchanges the data with neighboring sub-domains.
class instances and then exchanges the data with neighboring subdomains.
For simplicity those buffers are defined as ``double`` buffers and
used for doubles and integer numbers. This presents a unique problem
when 64-bit integers are used. While the storage needed for a ``double``

View File

@ -26,7 +26,7 @@ constructor with the signature: ``FixPrintVel(class LAMMPS *, int, char **)``.
Every fix must be registered in LAMMPS by writing the following lines
of code in the header before include guards:
.. code-block:: c
.. code-block:: c++
#ifdef FIX_CLASS
// clang-format off
@ -47,7 +47,7 @@ keyword when it parses the input script.
Let's write a simple fix which will print the average velocity at the end
of each timestep. First of all, implement a constructor:
.. code-block:: C++
.. code-block:: c++
FixPrintVel::FixPrintVel(LAMMPS *lmp, int narg, char **arg)
: Fix(lmp, narg, arg)
@ -72,7 +72,7 @@ in the Fix class called ``nevery`` which specifies how often the method
The next method we need to implement is ``setmask()``:
.. code-block:: C++
.. code-block:: c++
int FixPrintVel::setmask()
{
@ -87,7 +87,7 @@ during execution. The constant ``END_OF_STEP`` corresponds to the
are called during a timestep and the order in which they are called
are shown in the previous section.
.. code-block:: C++
.. code-block:: c++
void FixPrintVel::end_of_step()
{
@ -143,7 +143,7 @@ The group membership information of an atom is contained in the *mask*
property of and atom and the bit corresponding to a given group is
stored in the groupbit variable which is defined in Fix base class:
.. code-block:: C++
.. code-block:: c++
for (int i = 0; i < nlocal; ++i) {
if (atom->mask[i] & groupbit) {
@ -174,7 +174,7 @@ to store positions of atoms from previous timestep, we need to add
``double** xold`` to the header file. Than add allocation code
to the constructor:
.. code-block:: C++
.. code-block:: c++
FixSavePos::FixSavePos(LAMMPS *lmp, int narg, char **arg), xold(nullptr)
{
@ -190,7 +190,7 @@ to the constructor:
Implement the aforementioned methods:
.. code-block:: C++
.. code-block:: c++
double FixSavePos::memory_usage()
{

View File

@ -113,7 +113,7 @@ LAMMPS output, something is wrong with your simulation. If you
suspect this is happening, it is a good idea to print out
thermodynamic info frequently (e.g. every timestep) via the
:doc:`thermo <thermo>` so you can monitor what is happening.
Visualizing the atom movement is also a good idea to insure your model
Visualizing the atom movement is also a good idea to ensure your model
is behaving as you expect.
In parallel, one way LAMMPS can hang is due to how different MPI

View File

@ -40,7 +40,7 @@ We use it to show how to identify the origin of a segmentation fault.
After recompiling LAMMPS and running the input you should get something like this:
.. code-block::
.. code-block:: console
$ ./lmp -in in.melt
LAMMPS (19 Mar 2020)
@ -90,8 +90,9 @@ it. When it reaches the code causing the segmentation fault, it will
stop with a message why it stopped, print the current line of code, and
drop back to the GDB prompt.
.. code-block::
.. code-block:: console
(gdb) run
[...]
Setting up Verlet run ...
Unit style : lj
@ -106,7 +107,7 @@ drop back to the GDB prompt.
Now typing the command "where" will show the stack of functions starting from
the current function back to "main()".
.. code-block::
.. code-block:: console
(gdb) where
#0 0x00000000006653ab in LAMMPS_NS::PairLJCut::compute (this=0x829740, eflag=1, vflag=<optimized out>) at /home/akohlmey/compile/lammps/src/pair_lj_cut.cpp:139
@ -124,7 +125,7 @@ You can also print the value of variables and see if there is anything
unexpected. Segmentation faults, for example, commonly happen when a
pointer variable is not assigned and still initialized to NULL.
.. code-block::
.. code-block:: console
(gdb) print x
$1 = (double **) 0x7ffff7ca1010
@ -153,7 +154,7 @@ utility to the current folder. Example: ``coredumpctl -o core dump lmp``.
Now you can launch the debugger to load the executable, its debug info
and the core dump and drop you to a prompt like before.
.. code-block::
.. code-block:: console
$ gdb lmp core
Reading symbols from lmp...
@ -186,7 +187,7 @@ recommended to redirect the valgrind output to a file (e.g. with
process ID) so that the messages of the multiple valgrind instances to
the console are not mixed.
.. code-block::
.. code-block:: console
$ valgrind ./lmp -in in.melt
==1933642== Memcheck, a memory error detector

View File

@ -5635,7 +5635,7 @@ Doc page with :doc:`WARNING messages <Errors_warnings>`
Lost atoms are checked for each time thermo output is done. See the
thermo_modify lost command for options. Lost atoms usually indicate
bad dynamics, e.g. atoms have been blown far out of the simulation
box, or moved further than one processor's sub-domain away before
box, or moved further than one processor's subdomain away before
reneighboring.
*MEAM library error %d*
@ -6092,7 +6092,7 @@ keyword to allow for additional bonds to be formed
after a read_data, read_restart, or create_box command.
*Next command must list all universe and uloop variables*
This is to insure they stay in sync.
This is to ensure they stay in sync.
*No Kspace style defined for compute group/group*
Self-explanatory.
@ -6266,14 +6266,14 @@ keyword to allow for additional bonds to be formed
One or more atoms are attempting to map their charge to a MSM grid point
that is not owned by a processor. This is likely for one of two
reasons, both of them bad. First, it may mean that an atom near the
boundary of a processor's sub-domain has moved more than 1/2 the
boundary of a processor's subdomain has moved more than 1/2 the
:doc:`neighbor skin distance <neighbor>` without neighbor lists being
rebuilt and atoms being migrated to new processors. This also means
you may be missing pairwise interactions that need to be computed.
The solution is to change the re-neighboring criteria via the
:doc:`neigh_modify <neigh_modify>` command. The safest settings are
"delay 0 every 1 check yes". Second, it may mean that an atom has
moved far outside a processor's sub-domain or even the entire
moved far outside a processor's subdomain or even the entire
simulation box. This indicates bad physics, e.g. due to highly
overlapping atoms, too large a timestep, etc.
@ -6281,14 +6281,14 @@ keyword to allow for additional bonds to be formed
One or more atoms are attempting to map their charge to a PPPM grid
point that is not owned by a processor. This is likely for one of two
reasons, both of them bad. First, it may mean that an atom near the
boundary of a processor's sub-domain has moved more than 1/2 the
boundary of a processor's subdomain has moved more than 1/2 the
:doc:`neighbor skin distance <neighbor>` without neighbor lists being
rebuilt and atoms being migrated to new processors. This also means
you may be missing pairwise interactions that need to be computed.
The solution is to change the re-neighboring criteria via the
:doc:`neigh_modify <neigh_modify>` command. The safest settings are
"delay 0 every 1 check yes". Second, it may mean that an atom has
moved far outside a processor's sub-domain or even the entire
moved far outside a processor's subdomain or even the entire
simulation box. This indicates bad physics, e.g. due to highly
overlapping atoms, too large a timestep, etc.
@ -6296,14 +6296,14 @@ keyword to allow for additional bonds to be formed
One or more atoms are attempting to map their charge to a PPPM grid
point that is not owned by a processor. This is likely for one of two
reasons, both of them bad. First, it may mean that an atom near the
boundary of a processor's sub-domain has moved more than 1/2 the
boundary of a processor's subdomain has moved more than 1/2 the
:doc:`neighbor skin distance <neighbor>` without neighbor lists being
rebuilt and atoms being migrated to new processors. This also means
you may be missing pairwise interactions that need to be computed.
The solution is to change the re-neighboring criteria via the
:doc:`neigh_modify <neigh_modify>` command. The safest settings are
"delay 0 every 1 check yes". Second, it may mean that an atom has
moved far outside a processor's sub-domain or even the entire
moved far outside a processor's subdomain or even the entire
simulation box. This indicates bad physics, e.g. due to highly
overlapping atoms, too large a timestep, etc.
@ -7231,7 +7231,7 @@ keyword to allow for additional bonds to be formed
*Replacing a fix, but new style != old style*
A fix ID can be used a second time, but only if the style matches the
previous fix. In this case it is assumed you with to reset a fix's
previous fix. In this case it is assumed you want to reset a fix's
parameters. This error may mean you are mistakenly re-using a fix ID
when you do not intend to.
@ -7337,7 +7337,7 @@ keyword to allow for additional bonds to be formed
*Rigid body atoms %d %d missing on proc %d at step %ld*
This means that an atom cannot find the atom that owns the rigid body
it is part of, or vice versa. The solution is to use the communicate
cutoff command to insure ghost atoms are acquired from far enough away
cutoff command to ensure ghost atoms are acquired from far enough away
to encompass the max distance printed when the fix rigid/small command
was invoked.

View File

@ -109,9 +109,9 @@ Doc page with :doc:`ERROR messages <Errors_messages>`
*Communication cutoff is shorter than a bond length based estimate. This may lead to errors.*
Since LAMMPS stores topology data with individual atoms, all atoms
comprising a bond, angle, dihedral or improper must be present on any
sub-domain that "owns" the atom with the information, either as a
subdomain that "owns" the atom with the information, either as a
local or a ghost atom. The communication cutoff is what determines up
to what distance from a sub-domain boundary ghost atoms are created.
to what distance from a subdomain boundary ghost atoms are created.
The communication cutoff is by default the largest non-bonded cutoff
plus the neighbor skin distance, but for short or non-bonded cutoffs
and/or long bonds, this may not be sufficient. This warning indicates
@ -351,7 +351,7 @@ This will most likely cause errors in kinetic fluctuations.
Self-explanatory.
*Kspace_modify slab param < 2.0 may cause unphysical behavior*
The kspace_modify slab parameter should be larger to insure periodic
The kspace_modify slab parameter should be larger to ensure periodic
grids padded with empty space do not overlap.
*Less insertions than requested*
@ -398,7 +398,7 @@ This will most likely cause errors in kinetic fluctuations.
Lost atoms are checked for each time thermo output is done. See the
thermo_modify lost command for options. Lost atoms usually indicate
bad dynamics, e.g. atoms have been blown far out of the simulation
box, or moved further than one processor's sub-domain away before
box, or moved further than one processor's subdomain away before
reneighboring.
*MSM mesh too small, increasing to 2 points in each direction*
@ -491,7 +491,7 @@ This will most likely cause errors in kinetic fluctuations.
*Neighbor exclusions used with KSpace solver may give inconsistent Coulombic energies*
This is because excluding specific pair interactions also excludes
them from long-range interactions which may not be the desired effect.
The special_bonds command handles this consistently by insuring
The special_bonds command handles this consistently by ensuring
excluded (or weighted) 1-2, 1-3, 1-4 interactions are treated
consistently by both the short-range pair style and the long-range
solver. This is not done for exclusions of charged atom pairs via the
@ -545,7 +545,7 @@ This will most likely cause errors in kinetic fluctuations.
If there are other fixes that act immediately after the initial stage
of time integration within a timestep (i.e. after atoms move), then
the command that sets up the dynamic group should appear after those
fixes. This will insure that dynamic group assignments are made
fixes. This will ensure that dynamic group assignments are made
after all atoms have moved.
*One or more respa levels compute no forces*
@ -582,13 +582,13 @@ This will most likely cause errors in kinetic fluctuations.
needed. The requested volume fraction may be too high, or other atoms
may be in the insertion region.
*Proc sub-domain size < neighbor skin, could lead to lost atoms*
*Proc subdomain size < neighbor skin, could lead to lost atoms*
The decomposition of the physical domain (likely due to load
balancing) has led to a processor's sub-domain being smaller than the
balancing) has led to a processor's subdomain being smaller than the
neighbor skin in one or more dimensions. Since reneighboring is
triggered by atoms moving the skin distance, this may lead to lost
atoms, if an atom moves all the way across a neighboring processor's
sub-domain before reneighboring is triggered.
subdomain before reneighboring is triggered.
*Reducing PPPM order b/c stencil extends beyond nearest neighbor processor*
This may lead to a larger grid than desired. See the kspace_modify overlap

View File

@ -1,7 +1,7 @@
Example scripts
===============
The LAMMPS distribution includes an examples sub-directory with many
The LAMMPS distribution includes an examples subdirectory with many
sample problems. Many are 2d models that run quickly and are
straightforward to visualize, requiring at most a couple of minutes to
run on a desktop machine. Each problem has an input script (in.\*) and
@ -29,7 +29,7 @@ be quickly post-processed into a movie using commands described on the
Animations of many of the examples can be viewed on the Movies section
of the `LAMMPS website <https://www.lammps.org/movies.html>`_.
There are two kinds of sub-directories in the examples folder. Lower
There are two kinds of subdirectories in the examples folder. Lower
case named directories contain one or a few simple, quick-to-run
problems. Upper case named directories contain up to several complex
scripts that illustrate a particular kind of simulation method or
@ -221,10 +221,10 @@ Uppercase directories
Nearly all of these directories have README files which give more
details on how to understand and use their contents.
The PACKAGES directory has a large number of sub-directories which
The PACKAGES directory has a large number of subdirectories which
correspond by name to specific packages. They contain scripts that
illustrate how to use the command(s) provided in those packages. Many
of the sub-directories have their own README files which give further
of the subdirectories have their own README files which give further
instructions. See the :doc:`Packages_details <Packages_details>` doc
page for more info on specific packages.

File diff suppressed because it is too large Load Diff

View File

@ -4,10 +4,10 @@ Howto discussions
These doc pages describe how to perform various tasks with LAMMPS,
both for users and developers. The
`glossary <https://www.lammps.org/glossary.html>`_ website page also lists MD
terminology with links to corresponding LAMMPS manual pages. The
example input scripts included in the examples directory of the LAMMPS
distribution and highlighted on the :doc:`Examples <Examples>` doc page
also show how to setup and run various kinds of simulations.
terminology, with links to corresponding LAMMPS manual pages. The
example input scripts included in the ``examples`` directory of the LAMMPS
source code distribution and highlighted on the :doc:`Examples` page
also show how to set up and run various kinds of simulations.
General howto
=============
@ -51,6 +51,7 @@ Analysis howto
Howto_output
Howto_chunk
Howto_grid
Howto_temperature
Howto_elastic
Howto_kappa

View File

@ -22,7 +22,7 @@ atom in the file, assign a z coordinate so it falls inside the
z-boundaries of the box - e.g. 0.0.
Use the :doc:`fix enforce2d <fix_enforce2d>` command as the last
defined fix to insure that the z-components of velocities and forces
defined fix to ensure that the z-components of velocities and forces
are zeroed out every timestep. The reason to make it the last fix is
so that any forces induced by other fixes will be zeroed out.

View File

@ -261,11 +261,11 @@ all the options available to use with the tinker2lmp.py script:
.. code-block:: bash
% python tinker2lmp.py -xyz water_dimer.xyz -amoeba amoeba_water.prm -data data.water_dimer.amoeba # AMOEBA non-periodic system
% python tinker2lmp.py -xyz water_dimer.xyz -hippo hippo_water.prm -data data.water_dimer.hippo # HIPPO non-periodic system
% python tinker2lmp.py -xyz water_box.xyz -amoeba amoeba_water.prm -data data.water_box.amoeba -pbc 18.643 18.643 18.643 # AMOEBA periodic system
% python tinker2lmp.py -xyz water_box.xyz -hippo hippo_water.prm -data data.water_box.hippo -pbc 18.643 18.643 18.643 # HIPPO periodic system
% python tinker2lmp.py -xyz ubiquitin.xyz -amoeba amoeba_ubiquitin.prm -data data.ubiquitin.new -pbc 54.99 41.91 41.91 -bitorsion bitorsion.ubiquitin.data.new # system with bitorsions
python tinker2lmp.py -xyz water_dimer.xyz -amoeba amoeba_water.prm -data data.water_dimer.amoeba # AMOEBA non-periodic system
python tinker2lmp.py -xyz water_dimer.xyz -hippo hippo_water.prm -data data.water_dimer.hippo # HIPPO non-periodic system
python tinker2lmp.py -xyz water_box.xyz -amoeba amoeba_water.prm -data data.water_box.amoeba -pbc 18.643 18.643 18.643 # AMOEBA periodic system
python tinker2lmp.py -xyz water_box.xyz -hippo hippo_water.prm -data data.water_box.hippo -pbc 18.643 18.643 18.643 # HIPPO periodic system
python tinker2lmp.py -xyz ubiquitin.xyz -amoeba amoeba_ubiquitin.prm -data data.ubiquitin.new -pbc 54.99 41.91 41.91 -bitorsion bitorsion.ubiquitin.data.new # system with bitorsions
Switches and their arguments may be specified in any order.

View File

@ -3,16 +3,16 @@ Bonded particle models
The BPM package implements bonded particle models which can be used to
simulate mesoscale solids. Solids are constructed as a collection of
particles which each represent a coarse-grained region of space much
larger than the atomistic scale. Particles within a solid region are
particles, which each represent a coarse-grained region of space much
larger than the atomistic scale. Particles within a solid region are
then connected by a network of bonds to provide solid elasticity.
Unlike traditional bonds in molecular dynamics, the equilibrium bond
length can vary between bonds. Bonds store the reference state. This
includes setting the equilibrium length equal to the initial distance
between the two particles but can also include data on the bond
orientation for rotational models. This produces a stress free initial
state. Furthermore, bonds are allowed to break under large strains
between the two particles, but can also include data on the bond
orientation for rotational models. This produces a stress-free initial
state. Furthermore, bonds are allowed to break under large strains,
producing fracture. The examples/bpm directory has sample input scripts
for simulations of the fragmentation of an impacted plate and the
pouring of extended, elastic bodies.
@ -22,8 +22,8 @@ pouring of extended, elastic bodies.
Bonds can be created using a :doc:`read data <read_data>` or
:doc:`create bonds <create_bonds>` command. Alternatively, a
:doc:`molecule <molecule>` template with bonds can be used with
:doc:`fix deposit <fix_deposit>` or :doc:`fix pour <fix_pour>` to
create solid grains.
:doc:`fix deposit <fix_deposit>` or :doc:`fix pour <fix_pour>` to create
solid grains.
In this implementation, bonds store their reference state when they are
first computed in the setup of the first simulation run. Data is then
@ -35,21 +35,20 @@ such as those created by pouring grains using :doc:`fix pour
----------
Currently there are two types of bonds included in the BPM
package. The first bond style, :doc:`bond bpm/spring
<bond_bpm_spring>`, only applies pairwise, central body forces. Point
particles must have :doc:`bond atom style <atom_style>` and may be
thought of as nodes in a spring network. Alternatively, the second
bond style, :doc:`bond bpm/rotational <bond_bpm_rotational>`, resolves
tangential forces and torques arising with the shearing, bending, and
twisting of the bond due to rotation or displacement of particles.
Particles are similar to those used in the :doc:`granular package
<Howto_granular>`, :doc:`atom style sphere <atom_style>`. However,
they must also track the current orientation of particles and store bonds
and therefore use a :doc:`bpm/sphere atom style <atom_style>`.
This also requires a unique integrator :doc:`fix nve/bpm/sphere
<fix_nve_bpm_sphere>` which numerically integrates orientation similar
to :doc:`fix nve/asphere <fix_nve_asphere>`.
Currently, there are two types of bonds included in the BPM package. The
first bond style, :doc:`bond bpm/spring <bond_bpm_spring>`, only applies
pairwise, central body forces. Point particles must have :doc:`bond atom
style <atom_style>` and may be thought of as nodes in a spring
network. Alternatively, the second bond style, :doc:`bond bpm/rotational
<bond_bpm_rotational>`, resolves tangential forces and torques arising
with the shearing, bending, and twisting of the bond due to rotation or
displacement of particles. Particles are similar to those used in the
:doc:`granular package <Howto_granular>`, :doc:`atom style sphere
<atom_style>`. However, they must also track the current orientation of
particles and store bonds, and therefore use a :doc:`bpm/sphere atom
style <atom_style>`. This also requires a unique integrator :doc:`fix
nve/bpm/sphere <fix_nve_bpm_sphere>` which numerically integrates
orientation similar to :doc:`fix nve/asphere <fix_nve_asphere>`.
In addition to bond styles, a new pair style :doc:`pair bpm/spring
<pair_bpm_spring>` was added to accompany the bpm/spring bond
@ -63,7 +62,7 @@ A list of IDs for bonded atoms can be generated using the
:doc:`compute property/local <compute_property_local>` command.
Various properties of bonds can be computed using the
:doc:`compute bond/local <compute_bond_local>` command. This
command allows one to access data saved to the bond's history
command allows one to access data saved to the bond's history,
such as the reference length of the bond. More information on
bond history data can be found on the documentation pages for the specific
BPM bond styles. Finally, this data can be output using a :doc:`dump local <dump>`
@ -90,7 +89,7 @@ bond settings
Alternatively, one can turn off all pair interactions between bonded
particles. Unlike :doc:`bond quartic <bond_quartic>`, this is not done
by subtracting pair forces during the bond computation but rather by
by subtracting pair forces during the bond computation, but rather by
dynamically updating the special bond list. This is the default behavior
of BPM bond styles and is done by updating the 1-2 special bond list as
bonds break. To do this, LAMMPS requires :doc:`newton <newton>` bond off
@ -134,7 +133,10 @@ the following are currently compatible with BPM bond styles:
* :doc:`fix bond/break <fix_bond_break>`
* :doc:`fix bond/swap <fix_bond_swap>`
Note :doc:`create_bonds <create_bonds>` requires certain special_bonds settings.
To subtract pair interactions, one will need to switch between different
special_bonds settings in the input script. An example is found in
examples/bpm/impact.
.. note::
The :doc:`create_bonds <create_bonds>` command requires certain
:doc:`special_bonds <special_bonds>` settings. To subtract pair
interactions, one will need to switch between different *special_bonds*
settings in the input script. An example is found in
``examples/bpm/impact``.

View File

@ -1,15 +1,15 @@
Broken Bonds
============
Typically, bond interactions persist for the duration of a simulation
in LAMMPS. However, there are some exceptions that allow for bonds to
break including the :doc:`quartic bond style <bond_quartic>` and the
Typically, bond interactions persist for the duration of a simulation in
LAMMPS. However, there are some exceptions that allow for bonds to
break, including the :doc:`quartic bond style <bond_quartic>` and the
bond styles in the :doc:`BPM package <Howto_bpm>` which contains the
:doc:`bpm/spring <bond_bpm_spring>` and
:doc:`bpm/rotational <bond_bpm_rotational>` bond styles. In these cases,
a bond can be broken if it is stretched beyond a user-defined threshold.
LAMMPS accomplishes this by setting the bond type to zero such that the
bond force is no longer computed.
:doc:`bpm/spring <bond_bpm_spring>` and :doc:`bpm/rotational
<bond_bpm_rotational>` bond styles. In these cases, a bond can be broken
if it is stretched beyond a user-defined threshold. LAMMPS accomplishes
this by setting the bond type to 0, such that the bond force is no
longer computed.
Users are normally able to weight the contribution of pair forces to atoms
that are bonded using the :doc:`special_bonds command <special_bonds>`.

View File

@ -46,7 +46,7 @@ This tutorial assumes that you are operating in a command-line environment
using a shell like Bash.
- Linux: any Terminal window will work
- MacOS X: launch the Terminal application.
- macOS: launch the Terminal application.
- Windows 10: install and run the :doc:`Windows Subsystem for Linux <Howto_wsl>`
We also assume that you have downloaded and unpacked a recent LAMMPS source code package
@ -56,7 +56,7 @@ You should change into the top level directory of the LAMMPS source tree all
paths mentioned in the tutorial are relative to that. Immediately after downloading
it should look like this:
.. code-block:: bash
.. code-block:: console
$ ls
bench doc lib potentials README tools
@ -89,7 +89,7 @@ different options (``build-parallel``, ``build-serial``) or with
different compilers (``build-gnu``, ``build-clang``, ``build-intel``)
and so on. All the auxiliary files created by one build process
(executable, object files, log files, etc) are stored in this directory
or sub-directories within it that CMake creates.
or subdirectories within it that CMake creates.
Running CMake
@ -104,7 +104,7 @@ the progress of the configuration printed to the screen followed by a
summary of the enabled features, options and compiler settings. A typical
summary screen will look like this:
.. code-block::
.. code-block:: console
$ cmake ../cmake/
-- The CXX compiler identification is GNU 8.2.0

View File

@ -111,7 +111,7 @@ Therefore it is typically desirable to decouple the relative motion of
the core/shell pair, which is an imaginary degree of freedom, from the
real physical system. To do that, the :doc:`compute temp/cs <compute_temp_cs>` command can be used, in conjunction with
any of the thermostat fixes, such as :doc:`fix nvt <fix_nh>` or :doc:`fix langevin <fix_langevin>`. This compute uses the center-of-mass velocity
of the core/shell pairs to calculate a temperature, and insures that
of the core/shell pairs to calculate a temperature, and ensures that
velocity is what is rescaled for thermostatting purposes. This
compute also works for a system with both core/shell pairs and
non-polarized ions (ions without an attached satellite particle). The

View File

@ -1,27 +1,27 @@
Coupling LAMMPS to other codes
==============================
LAMMPS is designed to allow it to be coupled to other codes. For
LAMMPS is designed to support being coupled to other codes. For
example, a quantum mechanics code might compute forces on a subset of
atoms and pass those forces to LAMMPS. Or a continuum finite element
(FE) simulation might use atom positions as boundary conditions on FE
nodal points, compute a FE solution, and return interpolated forces on
MD atoms.
LAMMPS can be coupled to other codes in at least 4 ways. Each has
advantages and disadvantages, which you will have to think about in the
context of your application.
LAMMPS can be coupled to other codes in at least 4 different ways. Each
has advantages and disadvantages, which you will have to think about in
the context of your application.
1. Define a new :doc:`fix <fix>` command that calls the other code.
In this scenario, LAMMPS is the driver code. During timestepping,
the fix is invoked, and can make library calls to the other code,
which has been linked to LAMMPS as a library. This is the way the
1. Define a new :doc:`fix <fix>` command that calls the other code. In
this scenario, LAMMPS is the driver code. During timestepping, the
fix is invoked, and can make library calls to the other code, which
has been linked to LAMMPS as a library. This is the way the
:ref:`LATTE <PKG-LATTE>` package, which performs density-functional
tight-binding calculations using the `LATTE software
<https://github.com/lanl/LATTE>`_ to compute forces, is hooked to
<https://github.com/lanl/LATTE>`_ to compute forces, is interfaced to
LAMMPS. See the :doc:`fix latte <fix_latte>` command for more
details. Also see the :doc:`Modify <Modify>` doc pages for info on
how to add a new fix to LAMMPS.
details. Also see the :doc:`Modify <Modify>` pages for information
on how to add a new fix to LAMMPS.
.. spacer
@ -42,28 +42,26 @@ context of your application.
stand-alone code could communicate with LAMMPS through files that the
command writes and reads.
See the :doc:`Modify command <Modify_command>` page for info on how
to add a new command to LAMMPS.
See the :doc:`Modify command <Modify_command>` page for information
on how to add a new command to LAMMPS.
.. spacer
3. Use LAMMPS as a library called by another code. In this case the
other code is the driver and calls LAMMPS as needed. Or a wrapper
code could link and call both LAMMPS and another code as libraries.
Again, the :doc:`run <run>` command has options that allow it to be
invoked with minimal overhead (no setup or clean-up) if you wish to
do multiple short runs, driven by another program. Details about
using the library interface are given in the :doc:`library API
<Library>` documentation.
3. Use LAMMPS as a library called by another code. In this case, the
other code is the driver and calls LAMMPS as needed. Alternately, a
wrapper code could link and call both LAMMPS and another code as
libraries. Again, the :doc:`run <run>` command has options that
allow it to be invoked with minimal overhead (no setup or clean-up)
if you wish to do multiple short runs, driven by another program.
Details about using the library interface are given in the
:doc:`library API <Library>` documentation.
.. spacer
4. Couple LAMMPS with another code in a client/server fashion, using
using the `MDI Library
<https://molssi-mdi.github.io/MDI_Library/html/index.html>`_
4. Couple LAMMPS with another code in a client/server fashion, using the
`MDI Library <https://molssi-mdi.github.io/MDI_Library/html/index.html>`_
developed by the `Molecular Sciences Software Institute (MolSSI)
<https://molssi.org>`_ to run LAMMPS as either an MDI driver
(client) or an MDI engine (server). The MDI driver issues commands
to the MDI server to exchange data between them. See the
:doc:`Howto mdi <Howto_mdi>` page for more information about how
LAMMPS can operate in either of these modes.
<https://molssi.org>`_ to run LAMMPS as either an MDI driver (client)
or an MDI engine (server). The MDI driver issues commands to the MDI
server to exchange data between them. See the :doc:`Howto_mdi` page for
more information about how LAMMPS can operate in either of these modes.

View File

@ -78,13 +78,13 @@ machine via HTTPS:
.. code-block:: bash
$ git clone https://github.com/<your user name>/lammps.git <some name>
git clone https://github.com/<your user name>/lammps.git <some name>
or, if you have set up your GitHub account for using SSH keys, via SSH:
.. code-block:: bash
$ git clone git@github.com:<your user name>/lammps.git
git clone git@github.com:<your user name>/lammps.git
You can find the proper URL by clicking the "Clone or download"-button:
@ -103,21 +103,21 @@ and use git pull:
.. code-block:: bash
$ cd mylammps
$ git checkout develop
$ git pull https://github.com/lammps/lammps develop
cd mylammps
git checkout develop
git pull https://github.com/lammps/lammps develop
You can also add this URL as a remote:
.. code-block:: bash
$ git remote add upstream https://www.github.com/lammps/lammps
git remote add upstream https://www.github.com/lammps/lammps
From then on you can update your upstream branches with:
.. code-block:: bash
$ git fetch upstream
git fetch upstream
and then refer to the upstream repository branches with
`upstream/develop` or `upstream/release` and so on.
@ -129,8 +129,8 @@ workflow that updated this tutorial, and hence we will call the branch
.. code-block:: bash
$ git fetch upstream
$ git checkout -b github-tutorial-update upstream/develop
git fetch upstream
git checkout -b github-tutorial-update upstream/develop
Now that we have changed branches, we can make our changes to our local
repository. Just remember that if you want to start working on another,
@ -150,8 +150,8 @@ After everything is done, add the files to the branch and commit them:
.. code-block:: bash
$ git add doc/src/Howto_github.txt
$ git add doc/src/JPG/tutorial*.png
git add doc/src/Howto_github.txt
git add doc/src/JPG/tutorial*.png
.. warning::
@ -174,13 +174,13 @@ useful message that explains the change.
.. code-block:: bash
$ git commit -m 'Finally updated the GitHub tutorial'
git commit -m 'Finally updated the GitHub tutorial'
After the commit, the changes can be pushed to the same branch on GitHub:
.. code-block:: bash
$ git push
git push
Git will ask you for your user name and password on GitHub if you have
not configured anything. If your local branch is not present on GitHub yet,
@ -188,7 +188,7 @@ it will ask you to add it by running
.. code-block:: bash
$ git push --set-upstream origin github-tutorial-update
git push --set-upstream origin github-tutorial-update
If you correctly type your user name and
password, the feature branch should be added to your fork on GitHub.
@ -198,13 +198,13 @@ If you want to make really sure you push to the right repository
.. code-block:: bash
$ git push origin
git push origin
or using an explicit URL:
.. code-block:: bash
$ git push git@github.com:Pakketeretet2/lammps.git
git push git@github.com:Pakketeretet2/lammps.git
----------
@ -315,7 +315,7 @@ add changes. Please watch the comments to the pull requests. The two
"test" labels are used to trigger extended tests before the code is
merged. This is sometimes done by LAMMPS developers, if they suspect
that there may be some subtle side effects from your changes. It is not
done by default, because those tests are very time consuming. The
done by default, because those tests are very time-consuming. The
*ready_for_merge* label is usually attached when the LAMMPS developer
assigned to the pull request considers this request complete and to
trigger a final full test evaluation.
@ -412,10 +412,10 @@ we need to pull Axel's change back into our branch, and merge them:
.. code-block:: bash
$ git add Howto_github.txt
$ git add JPG/tutorial_reverse_pull_request*.png
$ git commit -m "Updated text and images on reverse pull requests"
$ git pull
git add Howto_github.txt
git add JPG/tutorial_reverse_pull_request*.png
git commit -m "Updated text and images on reverse pull requests"
git pull
In this case, the merge was painless because git could auto-merge:
@ -428,10 +428,10 @@ commit and push again:
.. code-block:: bash
$ git add Howto_github.txt
$ git add JPG/tutorial_reverse_pull_request6.png
$ git commit -m "Merged Axel's suggestions and updated text"
$ git push git@github.com:Pakketeretet2/lammps
git add Howto_github.txt
git add JPG/tutorial_reverse_pull_request6.png
git commit -m "Merged Axel's suggestions and updated text"
git push git@github.com:Pakketeretet2/lammps
This merge also shows up on the lammps GitHub page:
@ -456,9 +456,9 @@ branch!
.. code-block:: bash
$ git checkout develop
$ git pull https://github.com/lammps/lammps develop
$ git branch -d github-tutorial-update
git checkout develop
git pull https://github.com/lammps/lammps develop
git branch -d github-tutorial-update
If you do not pull first, it is not really a problem but git will warn
you at the next statement that you are deleting a local branch that
@ -472,7 +472,7 @@ to your remote(s) as well:
.. code-block:: bash
$ git push origin :github-tutorial-update
git push origin :github-tutorial-update
**Recent changes in the workflow**
@ -486,5 +486,6 @@ simplify comparisons between releases. Finally, all patches and
submissions are subject to automatic testing and code checks to make
sure they at the very least compile.
A discussion of the LAMMPS developer GitHub workflow can be found in the file
`doc/github-development-workflow.md <https://github.com/lammps/lammps/blob/develop/doc/github-development-workflow.md>`_
A discussion of the LAMMPS developer GitHub workflow can be found in the
file `doc/github-development-workflow.md
<https://github.com/lammps/lammps/blob/develop/doc/github-development-workflow.md>`_

102
doc/src/Howto_grid.rst Normal file
View File

@ -0,0 +1,102 @@
Using distributed grids
=======================
.. versionadded:: 22Dec2022
LAMMPS has internal capabilities to create uniformly spaced grids
which overlay the simulation domain. For 2d and 3d simulations these
are 2d and 3d grids respectively. Conceptually a grid can be thought
of as a collection of grid cells. Each grid cell can store one or
more values (data).
The grid cells and data they store are distributed across processors.
Each processor owns the grid cells (and data) whose center points lie
within the spatial subdomain of the processor. If needed for its
computations, a processor may also store ghost grid cells with their
data.
Distributed grids can overlay orthogonal or triclinic simulation
boxes; see the :doc:`Howto triclinic <Howto_triclinic>` doc page for
an explanation of the latter. For a triclinic box, the grid cell
shape conforms to the shape of the simulation domain,
e.g. parallelograms instead of rectangles in 2d.
If the box size or shape changes during a simulation, the grid changes
with it, so that it always overlays the entire simulation domain. For
non-periodic dimensions, the grid size in that dimension matches the
box size, as set by the :doc:`boundary <boundary>` command for fixed
or shrink-wrapped boundaries.
If load-balancing is invoked by the :doc:`balance <balance>` or
:doc:`fix balance <fix_balance>` commands, then the subdomain owned
by a processor can change which may also change which grid cells they
own.
Post-processing and visualization of grid cell data can be enabled by
the :doc:`dump grid <dump>`, :doc:`dump grid/vtk <dump>`, and
:doc:`dump image <dump_image>` commands. The latter has an optional
*grid* keyword. The `OVITO visualization tool
<https://www.ovito.org>`_ also plans (as of Nov 2022) to add support
for visualizing grid cell data (along with atoms) using :doc:`dump
grid <dump>` output files as input.
.. note::
For developers, distributed grids are implemented within the code via
two classes: Grid2d and Grid3d. These partition the grid across
processors and have methods which allow forward and reverse
communication of ghost grid data as well as load balancing. If you
write a new compute or fix which needs a distributed grid, these are
the classes to look at. A new pair style could use a distributed
grid by having a fix define it. Please see the section on
:doc:`using distributed grids within style classes <Developer_grid>`
for a detailed description.
----------
These are the commands which currently define or use distributed
grids:
* :doc:`fix ttm/grid <fix_ttm>` - store electron temperature on grid
* :doc:`fix ave/grid <fix_ave_grid>` - time average per-atom or per-grid values
* :doc:`compute property/grid <compute_property_grid>` - generate grid IDs and coords
* :doc:`dump grid <dump>` - output per-grid values in LAMMPS format
* :doc:`dump grid/vtk <dump>` - output per-grid values in VTK format
* :doc:`dump image grid <dump_image>` - include colored grid in output images
* :doc:`pair_style amoeba <pair_amoeba>` - FFT grids
* :doc:`kspace_style pppm <kspace_style>` (and variants) - FFT grids
* :doc:`kspace_style msm <kspace_style>` (and variants) - MSM grids
The grids used by the :doc:`kspace_style <kspace_style>` can not be
referenced by an input script. However the grids and data created and
used by the other commands can be.
A compute or fix command may create one or more grids (of different
sizes). Each grid can store one or more data fields. A data field
can be a single value per grid point (per-grid vector) or multiple
values per grid point (per-grid array). See the :doc:`Howto output
<Howto_output>` doc page for an explanation of how per-grid data can
be generated by some commands and used by other commands.
A command accesses grid data from a compute or fix using a *grid
reference* with the following syntax:
* c_ID:gname:dname
* c_ID:gname:dname[I]
* f_ID:gname:dname
* f_ID:gname:dname[I]
The prefix "c\_" or "f\_" refers to the ID of the compute or fix; gname is
the name of the grid, which is assigned by the compute or fix; dname is
the name of the data field, which is also assigned by the compute or
fix.
If the data field is a per-grid vector (one value per grid point),
then no brackets are used to access the values. If the data field is
a per-grid array (multiple values per grid point), then brackets are
used to specify the column I of the array. I ranges from 1 to Ncol
inclusive, where Ncol is the number of columns in the array and is
defined by the compute or fix.
Currently, there are no per-grid variables implemented in LAMMPS. We
may add this feature at some point.

View File

@ -6,22 +6,22 @@ can be built as a static or shared library, so that it can be called by
another code, used in a :doc:`coupled manner <Howto_couple>` with other
codes, or driven through a :doc:`Python interface <Python_head>`.
At the core of LAMMPS is the ``LAMMPS`` class which encapsulates the
At the core of LAMMPS is the ``LAMMPS`` class, which encapsulates the
state of the simulation program through the state of the various class
instances that it is composed of. So a calculation using LAMMPS
requires to create an instance of the ``LAMMPS`` class and then send it
requires creating an instance of the ``LAMMPS`` class and then send it
(text) commands, either individually or from a file, or perform other
operations that modify the state stored inside that instance or drive
simulations. This is essentially what the ``src/main.cpp`` file does
as well for the standalone LAMMPS executable with reading commands
either from an input file or stdin.
simulations. This is essentially what the ``src/main.cpp`` file does as
well for the standalone LAMMPS executable, reading commands either from
an input file or the standard input.
Creating a LAMMPS instance can be done by using C++ code directly or
through a C-style interface library to LAMMPS that is provided in the
files ``src/library.cpp`` and ``library.h``. This
:ref:`C language API <lammps_c_api>`, can be used from C and C++,
and is also the basis for the :doc:`Python <Python_module>` and
:doc:`Fortran <Fortran>` interfaces or wrappers included in the
files ``src/library.cpp`` and ``src/library.h``. This :ref:`C language
API <lammps_c_api>`, can be used from C and C++, and is also the basis
for the :doc:`Python <Python_module>` and :doc:`Fortran <Fortran>`
interfaces or the :ref:`SWIG based wrappers <swig>` included in the
LAMMPS source code.
The ``examples/COUPLE`` and ``python/examples`` directories contain some

View File

@ -12,11 +12,11 @@ developed by the `Molecular Sciences Software Institute (MolSSI)
<https://molssi.org>`_, which is supported by the :ref:`MDI <PKG-MDI>`
package.
Alternate methods for code coupling with LAMMPS are described on the
:doc:`Howto couple <Howto_couple>` doc page.
Alternate methods for coupling codes with LAMMPS are described on the
:doc:`Howto_couple` page.
Some advantages of client/server coupling are that the codes can run
as stand-alone executables; they need not be linked together. Thus
as stand-alone executables; they need not be linked together. Thus,
neither code needs to have a library interface. This also makes it
easy to run the two codes on different numbers of processors. If a
message protocol (format and content) is defined for a particular kind
@ -41,7 +41,7 @@ within that sub-communicator exchange messages with the corresponding
engine instance, and can also send MPI messages to other processors in
the driver. The driver code can also destroy engine instances and
re-instantiate them. LAMMPS can operate as either a stand-alone or
plugin MDI engine. When it operates as a driver, if can use either
plugin MDI engine. When it operates as a driver, it can use either
stand-alone or plugin MDI engines.
The way in which an MDI driver communicates with an MDI engine is by
@ -50,83 +50,83 @@ to MPI_Send() and MPI_Recv() calls. Each send or receive operation
uses a string to identify the command name, and optionally some data,
which can be a single value or vector of values of any data type.
Inside the MDI library, data is exchanged between the driver and
engine via MPI calls or sockets. This a run-time choice by the user.
engine via MPI calls or sockets. This is a run-time choice by the user.
----------
The :ref:`MDI <PKG-MDI>` package provides a :doc:`mdi engine <mdi>`
command which enables LAMMPS to operate as an MDI engine. Its doc
command, which enables LAMMPS to operate as an MDI engine. Its doc
page explains the variety of standard and custom MDI commands which
the LAMMPS engine recognizes and can respond to.
The package also provides a :doc:`mdi plugin <mdi>` command which
The package also provides a :doc:`mdi plugin <mdi>` command, which
enables LAMMPS to operate as an MDI driver and load an MDI engine as a
plugin library.
The package also has a `fix mdi/qm <fix_mdi_qm>` command in which
LAMMPS operates as an MDI driver in conjunction with a quantum
The package furthermore includes a `fix mdi/qm <fix_mdi_qm>` command, in
which LAMMPS operates as an MDI driver in conjunction with a quantum
mechanics code as an MDI engine. The post_force() method of the
fix_mdi_qm.cpp file shows how a driver issues MDI commands to another
code. This command can be used to couple to an MDI engine which is
``fix_mdi_qm.cpp`` file shows how a driver issues MDI commands to another
code. This command can be used to couple to an MDI engine, which is
either a stand-alone code or a plugin library.
As explained on the `fix mdi/qm <fix_mdi_qm>` command doc page, it can
be used to perform *ab initio* MD simulations or energy minimizations,
or to evaluate the quantum energy and forces for a series of
independent systems. The examples/mdi directory has example input
scripts for all of these use cases.
As explained in the `fix mdi/qm <fix_mdi_qm>` command documentation, it
can be used to perform *ab initio* MD simulations or energy
minimizations, or to evaluate the quantum energy and forces for a series
of independent systems. The ``examples/mdi`` directory has example
input scripts for all of these use cases.
----------
The examples/mdi directory contains Python scripts and LAMMPS input
script which use LAMMPS as either an MDI driver or engine or both.
script which use LAMMPS as either an MDI driver or engine, or both.
Currently, 5 example use cases are provided:
* Run ab initio MD (AIMD) using 2 instances of LAMMPS. As a driver
* Run ab initio MD (AIMD) using 2 instances of LAMMPS. As a driver,
LAMMPS performs the timestepping in either NVE or NPT mode. As an
engine, LAMMPS computes forces and is a surrogate for a quantum
code.
* As a driver, LAMMPS runs an MD simulation. Every N steps it passes
the current snapshot to an MDI engine to evaluate the energy,
virial, and peratom forces. As the engine LAMMPS is a surrogate for
a quantum code.
* As a driver, LAMMPS loops over a series of data files and passes the
configuration to an MDI engine to evaluate the energy, virial, and
peratom forces. As the engine LAMMPS is a surrogate for a quantum
* LAMMPS runs an MD simulation as a driver. Every N steps it passes the
current snapshot to an MDI engine to evaluate the energy, virial, and
peratom forces. As the engine, LAMMPS is a surrogate for a quantum
code.
* LAMMPS loops over a series of data files and passes the configuration
to an MDI engine to evaluate the energy, virial, and peratom forces
and thus acts as a simulation driver. As the engine, LAMMPS is used
as a surrogate for a quantum code.
* A Python script driver invokes a sequence of unrelated LAMMPS
calculations. Calculations can be single-point energy/force
evaluations, MD runs, or energy minimizations.
* Run AIMD with a Python driver code and 2 LAMMPS instances as
engines. The first LAMMPS instance performs MD timestepping. The
second LAMMPS instance acts as a surrogate QM code to compute
forces.
* Run AIMD with a Python driver code and 2 LAMMPS instances as engines.
The first LAMMPS instance performs MD timestepping. The second LAMMPS
instance acts as a surrogate QM code to compute forces.
Note that in any of these example where LAMMPS is used as an engine,
an actual QM code (which supports MDI) could be used in its place,
without modifying the input scripts or launch commands, except to
specify the name of the QM code.
.. note::
The examples/mdi/Run.sh file illustrates how to launch both driver and
engine codes so that they communicate using the MDI library via either
MPI or sockets. Or using the engine as a stand-alone code or plugin
library.
In any of these examples where LAMMPS is used as an engine, an actual
QM code (provided it has support for MDI) could be used in its place,
without modifying the input scripts or launch commands, except to
specify the name of the QM code.
The ``examples/mdi/Run.sh`` file illustrates how to launch both driver
and engine codes so that they communicate using the MDI library via
either MPI or sockets, or using the engine as a stand-alone code, or
as a plugin library.
-------------
Currently there are at least two quantum DFT codes which have direct
MDI support, `Quantum ESPRESSO (QE)
<https://www.quantum-espresso.org/>`_ and `INQ
<https://qsg.llnl.gov/node/101.html>`_. There are also several QM
codes which have indirect support through QCEngine or i-PI. The
former means they require a wrapper program (QCEngine) with MDI
support which writes/read files to pass data to the quantum code
itself. The list of QCEngine-supported and i-PI-supported quantum
codes is on the `MDI webpage
Currently, there are at least two quantum DFT codes which have direct MDI
support, `Quantum ESPRESSO (QE) <https://www.quantum-espresso.org/>`_
and `INQ <https://qsg.llnl.gov/node/101.html>`_. There are also several
QM codes which have indirect support through QCEngine or i-PI. The
former means they require a wrapper program (QCEngine) with MDI support
which writes/read files to pass data to the quantum code itself. The
list of QCEngine-supported and i-PI-supported quantum codes is on the
`MDI webpage
<https://molssi-mdi.github.io/MDI_Library/html/index.html>`_.
Here is how to build QE as a stand-alone ``pw.x`` file which can be
@ -134,30 +134,30 @@ used in stand-alone mode:
.. code-block:: bash
% git clone --branch mdi_plugin https://github.com/MolSSI-MDI/q-e.git <base_path>/q-e
% build the executable pw.x, following the `QE build guide <https://gitlab.com/QEF/q-e/-/wikis/Developers/CMake-build-system>`_
git clone --branch mdi_plugin https://github.com/MolSSI-MDI/q-e.git <base_path>/q-e
build the executable pw.x, following the `QE build guide <https://gitlab.com/QEF/q-e/-/wikis/Developers/CMake-build-system>`_
Here is how to build QE as a shared library which can be used in plugin mode,
which results in a libqemdi.so file in <base_path>/q-e/MDI/src:
which results in a ``libqemdi.so`` file in ``<base_path>/q-e/MDI/src``:
.. code-block:: bash
% git clone --branch mdi_plugin https://github.com/MolSSI-MDI/q-e.git <base_path>/q-e
% cd <base_path>/q-e
% ./configure --enable-parallel --enable-openmp --enable-shared FFLAGS="-fPIC" FCFLAGS="-fPIC" CFLAGS="-fPIC" foxflags="-fPIC" try_foxflags="-fPIC"
% make -j 4 mdi
git clone --branch mdi_plugin https://github.com/MolSSI-MDI/q-e.git <base_path>/q-e
cd <base_path>/q-e
./configure --enable-parallel --enable-openmp --enable-shared FFLAGS="-fPIC" FCFLAGS="-fPIC" CFLAGS="-fPIC" foxflags="-fPIC" try_foxflags="-fPIC"
make -j 4 mdi
INQ cannot be built as a stand-alone code; it is by design a library.
Here is how to build INQ as a shared library which can be used in
plugin mode, which results in a libinqmdi.so file in
<base_path>/inq/build/examples:
plugin mode, which results in a ``libinqmdi.so`` file in
``<base_path>/inq/build/examples``:
.. code-block:: bash
% git clone --branch mdi --recurse-submodules https://gitlab.com/taylor-a-barnes/inq.git <base_path>/inq
% cd <base_path>/inq
% mkdir -p build
% cd build
% ../configure --prefix=<install_path>/install
% make -j 4
% make install
git clone --branch mdi --recurse-submodules https://gitlab.com/taylor-a-barnes/inq.git <base_path>/inq
cd <base_path>/inq
mkdir -p build
cd build
../configure --prefix=<install_path>/install
make -j 4
make install

View File

@ -4,7 +4,7 @@ Run multiple simulations from one input script
This can be done in several ways. See the documentation for
individual commands for more details on how these examples work.
If "multiple simulations" means continue a previous simulation for
If "multiple simulations" means to continue a previous simulation for
more timesteps, then you simply use the :doc:`run <run>` command
multiple times. For example, this script

View File

@ -22,14 +22,17 @@ commands you specify.
As discussed below, LAMMPS gives you a variety of ways to determine
what quantities are computed and printed when the thermodynamics,
dump, or fix commands listed above perform output. Throughout this
discussion, note that users can also :doc:`add their own computes and fixes to LAMMPS <Modify>` which can then generate values that can then be
output with these commands.
discussion, note that users can also :doc:`add their own computes and
fixes to LAMMPS <Modify>` which can then generate values that can then
be output with these commands.
The following sub-sections discuss different LAMMPS command related
The following subsections discuss different LAMMPS commands related
to output and the kind of data they operate on and produce:
* :ref:`Global/per-atom/local data <global>`
* :ref:`Global/per-atom/local/per-grid data <global>`
* :ref:`Scalar/vector/array data <scalar>`
* :ref:`Per-grid data <grid>`
* :ref:`Disambiguation <disambiguation>`
* :ref:`Thermodynamic output <thermo>`
* :ref:`Dump file output <dump>`
* :ref:`Fixes that write output files <fixoutput>`
@ -42,27 +45,32 @@ to output and the kind of data they operate on and produce:
.. _global:
Global/per-atom/local data
--------------------------
Global/per-atom/local/per-grid data
-----------------------------------
Various output-related commands work with three different styles of
data: global, per-atom, or local. A global datum is one or more
system-wide values, e.g. the temperature of the system. A per-atom
datum is one or more values per atom, e.g. the kinetic energy of each
atom. Local datums are calculated by each processor based on the
atoms it owns, but there may be zero or more per atom, e.g. a list of
bond distances.
Various output-related commands work with four different styles of
data: global, per-atom, local, and per-grid. A global datum is one or
more system-wide values, e.g. the temperature of the system. A
per-atom datum is one or more values per atom, e.g. the kinetic energy
of each atom. Local datums are calculated by each processor based on
the atoms it owns, but there may be zero or more per atom, e.g. a list
of bond distances.
A per-grid datum is one or more values per grid cell, for a grid which
overlays the simulation domain. The grid cells and the data they
store are distributed across processors; each processor owns the grid
cells whose center point falls within its subdomain.
.. _scalar:
Scalar/vector/array data
------------------------
Global, per-atom, and local datums can each come in three kinds: a
single scalar value, a vector of values, or a 2d array of values. The
doc page for a "compute" or "fix" or "variable" that generates data
will specify both the style and kind of data it produces, e.g. a
per-atom vector.
Global, per-atom, and local datums can come in three kinds: a single
scalar value, a vector of values, or a 2d array of values. The doc
page for a "compute" or "fix" or "variable" that generates data will
specify both the style and kind of data it produces, e.g. a per-atom
vector.
When a quantity is accessed, as in many of the output commands
discussed below, it can be referenced via the following bracket
@ -83,6 +91,18 @@ the dimension twice (array -> scalar). Thus a command that uses
scalar values as input can typically also process elements of a vector
or array.
.. _grid:
Per-grid data
------------------------
Per-grid data can come in two kinds: a vector of values (one per grid
cekk), or a 2d array of values (multiple values per grid ckk). The
doc page for a "compute" or "fix" that generates data will specify
names for both the grid(s) and datum(s) it produces, e.g. per-grid
vectors or arrays, which can be referenced by other commands. See the
:doc:`Howto grid <Howto_grid>` doc page for more details.
.. _disambiguation:
Disambiguation
@ -90,15 +110,15 @@ Disambiguation
Some computes and fixes produce data in multiple styles, e.g. a global
scalar and a per-atom vector. Usually the context in which the input
script references the data determines which style is meant. Example: if
a compute provides both a global scalar and a per-atom vector, the
script references the data determines which style is meant. Example:
if a compute provides both a global scalar and a per-atom vector, the
former will be accessed by using ``c_ID`` in an equal-style variable,
while the latter will be accessed by using ``c_ID`` in an atom-style
variable. Note that atom-style variable formulas can also access global
scalars, but in this case it is not possible to do directly because of
the ambiguity. Instead, an equal-style variable can be defined which
accesses the global scalar, and that variable used in the atom-style
variable formula in place of ``c_ID``.
variable. Note that atom-style variable formulas can also access
global scalars, but in this case it is not possible to do this
directly because of the ambiguity. Instead, an equal-style variable
can be defined which accesses the global scalar, and that variable can
be used in the atom-style variable formula in place of ``c_ID``.
.. _thermo:
@ -107,15 +127,14 @@ Thermodynamic output
The frequency and format of thermodynamic output is set by the
:doc:`thermo <thermo>`, :doc:`thermo_style <thermo_style>`, and
:doc:`thermo_modify <thermo_modify>` commands. The
:doc:`thermo_style <thermo_style>` command also specifies what values
are calculated and written out. Pre-defined keywords can be specified
(e.g. press, etotal, etc). Three additional kinds of keywords can
also be specified (c_ID, f_ID, v_name), where a :doc:`compute <compute>`
or :doc:`fix <fix>` or :doc:`variable <variable>` provides the value to be
output. In each case, the compute, fix, or variable must generate
global values for input to the :doc:`thermo_style custom <dump>`
command.
:doc:`thermo_modify <thermo_modify>` commands. The :doc:`thermo_style
<thermo_style>` command also specifies what values are calculated and
written out. Pre-defined keywords can be specified (e.g. press, etotal,
etc). Three additional kinds of keywords can also be specified (c_ID,
f_ID, v_name), where a :doc:`compute <compute>` or :doc:`fix <fix>` or
:doc:`variable <variable>` provides the value to be output. In each
case, the compute, fix, or variable must generate global values for
input to the :doc:`thermo_style custom <dump>` command.
Note that thermodynamic output values can be "extensive" or
"intensive". The former scale with the number of atoms in the system
@ -141,9 +160,10 @@ There is also a :doc:`dump custom <dump>` format where the user
specifies what values are output with each atom. Pre-defined atom
attributes can be specified (id, x, fx, etc). Three additional kinds
of keywords can also be specified (c_ID, f_ID, v_name), where a
:doc:`compute <compute>` or :doc:`fix <fix>` or :doc:`variable <variable>`
provides the values to be output. In each case, the compute, fix, or
variable must generate per-atom values for input to the :doc:`dump custom <dump>` command.
:doc:`compute <compute>` or :doc:`fix <fix>` or :doc:`variable
<variable>` provides the values to be output. In each case, the
compute, fix, or variable must generate per-atom values for input to
the :doc:`dump custom <dump>` command.
There is also a :doc:`dump local <dump>` format where the user specifies
what local values to output. A pre-defined index keyword can be
@ -154,18 +174,23 @@ provides the values to be output. In each case, the compute or fix
must generate local values for input to the :doc:`dump local <dump>`
command.
There is also a :doc:`dump grid <dump>` format where the user
specifies what per-grid values to output from computes or fixes that
generate per-grid data.
.. _fixoutput:
Fixes that write output files
-----------------------------
Several fixes take various quantities as input and can write output
files: :doc:`fix ave/time <fix_ave_time>`, :doc:`fix ave/chunk <fix_ave_chunk>`, :doc:`fix ave/histo <fix_ave_histo>`,
:doc:`fix ave/correlate <fix_ave_correlate>`, and :doc:`fix print <fix_print>`.
files: :doc:`fix ave/time <fix_ave_time>`, :doc:`fix ave/chunk
<fix_ave_chunk>`, :doc:`fix ave/histo <fix_ave_histo>`, :doc:`fix
ave/correlate <fix_ave_correlate>`, and :doc:`fix print <fix_print>`.
The :doc:`fix ave/time <fix_ave_time>` command enables direct output to
a file and/or time-averaging of global scalars or vectors. The user
specifies one or more quantities as input. These can be global
The :doc:`fix ave/time <fix_ave_time>` command enables direct output
to a file and/or time-averaging of global scalars or vectors. The
user specifies one or more quantities as input. These can be global
:doc:`compute <compute>` values, global :doc:`fix <fix>` values, or
:doc:`variables <variable>` of any style except the atom style which
produces per-atom values. Since a variable can refer to keywords used
@ -184,8 +209,14 @@ atoms, e.g. individual molecules. The per-atom quantities can be atom
density (mass or number) or atom attributes such as position,
velocity, force. They can also be per-atom quantities calculated by a
:doc:`compute <compute>`, by a :doc:`fix <fix>`, or by an atom-style
:doc:`variable <variable>`. The chunk-averaged output of this fix can
also be used as input to other output commands.
:doc:`variable <variable>`. The chunk-averaged output of this fix is
global and can also be used as input to other output commands.
Note that the :doc:`fix ave/grid <fix_ave_grid>` command can also
average the same per-atom quantities within spatial bins, but it does
this for a distributed grid whose grid cells are owned by different
processors. It outputs per-grid data, not global data, so it is more
efficient for large numbers of averaging bins.
The :doc:`fix ave/histo <fix_ave_histo>` command enables direct output
to a file of histogrammed quantities, which can be global or per-atom
@ -202,38 +233,53 @@ written to the screen and log file or to a separate file, periodically
during a running simulation. The line can contain one or more
:doc:`variable <variable>` values for any style variable except the
vector or atom styles). As explained above, variables themselves can
contain references to global values generated by :doc:`thermodynamic keywords <thermo_style>`, :doc:`computes <compute>`,
:doc:`fixes <fix>`, or other :doc:`variables <variable>`, or to per-atom
values for a specific atom. Thus the :doc:`fix print <fix_print>`
command is a means to output a wide variety of quantities separate
from normal thermodynamic or dump file output.
contain references to global values generated by :doc:`thermodynamic
keywords <thermo_style>`, :doc:`computes <compute>`, :doc:`fixes
<fix>`, or other :doc:`variables <variable>`, or to per-atom values
for a specific atom. Thus the :doc:`fix print <fix_print>` command is
a means to output a wide variety of quantities separate from normal
thermodynamic or dump file output.
.. _computeoutput:
Computes that process output quantities
---------------------------------------
The :doc:`compute reduce <compute_reduce>` and :doc:`compute reduce/region <compute_reduce>` commands take one or more per-atom
or local vector quantities as inputs and "reduce" them (sum, min, max,
The :doc:`compute reduce <compute_reduce>` and :doc:`compute
reduce/region <compute_reduce>` commands take one or more per-atom or
local vector quantities as inputs and "reduce" them (sum, min, max,
ave) to scalar quantities. These are produced as output values which
can be used as input to other output commands.
The :doc:`compute slice <compute_slice>` command take one or more global
vector or array quantities as inputs and extracts a subset of their
values to create a new vector or array. These are produced as output
values which can be used as input to other output commands.
The :doc:`compute slice <compute_slice>` command take one or more
global vector or array quantities as inputs and extracts a subset of
their values to create a new vector or array. These are produced as
output values which can be used as input to other output commands.
The :doc:`compute property/atom <compute_property_atom>` command takes a
list of one or more pre-defined atom attributes (id, x, fx, etc) and
The :doc:`compute property/atom <compute_property_atom>` command takes
a list of one or more pre-defined atom attributes (id, x, fx, etc) and
stores the values in a per-atom vector or array. These are produced
as output values which can be used as input to other output commands.
The list of atom attributes is the same as for the :doc:`dump custom <dump>` command.
The list of atom attributes is the same as for the :doc:`dump custom
<dump>` command.
The :doc:`compute property/local <compute_property_local>` command takes
a list of one or more pre-defined local attributes (bond info, angle
info, etc) and stores the values in a local vector or array. These
are produced as output values which can be used as input to other
output commands.
The :doc:`compute property/local <compute_property_local>` command
takes a list of one or more pre-defined local attributes (bond info,
angle info, etc) and stores the values in a local vector or array.
These are produced as output values which can be used as input to
other output commands.
The :doc:`compute property/grid <compute_property_grid>` command takes
a list of one or more pre-defined per-grid attributes (id, grid cell
coords, etc) and stores the values in a per-grid vector or array.
These are produced as output values which can be used as input to the
:doc:`dump grid <dump>` command.
The :doc:`compute property/chunk <compute_property_chunk>` command
takes a list of one or more pre-defined chunk attributes (id, count,
coords for spatial bins) and stores the values in a global vector or
array. These are produced as output values which can be used as input
to other output commands.
.. _fixprocoutput:
@ -247,18 +293,42 @@ a time.
The :doc:`fix ave/atom <fix_ave_atom>` command performs time-averaging
of per-atom vectors. The per-atom quantities can be atom attributes
such as position, velocity, force. They can also be per-atom
quantities calculated by a :doc:`compute <compute>`, by a
:doc:`fix <fix>`, or by an atom-style :doc:`variable <variable>`. The
quantities calculated by a :doc:`compute <compute>`, by a :doc:`fix
<fix>`, or by an atom-style :doc:`variable <variable>`. The
time-averaged per-atom output of this fix can be used as input to
other output commands.
The :doc:`fix store/state <fix_store_state>` command can archive one or
more per-atom attributes at a particular time, so that the old values
can be used in a future calculation or output. The list of atom
attributes is the same as for the :doc:`dump custom <dump>` command,
including per-atom quantities calculated by a :doc:`compute <compute>`,
by a :doc:`fix <fix>`, or by an atom-style :doc:`variable <variable>`.
The output of this fix can be used as input to other output commands.
The :doc:`fix store/state <fix_store_state>` command can archive one
or more per-atom attributes at a particular time, so that the old
values can be used in a future calculation or output. The list of
atom attributes is the same as for the :doc:`dump custom <dump>`
command, including per-atom quantities calculated by a :doc:`compute
<compute>`, by a :doc:`fix <fix>`, or by an atom-style :doc:`variable
<variable>`. The output of this fix can be used as input to other
output commands.
The :doc:`fix ave/grid <fix_ave_grid>` command performs time-averaging
of either per-atom or per-grid data.
For per-atom data it performs averaging for the atoms within each grid
cell, similar to the :doc:`fix ave/chunk <fix_ave_chunk>` command when
its chunks are defined as regular 2d or 3d bins. The per-atom
quantities can be atom density (mass or number) or atom attributes
such as position, velocity, force. They can also be per-atom
quantities calculated by a :doc:`compute <compute>`, by a :doc:`fix
<fix>`, or by an atom-style :doc:`variable <variable>`.
The chief difference between the :doc:`fix ave/grid <fix_ave_grid>`
and :doc:`fix ave/chunk <fix_ave_chunk>` commands when used in this
context is that the former uses a distributed grid, while the latter
uses a global grid. Distributed means that each processor owns the
subset of grid cells within its subdomain. Global means that each
processor owns a copy of the entire grid. The :doc:`fix ave/grid
<fix_ave_grid>` command is thus more efficient for large grids.
For per-grid data, the :doc:`fix ave/grid <fix_ave_grid>` command
takes inputs for grid data produced by other computes or fixes and
averages the values for each grid point over time.
.. _compute:
@ -266,24 +336,25 @@ Computes that generate values to output
---------------------------------------
Every :doc:`compute <compute>` in LAMMPS produces either global or
per-atom or local values. The values can be scalars or vectors or
arrays of data. These values can be output using the other commands
described in this section. The page for each compute command
per-atom or local or per-grid values. The values can be scalars or
vectors or arrays of data. These values can be output using the other
commands described in this section. The page for each compute command
describes what it produces. Computes that produce per-atom or local
values have the word "atom" or "local" in their style name. Computes
without the word "atom" or "local" produce global values.
or per-grid values have the word "atom" or "local" or "grid as the
last word in their style name. Computes without the word "atom" or
"local" or "grid" produce global values.
.. _fix:
Fixes that generate values to output
------------------------------------
Some :doc:`fixes <fix>` in LAMMPS produces either global or per-atom or
local values which can be accessed by other commands. The values can
be scalars or vectors or arrays of data. These values can be output
using the other commands described in this section. The page for
each fix command tells whether it produces any output quantities and
describes them.
Some :doc:`fixes <fix>` in LAMMPS produces either global or per-atom
or local or per-grid values which can be accessed by other commands.
The values can be scalars or vectors or arrays of data. These values
can be output using the other commands described in this section. The
page for each fix command tells whether it produces any output
quantities and describes them.
.. _variable:
@ -300,6 +371,8 @@ computes, fixes, and other variables. The values generated by
variables can be used as input to and thus output by the other
commands described in this section.
Per-grid variables have not (yet) been implemented.
.. _table:
Summary table of output options and data flow between commands
@ -319,44 +392,52 @@ Also note that, as described above, when a command takes a scalar as
input, that could be an element of a vector or array. Likewise a
vector input could be a column of an array.
+--------------------------------------------------------+----------------------------------------------+-------------------------------------------+
| Command | Input | Output |
+--------------------------------------------------------+----------------------------------------------+-------------------------------------------+
| :doc:`thermo_style custom <thermo_style>` | global scalars | screen, log file |
+--------------------------------------------------------+----------------------------------------------+-------------------------------------------+
| :doc:`dump custom <dump>` | per-atom vectors | dump file |
+--------------------------------------------------------+----------------------------------------------+-------------------------------------------+
| :doc:`dump local <dump>` | local vectors | dump file |
+--------------------------------------------------------+----------------------------------------------+-------------------------------------------+
| :doc:`fix print <fix_print>` | global scalar from variable | screen, file |
+--------------------------------------------------------+----------------------------------------------+-------------------------------------------+
| :doc:`print <print>` | global scalar from variable | screen |
+--------------------------------------------------------+----------------------------------------------+-------------------------------------------+
| :doc:`computes <compute>` | N/A | global/per-atom/local scalar/vector/array |
+--------------------------------------------------------+----------------------------------------------+-------------------------------------------+
| :doc:`fixes <fix>` | N/A | global/per-atom/local scalar/vector/array |
+--------------------------------------------------------+----------------------------------------------+-------------------------------------------+
| :doc:`variables <variable>` | global scalars and vectors, per-atom vectors | global scalar and vector, per-atom vector |
+--------------------------------------------------------+----------------------------------------------+-------------------------------------------+
| :doc:`compute reduce <compute_reduce>` | per-atom/local vectors | global scalar/vector |
+--------------------------------------------------------+----------------------------------------------+-------------------------------------------+
| :doc:`compute slice <compute_slice>` | global vectors/arrays | global vector/array |
+--------------------------------------------------------+----------------------------------------------+-------------------------------------------+
| :doc:`compute property/atom <compute_property_atom>` | per-atom vectors | per-atom vector/array |
+--------------------------------------------------------+----------------------------------------------+-------------------------------------------+
| :doc:`compute property/local <compute_property_local>` | local vectors | local vector/array |
+--------------------------------------------------------+----------------------------------------------+-------------------------------------------+
| :doc:`fix vector <fix_vector>` | global scalars | global vector |
+--------------------------------------------------------+----------------------------------------------+-------------------------------------------+
| :doc:`fix ave/atom <fix_ave_atom>` | per-atom vectors | per-atom vector/array |
+--------------------------------------------------------+----------------------------------------------+-------------------------------------------+
| :doc:`fix ave/time <fix_ave_time>` | global scalars/vectors | global scalar/vector/array, file |
+--------------------------------------------------------+----------------------------------------------+-------------------------------------------+
| :doc:`fix ave/chunk <fix_ave_chunk>` | per-atom vectors | global array, file |
+--------------------------------------------------------+----------------------------------------------+-------------------------------------------+
| :doc:`fix ave/histo <fix_ave_histo>` | global/per-atom/local scalars and vectors | global array, file |
+--------------------------------------------------------+----------------------------------------------+-------------------------------------------+
| :doc:`fix ave/correlate <fix_ave_correlate>` | global scalars | global array, file |
+--------------------------------------------------------+----------------------------------------------+-------------------------------------------+
| :doc:`fix store/state <fix_store_state>` | per-atom vectors | per-atom vector/array |
+--------------------------------------------------------+----------------------------------------------+-------------------------------------------+
+--------------------------------------------------------+----------------------------------------------+----------------------------------------------------+
| Command | Input | Output |
+--------------------------------------------------------+----------------------------------------------+----------------------------------------------------+
| :doc:`thermo_style custom <thermo_style>` | global scalars | screen, log file |
+--------------------------------------------------------+----------------------------------------------+----------------------------------------------------+
| :doc:`dump custom <dump>` | per-atom vectors | dump file |
+--------------------------------------------------------+----------------------------------------------+----------------------------------------------------+
| :doc:`dump local <dump>` | local vectors | dump file |
+--------------------------------------------------------+----------------------------------------------+----------------------------------------------------+
| :doc:`dump grid <dump>` | per-grid vectors | dump file |
+--------------------------------------------------------+----------------------------------------------+----------------------------------------------------+
| :doc:`fix print <fix_print>` | global scalar from variable | screen, file |
+--------------------------------------------------------+----------------------------------------------+----------------------------------------------------+
| :doc:`print <print>` | global scalar from variable | screen |
+--------------------------------------------------------+----------------------------------------------+----------------------------------------------------+
| :doc:`computes <compute>` | N/A | global/per-atom/local/per-grid scalar/vector/array |
+--------------------------------------------------------+----------------------------------------------+----------------------------------------------------+
| :doc:`fixes <fix>` | N/A | global/per-atom/local/per-grid scalar/vector/array |
+--------------------------------------------------------+----------------------------------------------+----------------------------------------------------+
| :doc:`variables <variable>` | global scalars and vectors, per-atom vectors | global scalar and vector, per-atom vector |
+--------------------------------------------------------+----------------------------------------------+----------------------------------------------------+
| :doc:`compute reduce <compute_reduce>` | per-atom/local vectors | global scalar/vector |
+--------------------------------------------------------+----------------------------------------------+----------------------------------------------------+
| :doc:`compute slice <compute_slice>` | global vectors/arrays | global vector/array |
+--------------------------------------------------------+----------------------------------------------+----------------------------------------------------+
| :doc:`compute property/atom <compute_property_atom>` | N/A | per-atom vector/array |
+--------------------------------------------------------+----------------------------------------------+----------------------------------------------------+
| :doc:`compute property/local <compute_property_local>` | N/A | local vector/array |
+--------------------------------------------------------+----------------------------------------------+----------------------------------------------------+
| :doc:`compute property/grid <compute_property_grid>` | N/A | per-grid vector/array |
+--------------------------------------------------------+----------------------------------------------+----------------------------------------------------+
| :doc:`compute property/chunk <compute_property_chunk>` | N/A | global vector/array |
+--------------------------------------------------------+----------------------------------------------+----------------------------------------------------+
| :doc:`fix vector <fix_vector>` | global scalars | global vector |
+--------------------------------------------------------+----------------------------------------------+----------------------------------------------------+
| :doc:`fix ave/atom <fix_ave_atom>` | per-atom vectors | per-atom vector/array |
+--------------------------------------------------------+----------------------------------------------+----------------------------------------------------+
| :doc:`fix ave/time <fix_ave_time>` | global scalars/vectors | global scalar/vector/array, file |
+--------------------------------------------------------+----------------------------------------------+----------------------------------------------------+
| :doc:`fix ave/chunk <fix_ave_chunk>` | per-atom vectors | global array, file |
+--------------------------------------------------------+----------------------------------------------+----------------------------------------------------+
| :doc:`fix ave/grid <fix_ave_grid>` | per-atom vectors or per-grid vectors | per-grid vector/array |
+--------------------------------------------------------+----------------------------------------------+----------------------------------------------------+
| :doc:`fix ave/histo <fix_ave_histo>` | global/per-atom/local scalars and vectors | global array, file |
+--------------------------------------------------------+----------------------------------------------+----------------------------------------------------+
| :doc:`fix ave/correlate <fix_ave_correlate>` | global scalars | global array, file |
+--------------------------------------------------------+----------------------------------------------+----------------------------------------------------+
| :doc:`fix store/state <fix_store_state>` | per-atom vectors | per-atom vector/array |
+--------------------------------------------------------+----------------------------------------------+----------------------------------------------------+

Some files were not shown because too many files have changed in this diff Show More