Compare commits

...

750 Commits

Author SHA1 Message Date
e890a0b45e Merge pull request #2999 from akohlmey/maintenance-2021-09-29
Maintenance fixes for the stable release
2021-11-09 15:11:19 -05:00
68223f0385 mention that dump sorting is limited to less than 2 billion atoms 2021-11-07 08:31:15 -05:00
1291a88bff skip MPI tests if they would be oversubscribing the available processors 2021-11-07 08:30:19 -05:00
d9b687450a account for increased floating point errors when summing numbers to zero 2021-11-07 08:30:04 -05:00
bd950b37d7 change git:// protocol for accessing github to https:// protocol
https://github.blog/2021-09-01-improving-git-protocol-security-github/
2021-11-02 15:30:27 -04:00
21fcdf8c56 Fix bug in Kokkos neighborlist where stencil wasn't updated for occasional list 2021-11-02 13:17:28 -04:00
6b400fb4bf fix indexing bug 2021-10-31 16:19:17 -04:00
d982298ab2 update new LAMMPS paper citation info 2021-10-28 10:09:01 -04:00
765fd7f763 Use correct sizeof in memset 2021-10-27 17:46:37 -04:00
0325047c01 update a few GPU kernels so they can be compiled on GPUs without double precisions support 2021-10-21 07:34:05 -04:00
2dce8923ee more direct version of clearing out loaded plugins 2021-10-19 08:28:19 -04:00
8d1ba074be wipe out all loaded plugins before destroying the LAMMPS instance 2021-10-18 18:06:09 -04:00
4675a3b560 Only check for GPU double precision support if a GPU is present 2021-10-18 13:44:37 -04:00
8999b1f69f add a LAMMPS_UPDATE string define to signal updates to stable releases 2021-10-17 18:06:04 -04:00
6c2b19c11b Add support for an "Update #" appendix to the version string
This is for informative output only, so that any code depending
on the LAMMPS_VERSION define will not have to be changed and no
warnings will be printed etc.
2021-10-17 18:05:29 -04:00
a425334928 port dump vtk to correctly support custom per-atom arrays and fix some bugs 2021-10-17 11:00:33 -04:00
db2faf2789 fix bugs related to custom per-atom properties in dump style custom 2021-10-17 11:00:21 -04:00
fdbb7d0da4 Report only compatible GPU, i.e. no GPU if mixed/double precision is requested by the hardware does not support it 2021-10-15 20:26:47 -04:00
52cd99918f pppm kspace styles also require -DFFT_SINGLE when using GPUs in single precision 2021-10-15 20:24:47 -04:00
a3e6a95ffb allow single precision FFT introspection 2021-10-15 20:24:47 -04:00
5b65169997 correct expansion of fix/compute/variable arguments to avoid bogus thermo outpu 2021-10-15 20:23:57 -04:00
5f3bf69e30 plug memory leaks 2021-10-15 17:00:46 -04:00
507c02b9af must set define to "see" the lammps_open() library function 2021-10-09 10:21:31 -04:00
b7fe47ba48 Fix bugs and compilation issues in KOKKOS 2021-10-08 09:39:53 -04:00
7dfd11da4b re-freeze Sphinx and other pip installed packages for doc build
The change relative to the stable release fixes a bug with python 3.10 support
2021-10-05 10:52:34 -04:00
97ba95f30e fix a couple more bugs like in 5246cedda6 2021-10-05 10:39:03 -04:00
c1945b4ec9 Fix misplaced MPI calls bug in pair style drip 2021-10-04 07:12:50 -04:00
c4291a4b8e unfreeze versions of python packages used to build the documentation 2021-10-02 23:57:23 -04:00
5b5dfa86c5 also update eigen download for traditional build 2021-10-02 23:56:28 -04:00
3ca3f6959f update eigen3 to the latest release and move download to our own server 2021-10-02 22:55:06 -04:00
f7b7bfa406 Avoid assertions in PythonCapabilities check when using external KOKKOS 2021-10-01 12:05:59 -04:00
3d2f29c92d fix memory allocation bug causing memory corruption on 32-bit arches 2021-10-01 01:16:45 -04:00
c30ba70fab Merge pull request #2957 from akohlmey/next_release_version
Step version strings for stable release
2021-09-29 20:40:00 -04:00
8d6adfa0d1 Merge pull request #2966 from akohlmey/cmake-tweaks
Tweaks to CMake build for portability and early detection of build problems
2021-09-29 19:46:33 -04:00
111e9d9060 Merge pull request #2969 from jrgissing/bond/react-make-Nevery-per-reaction
bond/react: fix nevery keyword bug
2021-09-29 18:42:00 -04:00
7fbd2138bd recover cross-compilation with mingw64 2021-09-29 15:13:55 -04:00
a5ed701908 make Nevery keyword per-reaction 2021-09-29 14:40:22 -04:00
dd4b195552 silence compiler warnings 2021-09-29 14:04:01 -04:00
2651e6ec2f make C library example work with strict C compilers 2021-09-29 10:37:15 -04:00
81d3eb0b2e add missing keyword 2021-09-29 10:29:09 -04:00
3381f72b80 correctly handle Tcl stub library if available 2021-09-29 09:19:47 -04:00
b4307e2354 only need Tcl not Tk to compile Tcl swig wrapper 2021-09-29 09:01:01 -04:00
aa59f7bd91 must have patch command available to compile ScaFaCoS 2021-09-29 07:50:53 -04:00
af7c613200 portability improvement 2021-09-29 07:50:13 -04:00
f7238de5d5 detect and error out if BLAS/LAPACK libraries variables are a list
This will cause external project compilation to fail since the semi-colons
are converted to blanks, but one cannot properly escape the variables.
So far the only viable solution seems to be to convert the scripts from
using ExternalProject_add() to FetchContent and add_subdirectory()
2021-09-29 07:45:07 -04:00
23e173d44f compiling ML-HDNNP with downloaded n2p2 lib requires the sed command 2021-09-29 07:27:49 -04:00
9e49a934c2 Merge pull request #2965 from stanmoore1/neigh_cutoff
Bugfix: prevent neigh list from copying "unique" stencil/bin
2021-09-28 19:28:32 -04:00
8a35ea05bc Prevent neigh list from copying "unique" stencil/bin 2021-09-28 15:33:44 -06:00
ee0d439bbd Merge pull request #2963 from akohlmey/hybrid-one-coeff-bugfix
Make sure the one_coeff flag is applied to hybrid sub-styles
2021-09-28 09:44:10 -04:00
b3c8f85ff9 make sure the one_coeff flag is applied to sub-styles
since the check for Pair::one_coeff was moved to the Input class (to
reduce redundant code), hybrid substyles could "escape" that requirement.
Thus checks have to be added to the hybrid coeff() methods.
2021-09-28 04:39:46 -04:00
c4616d4a11 Merge pull request #2962 from akohlmey/doc-updates
A few final updates to the LAMMPS manual
2021-09-27 20:39:06 -04:00
9d5aa757c3 Merge pull request #2961 from akohlmey/makefile-updates
Add -std=c++11 to a number of machine makefiles for the traditional make build system
2021-09-27 19:42:49 -04:00
34fe792fad freeze versions of pip packages for processing the manual of the stable version
this way we avoid surprises in case one of the packages get updated
to an incompatible new version. these are know-to-work versions.
2021-09-27 18:31:46 -04:00
d171b92a57 Merge pull request #2959 from Colvars/fix-colvars-run0
Fix Colvars output files not written with "run 0"
2021-09-27 18:08:45 -04:00
53e227766a make "make package-update" and "make package-overwrite" less verbose 2021-09-27 18:01:37 -04:00
09e0214f7d remove references to USER packages, have package lists alphabetically sorted
"make package-update" or "make pu" must be processed in the special order
because of inter-package dependencies
2021-09-27 18:01:01 -04:00
913ce25a01 small tweak 2021-09-27 17:13:32 -04:00
9c4a82f286 be more specific about what the name of the LAMMPS executable can be
also provide a few more examples without a machine suffix
2021-09-27 16:50:25 -04:00
9dbd5bb27d copy request to mention lammps.org form home page instructions for citing 2021-09-27 16:49:29 -04:00
395e22457c add -std=c++11 to a number of machine makefiles for traditional make build 2021-09-27 16:28:55 -04:00
7601001632 Fix Colvars output files not written with "run 0"
See:
  https://github.com/Colvars/colvars/commit/ff2f0d39ee5
which fixes a bug introduced in:
  https://github.com/Colvars/colvars/commit/1e964a542b

The message applies to NAMD, but the logic used in LAMMPS when handling "run 0" is very similar.

The Colvars version string is also updated, however this commit does not
include other changes, such as the following:
  https://github.com/Colvars/colvars/pull/419
which were not fully completed before the LAMMPS Summer 2021 finalization.
2021-09-27 13:38:30 -04:00
7b11f916b7 Merge pull request #2952 from akohlmey/collected-small-changes
Final changes and bugfixes for the stable release
2021-09-26 20:18:34 -04:00
ea030c6dd8 Merge branch 'master' into collected-small-changes 2021-09-26 18:12:40 -04:00
f3b1da83f7 Merge pull request #2956 from stanmoore1/kk_eam_alloy
Fix bug in Kokkos pair_eam_alloy on GPUs
2021-09-26 17:57:03 -04:00
b1d65f001e Merge pull request #2949 from ellio167/kim-print-dirs
Add log file printing of KIM search directories in 'kim init'
2021-09-26 16:34:15 -04:00
b24079fe33 cleaner variant of version check, add directory numbering 2021-09-26 11:24:03 -04:00
18a3728800 Adjust for kim-api bug 2021-09-26 08:36:02 -05:00
184e5fd779 step version strings for stable release 2021-09-25 23:04:53 -04:00
9da8c932ab make check more obvious 2021-09-25 21:33:10 -04:00
0534d98987 update .gitignore for recent additions 2021-09-25 15:54:33 -04:00
9df8a12235 include zstd libs in windows build 2021-09-25 15:18:14 -04:00
64cfd90eeb apply current include file conventions 2021-09-25 13:36:39 -04:00
6f87b1236a cosmetic 2021-09-25 10:42:52 -04:00
53e773e438 calling fwrite() with a null pointer causes undefined behavior. avoid it. 2021-09-25 10:18:55 -04:00
1435a96d6e Fix bug in Kokkos pair_eam_alloy 2021-09-25 07:20:24 -06:00
530912a930 detect double precision support according to OpenCL specs (1.2 and later) 2021-09-25 07:20:52 -04:00
24c9bd4cd2 silence output from hwloc when launching LAMMPS 2021-09-24 23:42:33 -04:00
0b2a4ec4e7 Building voro++ lib as part of LAMMPS requires the "patch" program 2021-09-24 17:07:59 -04:00
85bc9911b8 use proper integer type for atom IDs 2021-09-24 16:57:06 -04:00
b3a8a7bf6f in floating point math a*b may be zero even if both a>0 and b>0 2021-09-24 16:43:07 -04:00
4d9cef823d must use a soft core potential to avoid a singularity 2021-09-24 16:22:44 -04:00
2df1107561 fix string formatting bugs in fix npt/cauchy 2021-09-24 15:52:01 -04:00
973cf017a9 do not call memset on a null pointer 2021-09-24 15:32:59 -04:00
42dca75225 add check and suitable error message when fp64 is required but not available 2021-09-24 12:17:58 -04:00
31f9f17c1b Merge pull request #2917 from akohlmey/programmer-guide-updates
Updates to the Programmer guide section of the manual
2021-09-24 11:27:01 -04:00
46f331095a update some formulations as suggested by @sjplimp 2021-09-23 13:51:06 -04:00
16ab49cff4 update citation info with new LAMMPS paper reference and acknowledge it 2021-09-23 11:59:43 -04:00
5ef4913ebb Merge remote-tracking branch 'github/master' into programmer-guide-updates 2021-09-23 11:16:31 -04:00
17ba0d5804 possible workaround for some GPU package neighbor list issue 2021-09-22 21:47:32 -04:00
7792a4db6b Merge pull request #2932 from rbberger/container_updates
Container definition updates
2021-09-22 17:37:50 -04:00
1b1b6298cd Merge remote-tracking branch 'origin/master' into container_updates 2021-09-22 16:29:42 -04:00
f5fa892ec8 Merge pull request #2916 from rbberger/rocm_updates
Updates to support ROCm 4.3 in GPU package
2021-09-22 16:23:19 -04:00
407f032a55 Update CMake variable descriptions 2021-09-22 15:14:39 -04:00
9906486578 correct paths to downloaded PACE package sources in lib 2021-09-22 12:40:19 -04:00
e79ae552c8 mention how to set the path to the fftw3_omp library 2021-09-22 12:23:20 -04:00
5142300b2e undo "risky" C++20 related changes 2021-09-22 12:22:52 -04:00
d89e6f6765 do not downgrade C++ standard when adding the KOKKOS package 2021-09-21 23:52:49 -04:00
ce05ed15c1 adjust for compatibility with C++20 compilers 2021-09-21 23:52:30 -04:00
f2aacca803 modernize and fix some memory leaks 2021-09-21 22:03:38 -04:00
afccf1933f correctly specify the destructor function name. 2021-09-20 23:40:14 -04:00
8d8c710982 Merge pull request #2942 from akohlmey/next_patch_release
Step version strings for the next patch release
2021-09-20 20:35:23 -04:00
9a2c2b5fe3 Merge pull request #2941 from akohlmey/collected-small-changes
Large collection of updates and bugfixes for the stable release
2021-09-20 16:49:00 -04:00
f340e15587 update version strings 2021-09-20 16:26:47 -04:00
c39d3057dc insert missing atom-ID 2021-09-20 16:14:18 -04:00
b73c9280c9 improve error message 2021-09-20 13:58:48 -04:00
5ff881fb0d Change "offsite" to "external" to correct broken URLs to lammps.org 2021-09-20 12:05:52 -04:00
22d7ce564a fix typo 2021-09-20 07:29:10 -04:00
f80df9ae41 a few more (final?) IWYU updates 2021-09-19 09:41:23 -04:00
4fcf343227 fix typo 2021-09-18 21:59:31 -04:00
3cab58bffe small correction 2021-09-18 21:34:30 -04:00
12406b90a1 more iwyu header updates 2021-09-18 21:24:01 -04:00
579f08bbbc add support for compilation of OpenCL loader on FreeBSD 2021-09-18 19:04:08 -04:00
c0a910a6c5 expand mapping to handle "style_*.h" header files correctly. 2021-09-18 16:37:06 -04:00
2b3a09ac88 a few remaining updates to include statements 2021-09-18 16:36:44 -04:00
2382d6c71d handle changes in GAP repo 2021-09-18 16:36:18 -04:00
bca99f684f update list and order of include files from include-what-you-use analysis 2021-09-18 14:16:48 -04:00
db76edbade implement utils::current_date() convenience function to reduce replicated code 2021-09-18 09:05:35 -04:00
8769c0ae98 reformat strings 2021-09-17 22:58:17 -04:00
5a6c1abeed dead code removal 2021-09-17 22:53:59 -04:00
a46b8688ea apply fix from balance command to fix balance 2021-09-17 22:52:58 -04:00
cb2de211b2 small corrections 2021-09-17 22:52:13 -04:00
a71b77c06e simplify. use utils::strdup() more. 2021-09-17 22:51:59 -04:00
385220fd4b format changes 2021-09-17 22:50:15 -04:00
cd3efc3fa8 initialize all members 2021-09-17 22:45:26 -04:00
029fd56c2a Improve style in response to Axel's suggestions 2021-09-17 20:17:45 -05:00
eb3e8e19c6 use clang-format on kim_init.cpp 2021-09-17 20:14:37 -05:00
2709e06d25 Add log file printing of KIM search directories in 'kim init' 2021-09-17 19:43:54 -05:00
ffeeb2f977 simplify 2021-09-17 19:54:55 -04:00
e6fb0e3bd8 small tweaks 2021-09-17 16:51:37 -04:00
3046c9ca93 include EXTRA-DUMP in "most" 2021-09-16 23:01:42 -04:00
dc49917412 remove unused variable 2021-09-16 22:58:42 -04:00
5bddddcd7a revert modernization change (for now) 2021-09-16 22:57:14 -04:00
5c14825d69 Add stable link in docs 2021-09-16 18:13:41 -04:00
5bbec337e5 provide more comprehensive suggestions for GPU neighbor list errors 2021-09-16 10:23:44 -04:00
0fcc10b635 fix typo 2021-09-16 10:18:49 -04:00
e82a2a3280 enforce initialization and thus silence compiler warnings 2021-09-16 07:58:21 -04:00
75f2eb604d remove redundant code: all struct members are initialized to defaults in the constructor 2021-09-16 07:45:33 -04:00
5411075cc6 modernize 2021-09-16 07:44:27 -04:00
90225153d9 make sure err_flag is initialized 2021-09-16 07:33:34 -04:00
00e396c921 move misplaced #endif and make code more readable 2021-09-16 07:33:24 -04:00
353b3a2bb3 reformat for increased readability 2021-09-16 07:25:04 -04:00
dc50db0675 use explicit scoping when virtual dispatch is not (yet) available 2021-09-16 01:01:38 -04:00
1fd25071b9 modernize 2021-09-16 01:01:19 -04:00
ef8a0e5005 removed dead code, reformat 2021-09-16 00:55:30 -04:00
761e519a15 simplify 2021-09-16 00:55:02 -04:00
a47df02f79 modernize 2021-09-16 00:54:46 -04:00
c83ad07740 simplify 2021-09-16 00:27:16 -04:00
2c945f6753 small performance optimization for pair style comb 2021-09-16 00:26:53 -04:00
7aa6241db5 about 1.5x speedup for pair style comb3 by using MathSpecial::powint() 2021-09-16 00:13:28 -04:00
2b6ff442d8 remove dead code 2021-09-16 00:11:53 -04:00
72193bf877 simplify/modernize 2021-09-16 00:11:44 -04:00
707d9f0ad2 use correct data type for MPI calls 2021-09-16 00:11:16 -04:00
94f83c172a simplify and modernize code a little 2021-09-15 23:15:14 -04:00
272badfa7f small tweaks 2021-09-15 20:14:06 -04:00
1f1029486a fix small bug 2021-09-15 20:13:54 -04:00
7196a295a6 small tweaks from static code analysis 2021-09-15 19:50:52 -04:00
fef8f51d80 refer to "XXX Coeffs" sections consistently 2021-09-15 19:20:47 -04:00
8fa5ac28c4 Merge pull request #2939 from rbberger/python_module_fixes
Python module fixes
2021-09-15 21:47:01 +00:00
fbd0fd7727 fix typo 2021-09-15 17:23:20 -04:00
70b09a809d Bugfix from Trung for crashes in pppm/gpu without local atoms 2021-09-15 17:23:12 -04:00
36b3ee32a4 simplify 2021-09-15 16:46:33 -04:00
3caa066c28 simplify/optimize code 2021-09-15 16:23:07 -04:00
a8220a8502 cosmetic changes 2021-09-15 16:08:53 -04:00
7d92d665e8 use explicit scoping when virtual dispatch is not available. 2021-09-15 16:08:17 -04:00
65d8f7f964 use cmath header instead of math.h 2021-09-15 15:25:58 -04:00
1fdba7280e small optimization 2021-09-15 15:14:52 -04:00
f01681eae7 use symbolic constant 2021-09-15 15:09:58 -04:00
9c301822fd use nullptr 2021-09-15 14:57:10 -04:00
eb80102871 spelling 2021-09-15 13:51:31 -04:00
c1fa663dd8 Try to improve the pair style hybrid docs
This specifically tries to avoid the ambiguous use of "mixing" and
clarify that similar is still different when pair styles are concerned.
See discussion here: https://matsci.org/t/confusion-about-mixing-and-pair-coeff-section/38317/3
2021-09-15 13:48:47 -04:00
1b91bfbfa1 spelling 2021-09-14 17:17:46 -04:00
b1ebaa298c build "fat" cuda binaries only with known toolkits 2021-09-14 17:17:38 -04:00
b1092cfa4e detect C++20 standard 2021-09-14 11:56:43 -04:00
c8170c3388 fix mingw 32-bit vs 64-bit craziness 2021-09-13 10:14:34 -04:00
80f95e5087 step version strings for next patch release 2021-09-13 07:33:34 -04:00
37894d48c6 Revert "simplify building shared libs on windows"
This reverts commit fa3429ab02.
2021-09-13 07:24:00 -04:00
ede3762e84 detect a few more compilers 2021-09-13 00:29:04 -04:00
fa3429ab02 simplify building shared libs on windows 2021-09-12 22:09:18 -04:00
585f35235e add note to README files about age of the example 2021-09-11 13:31:55 -04:00
8cef98fae7 update example to use current library interface. No need to use the namespace. 2021-09-11 13:31:55 -04:00
bd225e2484 update example for dynamically loading LAMMPS with current library API 2021-09-11 13:31:55 -04:00
1c21560c70 must not clear force array. will segfault in hybrid atom styles 2021-09-10 20:33:49 -04:00
f5f49078ee Add more atom fields in numpy_wrapper and correct csforce size 2021-09-10 15:40:49 -04:00
7bb863a46c Return None in case of null pointer 2021-09-10 14:55:17 -04:00
e10d89d8c4 Add omega field to numpy_wrapper detection 2021-09-10 14:55:17 -04:00
02da29513e Merge branch 'master' into programmer-guide-updates
# Conflicts:
#	doc/lammps.1
2021-09-09 23:34:46 -04:00
0dd35bdb66 Merge pull request #2935 from akohlmey/python-module-fixes-and-tests
Python module fixes and tests
2021-09-09 23:31:16 -04:00
b535e58e16 Merge pull request #2929 from stanmoore1/kk_gridcomm
Recover Kokkos compilation
2021-09-09 23:30:41 -04:00
551810d388 Merge pull request #2928 from wouterel/enable-dyngroups-fixbondcreate
Enable dynamic groups for fix bond/create
2021-09-09 23:27:55 -04:00
3fd4bd1fcd Merge branch 'python-module-fixes-and-tests' of github.com:akohlmey/lammps into python-module-fixes-and-tests 2021-09-09 23:05:48 -04:00
6ef8c12457 whitespace 2021-09-09 23:05:30 -04:00
e2b44e89a7 Merge pull request #2927 from akohlmey/docs-update
Update documentation for the stable release
2021-09-09 23:03:12 -04:00
d09851e695 Improve MPI support in PyLammps 2021-09-09 21:47:08 -04:00
7b1e951916 add unit test for checking properties parsed from info command output 2021-09-09 21:13:09 -04:00
4eeb90d135 fix PyLammps parser issue with parsing info command output 2021-09-09 21:12:28 -04:00
390f9eff39 Merge branch 'master' into kk_gridcomm 2021-09-09 19:17:55 -04:00
150a695b8c Merge pull request #2925 from akohlmey/collected-small-changes
Collected small changes
2021-09-09 19:03:20 -04:00
a954ddac5a add missing "private" 2021-09-09 18:03:17 -04:00
f9cd6a384b Add Rocky Linux 8 container definition 2021-09-09 10:45:30 -04:00
8da122c6a4 RHEL8/CentOS8 PowerTools is now powertools 2021-09-09 10:31:17 -04:00
4e92c68244 allow skipping fix timestep tests when LAMMPS was compiled for static libs 2021-09-08 23:41:31 -04:00
8c3924352d only check for meminfo[2] on platforms we know to be supported 2021-09-08 23:02:56 -04:00
6bad470dd5 avoid namespace clash in mini-regex library 2021-09-08 20:39:41 -04:00
bc7dfbed3c add missing #if 2021-09-08 20:00:39 -04:00
9cdb83a24d support utils::guesspath() also on Windows 2021-09-08 18:17:14 -04:00
5c1fa54750 Update more definition files 2021-09-08 18:11:40 -04:00
d5f70ed347 Update container definitions to include PLUMED 2.7.2 2021-09-08 17:43:12 -04:00
9fb29b165d Update CUDA container definitions to CUDA 11.4 2021-09-08 17:40:48 -04:00
40f861097c Recover Kokkos compilation 2021-09-08 14:41:51 -06:00
b74a32c1e3 Update Singularity definitions to use ROCm 4.3 2021-09-08 16:07:54 -04:00
b87a48e40b re-apply clang-format 2021-09-08 15:42:15 -04:00
04748779fd tweak epsilon for portability to FreeBSD 2021-09-08 15:41:43 -04:00
cfa94dfbaf add support for utils::guesspath() on macos 2021-09-08 15:14:06 -04:00
22f295ffd8 Prevent buffer overflow in TextFileReader::next_dvector() 2021-09-08 10:52:42 -04:00
ebcf0bd6a1 Enable dyanmic groups for fix bond/create 2021-09-08 11:54:50 +02:00
c1dbc110d9 cosmetic changes for consistency 2021-09-07 19:12:59 -04:00
36eb2e30df correct URL 2021-09-07 19:12:27 -04:00
a4735628f9 document flags that were missing in the man page and the help message 2021-09-07 19:11:51 -04:00
ad39aa85ab update style guide and requirements/suggestions for contributions 2021-09-07 19:09:35 -04:00
1ae15cf8b7 Merge branch 'master' into programmer-guide-updates 2021-09-07 19:01:21 -04:00
3562c76a66 Update compute angle doc page 2021-09-07 19:00:22 -04:00
194a42b7a5 use more reasonable install prefix when compiling natively on Windows 2021-09-07 15:05:17 -04:00
a16fd25840 minor tweak 2021-09-07 14:26:19 -04:00
55a802afe3 Merge remote-tracking branch 'github/master' into collected-small-changes 2021-09-07 14:20:53 -04:00
9c50420c14 apply clang-format 2021-09-07 14:20:26 -04:00
19e6a9e0d8 Merge pull request #2924 from ohenrich/cg-dna
CG-DNA: Documentation Update
2021-09-07 14:12:07 -04:00
9bc8e0998e must use Python3 version of imported target 2021-09-07 13:34:07 -04:00
909376b14b Merge branch 'master' into collected-small-changes 2021-09-07 13:32:21 -04:00
b0fa666de4 Merge pull request #2923 from akohlmey/python-finalize-take2
Treat calling Py_Finalize() more like MPI_Finalize() and avoid crashes
2021-09-07 11:57:20 -04:00
e070766915 including lmpwindows.h globally from lmptype.h does more harm than good
this addresses some (cross) compilation issues locally.
in the long run, this should be addressed by implementing issue #1884
where platform specific functionality is wrapped into a small library
of generic functions adapted for LAMMPS' needs (like utils:: does for
non-portable convenience functions).
2021-09-07 10:39:16 -04:00
3f83c8397d windows needs io.h for _isatty() 2021-09-07 10:21:00 -04:00
ea34571da1 avoid 32-bit integer overflow 2021-09-07 01:12:24 -04:00
68c842ca84 workaround for MSVC insanity 2021-09-07 00:59:51 -04:00
b2ee7fa3a3 remove stuff that is incompatible with recent MSVC compilers 2021-09-07 00:59:16 -04:00
f5259f0081 correct non-portable code 2021-09-07 00:58:16 -04:00
9a8a4a111f include utils::binary_search in docs 2021-09-06 18:16:07 -04:00
29505404bc add unit test for checking the impact of lammps_python_finalize() 2021-09-06 17:42:18 -04:00
63a2882127 apply clang-format 2021-09-06 17:01:22 -04:00
898f8086db consolidate binary() member functions of Comm and Balance into utils::binary_search() 2021-09-06 16:58:14 -04:00
31a8940ae8 use larger version of FFT grid comm image 2021-09-06 15:50:02 -04:00
bb8b0ef157 add section on PPPM 2021-09-06 12:23:49 -04:00
c1599ffb3e spelling 2021-09-06 09:52:32 -04:00
d8ba7a3e9a add discussion of OpenMP parallelization 2021-09-06 09:52:19 -04:00
bb0188ac1a Corrected linking errors 2021-09-06 13:29:40 +01:00
57cea77fe9 Updated online docu 2021-09-06 11:38:21 +01:00
b132a7eb3a Updated docu to new oxdna atom_style 2021-09-06 09:47:46 +01:00
a7696d5f00 add -skipruin to help message 2021-09-05 22:44:37 -04:00
6e17446f38 add section about parallelization in the OPENMP package 2021-09-05 22:42:42 -04:00
6e57f4f08f fix typo 2021-09-05 22:10:00 -04:00
4fc9753a69 break large file into multiple smaller files by section and add toctree 2021-09-05 21:57:03 -04:00
94f03f169f add section about neighbor list construction 2021-09-05 21:22:39 -04:00
d3af77a876 improve the load imbalance viz 2021-09-05 17:56:58 -04:00
b34a3cec1e update man page with missing flags and correct URLs 2021-09-05 12:45:29 -04:00
0c2d8ad210 Merge branch 'master' into programmer-guide-updates 2021-09-05 12:45:15 -04:00
805b15f5c4 apply clang-format 2021-09-04 14:19:51 -04:00
e2d8fd58fa apply clang-format 2021-09-04 14:01:24 -04:00
0286c3e2be treat Py_Finalize() more like MPI_Finalize()
this is done by
- not automatically calling Py_Finalize() when destructing a python interpreter
- adding wrapper functions so that the call to Py_Finalize() is hidden
  and skipped if Python support is no included.
- call the Python::finalize() wrapper in main.cpp (similar to the equivalent Kokkos function)
- add a wrapper of that call to the C library interface
2021-09-04 13:53:51 -04:00
91b0ae798a make VALUELENGTH constant consistent. 2021-09-04 12:41:52 -04:00
59ef1737c6 add communication section 2021-09-03 22:42:01 -04:00
5be4fb86ea use a more compact image 2021-09-03 21:05:16 -04:00
801cd647c3 Merge pull request #2919 from akohlmey/collected-small-changes
Collected small changes and fixes
2021-09-03 19:03:29 -04:00
a98ded7722 adapt section about domain decomposition from paper 2021-09-03 16:59:41 -04:00
6290054e52 forgot to update lammps.cpp 2021-09-03 11:37:03 -04:00
f768b701ee add -skiprun command line flag that sets a timeout so that run and minimizations loops are skipped 2021-09-03 11:21:42 -04:00
6cf2aa4fbb update github workflow doc 2021-09-02 16:29:20 -04:00
0d765a824e integrate file with description of include file conventions 2021-09-02 15:03:19 -04:00
5851692527 mention when testing may be added 2021-09-02 14:25:10 -04:00
d3447008a1 update contribution guidelines for github 2021-09-02 14:24:57 -04:00
bca9157405 Correct fix bond/swap doc page 2021-09-02 14:10:43 -04:00
ca7bab7e41 refactor style guide and integrate text from issue 2021-09-01 22:16:26 -04:00
72d92ac9e8 correct and clarify Python compatibility 2021-09-01 22:03:12 -04:00
c186b24292 avoid segfaults due to uninitialized data 2021-09-01 21:47:39 -04:00
495f424a67 apply clang-format to pair_lj_cut.cpp so it can serve as example 2021-09-01 20:08:06 -04:00
e6d7a544e2 remove whitespace from comma separated arguments to variable functions 2021-09-01 14:02:35 -04:00
af33724a38 update and reorder the description of the process for submitting contributions 2021-09-01 12:15:52 -04:00
d301c2a71f Merge branch 'master' into programmer-guide-updates 2021-09-01 10:08:51 -04:00
9085662e2b Merge pull request #2899 from akohlmey/next_patch_release
Step version strings for the next patch release
2021-08-31 19:43:41 -04:00
7943cb2067 Merge branch 'master' into programmer-guide-updates 2021-08-31 18:27:25 -04:00
66008a519b Merge pull request #2913 from akohlmey/last-minute-fixes
Some last minute fixes for the next patch release
2021-08-31 18:24:17 -04:00
8db2d64f11 Updates to support ROCm 4.3 in GPU package 2021-08-31 17:56:01 -04:00
000b4c5fda integrate fix ttm/grid properly into the documentation 2021-08-31 16:20:21 -04:00
c567f33cc1 apply spelling fixes and update formatting a little 2021-08-31 16:17:03 -04:00
ae2f0ef18d whitespace 2021-08-31 16:05:11 -04:00
e9ef26c2be Merge branch 'master' into last-minute-fixes 2021-08-31 16:03:50 -04:00
6448f44fa5 Merge pull request #2914 from rbberger/doc_updates
Minor documentation updates
2021-08-31 15:59:34 -04:00
08eb3345af silence some compiler warnings 2021-08-31 15:11:46 -04:00
6b243845c0 update HIP preset for CMake 2021-08-31 15:11:37 -04:00
b8ed4b28b3 add test for fix adapt with hybrid pair 2021-08-31 14:28:09 -04:00
c66a51bca1 fix bug in fix adapt: reinit must be called for the top-level pair/bond style 2021-08-31 14:23:13 -04:00
888d6fd9b4 small update 2021-08-31 14:20:52 -04:00
191e4671b6 Add section about how to output YAML or JSON 2021-08-31 11:28:13 -04:00
de0aa1e97a Fixup ttm doc page 2021-08-31 11:28:08 -04:00
8f600f6db7 Merge pull request #2912 from stanmoore1/kk_foward_comm_array
Add missing Kokkos sync-to-host to fix false-positive warning
2021-08-31 10:21:31 -04:00
16c063cba5 Fix OPENMP install script properly remove -DLMP_OPENMP from Makefile.packages 2021-08-30 18:39:24 -04:00
c76949e0f0 Merge pull request #2902 from lammps/fix-ttm-grid
Add fix ttm/grid and refactor grid communication to make it globally available.
2021-08-30 17:43:39 -04:00
5b42d5f302 Fix compile issue 2021-08-30 15:21:24 -06:00
1703cd4ca2 Whitespace 2021-08-30 14:57:59 -06:00
0e639a2c5b Add missing Kokkos sync to host 2021-08-30 14:52:26 -06:00
66fc0438a8 Merge branch 'master' into fix-ttm-grid
# Conflicts:
#	doc/src/pair_snap.rst
2021-08-30 16:37:51 -04:00
25a6c59cea Merge pull request #2900 from stanmoore1/kk_bugfixes
Fix issues in KOKKOS package
2021-08-30 15:28:41 -04:00
00c3c5cf06 Port changes from #2903 to Kokkos 2021-08-30 12:43:07 -06:00
2de482f825 Merge pull request #2911 from akohlmey/fix-gpu-package-issues
Fix minor GPU package issues for the stable release
2021-08-30 13:45:23 -04:00
6635b402c6 Merge pull request #2910 from wmbrownIntel/intel-mm-scale-fix
Fix (the fix) for _MM_SCALE preprocessor defines for future Intel compilers
2021-08-30 13:10:21 -04:00
22ce955065 Merge pull request #2909 from wmbrownIntel/born_coul_wolf_nofast
Override any OpenCL fast math JIT settings for born/coul/wolf{/cs}/gpu…
2021-08-30 11:51:04 -04:00
d9c1a299bf Merge pull request #2908 from jrgissing/bond-react-fixes
Bond/react: memory leak
2021-08-30 11:23:26 -04:00
284ed98fb8 fix spelling error and reformat paragraph 2021-08-29 22:08:49 -04:00
5d03028028 Merge branch 'master' into kk_bugfixes 2021-08-29 22:07:40 -04:00
5257b8d280 split off the programming/submission style guide to a separate file 2021-08-29 22:00:05 -04:00
afc65993d0 clarify 2021-08-29 21:43:13 -04:00
be3348be86 update for clang-format 2021-08-29 21:42:59 -04:00
518b2c24f2 use the term 'website' consistently (and not also 'web site') 2021-08-29 21:42:49 -04:00
664a07a3fe disallow GPU neighbor list with hybrid pair styles (which has still problems) 2021-08-29 17:57:30 -04:00
39d8b239ff don't report bogus timings 2021-08-29 17:56:47 -04:00
05eba8e484 move patch release date to august 31st 2021-08-29 16:33:14 -04:00
fb72e00081 Fix (the fix) for _MM_SCALE preprocessor defines for future Intel compilers. 2021-08-28 17:18:05 -07:00
89556f0bcb Override any OpenCL fast math JIT settings for born/coul/wolf{/cs}/gpu to resolve numerical deviations seen with some OpenCL implementations. 2021-08-28 17:01:58 -07:00
653f6f994f Merge branch 'lammps:master' into bond-react-fixes 2021-08-28 16:05:59 -04:00
cddac395c6 some more cleanup 2021-08-28 07:52:14 -04:00
993826989c modernize fix ttm/mod implementation and align with fix ttm 2021-08-28 07:44:06 -04:00
1e37595055 pretty 2021-08-28 07:43:18 -04:00
f49b94e126 update docs. mention support for comments in electron temperature grid files 2021-08-28 07:42:55 -04:00
da1fb924bb modernize code some more. avoid string pointer magic. 2021-08-28 05:43:39 -04:00
e6a45c1fa7 refactor grid data file reader. support descriptive comment(s) and metadata 2021-08-27 23:23:12 -04:00
90d95466c2 add UNITS: metadata 2021-08-27 23:21:04 -04:00
6be84b72a8 simplify and plug memory leak with file output 2021-08-27 21:10:05 -04:00
c779798f3f properly disable clang-format processing 2021-08-27 20:34:46 -04:00
59a6c08a43 correct spelling 2021-08-27 20:32:42 -04:00
9c2b96286f print GPU available info only when GPU package is included 2021-08-27 20:32:22 -04:00
28b6649f0c whitespace 2021-08-27 20:31:58 -04:00
cf33f0bb96 silence compiler warnings, remove dead code, and do some reformatting 2021-08-27 20:22:29 -04:00
a66f3dfbdd Merge branch 'master' into fix-ttm-grid 2021-08-27 19:56:42 -04:00
e93ae9ba12 apply clang-format 2021-08-27 19:56:33 -04:00
c513fc8784 update pppm/gpu to use the refactored GridComm class 2021-08-27 19:52:39 -04:00
90f82a8ef1 memory leak 2021-08-27 17:03:11 -04:00
4d1a6cbd73 Merge pull request #2904 from lammps/memory-null
force all memory methods to return nullptr if requested size <= 0
2021-08-27 16:59:04 -04:00
3e058b734b Merge pull request #2887 from jrgissing/bond-react-fixes
Bond react fixes
2021-08-27 16:58:33 -04:00
cc69431dd3 Merge pull request #2897 from dxhisboy/master
Correcting non-fdotr Virial tensor computation for interlayer potentials
2021-08-27 16:54:56 -04:00
1795e1530f Merge pull request #2896 from akohlmey/collected-small-changes
Collected changes and updates for the next patch release
2021-08-27 15:58:05 -04:00
a58e4fc876 whitespace 2021-08-27 14:59:26 -04:00
4eef3eaac6 Merge branch 'master' into collected-small-changes 2021-08-27 14:58:42 -04:00
4be33df8fb relax force test epsilon values a little for cross-platform tests 2021-08-27 14:57:31 -04:00
e363b4aeff Merge pull request #2905 from weinbe2/fea-snap-large-system
Kokkos SNAP large system optimizations and cleanup
2021-08-27 14:23:37 -04:00
66da0ebada adjust INTEL pppm files for new GridComm interface 2021-08-27 11:01:27 -06:00
9658d1d983 Bump up the default chunksize in SNAP and update the docs 2021-08-27 12:34:19 -04:00
6ab951fedc only change functions known to break with zero-length 2021-08-27 10:28:40 -06:00
2387e12464 Merge pull request #2893 from lammps/doc-intro-updates
Update Intro section of LAMMPS Manual for stable release
2021-08-27 12:09:10 -04:00
0879484827 sync OPENMP package with new GridComm syntax 2021-08-27 09:48:35 -06:00
4089d7757d error->one to error->all corrections 2021-08-27 11:24:04 -04:00
89b4cc9498 Remove comment 2021-08-27 11:03:54 -04:00
aa9f337ef5 Small tweak to docs 2021-08-27 10:47:11 -04:00
27cabbf734 Add missing variable 2021-08-27 10:38:47 -04:00
ecba2d8489 Update doc page 2021-08-27 10:33:18 -04:00
1970ede534 Add user-settable threshold for extra parallelism 2021-08-27 10:22:10 -04:00
cfaa3040ed add a comment explaining the restriction to C and H elements in AIREBO/REBO 2021-08-27 10:02:53 -04:00
7ac2c0c66e refactor custom constraint
evaluates per-atom variables once, and correctly communicates values to ghosts
2021-08-26 23:00:15 -04:00
8c96f1a14b Merge branch 'collected-small-changes' of github.com:akohlmey/lammps into collected-small-changes 2021-08-26 22:56:08 -04:00
a686ce33c6 Added less-parallelism-higher-perf paths to recursive polynomial routines. Fixed qSNAP memory coalescing issue. Various modularity improvements. 2021-08-26 22:55:07 -04:00
bbb3f35aa3 "int64_t" is defined in stdint.h; must use "long" in OpenCL kernels instead 2021-08-26 22:46:08 -04:00
fc6b17b82a improve whitespace handling
previously, spaces inside of custom 'rxn' functions could cause issues
2021-08-26 22:28:44 -04:00
42a3a7d10f Merge branch 'master' into collected-small-changes
# Conflicts:
#	src/fix_property_atom.cpp
2021-08-26 21:14:23 -04:00
a587f67423 Merge pull request #2903 from lammps/fix-property-tweak
Fix property/atom tweak
2021-08-26 20:07:13 -04:00
a519dc3e9a make DIELECTRIC package use of GridComm compatible with new version 2021-08-26 16:33:39 -06:00
21b017368b force all memory methods to return nullptr if requested size <= 0 2021-08-26 15:43:12 -06:00
ab8c9851b2 change style to styles to remove override of fix->style string 2021-08-26 15:20:52 -06:00
a85f125ee7 whitespace 2021-08-26 16:58:14 -04:00
892a18c3f6 Merge branch 'master' into fix-ttm-grid 2021-08-26 16:57:19 -04:00
f63d0202be Rely on auto_sync in verlet setup 2021-08-26 14:54:48 -06:00
6fea5dd316 avoid creating empty per atom position arrays for enforcing pbc for dumps 2021-08-26 16:16:30 -04:00
16d73c86ba adjust example TTM input scripts 2021-08-26 13:37:00 -06:00
ddbb8f1aa6 Remove unnecessary data tranfer in fix_nve_sphere_kokkos 2021-08-26 13:36:32 -06:00
49b0623d6b Fix issue with Kokkos granular and pair/only on 2021-08-26 13:26:46 -06:00
62fcaedd33 update example log files 2021-08-26 13:25:46 -06:00
7b3e7d3d3a allow for command-line setting of initial temp 2021-08-26 11:52:07 -06:00
d38549e05f Update ancient Kokkos Arch in Makefile.kokkos_cuda_mpi 2021-08-26 11:03:57 -06:00
beffa0d1a1 remove old fix ttm 2021-08-26 10:19:56 -06:00
cbe27096b3 final tweaks 2021-08-26 10:19:22 -06:00
0fb03072b1 restart bug fix in new fix ttm/grid 2021-08-26 10:08:34 -06:00
be98d0bbd9 Fix memory issue in fix_nvt_sllod_kokkos 2021-08-26 09:36:16 -06:00
0e8facdcbb Makefile.kokkos: fix (standard_in) 1: syntax error (kokkos PR4173) 2021-08-26 08:58:58 -06:00
c1ca58ba82 Merge branch 'master' of github.com:lammps/lammps into kk_bugfixes 2021-08-26 08:21:39 -06:00
7e5782a81b Fix deallocation issue in pair_lj_charmm_coul_charmm_kokkos 2021-08-26 08:21:16 -06:00
45854bab0c step version strings for next patch release 2021-08-26 07:46:24 -04:00
0d8c58db02 synchronize DomainOMP::pbc() code with Domain::pbc() 2021-08-26 07:41:57 -04:00
a7f4bbffcf avoid segfault when trying to apply (strict) pbc or convert to/from fractional coordinates on an MPI rank without atoms 2021-08-26 07:10:47 -04:00
84896fc7d4 add building micelle2d.x 2021-08-26 06:36:27 -04:00
e20d66ac19 avoid module name conflict 2021-08-26 06:36:17 -04:00
49a81d6fba silence compiler warnings 2021-08-26 06:30:16 -04:00
c7357d5731 Merge remote-tracking branch 'github/master' into collected-small-changes 2021-08-26 05:30:50 -04:00
6fcd4c0e30 Merge remote-tracking branch 'github/master' into doc-intro-updates 2021-08-26 05:29:53 -04:00
e3af1544f1 Merge pull request #2804 from Vsevak/tip4p_fix_types
Fix atom types handling in the tip4p/gpu kernels
2021-08-26 01:08:19 -04:00
1d33bd1264 whitespace 2021-08-26 01:05:25 -04:00
484f2f4c95 must exclude two more folders from whitespace checking 2021-08-26 01:05:14 -04:00
acf80f5c89 Merge branch 'master' into doc-intro-updates 2021-08-26 01:03:25 -04:00
2845269bdb use MBytes consistently 2021-08-26 01:00:08 -04:00
0aded3931b convert to Fortran 2003 2021-08-26 00:37:25 -04:00
4b707b8684 small tweak 2021-08-26 00:35:43 -04:00
f13fe138cc apply clang-format 2021-08-26 00:35:31 -04:00
9dd1dcab30 remove call to non-portable FDATE() function (a GNU Fortran extension) 2021-08-25 23:56:20 -04:00
61855c5058 apply whitespace checking/fixing also to free-format Fortran files 2021-08-25 23:46:48 -04:00
45e599cb33 modernize Fortran 2021-08-25 23:42:07 -04:00
fe4ec9d1ea select Fortran 2003 as standard for compiling bundled Fortran code 2021-08-25 23:36:12 -04:00
8468d89ec8 tweak epsilon for passing test on macOS 2021-08-25 23:31:53 -04:00
5361af7082 notes on reducing disk space requirements when building LAMMPS from source 2021-08-25 22:51:21 -04:00
c3083785b7 list some more features 2021-08-25 22:02:51 -04:00
a2d77593bb fix typo 2021-08-25 22:01:42 -04:00
4846d8283e convert chain.f to fortran 90+ style free format file chain.f90
this is to maintain compatibility with some newer fortran compilers
that do not support legacy style fortran by default anymore.
2021-08-25 18:38:08 -04:00
a0dfae9876 more debugging of restarts 2021-08-25 16:28:40 -06:00
abd4a6cfa3 remove calls to Modify::end_of_step() during the full_energy() functions
the fixes atom/swap, gcmc, widom, and charge_regulation would call
Modify::end_of_step() in order to make certain that all energy contributions
to the total energy are properly tallied. However, this is no longer
true and it causes lots of unexpected problems, since fixes like
fix ave/time, fix store/state, fix print and many more are called at
the wrong time during a timestep and possibly multiple times which can
lead to very unexpected and incorrect results. fix atc and fix colvars
are currently the only fixes that signal that they contribute to the
global energy *and* run during Modify::end_of_step(). However, they
do not perform any actions related to the global energy in those calls.
2021-08-25 16:41:25 -04:00
51d4e91086 Merge pull request #2882 from CTCMS-UQ/SLLOD-Kokkos
Add Kokkos accelerated styles for shear flow simulations (SLLOD)
2021-08-25 14:44:50 -04:00
ae94a60d4a more debugging 2021-08-25 12:42:47 -06:00
1c0ac4adb7 correct citation string 2021-08-25 07:57:16 -04:00
cc98f9b1e6 add unit test 2021-08-25 07:42:37 -04:00
ce0f1478cb correct stress tally to give results consistent with fdotr 2021-08-25 07:42:37 -04:00
b55673f0a6 add unit test 2021-08-25 07:42:37 -04:00
3a8faa8966 correct stress tally 2021-08-25 07:42:37 -04:00
b1e40a05bc disallow newton pair off 2021-08-25 07:42:37 -04:00
61b9d4a19f update epsilon 2021-08-25 07:42:37 -04:00
d9579c4ecd Changed the virial computation method for pair/ilp/graphene/hbn and pair/kolmogorov/crespi/full from fk x rkj to fk x rki 2021-08-25 14:55:28 +08:00
caaea35c64 Merge pull request #2 from akohlmey/SLLOD-Kokkos
Update pull request to current upstream and resolve merge conflict
2021-08-25 15:29:23 +10:00
0a07f4eae0 spelling issues 2021-08-24 23:48:17 -04:00
c6145e029a update features list 2021-08-24 23:46:06 -04:00
026d7bd112 update description of development model and release cycles 2021-08-24 23:26:22 -04:00
e4e08972f8 update overview text 2021-08-24 23:02:49 -04:00
a1e0341d8c detect and update output for OpenMP version 5.1 2021-08-24 23:01:43 -04:00
7ddfa382dc enable and process pair style table with clang-format 2021-08-24 22:27:11 -04:00
d79c42ac41 improve error messages for incorrect/inconsistent table data 2021-08-24 22:26:59 -04:00
5ba6fee94e Merge branch 'master' into SLLOD-Kokkos
# Conflicts:
#	src/KOKKOS/compute_temp_kokkos.h
2021-08-24 21:48:03 -04:00
857d0d255d change OFFSET to correct value 2021-08-24 17:25:53 -06:00
30fc6e3790 consistency between fix TTM variants 2021-08-24 17:17:54 -06:00
ccbf39d2c9 add unit tests using pppm and ewald with a tilted box 2021-08-24 16:00:26 -04:00
dfc03bd107 avoid 32bit integer overflow on 64-bit storage sizes 2021-08-24 15:49:41 -04:00
588f821ac8 add support for text output and restart output 2021-08-24 13:46:29 -06:00
2150fb7413 adjust epsilon for portability 2021-08-24 15:41:42 -04:00
2239130798 randomize bilayer data file positions to make interlayer tests more reliable 2021-08-24 15:41:28 -04:00
eaf5e08542 detect invalid use and silence compiler warnings 2021-08-24 14:27:20 -04:00
25d9d5dfff Merge pull request #2895 from rbberger/python_coverage_fix
Use .coveragerc to configure Python coverage reporting
2021-08-24 14:07:23 -04:00
3d34ee5087 Merge branch 'master' into fix-ttm-grid 2021-08-24 11:34:27 -06:00
8dd2428294 Merge pull request #2891 from akohlmey/collected-small-changes
Collected small changes and bug fixes
2021-08-24 13:34:20 -04:00
0bb26ff296 make fix qeq/reaxff/kk consistent with REAXFF package version 2021-08-24 12:13:06 -04:00
a26da031aa Use .coveragerc to configure Python coverage reporting 2021-08-24 11:27:30 -04:00
af14e3227d skip folders/files in lib with downloaded content 2021-08-24 10:32:10 -04:00
1c7cc42846 fix parallel programming bug in interlayer pair styles 2021-08-24 10:28:57 -04:00
862cb43fa9 Enable unittest for GPU lj/cut/tip4p/long 2021-08-24 17:07:51 +03:00
3dc142c0b0 Added fix_nvt_sllod_kokkos and compute_temp_deform_kokkos to Install.sh 2021-08-24 16:23:05 +10:00
d34083dd54 update false positives 2021-08-23 23:25:25 -04:00
4fb67c0cc6 mention pre-C++-11 version as C++-98 version. 2021-08-23 23:25:16 -04:00
d561fe3457 clarify license terms description and reduce redundancy. mention LGPL verison 2021-08-23 23:24:47 -04:00
897dfdfb19 some updates to authors list 2021-08-23 23:24:06 -04:00
e6455c2153 fix spelling errors 2021-08-23 23:12:23 -04:00
3bce886ab7 workaround style checker issue 2021-08-23 22:16:39 -04:00
49c9f4597f apply clang-format 2021-08-23 21:46:54 -04:00
72679f6127 Merge branch 'master' into collected-small-changes 2021-08-23 21:44:21 -04:00
c84ebd1c93 update docs for build options for development 2021-08-23 21:43:49 -04:00
d72d8fa938 we require python 3.5 or later 2021-08-23 21:43:06 -04:00
1ee1471b56 fix spelling errors 2021-08-23 21:42:48 -04:00
43261c3a4f Merge pull request #2885 from lammps/grid-adjust
Grid adjust
2021-08-23 21:39:35 -04:00
7b3755bcf4 remove redundant '// clang-format off' marker 2021-08-23 21:17:04 -04:00
7fe6e95d3a make clang-format processing verbose to show progress 2021-08-23 21:11:05 -04:00
1bd6e56369 simplify code using utils::strdup() 2021-08-23 21:06:56 -04:00
9a19a814e4 apply clang-format to packages 2021-08-23 21:06:33 -04:00
686f41731f disable applying clang-format to all "style" classes in the KOKKOS package (for now) 2021-08-23 20:55:41 -04:00
8f71979ba1 update formatting in src folder with clang-format 2021-08-23 20:46:09 -04:00
cb19806020 update ReaxFF reference data due to use of more precise constants in fix qeq/reax 2021-08-23 20:34:44 -04:00
d44edeb32e make clang-format custom targets in CMake similar to the ones in GNU make 2021-08-23 18:36:44 -04:00
6b6e63f77f avoid redundant defines 2021-08-23 18:36:07 -04:00
fec77e49bd add clang-format commands to Makefile 2021-08-23 18:22:12 -04:00
2cfc629388 reformat REAXFF headers with clang-format 2021-08-23 18:21:47 -04:00
86739c46d9 Merge pull request #2889 from jrgissing/property/atom-group-bugfix
property/atom group bugfix
2021-08-23 18:20:53 -04:00
6bc8da05b9 reformat unittest tree with clang-format 2021-08-23 17:06:30 -04:00
4e715da2f3 Merge branch 'grid-adjust' of github.com:lammps/lammps into grid-adjust 2021-08-23 14:57:12 -06:00
0dea376e1a restart support for TTM fixes 2021-08-23 14:56:33 -06:00
d640cd6838 Merge pull request #2890 from stanmoore1/kk_deform
Fix bug with v remap option in Kokkos fix deform
2021-08-23 16:41:23 -04:00
3a3f32d3a8 Merge branch 'master' into tip4p_fix_types 2021-08-23 16:43:55 +03:00
0f8b331d8f enable check/fix scripts in traditional makefile 2021-08-22 22:47:55 -04:00
0c7cf3cdaa protect against use with Python 2.x, use full absolute directory path internally 2021-08-22 22:47:09 -04:00
bc91d05857 fix typo 2021-08-22 20:46:58 -04:00
92b5b159e5 replace tabs and remove trailing whitespace in lib folder with updated script 2021-08-22 20:45:24 -04:00
30821b37e5 replace tabs 2021-08-22 20:43:27 -04:00
0c4752b858 add support to check for tabs as whitespace errors including option to fix 2021-08-22 20:43:08 -04:00
607e75f984 remove tabs 2021-08-22 19:42:55 -04:00
8b2e3ad3ee add unit tests for fix addtorque 2021-08-22 14:27:38 -04:00
bb852f2393 skip some more aliased styles 2021-08-22 14:21:31 -04:00
bb5a11b330 add timestepping unit tests for atom style sphere 2021-08-22 14:16:50 -04:00
bf618b3128 support tests for integrators with dipoles and extended particles 2021-08-22 12:44:02 -04:00
d9538a4745 skip some aliases when checking for missing force style tests 2021-08-22 11:55:37 -04:00
db887b4d7a add unit test for angle style dipole 2021-08-22 11:49:29 -04:00
433ece22ec add unit test for dihedral style spherical 2021-08-22 11:28:32 -04:00
9b4317335a reorder includes 2021-08-22 11:28:04 -04:00
9ce9d36ac5 correct package designations for styles in the EXTRA-MOLECULES package 2021-08-22 11:27:48 -04:00
403ee3a85f apply clang-format 2021-08-22 11:13:34 -04:00
ce71e45db0 plug memory leak 2021-08-22 11:11:32 -04:00
eeff288541 tweak settings to pass OpenCL GPU tests in mixed precision 2021-08-22 10:50:28 -04:00
dd670bab66 update dipole data file with randomized dipole orientations 2021-08-21 20:50:16 -04:00
46e4e1b60e add kspace tests with dipoles 2021-08-21 20:45:25 -04:00
1b72cf01a9 add unit test inputs for pair styles with point dipoles 2021-08-21 20:31:18 -04:00
384330aff2 update/correct extract function 2021-08-21 20:31:02 -04:00
1c7bf82930 initialize scale array 2021-08-21 20:30:38 -04:00
4032c6da98 fix restart bug 2021-08-21 20:30:15 -04:00
09b0809d75 add template files for testing dipolar pair styles and kspace styles 2021-08-21 19:18:21 -04:00
3083e6f4cb make ewald/disp/dipole an alias for ewald/disp for more obvious choices for users 2021-08-21 15:56:46 -04:00
2afa00ae66 pretty 2021-08-21 15:18:54 -04:00
ad5cc694dc correctly check for and enable/disable dipole and dispersion support 2021-08-21 15:18:44 -04:00
d8f0cec031 updates/bug-fixes to parallel fix ttm/grid 2021-08-20 16:57:20 -06:00
7c61e96f0b Fix bug with v remap option in Kokkos fix deform 2021-08-20 16:08:06 -06:00
1a81a94dfb fix up whitespace issues (remove tabs, trailing whitespace) 2021-08-20 15:00:19 -04:00
29fe006e46 fix issue in non-perioidic msm.cpp to allow it to work with any grid partitioning 2021-08-20 12:43:47 -06:00
1eb506002b Merge pull request #2888 from lammps/sticker-bonds
Sticker bonds
2021-08-20 14:28:57 -04:00
8735555e00 1 liner fix for PR #2342 2021-08-20 14:17:05 -04:00
fcc6cc628e fix whitespace 2021-08-20 13:47:24 -04:00
55605167ab Merge pull request #135 from lammps/master
rebase
2021-08-20 10:26:57 -04:00
7a8afb6eef add fragment count to molecule file output 2021-08-19 20:10:26 -04:00
f0a041799f add original TTM for testing 2021-08-19 16:55:57 -06:00
95bae4d78c sync with current master 2021-08-19 16:09:41 -06:00
9577db6578 Merge branch 'master' into fix-ttm-grid 2021-08-19 16:00:56 -06:00
3404920e98 Merge pull request #2342 from lammps/fix-property-array
Enable fix property/atom to create custom arrays
2021-08-19 17:33:55 -04:00
b0197e0607 Merge branch 'master' into grid-adjust 2021-08-19 17:29:51 -04:00
d4de26f6ef fix whitespace issues 2021-08-19 17:28:48 -04:00
537f0eed8e Merge pull request #2886 from akohlmey/pair-coul-exclude
Add a pair style coul/exclude for removing excluded coulomb interactions
2021-08-19 17:25:57 -04:00
f7c8b0c88b address spellcheck issues 2021-08-19 17:00:46 -04:00
bc6e805c99 fix doc formatting issues 2021-08-19 16:53:03 -04:00
e1c1c663c4 correction to doc page 2021-08-19 14:21:15 -06:00
845cebaab1 Add comment 2021-08-19 14:02:57 -06:00
eebbbe9f73 support a second usage model with fix bond/swap 2021-08-19 14:01:06 -06:00
7d0c052425 Fix deallocation with Kokkos 2021-08-19 14:00:37 -06:00
9470a0eeb6 clarified doc pages for fix property/atom and read_data 2021-08-19 11:34:25 -06:00
8aeaa82909 improve error message 2021-08-19 11:08:04 -04:00
1c67561be8 Merge branch 'fix-property-array' of github.com:lammps/lammps into fix-property-array 2021-08-19 09:00:51 -06:00
7046b75861 remove evil tabs 2021-08-19 10:06:34 -04:00
11b4ae641f add unit test for pair style coul/exclude 2021-08-19 05:46:12 -04:00
23231118d1 add a couple explanatory comments 2021-08-19 05:29:54 -04:00
093fbfd4b5 add documentation for pair style coul/exclude 2021-08-19 05:25:36 -04:00
8b680d43e5 add pair style coul/exclude for use with kspace style scafacos 2021-08-19 05:00:52 -04:00
7d0cdea282 allow using kspace_style scafacos for molecular systems under certain conditions 2021-08-19 05:00:11 -04:00
4ce71fd767 pretty 2021-08-19 04:23:44 -04:00
89de4eb7c4 make sure that coul/exclude special neighbors are always flagged 2021-08-19 04:23:26 -04:00
3a7a5d13ef apply clang-format 2021-08-19 04:22:55 -04:00
e149c2fe10 function no longer needs to be public 2021-08-19 04:20:12 -04:00
5c46c6d3a6 update unit test for per-atom arrays and vectors 2021-08-18 22:51:09 -04:00
c53875421b fix read_data bug 2021-08-18 22:50:42 -04:00
b942c4d122 fix data corruption bug affecting write_data 2021-08-18 22:31:46 -04:00
04b0f98a5f fix logic bug in utils::expand_args() 2021-08-18 20:26:51 -04:00
d9f3745eff pretty 2021-08-18 20:26:01 -04:00
546c9a109e fix uninitialized data bug 2021-08-18 20:25:49 -04:00
5e6079c2fc Merge branch 'fix-property-array' of github.com:lammps/lammps into fix-property-array 2021-08-18 16:54:02 -06:00
b19a211d70 update code 2021-08-18 18:06:21 -04:00
f6874af7e5 pretty 2021-08-18 18:05:36 -04:00
104fa4624e correct utils::expand_args() 2021-08-18 18:04:44 -04:00
4e16df9a21 remove prototype for early version of partition_grid method 2021-08-18 15:56:52 -06:00
2119b59d97 code documentation tweaks 2021-08-18 15:49:23 -06:00
1c5bdadcfb small alteration to code that assigns grid pts to procs 2021-08-18 15:43:54 -06:00
dbfba25e04 Merge pull request #1 from akohlmey/SLLOD-Kokkos
Update to current upstream, fix a few cosmetic issues, use alternative to str(n)cmp()
2021-08-19 07:29:51 +10:00
cf25a586bd debugging merged version 2021-08-18 13:07:49 -06:00
de61b3a547 update utils::expand_args 2021-08-18 14:35:27 -04:00
0a99d338f2 update argument parsing 2021-08-18 14:35:02 -04:00
1e37d1ad7f pretty 2021-08-18 14:34:03 -04:00
40fcfef35b create_atoms serial build bugfix 2021-08-18 14:17:04 -04:00
355dd5db9b include 2 use cases in doc page 2021-08-18 11:55:47 -06:00
e08c4abb4b whitespace fixes 2021-08-18 13:06:00 -04:00
4fed16fe8b pretty 2021-08-18 13:00:40 -04:00
f9b32f0eef use ArgInfo class to process references to custom vectors and arrays 2021-08-18 13:00:32 -04:00
300fee0437 add some more checks for typical string matches for references to fixes and alike 2021-08-18 12:59:56 -04:00
c50abed92b recover compilation 2021-08-18 12:59:31 -04:00
c6819e30cf simplify 2021-08-18 12:58:39 -04:00
c57da0661d update package name 2021-08-18 12:49:16 -04:00
6db856fd68 refactor dynamic constraints array
cannot use memory->* routines with non-primitive types
2021-08-18 11:24:32 -04:00
08e71eee6d corrections to recent large reformatting PR 2021-08-18 10:30:35 -04:00
f30434659e Merge branch 'master' into SLLOD-Kokkos 2021-08-18 05:55:34 -04:00
511ac49949 reformat, minor cosmetic changes 2021-08-18 05:53:23 -04:00
ee5273fbb1 Merge pull request #2879 from akohlmey/interlayer-refactor
Unit tests, bugfixes and file reader refactor for some INTERLAYER pair styles
2021-08-18 04:54:13 -04:00
4876e0cbb6 Changed URLs in the headers to point to the new LAMMPS site. 2021-08-18 17:37:00 +10:00
2e59b5c4de Fixed whitespace errors and removed some extraneous comments. 2021-08-18 15:23:46 +10:00
b385c85440 Refactored PPPMKokkos::setup_triclinic kernel indexing to be more consistent the rest of the codebase.
This commit "fixes" the temporary solution using Kokkos::MDRange in commit a98b8bee88.
2021-08-18 15:23:46 +10:00
d7f9f9fead Updated documentation to include Kokkos accelerated NEMD styles.
Also tidied up header files and attribution to fit LAMMPS coding style.
2021-08-18 15:23:46 +10:00
8ae9d51466 Fixed memory issues in ComputeTempDeformKokkos. 2021-08-18 15:23:46 +10:00
8945d81be3 Added Kokkos accelerated SLLOD thermostat (nvt/sllod/kk). 2021-08-18 15:23:46 +10:00
e7ba4179a7 Added Kokkos-enabled version of compute temp/deform. 2021-08-18 15:23:46 +10:00
e400e5b6f7 Fixed bug in PPPMKokkos::setup_triclinic for MPI calculations.
This fix should probably be considered a temporary fix - it relies on a
3-dimensional Kokkos range which seems to be disfavoured in the rest of
LAMMPS' codebase.
2021-08-18 15:23:46 +10:00
cfd9cf625d Initial draft of Kokkos acclerated PPPM routines for triclinic cells. 2021-08-18 15:23:46 +10:00
a1dd2c7655 move inline functions from header to cpp file 2021-08-17 22:37:47 -04:00
f470964393 apply clang-format 2021-08-17 22:35:05 -04:00
96b563dffc move common taper functions for interlayer potentials to separate header 2021-08-17 22:34:32 -04:00
bbb8adf656 update kolmogorov/crespi/z and lebedeva/z pair styles to use new file reader and unit conversion 2021-08-17 21:56:17 -04:00
661ec1acc3 fix typo 2021-08-17 21:55:22 -04:00
bb3c4797b3 update some more interlayer potential files 2021-08-17 21:55:12 -04:00
c758d224e0 Merge pull request #2881 from stanmoore1/kk_cmake
Fix issue when building Kokkos with CMake
2021-08-17 21:12:18 -04:00
62564b0a5c cmake: only use LMP_KOKKOS define in build interface 2021-08-17 15:52:09 -06:00
58a86412ec recover compilation 2021-08-17 16:26:59 -04:00
6dafbd2fbe support metal2real unit conversion 2021-08-17 16:20:00 -04:00
0906e94207 small fixes 2021-08-17 16:13:01 -04:00
e5a194d8d4 sync Kokkos changes with current master 2021-08-17 14:12:47 -06:00
2bf9fa91db more changes to merge with current master 2021-08-17 14:03:58 -06:00
05bd545cd3 flush tiny stresses to zero to avoid false positives when testing 2021-08-17 15:10:46 -04:00
4f9941e18d support metal2real unit conversion in pair style drip 2021-08-17 15:05:23 -04:00
6d53cd1986 refactor potential file reader in pair style drip 2021-08-17 14:50:34 -04:00
96280dc185 Merge branch 'master' into fix-property-array 2021-08-17 12:19:27 -06:00
8b8cce4399 add unit test YAML file for DRIP pair style 2021-08-17 14:12:50 -04:00
e6af1eecb8 resolved merge conflicts with master 2021-08-17 11:55:33 -06:00
82871ca515 Merge branch 'master' into interlayer-refactor 2021-08-17 13:25:13 -04:00
527240e941 Merge pull request #2880 from akohlmey/arginfo_update
Collected bugfixes and small update for ArgInfo class
2021-08-17 13:24:02 -04:00
d321202908 Add change from @junghans 2021-08-17 10:27:50 -06:00
9fa255b3ff Fix issue when building Kokkos with CMake 2021-08-17 10:09:39 -06:00
18cc43a560 extend ArgInfo class to also accept "i2_name" and "d2_name" 2021-08-17 12:04:58 -04:00
95a2041df3 reformat potential file headers to comply with LAMMPS' conventions 2021-08-17 10:48:51 -04:00
01503535f4 remove unused symlinks 2021-08-17 10:48:09 -04:00
6ccdeafa78 reformat with clang-format 2021-08-17 10:22:42 -04:00
42fadf55cf fix typos 2021-08-17 10:05:58 -04:00
0dbcb5dd66 replace #define with constrexpr for better compiler error reports on integer constants 2021-08-17 09:42:08 -04:00
f24054f7b3 test utils::fgets_trunc() with buffer size of exactly the length of string 2021-08-17 09:41:19 -04:00
e91185869d fix bug in utils::fgets_trunc(). closes #2878 2021-08-17 09:38:12 -04:00
a901427ee0 Merge pull request #2876 from akohlmey/address-lgtm-issues
Address code quality issues flagged by lgtm.com
2021-08-17 08:53:09 -04:00
dad9942bb8 Merge pull request #2869 from akohlmey/modify-add-returns-index
Have add_fix(), replace_fix() and add_compute() in Modify return class instance and refactor/simplify code
2021-08-16 15:44:16 -04:00
436d200a9a refactor file reader code 2021-08-16 15:29:43 -04:00
9e559de601 pretty 2021-08-16 15:21:51 -04:00
56a74bbe3d refactor file reader code 2021-08-16 15:21:38 -04:00
6f46ac57b9 plug small memory leak in pppm/gpu 2021-08-16 13:50:43 -04:00
7b873ffc0b add unit tests for ilp/graphene/hbn and kolmogorov/crespi/full 2021-08-15 19:07:57 -04:00
832f6499ed add suppression for OpenMP in newer GCC compilers 2021-08-15 18:39:42 -04:00
7efbdb24cc fix memory leak 2021-08-15 18:39:21 -04:00
e15c51c7e1 correctly use global cutoff instead of per-type-pair cutoffs 2021-08-15 17:44:22 -04:00
cba8e8237a avoid memory leak with MPI-IO 2021-08-13 06:25:21 -04:00
eaedd9ad48 fix output issues 2021-08-13 06:24:57 -04:00
9cb8a6205e apply "no" argument correctly 2021-08-13 06:24:39 -04:00
a765cf373a update formatting 2021-08-13 06:24:22 -04:00
f08c249d40 don't hide parameter with local variable 2021-08-13 06:23:46 -04:00
1abce8e821 remove dead code 2021-08-13 05:51:05 -04:00
3bfb235070 fix memory leak 2021-08-13 05:50:53 -04:00
3e99e24f41 make calls to virtual functions from constructors explicit 2021-08-13 05:50:44 -04:00
0928c912c0 fix memory leaks and reformat 2021-08-13 05:50:03 -04:00
26c681cf73 update for changes in base class 2021-08-09 16:28:19 -04:00
c8b7b8271d add missing dependency 2021-08-09 16:28:03 -04:00
1d98388129 Merge branch 'modify-add-returns-index' of github.com:akohlmey/lammps into modify-add-returns-index
# Conflicts:
#	src/GRANULAR/pair_gran_hooke_history.cpp
2021-08-09 16:00:48 -04:00
fe008b93d7 remove obsolete line 2021-08-07 10:33:26 -04:00
42625a82d1 simplify more code for creating fix instances using the improved APIs 2021-08-07 10:09:06 -04:00
68c15ebf04 refactor/simplify code due to changes in Modify 2021-08-07 10:09:06 -04:00
f23b04f9b6 update Eigen3 to support the latest stable release 3.3.9 2021-08-07 10:09:06 -04:00
88604328f5 workaround for PGI compilers 2021-08-07 10:09:06 -04:00
156790df2c apply changes to modify class 2021-08-07 10:08:58 -04:00
0b30f57812 streamline code by using changes in Modify class 2021-08-07 10:04:49 -04:00
0d9344c9e2 simplify 2021-08-07 10:04:49 -04:00
01f5b7e095 when creating or replacing a fix or compute, return pointer to new instance 2021-08-07 10:04:49 -04:00
e789bf8925 use temporary vector container to avoid explicit delete[] 2021-08-07 10:04:49 -04:00
0123f9290f update Eigen3 to support the latest stable release 3.3.9 2021-08-06 18:59:56 -04:00
06371629d6 workaround for PGI compilers 2021-08-06 18:44:42 -04:00
c84e7a5040 Merge pull request #2868 from akohlmey/collected-small-changes
Collected small changes
2021-08-06 18:35:29 -04:00
29bf3acd9e apply changes to modify class 2021-08-06 18:34:32 -04:00
03f9ef7de9 add unique identifier to the history fix so the gran/*/history styles can be used multiple times with pair style hybrid 2021-08-06 15:34:43 -04:00
e9e6cdca1d using GPU package is not compatible with fix qeq variants 2021-08-06 14:22:48 -04:00
e29bd3d157 update defines from -DLMP_USER-<PKG> to -DLMP_<PKG> for consistency 2021-08-06 14:07:43 -04:00
93465f98d8 improve error message 2021-08-06 13:55:53 -04:00
aeef6e6773 reformat with clang-format 2021-08-06 13:55:53 -04:00
8baaed5724 use const std::string & instead of const char *. avoid exception in sfree() 2021-08-06 13:55:53 -04:00
a7d05cff09 streamline code by using changes in Modify class 2021-08-06 13:39:02 -04:00
b16bca2f45 simplify 2021-08-06 13:39:02 -04:00
06f6434b38 when creating or replacing a fix or compute, return pointer to new instance 2021-08-06 13:39:02 -04:00
5861577a72 use temporary vector container to avoid explicit delete[] 2021-08-06 13:39:02 -04:00
912a1fc561 Merge pull request #2865 from rbberger/python_update
Python package update
2021-08-06 13:37:14 -04:00
eece77eecf Merge pull request #2866 from Colvars/colvars-update
Update Colvars to version 2021-08-06 (silence Coverity Scan warnings)
2021-08-06 11:20:46 -04:00
eb52f7c290 Update Colvars to version 2021-08-06 (silence Coverity Scan warnings)
Also include PDF copy of the manual forgotten in previous PR.
2021-08-06 10:32:37 -04:00
b9fa4e1db2 avoid memory leaks on specifying keywords multiple times 2021-08-06 10:22:31 -04:00
f3a03d6a84 Catch ValueError instead of base exception 2021-08-06 10:21:40 -04:00
53b94ac94d Allow fix python/move to load class from __main__ 2021-08-05 18:10:19 -04:00
980b817f3f Allow python pair style to load class from __main__ 2021-08-05 18:03:05 -04:00
5045595ad8 Merge pull request #2861 from akohlmey/fix-valgrind-issues
Address issues flagged by running unit tests with valgrind and sanitizer instrumentation
2021-08-05 16:07:57 -04:00
3fc97e9466 Merge branch 'fix-valgrind-issues' of github.com:akohlmey/lammps into fix-valgrind-issues 2021-08-05 12:20:33 -04:00
5295bb5109 fix refactoring bugs 2021-08-05 12:20:20 -04:00
177e60830e Merge branch 'master' into fix-valgrind-issues 2021-08-05 12:11:59 -04:00
c23dc22a3e Merge pull request #2862 from akohlmey/intel-set_ntypes-consistent
Make ForceConst::set_ntypes() more robust and fix related bug in pair style sw/intel
2021-08-05 11:50:50 -04:00
50c476b6af Merge pull request #2863 from Colvars/colvars-update
Update Colvars library to version 2021-08-03
2021-08-05 11:16:51 -04:00
9a60ab0c23 correctly insert atoms/molecules any nfreq timesteps even with multiple run
this changes the computation of "next_reneighbor" so that it is based
on "nfirst" which is set during the constructor of the class.
This still maintains the property that the first deposit attempt is not
done during setup, but on the next step.
2021-08-04 21:32:10 -04:00
bc6dfdb656 update readme 2021-08-04 17:44:56 -04:00
08a727d510 make some class members temporaries since they don't need to persist 2021-08-04 17:19:23 -04:00
2e7b3081a1 fix bug enumerating output when using python invoke with multiple functions 2021-08-04 17:07:16 -04:00
bb9c0630f8 suppressions for readline function calls from lammps-shell 2021-08-04 17:06:02 -04:00
0ea6406bb9 Merge branch 'fix-valgrind-issues' of github.com:akohlmey/lammps into fix-valgrind-issues 2021-08-04 12:25:12 -04:00
c4442206d4 add special case for heredocs in utils::split_words() to avoid segfaults 2021-08-04 12:03:34 -04:00
7068f3e77b add a few more test cases for testing utils::split_words() 2021-08-04 12:02:55 -04:00
2a9be42758 Update Colvars to version 2021-08-03 2021-08-03 18:03:18 -04:00
0938bc8999 update docs for hybrid style updates 2021-08-02 21:53:31 -04:00
c1c31c6b04 may not call memmove() on a null pointer, even if 'n' is 0. 2021-08-02 21:35:25 -04:00
04c7e7543e use friend statement instead of (incorrect) cast to give access to protected class member 2021-08-02 21:34:30 -04:00
37ca6a8e0b make handling of reference to Memory class in ForceConst class more robust 2021-08-02 15:50:44 -04:00
b7be9415de fix segfault with pair style sw/intel 2021-08-02 15:49:26 -04:00
53050a0429 add suppressions for FlexiBLAS on Fedora 2021-08-02 15:45:32 -04:00
a3bfcc68ef add libgomp suppression for newer GCC 2021-08-02 15:45:15 -04:00
848db31a77 reformat with clang-format 2021-08-02 15:25:01 -04:00
8aa39a6c40 make compatible with CLASS2 2021-08-02 15:23:16 -04:00
45858be1b6 avoid uninitialized data access for hybrid styles with OPENMP 2021-08-02 15:22:21 -04:00
50e8d7c36b Merge pull request #2859 from akohlmey/next_patch_release
Step version strings for next patch release
2021-07-30 16:40:10 -04:00
29eee29241 Merge pull request #2860 from evoyiatzis/patch-1
fixing compute gyration/shape indexing bug
2021-07-30 15:45:51 -04:00
db4fcd7537 update package dependency 2021-07-30 15:24:23 -04:00
75214f1eeb Merge pull request #2857 from akohlmey/update-formatted-output
Modernize formatted output and string handling in packages
2021-07-30 12:50:25 -04:00
82936b1e4f fixing indexing bug
The gyration_tensor[4] element  as computed by "compute gyration" corresponds to the xz component of the gyration tensor and the gyration_tensor[5] to the yz component. The  code  assumed that gyration_tensor[4] corresponds to the yz component and the gyration_tensor[5] to the xz.
2021-07-30 18:14:44 +02:00
f5b82ea3ef Merge pull request #2856 from akohlmey/collected-small-changes
Collected small changes and fixes
2021-07-30 11:36:40 -04:00
5f401da462 correct bug in derived CG-DNA FENE bond classes and optimize code 2021-07-30 10:48:15 -04:00
9dc662973e step version strings for next patch release 2021-07-29 21:18:03 -04:00
d211bbc0d6 expand ArgInfo class unit tests 2021-07-29 20:58:02 -04:00
cb32bb972b fix bugs in ArgInfo class 2021-07-29 20:57:42 -04:00
6b20da7549 update lammps shell test to use a fix that is always available 2021-07-29 17:48:35 -04:00
4710b7bc9e modernize and simplify code to find best matching restart file 2021-07-29 17:25:42 -04:00
5cdf55937d move pair style tracker to a better location 2021-07-29 17:17:06 -04:00
ca2abd22be remove unused file 2021-07-29 17:08:16 -04:00
a80829bd79 avoid compilation error 2021-07-29 16:14:52 -04:00
a6d66c3518 update .gitignore 2021-07-29 16:07:23 -04:00
33905fd689 fix one more KOKKOS package installation dependency 2021-07-29 16:07:14 -04:00
246b70ae46 update codeowners list 2021-07-29 15:56:21 -04:00
c49a533ad9 reformat, simplify, add reference log files 2021-07-29 15:40:43 -04:00
b108da3e5c simplify format handling 2021-07-29 15:26:29 -04:00
dcff3d70e0 simplify fix instance creation 2021-07-29 15:18:58 -04:00
520109bda0 simplify 2021-07-29 14:55:22 -04:00
ebe5e6c024 reformat 2021-07-29 14:44:15 -04:00
5b6b6b8767 simplify and use utils functions 2021-07-29 14:33:41 -04:00
b5830b672a simplify logging code 2021-07-29 14:18:38 -04:00
9cf790a2fe simplify and use fmtlib 2021-07-29 14:09:49 -04:00
3a968b81ad update 2021-07-29 13:59:59 -04:00
b4e3795913 fix copy-n-paste error 2021-07-29 13:58:27 -04:00
43b3c97cc0 add unit tests for scafacos kspace solver (skipping p3m) 2021-07-29 13:57:02 -04:00
2a1177fa92 reformat with clang-format 2021-07-29 13:29:56 -04:00
508798ab2b simplify code, make use of fmtlib and utils 2021-07-29 13:25:06 -04:00
a9271b6d9a replace temporary char buffer with using fmtlib 2021-07-29 12:36:50 -04:00
211d6636b4 modernize and simplify code to find best matching restart file 2021-07-29 12:09:55 -04:00
5f2b947b99 fix typo 2021-07-29 11:48:24 -04:00
1e48be92aa avoid segfault 2021-07-28 21:50:20 -04:00
b9ab0eb607 fix broken symbolic links 2021-07-28 21:32:52 -04:00
bf6c982b49 skip using neighbor list load balancing weight when using KOKKOS with GPU 2021-07-28 21:30:06 -04:00
b8d3297659 add missing package dependency 2021-07-28 18:45:09 -04:00
d33863839e update pair style installation dependencies 2021-07-28 18:37:59 -04:00
294ac76f41 forgot to move pair style beck to EXTRA-PAIR 2021-07-28 18:33:33 -04:00
6fcfbb7793 add missing dependency for conventional build 2021-07-28 18:18:54 -04:00
3a5d3fc541 fix compilation 2021-07-28 18:11:59 -04:00
218467b385 use fabs() instead of abs() on floating point number 2021-07-28 16:17:12 -04:00
9a4bc8eda1 apply citation reminder 2021-07-28 16:16:54 -04:00
f46e1c98f7 removed dead code and make consistent with non-OPENMP version 2021-07-28 16:16:42 -04:00
32be894ae2 silence compiler warnings 2021-07-28 16:16:22 -04:00
d5ba7b2578 Propagate variable rename 2021-07-22 08:10:42 -06:00
6d3a5a6eb9 Port custom changes to atom_kokkos 2021-07-21 17:05:56 -06:00
94ce07b2de Merge branch 'lammps:master' into tip4p_fix_types 2021-07-21 14:09:39 +03:00
2a21c4b29f add sticker-bond support to fix bond/swap 2021-07-02 11:46:25 -06:00
d982d153f8 Fix conditions for correct results on other types 2021-06-18 18:26:53 +03:00
8fef6a10dd Fix atom types handling in the tip4p/gpu kernels 2021-06-18 00:52:23 +03:00
26127e1fa0 more changes to fix ttm/grid 2021-06-09 15:49:20 -06:00
456b81417d first version of fix ttm/grid 2021-06-09 09:03:50 -06:00
b2f96d92df remove print statement 2021-01-13 10:31:03 -07:00
fc79280548 other USER-DPD uses of dname vs new dvname 2021-01-12 12:37:50 -07:00
6f4d657061 enable pair table/rx for new custom vector syntax 2021-01-12 12:28:06 -07:00
386fe6158a edits to doc pages, including per-atom variables 2021-01-12 09:07:23 -07:00
bddd26ba6c additional changes needed to merge with current master 2021-01-11 17:26:00 -07:00
0b14770468 merge with current master 2021-01-11 16:13:33 -07:00
64257393b9 remove custom vector usage from USER-DPD:fix_rx.cpp 2020-09-09 10:21:59 -06:00
76725731fd changes in package files to match new find_custom() syntax 2020-09-08 13:48:41 -06:00
d1442b0538 enable per-atom custom arrays in addition to vectors 2020-09-04 11:33:49 -06:00
1569 changed files with 54886 additions and 29966 deletions

65
.github/CODEOWNERS vendored
View File

@ -22,42 +22,42 @@ src/MESSAGE/* @sjplimp
src/MLIAP/* @athomps
src/SNAP/* @athomps
src/SPIN/* @julient31
src/BROWNIAN/* @samueljmcameron
src/CG-DNA/* @ohenrich
src/CG-SDK/* @akohlmey
src/COLVARS/* @giacomofiorin
src/DIELECTRIC/* @ndtrung81
src/FEP/* @agiliopadua
src/ML-HDNNP/* @singraber
src/INTEL/* @wmbrownintel
src/MANIFOLD/* @Pakketeretet2
src/MDI/* @taylor-a-barnes
src/MEAM/* @martok
src/MESONT/* @iafoss
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/QMMM/* @akohlmey
src/REAXFF/* @hasanmetin
src/REACTION/* @jrgissing
src/SCAFACOS/* @rhalver
src/TALLY/* @akohlmey
src/UEF/* @danicholson
src/VTK/* @rbberger
src/BROWNIAN/* @samueljmcameron
src/CG-DNA/* @ohenrich
src/CG-SDK/* @akohlmey
src/COLVARS/* @giacomofiorin
src/DIELECTRIC/* @ndtrung81
src/FEP/* @agiliopadua
src/ML-HDNNP/* @singraber
src/INTEL/* @wmbrownintel
src/MANIFOLD/* @Pakketeretet2
src/MDI/* @taylor-a-barnes
src/MEAM/* @martok
src/MESONT/* @iafoss
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/QMMM/* @akohlmey
src/REAXFF/* @hasanmetin @stanmoore1
src/REACTION/* @jrgissing
src/SCAFACOS/* @rhalver
src/TALLY/* @akohlmey
src/UEF/* @danicholson
src/VTK/* @rbberger
# individual files in packages
src/GPU/pair_vashishta_gpu.* @andeplane
src/KOKKOS/pair_vashishta_kokkos.* @andeplane
src/MANYBODY/pair_vashishta_table.* @andeplane
src/MANYBODY/pair_atm.* @sergeylishchuk
src/USER-MISC/*_grem.* @dstelter92
src/USER-MISC/compute_stress_mop*.* @RomainVermorel
src/REPLICA/*_grem.* @dstelter92
src/EXTRA-COMPUTE/compute_stress_mop*.* @RomainVermorel
src/MISC/*_tracker.* @jtclemm
# core LAMMPS classes
src/lammps.* @sjplimp
@ -81,6 +81,7 @@ src/kspace.* @sjplimp
src/lmptyp.h @sjplimp
src/library.* @sjplimp
src/main.cpp @sjplimp
src/min_*.* @sjplimp
src/memory.* @sjplimp
src/modify.* @sjplimp
src/molecule.* @sjplimp
@ -109,7 +110,6 @@ src/thermo.* @sjplimp
src/universe.* @sjplimp
src/update.* @sjplimp
src/variable.* @sjplimp
src/verlet.* @sjplimp
src/velocity.* @sjplimp
src/write_data.* @sjplimp
src/write_restart.* @sjplimp
@ -122,13 +122,14 @@ src/info.* @akohlmey @rbberger
src/timer.* @akohlmey
src/min* @sjplimp @stanmoore1
src/utils.* @akohlmey @rbberger
src/verlet.* @sjplimp @stanmoore1
src/math_eigen_impl.h @jewettaij
# tools
tools/msi2lmp/* @akohlmey
tools/emacs/* @HaoZeke
tools/singularity/* @akohlmey @rbberger
tools/code_standard/* @rbberger
tools/coding_standard/* @rbberger
tools/valgrind/* @akohlmey
tools/swig/* @akohlmey
tools/offline/* @rbberger

View File

@ -5,8 +5,9 @@ Thank your for considering to contribute to the LAMMPS software project.
The following is a set of guidelines as well as explanations of policies and work flows for contributing to the LAMMPS molecular dynamics software project. These guidelines focus on submitting issues or pull requests on the LAMMPS GitHub project.
Thus please also have a look at:
* [The Section on submitting new features for inclusion in LAMMPS of the Manual](https://lammps.sandia.gov/doc/Modify_contribute.html)
* [The LAMMPS GitHub Tutorial in the Manual](http://lammps.sandia.gov/doc/Howto_github.html)
* [The guide for submitting new features in the LAMMPS manual](https://lammps.sandia.gov/doc/Modify_contribute.html)
* [The guide on programming style and requirement in the LAMMPS manual](https://lammps.sandia.gov/doc/Modify_contribute.html)
* [The GitHub tutorial in the LAMMPS manual](http://lammps.sandia.gov/doc/Howto_github.html)
## Table of Contents
@ -26,11 +27,11 @@ __
## I don't want to read this whole thing I just have a question!
> **Note:** Please do not file an issue to ask a general question about LAMMPS, its features, how to use specific commands, or how perform simulations or analysis in LAMMPS. Instead post your question to either the ['lammps-users' mailing list](https://lammps.sandia.gov/mail.html) or the [LAMMPS Material Science Discourse forum](https://matsci.org/lammps). You do not need to be subscribed to post to the list (but a mailing list subscription avoids having your post delayed until it is approved by a mailing list moderator). Most posts to the mailing list receive a response within less than 24 hours. Before posting to the mailing list, please read the [mailing list guidelines](https://lammps.sandia.gov/guidelines.html). Following those guidelines will help greatly to get a helpful response. Always mention which LAMMPS version you are using. The LAMMPS forum was recently created as part of a larger effort to build a materials science community and have discussions not just about using LAMMPS. Thus the forum may be also used for discussions that would be off-topic for the mailing list. Those will just have to be moved to a more general category.
> **Note:** Please do not file an issue to ask a general question about LAMMPS, its features, how to use specific commands, or how perform simulations or analysis in LAMMPS. Instead post your question to either the ['lammps-users' mailing list](https://lammps.sandia.gov/mail.html) or the [LAMMPS Material Science Discourse forum](https://matsci.org/lammps). You do not need to be subscribed to post to the list (but a mailing list subscription avoids having your post delayed until it is approved by a mailing list moderator). Most posts to the mailing list receive a response within less than 24 hours. Before posting to the mailing list, please read the [mailing list guidelines](https://lammps.sandia.gov/guidelines.html). Following those guidelines will help greatly to get a helpful response. Always mention which LAMMPS version you are using. The LAMMPS forum was recently created as part of a larger effort to build a materials science community and have discussions not just about using LAMMPS. Thus the forum may be also used for discussions that would be off-topic for the mailing list. Those will just have to be posted to a more general category.
## How Can I Contribute?
There are several ways how you can actively contribute to the LAMMPS project: you can discuss compiling and using LAMMPS, and solving LAMMPS related problems with other LAMMPS users on the lammps-users mailing list, you can report bugs or suggest enhancements by creating issues on GitHub (or posting them to the lammps-users mailing list or posting in the LAMMPS Materials Science Discourse forum), and you can contribute by submitting pull requests on GitHub or e-mail your code
There are several ways how you can actively contribute to the LAMMPS project: you can discuss compiling and using LAMMPS, and solving LAMMPS related problems with other LAMMPS users on the lammps-users mailing list or the forum, you can report bugs or suggest enhancements by creating issues on GitHub (or posting them to the lammps-users mailing list or posting in the LAMMPS Materials Science Discourse forum), and you can contribute by submitting pull requests on GitHub or e-mail your code
to one of the [LAMMPS core developers](https://lammps.sandia.gov/authors.html). As you may see from the aforementioned developer page, the LAMMPS software package includes the efforts of a very large number of contributors beyond the principal authors and maintainers.
### Discussing How To Use LAMMPS
@ -62,37 +63,12 @@ To be able to submit an issue on GitHub, you have to register for an account (fo
### Contributing Code
We encourage users to submit new features or modifications for LAMMPS to the core developers so they can be added to the LAMMPS distribution. The preferred way to manage and coordinate this is by submitting a pull request at the LAMMPS project on GitHub. For any larger modifications or programming project, you are encouraged to contact the LAMMPS developers ahead of time, in order to discuss implementation strategies and coding guidelines, that will make it easier to integrate your contribution and result in less work for everybody involved. You are also encouraged to search through the list of open issues on GitHub and submit a new issue for a planned feature, so you would not duplicate the work of others (and possibly get scooped by them) or have your work duplicated by others.
We encourage users to submit new features or modifications for LAMMPS. Instructions, guidelines, requirements,
and recommendations are in the following sections of the LAMMPS manual:
* [The guide for submitting new features in the LAMMPS manual](https://lammps.sandia.gov/doc/Modify_contribute.html)
* [The guide on programming style and requirement in the LAMMPS manual](https://lammps.sandia.gov/doc/Modify_contribute.html)
* [The GitHub tutorial in the LAMMPS manual](http://lammps.sandia.gov/doc/Howto_github.html)
How quickly your contribution will be integrated depends largely on how much effort it will cause to integrate and test it, how much it requires changes to the core code base, and of how much interest it is to the larger LAMMPS community. Please see below for a checklist of typical requirements. Once you have prepared everything, see [this tutorial](https://lammps.sandia.gov/doc/Howto_github.html)
for instructions on how to submit your changes or new files through a GitHub pull request
Here is a checklist of steps you need to follow to submit a single file or user package for our consideration. Following these steps will save both you and us time. See existing files in packages in the source directory for examples. If you are uncertain, please ask on the lammps-users mailing list.
* C++ source code must be compatible with the C++-11 standard. Packages may require a later standard, if justified.
* All source files you provide must compile with the most current version of LAMMPS with multiple configurations. In particular you need to test compiling LAMMPS from scratch with `-DLAMMPS_BIGBIG` set in addition to the default `-DLAMMPS_SMALLBIG` setting. Your code will need to work correctly in serial and in parallel using MPI.
* For consistency with the rest of LAMMPS and especially, if you want your contribution(s) to be added to main LAMMPS code or one of its standard packages, it needs to be written in a style compatible with other LAMMPS source files. This means: 2-character indentation per level, no tabs, no trailing whitespace, no lines over 80 characters. I/O is done via the C-style stdio library, style class header files should not import any system headers, STL containers should be avoided in headers, and forward declarations used where possible or needed. All added code should be placed into the LAMMPS_NS namespace or a sub-namespace; global or static variables should be avoided, as they conflict with the modular nature of LAMMPS and the C++ class structure. There MUST NOT be any "using namespace XXX;" statements in headers. In the implementation file (<name>.cpp) system includes should be placed in angular brackets (<>) and for c-library functions the C++ style header files should be included (<cstdio> instead of <stdio.h>, or <cstring> instead of <string.h>). This all is so the developers can more easily understand, integrate, and maintain your contribution and reduce conflicts with other parts of LAMMPS. This basically means that the code accesses data structures, performs its operations, and is formatted similar to other LAMMPS source files, including the use of the error class for error and warning messages.
* Source, style name, and documentation file should follow the following naming convention: style names should be lowercase and words separated by a forward slash; for a new fix style 'foo/bar', the class should be named FixFooBar, the name of the source files should be 'fix_foo_bar.h' and 'fix_foo_bar.cpp' and the corresponding documentation should be in a file 'fix_foo_bar.rst'.
* If you want your contribution to be added as a user-contributed feature, and it is a single file (actually a `<name>.cpp` and `<name>.h` file) it can be rapidly added to the USER-MISC directory. Include the one-line entry to add to the USER-MISC/README file in that directory, along with the 2 source files. You can do this multiple times if you wish to contribute several individual features.
* If you want your contribution to be added as a user-contribution and it is several related features, it is probably best to make it a user package directory with a name like FOO. In addition to your new files, the directory should contain a README text file. The README should contain your name and contact information and a brief description of what your new package does. If your files depend on other LAMMPS style files also being installed (e.g. because your file is a derived class from the other LAMMPS class), then an Install.sh file is also needed to check for those dependencies. See other README and Install.sh files in other USER directories as examples. Send us a tarball of this FOO directory.
* Your new source files need to have the LAMMPS copyright, GPL notice, and your name and email address at the top, like other user-contributed LAMMPS source files. They need to create a class that is inside the LAMMPS namespace. If the file is for one of the USER packages, including USER-MISC, then we are not as picky about the coding style (see above). I.e. the files do not need to be in the same stylistic format and syntax as other LAMMPS files, though that would be nice for developers as well as users who try to read your code.
* You **must** also create or extend a documentation file for each new command or style you are adding to LAMMPS. For simplicity and convenience, the documentation of groups of closely related commands or styles may be combined into a single file. This will be one file for a single-file feature. For a package, it might be several files. These are files in the [reStructuredText](https://docutils.sourceforge.io/rst.html) markup language, that are then converted to HTML and PDF. The tools for this conversion are included in the source distribution, and the translation can be as simple as doing "make html pdf" in the doc folder. Thus the documentation source files must be in the same format and style as other `<name>.rst` files in the lammps/doc/src directory for similar commands and styles; use one or more of them as a starting point. An introduction to reStructuredText can be found at [https://docutils.sourceforge.io/docs/user/rst/quickstart.html](https://docutils.sourceforge.io/docs/user/rst/quickstart.html). The text files can include mathematical expressions and symbol in ".. math::" sections or ":math:" expressions or figures (see doc/JPG for examples), or even additional PDF files with further details (see doc/PDF for examples). The doc page should also include literature citations as appropriate; see the bottom of doc/fix_nh.rst for examples and the earlier part of the same file for how to format the cite itself. The "Restrictions" section of the doc page should indicate that your command is only available if LAMMPS is built with the appropriate USER-MISC or FOO package. See other user package doc files for examples of how to do this. The prerequisite for building the HTML format files are Python 3.x and virtualenv. Please run at least `make html`, `make pdf` and `make spelling` and carefully inspect and proofread the resulting HTML format doc page as well as the output produced to the screen. Make sure that all spelling errors are fixed or the necessary false positives are added to the `doc/utils/sphinx-config/false_positives.txt` file. For new styles, those usually also need to be added to lists on the respective overview pages. This can be checked for also with `make style_check`.
* For a new package (or even a single command) you should include one or more example scripts demonstrating its use. These should run in no more than a couple minutes, even on a single processor, and not require large data files as input. See directories under examples/PACKAGES for examples of input scripts other users provided for their packages. These example inputs are also required for validating memory accesses and testing for memory leaks with valgrind
* For new utility functions or class (i.e. anything that does not depend on a LAMMPS object), new unit tests should be added to the unittest tree.
* When adding a new LAMMPS style, a .yaml file with a test configuration and reference data should be added for the styles where a suitable tester program already exists (e.g. pair styles, bond styles, etc.).
* If there is a paper of yours describing your feature (either the algorithm/science behind the feature itself, or its initial usage, or its implementation in LAMMPS), you can add the citation to the <name>.cpp source file. See src/EFF/atom_vec_electron.cpp for an example. A LaTeX citation is stored in a variable at the top of the file and a single line of code that references the variable is added to the constructor of the class. Whenever a user invokes your feature from their input script, this will cause LAMMPS to output the citation to a log.cite file and prompt the user to examine the file. Note that you should only use this for a paper you or your group authored. E.g. adding a cite in the code for a paper by Nose and Hoover if you write a fix that implements their integrator is not the intended usage. That kind of citation should just be in the doc page you provide.
Finally, as a general rule-of-thumb, the more clear and self-explanatory you make your documentation and README files, and the easier you make it for people to get started, e.g. by providing example scripts, the more likely it is that users will try out your new feature.
If the new features/files are broadly useful we may add them as core files to LAMMPS or as part of a standard package. Else we will add them as a user-contributed file or package. Examples of user packages are in src sub-directories that start with USER. The USER-MISC package is simply a collection of (mostly) unrelated single files, which is the simplest way to have your contribution quickly added to the LAMMPS distribution. You can see a list of the both standard and user packages by typing "make package" in the LAMMPS src directory.
Note that by providing us files to release, you are agreeing to make them open-source, i.e. we can release them under the terms of the GPL, used as a license for the rest of LAMMPS. See Section 1.4 for details.
With user packages and files, all we are really providing (aside from the fame and fortune that accompanies having your name in the source code and on the Authors page of the LAMMPS WWW site), is a means for you to distribute your work to the LAMMPS user community, and a mechanism for others to easily try out your new feature. This may help you find bugs or make contact with new collaborators. Note that you are also implicitly agreeing to support your code which means answer questions, fix bugs, and maintain it if LAMMPS changes in some way that breaks it (an unusual event).
To be able to submit an issue on GitHub, you have to register for an account (for GitHub in general). If you do not want to do that, or have other reservations or difficulties to submit a pull request, you can - as an alternative - contact one or more of the core LAMMPS developers and ask if one of them would be interested in manually merging your code into LAMMPS and send them your source code. Since the effort to merge a pull request is a small fraction of the effort of integrating source code manually (which would usually be done by converting the contribution into a pull request), your chances to have your new code included quickly are the best with a pull request.
If you prefer to submit patches or full files, you should first make certain, that your code works correctly with the latest patch-level version of LAMMPS and contains all bug fixes from it. Then create a gzipped tar file of all changed or added files or a corresponding patch file using 'diff -u' or 'diff -c' and compress it with gzip. Please only use gzip compression, as this works well on all platforms.
## GitHub Workflows
@ -102,17 +78,17 @@ This section briefly summarizes the steps that will happen **after** you have su
After submitting an issue, one or more of the LAMMPS developers will review it and categorize it by assigning labels. Confirmed bug reports will be labeled `bug`; if the bug report also contains a suggestion for how to fix it, it will be labeled `bugfix`; if the issue is a feature request, it will be labeled `enhancement`. Other labels may be attached as well, depending on which parts of the LAMMPS code are affected. If the assessment is, that the issue does not warrant any changes, the `wontfix` label will be applied and if the submission is incorrect or something that should not be submitted as an issue, the `invalid` label will be applied. In both of the last two cases, the issue will then be closed without further action.
For feature requests, what happens next is that developers may comment on the viability or relevance of the request, discuss and make suggestions for how to implement it. If a LAMMPS developer or user is planning to implement the feature, the issue will be assigned to that developer. For developers, that are not yet listed as LAMMPS project collaborators, they will receive an invitation to be added to the LAMMPS project as a collaborator so they can get assigned. If the requested feature or enhancement is implemented, it will usually be submitted as a pull request, which will contain a reference to the issue number. And once the pull request is reviewed and accepted for inclusion into LAMMPS, the issue will be closed. For details on how pull requests are processed, please see below.
For feature requests, what happens next is that developers may comment on the viability or relevance of the request, discuss and make suggestions for how to implement it. If a LAMMPS developer or user is planning to implement the feature, the issue will be assigned to that developer. For developers, that are not yet listed as LAMMPS project collaborators, they will receive an invitation to be added to the LAMMPS project as a collaborator so they can get assigned. If the requested feature or enhancement is implemented, it will be submitted as a pull request, which will contain a reference to the issue number. And once the pull request is reviewed and accepted for inclusion into LAMMPS, the issue will be closed. For details on how pull requests are processed, please see below. Feature requests may be labeled with `volunteer_needed` if none of the LAMMPS developers has the time and the required knowledge implement the feature.
For bug reports, the next step is that one of the core LAMMPS developers will self-assign to the issue and try to confirm the bug. If confirmed, the `bug` label and potentially other labels are added to classify the issue and its impact to LAMMPS. Before confirming, further questions may be asked or requests for providing additional input files or details about the steps required to reproduce the issue. Any bugfix is likely to be submitted as a pull request (more about that below) and since most bugs require only local changes, the bugfix may be included in a pull request specifically set up to collect such local bugfixes or small enhancements. Once the bugfix is included in the master branch, the issue will be closed.
For bug reports, the next step is that one of the core LAMMPS developers will self-assign to the issue and try to confirm the bug. If confirmed, the `bug` label and potentially other labels are added to classify the issue and its impact to LAMMPS. Otherwise the `unconfirmed` label will be applied and some comment about what was tried to confirm the bug added. Before confirming, further questions may be asked or requests for providing additional input files or details about the steps required to reproduce the issue. Any bugfix will be submitted as a pull request (more about that below) and since most bugs require only local changes, the bugfix may be included in a pull request specifically set up to collect such local bugfixes or small enhancements. Once the bugfix is included in the master branch, the issue will be closed.
### Pull Requests
For submitting pull requests, there is a [detailed tutorial](https://lammps.sandia.gov/doc/Howto_github.html) in the LAMMPS manual. Thus only a brief breakdown of the steps is presented here. Please note, that the LAMMPS developers are still reviewing and trying to improve the process. If you are unsure about something, do not hesitate to post a question on the lammps-users mailing list or contact one fo the core LAMMPS developers.
Immediately after the submission, the LAMMPS continuing integration server at ci.lammps.org will download your submitted branch and perform a simple compilation test, i.e. will test whether your submitted code can be compiled under various conditions. It will also do a check on whether your included documentation translates cleanly. Whether these tests are successful or fail will be recorded. If a test fails, please inspect the corresponding output on the CI server and take the necessary steps, if needed, so that the code can compile cleanly again. The test will be re-run each the pull request is updated with a push to the remote branch on GitHub.
Next a LAMMPS core developer will self-assign and do an overall technical assessment of the submission. If you are not yet registered as a LAMMPS collaborator, you will receive an invitation for that. As part of the assessment, the pull request will be categorized with labels. There are two special labels: `needs_work` (indicates that work from the submitter of the pull request is needed) and `work_in_progress` (indicates, that the assigned LAMMPS developer will make changes, if not done by the contributor who made the submit).
Pull requests are the **only** way that changes get made to the LAMMPS distribution. So also the LAMMPS core developers will submit pull requests for their own changes and discuss them on GitHub. Thus if you submit a pull request it will be treated in a similar fashion. When you submit a pull request you may opt to submit a "Draft" pull request. That means your changes are visible and will be subject to testing, but reviewers will not be (auto-)assigned and comments will take into account that this is not complete. On the other hand, this is a perfect way to ask the LAMMPS developers for comments on non-obvious changes and get feedback and possible suggestions for improvements or recommendations about what to avoid.
Immediately after the submission, the LAMMPS continuing integration server at ci.lammps.org will download your submitted branch and perform a number of tests: it will tests whether it compiles cleanly under various conditions, it will also do a check on whether your included documentation translates cleanly and run some unit tests and other checks. Whether these tests are successful or fail will be recorded. If a test fails, please inspect the corresponding output on the CI server and take the necessary steps, if needed, so that the code can compile cleanly again. The test will be re-run each time the pull request is updated with a push to the remote branch on GitHub. If you are unsure about what you need to change, ask a question in the discussion area of the pull request.
Next a LAMMPS core developer will self-assign and do an overall technical assessment of the submission. If you submitted a draft pull request, this will not happen unless you mark it "ready for review". If you are not yet invited as a LAMMPS collaborator, and your contribution seems significant, you may also receive an invitation for collaboration on the LAMMPS repository. As part of the assessment, the pull request will be categorized with labels. There are two special labels: `needs_work` (indicates that work from the submitter of the pull request is needed) and `work_in_progress` (indicates, that the assigned LAMMPS developer will make changes, if not done by the contributor who made the submit).
You may also receive comments and suggestions on the overall submission or specific details and on occasion specific requests for changes as part of the review. If permitted, also additional changes may be pushed into your pull request branch or a pull request may be filed in your LAMMPS fork on GitHub to include those changes.
The LAMMPS developer may then decide to assign the pull request to another developer (e.g. when that developer is more knowledgeable about the submitted feature or enhancement or has written the modified code). It may also happen, that additional developers are requested to provide a review and approve the changes. For submissions, that may change the general behavior of LAMMPS, or where a possibility of unwanted side effects exists, additional tests may be requested by the assigned developer.
If the assigned developer is satisfied and considers the submission ready for inclusion into LAMMPS, the pull request will receive approvals and be merged into the master branch by one of the core LAMMPS developers. After the pull request is merged, you may delete the feature branch used for the pull request in your personal LAMMPS fork.
Since the learning curve for git is quite steep for efficiently managing remote repositories, local and remote branches, pull requests and more, do not hesitate to ask questions, if you are not sure about how to do certain steps that are asked of you. Even if the changes asked of you do not make sense to you, they may be important for the LAMMPS developers. Please also note, that these all are guidelines and nothing set in stone. So depending on the nature of the contribution, the workflow may be adjusted.
If the assigned developer is satisfied and considers the submission ready for inclusion into LAMMPS, the pull request will receive approvals and be merged into the master branch by one of the core LAMMPS developers. After the pull request is merged, you may delete the feature branch used for the pull request in your personal LAMMPS fork. The minimum requirement to merge a pull request is that all automated tests have to pass and at least one LAMMPS developer has approved integrating the submitted code. Since the approver will not be the person merging a pull request, you will have at least two LAMMPS developers that looked at your contribution.
Since the learning curve for git is quite steep for efficiently managing remote repositories, local and remote branches, pull requests and more, do not hesitate to ask questions, if you are not sure about how to do certain steps that are asked of you. Even if the changes asked of you do not make sense to you, they may be important for the LAMMPS developers. Please also note, that these all are guidelines and nothing set in stone. So depending on the nature of the contribution, the work flow may be adjusted.

10
cmake/.coveragerc.in Normal file
View File

@ -0,0 +1,10 @@
[run]
source = @LAMMPS_PYTHON_DIR@
parallel=True
branch=True
omit=*/install.py
*/setup.py
[paths]
sources = python
@LAMMPS_PYTHON_DIR@

View File

@ -36,7 +36,11 @@ find_package(Git)
# by default, install into $HOME/.local (not /usr/local), so that no root access (and sudo!!) is needed
if(CMAKE_INSTALL_PREFIX_INITIALIZED_TO_DEFAULT)
set(CMAKE_INSTALL_PREFIX "$ENV{HOME}/.local" CACHE PATH "Default install path" FORCE)
if((CMAKE_SYSTEM_NAME STREQUAL "Windows") AND (NOT CMAKE_CROSSCOMPILING))
set(CMAKE_INSTALL_PREFIX "$ENV{USERPROFILE}/LAMMPS" CACHE PATH "Default install path" FORCE)
else()
set(CMAKE_INSTALL_PREFIX "$ENV{HOME}/.local" CACHE PATH "Default install path" FORCE)
endif()
endif()
# If enabled, no need to use LD_LIBRARY_PATH / DYLD_LIBRARY_PATH when installed
@ -90,6 +94,10 @@ endif()
set(CMAKE_CXX_STANDARD 11)
set(CMAKE_CXX_STANDARD_REQUIRED ON)
set(CMAKE_CXX_EXTENSIONS OFF CACHE BOOL "Use compiler extensions")
# ugly hack for MSVC which by default always reports an old C++ standard in the __cplusplus macro
if(MSVC)
add_compile_options(/Zc:__cplusplus)
endif()
# export all symbols when building a .dll file on windows
if((CMAKE_SYSTEM_NAME STREQUAL "Windows") AND BUILD_SHARED_LIBS)
@ -769,6 +777,13 @@ endif()
include(Testing)
include(CodeCoverage)
include(CodingStandard)
find_package(ClangFormat 8.0)
if(ClangFormat_FOUND)
add_custom_target(format-src
COMMAND ${ClangFormat_EXECUTABLE} --verbose -i -style=file *.cpp *.h */*.cpp */*.h
WORKING_DIRECTORY ${LAMMPS_SOURCE_DIR})
endif()
get_target_property(DEFINES lammps COMPILE_DEFINITIONS)
include(FeatureSummary)

View File

@ -54,6 +54,8 @@ if(ENABLE_COVERAGE)
if(COVERAGE_FOUND)
set(PYTHON_COVERAGE_HTML_DIR ${CMAKE_BINARY_DIR}/python_coverage_html)
configure_file(.coveragerc.in ${CMAKE_BINARY_DIR}/.coveragerc @ONLY)
add_custom_command(
OUTPUT ${CMAKE_BINARY_DIR}/unittest/python/.coverage
COMMAND ${COVERAGE_BINARY} combine
@ -63,16 +65,16 @@ if(ENABLE_COVERAGE)
add_custom_target(
gen_python_coverage_html
COMMAND ${COVERAGE_BINARY} html -d ${PYTHON_COVERAGE_HTML_DIR}
DEPENDS ${CMAKE_BINARY_DIR}/unittest/python/.coverage
COMMAND ${COVERAGE_BINARY} html --rcfile=${CMAKE_BINARY_DIR}/.coveragerc -d ${PYTHON_COVERAGE_HTML_DIR}
DEPENDS ${CMAKE_BINARY_DIR}/unittest/python/.coverage ${CMAKE_BINARY_DIR}/.coveragerc
WORKING_DIRECTORY ${CMAKE_BINARY_DIR}/unittest/python
COMMENT "Generating HTML Python coverage report..."
)
add_custom_target(
gen_python_coverage_xml
COMMAND ${COVERAGE_BINARY} xml -o ${CMAKE_BINARY_DIR}/python_coverage.xml
DEPENDS ${CMAKE_BINARY_DIR}/unittest/python/.coverage
COMMAND ${COVERAGE_BINARY} xml --rcfile=${CMAKE_BINARY_DIR}/.coveragerc -o ${CMAKE_BINARY_DIR}/python_coverage.xml
DEPENDS ${CMAKE_BINARY_DIR}/unittest/python/.coverage ${CMAKE_BINARY_DIR}/.coveragerc
WORKING_DIRECTORY ${CMAKE_BINARY_DIR}/unittest/python
COMMENT "Generating XML Python coverage report..."
)

View File

@ -38,7 +38,7 @@ if(FFTW3_FOUND)
add_library(FFTW3::FFTW3_OMP UNKNOWN IMPORTED)
set_target_properties(FFTW3::FFTW3_OMP PROPERTIES
IMPORTED_LINK_INTERFACE_LANGUAGES "C"
IMPORTED_LOCATION "${FFTW3_OMP_LIBRARY}"
IMPORTED_LOCATION "${FFTW3_OMP_LIBRARY}"
INTERFACE_INCLUDE_DIRECTORIES "${FFTW3_INCLUDE_DIRS}")
endif()
endif()

View File

@ -37,7 +37,7 @@ if(FFTW3F_FOUND)
add_library(FFTW3F::FFTW3F_OMP UNKNOWN IMPORTED)
set_target_properties(FFTW3F::FFTW3F_OMP PROPERTIES
IMPORTED_LINK_INTERFACE_LANGUAGES "C"
IMPORTED_LOCATION "${FFTW3F_OMP_LIBRARY}"
IMPORTED_LOCATION "${FFTW3F_OMP_LIBRARY}"
INTERFACE_INCLUDE_DIRECTORIES "${FFTW3F_INCLUDE_DIRS}")
endif()
endif()

View File

@ -1,6 +1,6 @@
message(STATUS "Downloading and building OpenCL loader library")
set(OPENCL_LOADER_URL "${LAMMPS_THIRDPARTY_URL}/opencl-loader-2021.06.30.tar.gz" CACHE STRING "URL for OpenCL loader tarball")
set(OPENCL_LOADER_MD5 "f9e55dd550cfbf77f46507adf7cb8fd2" CACHE STRING "MD5 checksum of OpenCL loader tarball")
set(OPENCL_LOADER_URL "${LAMMPS_THIRDPARTY_URL}/opencl-loader-2021.09.18.tar.gz" CACHE STRING "URL for OpenCL loader tarball")
set(OPENCL_LOADER_MD5 "3b3882627964bd02e5c3b02065daac3c" CACHE STRING "MD5 checksum of OpenCL loader tarball")
mark_as_advanced(OPENCL_LOADER_URL)
mark_as_advanced(OPENCL_LOADER_MD5)

View File

@ -71,44 +71,47 @@ if(GPU_API STREQUAL "CUDA")
# 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
set(GPU_CUDA_GENCODE "-arch=${GPU_ARCH}")
# Fermi (GPU Arch 2.x) is supported by CUDA 3.2 to CUDA 8.0
if((CUDA_VERSION VERSION_GREATER_EQUAL "3.2") AND (CUDA_VERSION VERSION_LESS "9.0"))
string(APPEND GPU_CUDA_GENCODE " -gencode arch=compute_20,code=[sm_20,compute_20] ")
endif()
# 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"))
string(APPEND GPU_CUDA_GENCODE " -gencode arch=compute_30,code=[sm_30,compute_30] ")
endif()
# Kepler (GPU Arch 3.5) is supported by CUDA 5 to CUDA 11
if((CUDA_VERSION VERSION_GREATER_EQUAL "5.0") AND (CUDA_VERSION VERSION_LESS "12.0"))
string(APPEND GPU_CUDA_GENCODE " -gencode arch=compute_35,code=[sm_35,compute_35]")
endif()
# Maxwell (GPU Arch 5.x) is supported by CUDA 6 and later
if(CUDA_VERSION VERSION_GREATER_EQUAL "6.0")
string(APPEND GPU_CUDA_GENCODE " -gencode arch=compute_50,code=[sm_50,compute_50] -gencode arch=compute_52,code=[sm_52,compute_52]")
endif()
# Pascal (GPU Arch 6.x) is supported by CUDA 8 and later
if(CUDA_VERSION VERSION_GREATER_EQUAL "8.0")
string(APPEND GPU_CUDA_GENCODE " -gencode arch=compute_60,code=[sm_60,compute_60] -gencode arch=compute_61,code=[sm_61,compute_61]")
endif()
# Volta (GPU Arch 7.0) is supported by CUDA 9 and later
if(CUDA_VERSION VERSION_GREATER_EQUAL "9.0")
string(APPEND GPU_CUDA_GENCODE " -gencode arch=compute_70,code=[sm_70,compute_70]")
endif()
# Turing (GPU Arch 7.5) is supported by CUDA 10 and later
if(CUDA_VERSION VERSION_GREATER_EQUAL "10.0")
string(APPEND GPU_CUDA_GENCODE " -gencode arch=compute_75,code=[sm_75,compute_75]")
endif()
# Ampere (GPU Arch 8.0) is supported by CUDA 11 and later
if(CUDA_VERSION VERSION_GREATER_EQUAL "11.0")
string(APPEND GPU_CUDA_GENCODE " -gencode arch=compute_80,code=[sm_80,compute_80]")
endif()
# Ampere (GPU Arch 8.6) is supported by CUDA 11.1 and later
if(CUDA_VERSION VERSION_GREATER_EQUAL "11.1")
string(APPEND GPU_CUDA_GENCODE " -gencode arch=compute_86,code=[sm_86,compute_86]")
endif()
# apply the following to build "fat" CUDA binaries only for known CUDA toolkits
if(CUDA_VERSION VERSION_GREATER_EQUAL "12.0")
message(WARNING "Unsupported CUDA version. Use at your own risk.")
message(WARNING "Untested CUDA Toolkit version. Use at your own risk")
else()
# Fermi (GPU Arch 2.x) is supported by CUDA 3.2 to CUDA 8.0
if((CUDA_VERSION VERSION_GREATER_EQUAL "3.2") AND (CUDA_VERSION VERSION_LESS "9.0"))
string(APPEND GPU_CUDA_GENCODE " -gencode arch=compute_20,code=[sm_20,compute_20] ")
endif()
# 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"))
string(APPEND GPU_CUDA_GENCODE " -gencode arch=compute_30,code=[sm_30,compute_30] ")
endif()
# Kepler (GPU Arch 3.5) is supported by CUDA 5 to CUDA 11
if((CUDA_VERSION VERSION_GREATER_EQUAL "5.0") AND (CUDA_VERSION VERSION_LESS "12.0"))
string(APPEND GPU_CUDA_GENCODE " -gencode arch=compute_35,code=[sm_35,compute_35]")
endif()
# Maxwell (GPU Arch 5.x) is supported by CUDA 6 and later
if(CUDA_VERSION VERSION_GREATER_EQUAL "6.0")
string(APPEND GPU_CUDA_GENCODE " -gencode arch=compute_50,code=[sm_50,compute_50] -gencode arch=compute_52,code=[sm_52,compute_52]")
endif()
# Pascal (GPU Arch 6.x) is supported by CUDA 8 and later
if(CUDA_VERSION VERSION_GREATER_EQUAL "8.0")
string(APPEND GPU_CUDA_GENCODE " -gencode arch=compute_60,code=[sm_60,compute_60] -gencode arch=compute_61,code=[sm_61,compute_61]")
endif()
# Volta (GPU Arch 7.0) is supported by CUDA 9 and later
if(CUDA_VERSION VERSION_GREATER_EQUAL "9.0")
string(APPEND GPU_CUDA_GENCODE " -gencode arch=compute_70,code=[sm_70,compute_70]")
endif()
# Turing (GPU Arch 7.5) is supported by CUDA 10 and later
if(CUDA_VERSION VERSION_GREATER_EQUAL "10.0")
string(APPEND GPU_CUDA_GENCODE " -gencode arch=compute_75,code=[sm_75,compute_75]")
endif()
# Ampere (GPU Arch 8.0) is supported by CUDA 11 and later
if(CUDA_VERSION VERSION_GREATER_EQUAL "11.0")
string(APPEND GPU_CUDA_GENCODE " -gencode arch=compute_80,code=[sm_80,compute_80]")
endif()
# Ampere (GPU Arch 8.6) is supported by CUDA 11.1 and later
if(CUDA_VERSION VERSION_GREATER_EQUAL "11.1")
string(APPEND GPU_CUDA_GENCODE " -gencode arch=compute_86,code=[sm_86,compute_86]")
endif()
endif()
cuda_compile_fatbin(GPU_GEN_OBJS ${GPU_LIB_CU} OPTIONS ${CUDA_REQUEST_PIC}
@ -214,13 +217,20 @@ elseif(GPU_API STREQUAL "OPENCL")
elseif(GPU_API STREQUAL "HIP")
if(NOT DEFINED HIP_PATH)
if(NOT DEFINED ENV{HIP_PATH})
set(HIP_PATH "/opt/rocm/hip" CACHE PATH "Path to which HIP has been installed")
set(HIP_PATH "/opt/rocm/hip" CACHE PATH "Path to HIP installation")
else()
set(HIP_PATH $ENV{HIP_PATH} CACHE PATH "Path to which HIP has been installed")
set(HIP_PATH $ENV{HIP_PATH} CACHE PATH "Path to HIP installation")
endif()
endif()
set(CMAKE_MODULE_PATH "${HIP_PATH}/cmake" ${CMAKE_MODULE_PATH})
find_package(HIP REQUIRED)
if(NOT DEFINED ROCM_PATH)
if(NOT DEFINED ENV{ROCM_PATH})
set(ROCM_PATH "/opt/rocm" CACHE PATH "Path to ROCm installation")
else()
set(ROCM_PATH $ENV{ROCM_PATH} CACHE PATH "Path to ROCm installation")
endif()
endif()
list(APPEND CMAKE_PREFIX_PATH ${HIP_PATH} ${ROCM_PATH})
find_package(hip REQUIRED)
option(HIP_USE_DEVICE_SORT "Use GPU sorting" ON)
if(NOT DEFINED HIP_PLATFORM)
@ -322,10 +332,11 @@ elseif(GPU_API STREQUAL "HIP")
set_directory_properties(PROPERTIES ADDITIONAL_MAKE_CLEAN_FILES "${LAMMPS_LIB_BINARY_DIR}/gpu/*_cubin.h ${LAMMPS_LIB_BINARY_DIR}/gpu/*.cu.cpp")
hip_add_library(gpu STATIC ${GPU_LIB_SOURCES})
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_link_libraries(gpu PRIVATE hip::host)
if(HIP_USE_DEVICE_SORT)
# add hipCUB
@ -374,8 +385,9 @@ elseif(GPU_API STREQUAL "HIP")
endif()
endif()
hip_add_executable(hip_get_devices ${LAMMPS_LIB_SOURCE_DIR}/gpu/geryon/ucl_get_devices.cpp)
add_executable(hip_get_devices ${LAMMPS_LIB_SOURCE_DIR}/gpu/geryon/ucl_get_devices.cpp)
target_compile_definitions(hip_get_devices PRIVATE -DUCL_HIP)
target_link_libraries(hip_get_devices hip::host)
if(HIP_PLATFORM STREQUAL "nvcc")
target_compile_definitions(gpu PRIVATE -D__HIP_PLATFORM_NVCC__)

View File

@ -3,7 +3,7 @@ if(NOT FOUND_IMMINTRIN)
message(FATAL_ERROR "immintrin.h header not found, Intel package won't work without it")
endif()
target_compile_definitions(lammps PRIVATE -DLMP_USER_INTEL)
target_compile_definitions(lammps PRIVATE -DLMP_INTEL)
set(INTEL_ARCH "cpu" CACHE STRING "Architectures used by INTEL (cpu or knl)")
set(INTEL_ARCH_VALUES cpu knl)

View File

@ -1,6 +1,8 @@
########################################################################
# As of version 3.3.0 Kokkos requires C++14
set(CMAKE_CXX_STANDARD 14)
if(CMAKE_CXX_STANDARD LESS 14)
set(CMAKE_CXX_STANDARD 14)
endif()
########################################################################
# consistency checks and Kokkos options/settings required by LAMMPS
if(Kokkos_ENABLE_CUDA)
@ -74,7 +76,7 @@ else()
target_link_libraries(lammps PRIVATE kokkos)
target_link_libraries(lmp PRIVATE kokkos)
endif()
target_compile_definitions(lammps PRIVATE -DLMP_KOKKOS)
target_compile_definitions(lammps PUBLIC $<BUILD_INTERFACE:LMP_KOKKOS>)
set(KOKKOS_PKG_SOURCES_DIR ${LAMMPS_SOURCE_DIR}/KOKKOS)
set(KOKKOS_PKG_SOURCES ${KOKKOS_PKG_SOURCES_DIR}/kokkos.cpp
@ -127,4 +129,4 @@ endif()
get_property(KOKKOS_PKG_SOURCES GLOBAL PROPERTY KOKKOS_PKG_SOURCES)
target_sources(lammps PRIVATE ${KOKKOS_PKG_SOURCES})
target_include_directories(lammps PRIVATE ${KOKKOS_PKG_SOURCES_DIR})
target_include_directories(lammps PUBLIC $<BUILD_INTERFACE:${KOKKOS_PKG_SOURCES_DIR}>)

View File

@ -19,6 +19,14 @@ if(DOWNLOAD_LATTE)
set(LATTE_MD5 "820e73a457ced178c08c71389a385de7" CACHE STRING "MD5 checksum of LATTE tarball")
mark_as_advanced(LATTE_URL)
mark_as_advanced(LATTE_MD5)
# CMake cannot pass BLAS or LAPACK library variable to external project if they are a list
list(LENGTH BLAS_LIBRARIES} NUM_BLAS)
list(LENGTH LAPACK_LIBRARIES NUM_LAPACK)
if((NUM_BLAS GREATER 1) OR (NUM_LAPACK GREATER 1))
message(FATAL_ERROR "Cannot compile downloaded LATTE library due to a technical limitation")
endif()
include(ExternalProject)
ExternalProject_Add(latte_build
URL ${LATTE_URL}

View File

@ -7,8 +7,9 @@ endif()
option(DOWNLOAD_EIGEN3 "Download Eigen3 instead of using an already installed one)" ${DOWNLOAD_EIGEN3_DEFAULT})
if(DOWNLOAD_EIGEN3)
message(STATUS "Eigen3 download requested - we will build our own")
set(EIGEN3_URL "https://gitlab.com/libeigen/eigen/-/archive/3.3.7/eigen-3.3.7.tar.gz" CACHE STRING "URL for Eigen3 tarball")
set(EIGEN3_MD5 "9e30f67e8531477de4117506fe44669b" CACHE STRING "MD5 checksum of Eigen3 tarball")
set(EIGEN3_URL "https://download.lammps.org/thirdparty/eigen-3.4.0.tar.gz" CACHE STRING "URL for Eigen3 tarball")
set(EIGEN3_MD5 "4c527a9171d71a72a9d4186e65bea559" CACHE STRING "MD5 checksum of Eigen3 tarball")
mark_as_advanced(EIGEN3_URL)
mark_as_advanced(EIGEN3_MD5)
include(ExternalProject)
@ -30,3 +31,8 @@ else()
endif()
target_link_libraries(lammps PRIVATE Eigen3::Eigen)
endif()
# PGI/Nvidia compiler internals collide with vector intrinsics support in Eigen3
if((CMAKE_CXX_COMPILER_ID STREQUAL "PGI") OR (CMAKE_CXX_COMPILER_ID STREQUAL "NVHPC"))
target_compile_definitions(lammps PRIVATE -DEIGEN_DONT_VECTORIZE)
endif()

View File

@ -114,5 +114,5 @@ else()
target_link_libraries(lmp PRIVATE ${mdi_LIBRARY})
endif()
target_compile_definitions(lammps PRIVATE -DLMP_USER_MDI)
target_compile_definitions(lmp PRIVATE -DLMP_USER_MDI)
target_compile_definitions(lammps PRIVATE -DLMP_MDI)
target_compile_definitions(lmp PRIVATE -DLMP_MDI)

View File

@ -45,12 +45,12 @@ if(DOWNLOAD_N2P2)
# get path to MPI include directory when cross-compiling to windows
if((CMAKE_SYSTEM_NAME STREQUAL Windows) AND CMAKE_CROSSCOMPILING)
get_target_property(N2P2_MPI_INCLUDE MPI::MPI_CXX INTERFACE_INCLUDE_DIRECTORIES)
set(N2P2_PROJECT_OPTIONS "-I ${N2P2_MPI_INCLUDE} -DMPICH_SKIP_MPICXX=1")
set(N2P2_PROJECT_OPTIONS "-I${N2P2_MPI_INCLUDE}")
set(MPI_CXX_COMPILER ${CMAKE_CXX_COMPILER})
endif()
if(CMAKE_CXX_COMPILER_ID STREQUAL "Intel")
get_target_property(N2P2_MPI_INCLUDE MPI::MPI_CXX INTERFACE_INCLUDE_DIRECTORIES)
set(N2P2_PROJECT_OPTIONS "-I ${N2P2_MPI_INCLUDE} -DMPICH_SKIP_MPICXX=1")
set(N2P2_PROJECT_OPTIONS "-I${N2P2_MPI_INCLUDE}")
set(MPI_CXX_COMPILER ${CMAKE_CXX_COMPILER})
endif()
endif()
@ -69,6 +69,12 @@ if(DOWNLOAD_N2P2)
# echo final flag for debugging
message(STATUS "N2P2 BUILD OPTIONS: ${N2P2_BUILD_OPTIONS}")
# must have "sed" command to compile n2p2 library (for now)
find_program(HAVE_SED sed)
if(NOT HAVE_SED)
message(FATAL_ERROR "Must have 'sed' program installed to compile 'n2p2' library for ML-HDNNP package")
endif()
# 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

View File

@ -38,7 +38,7 @@ if(DOWNLOAD_QUIP)
set(temp "${temp}HAVE_LOCAL_E_MIX=0\nHAVE_QC=0\nHAVE_GAP=1\nHAVE_DESCRIPTORS_NONCOMMERCIAL=1\n")
set(temp "${temp}HAVE_TURBOGAP=0\nHAVE_QR=1\nHAVE_THIRDPARTY=0\nHAVE_FX=0\nHAVE_SCME=0\nHAVE_MTP=0\n")
set(temp "${temp}HAVE_MBD=0\nHAVE_TTM_NF=0\nHAVE_CH4=0\nHAVE_NETCDF4=0\nHAVE_MDCORE=0\nHAVE_ASAP=0\n")
set(temp "${temp}HAVE_CGAL=0\nHAVE_METIS=0\nHAVE_LMTO_TBE=0\n")
set(temp "${temp}HAVE_CGAL=0\nHAVE_METIS=0\nHAVE_LMTO_TBE=0\nHAVE_SCALAPACK=0\n")
file(WRITE ${CMAKE_BINARY_DIR}/quip.config "${temp}")
message(STATUS "QUIP download via git requested - we will build our own")
@ -50,7 +50,7 @@ if(DOWNLOAD_QUIP)
GIT_TAG origin/public
GIT_SHALLOW YES
GIT_PROGRESS YES
PATCH_COMMAND cp ${CMAKE_BINARY_DIR}/quip.config <SOURCE_DIR>/arch/Makefile.lammps
PATCH_COMMAND ${CMAKE_COMMAND} -E copy_if_different ${CMAKE_BINARY_DIR}/quip.config <SOURCE_DIR>/arch/Makefile.lammps
CONFIGURE_COMMAND env QUIP_ARCH=lammps make config
BUILD_COMMAND env QUIP_ARCH=lammps make libquip
INSTALL_COMMAND ""

View File

@ -12,6 +12,13 @@ if(DOWNLOAD_MSCG)
mark_as_advanced(MSCG_URL)
mark_as_advanced(MSCG_MD5)
# CMake cannot pass BLAS or LAPACK library variable to external project if they are a list
list(LENGTH BLAS_LIBRARIES} NUM_BLAS)
list(LENGTH LAPACK_LIBRARIES NUM_LAPACK)
if((NUM_BLAS GREATER 1) OR (NUM_LAPACK GREATER 1))
message(FATAL_ERROR "Cannot compile downloaded MSCG library due to a technical limitation")
endif()
include(ExternalProject)
ExternalProject_Add(mscg_build
URL ${MSCG_URL}

View File

@ -5,7 +5,7 @@
${OPENMP_SOURCES_DIR}/fix_nh_omp.cpp
${OPENMP_SOURCES_DIR}/fix_nh_sphere_omp.cpp
${OPENMP_SOURCES_DIR}/domain_omp.cpp)
target_compile_definitions(lammps PRIVATE -DLMP_USER_OMP)
target_compile_definitions(lammps PRIVATE -DLMP_OPENMP)
set_property(GLOBAL PROPERTY "OMP_SOURCES" "${OPENMP_SOURCES}")
# detects styles which have OPENMP version

View File

@ -23,6 +23,11 @@ if(DOWNLOAD_SCAFACOS)
file(DOWNLOAD ${LAMMPS_THIRDPARTY_URL}/scafacos-1.0.1-fix.diff ${CMAKE_CURRENT_BINARY_DIR}/scafacos-1.0.1.fix.diff
EXPECTED_HASH MD5=4baa1333bb28fcce102d505e1992d032)
find_program(HAVE_PATCH patch)
if(NOT HAVE_PATCH)
message(FATAL_ERROR "The 'patch' program is required to build the ScaFaCoS library")
endif()
include(ExternalProject)
ExternalProject_Add(scafacos_build
URL ${SCAFACOS_URL}

View File

@ -26,6 +26,11 @@ if(DOWNLOAD_VORO)
set(VORO_BUILD_OPTIONS CXX=${CMAKE_CXX_COMPILER} CFLAGS=${VORO_BUILD_CFLAGS})
endif()
find_program(HAVE_PATCH patch)
if(NOT HAVE_PATCH)
message(FATAL_ERROR "The 'patch' program is required to build the voro++ library")
endif()
ExternalProject_Add(voro_build
URL ${VORO_URL}
URL_MD5 ${VORO_MD5}

View File

@ -9,14 +9,16 @@ if(BUILD_TOOLS)
check_language(Fortran)
if(CMAKE_Fortran_COMPILER)
enable_language(Fortran)
add_executable(chain.x ${LAMMPS_TOOLS_DIR}/chain.f)
add_executable(chain.x ${LAMMPS_TOOLS_DIR}/chain.f90)
target_link_libraries(chain.x PRIVATE ${CMAKE_Fortran_IMPLICIT_LINK_LIBRARIES})
install(TARGETS chain.x DESTINATION ${CMAKE_INSTALL_BINDIR})
add_executable(micelle2d.x ${LAMMPS_TOOLS_DIR}/micelle2d.f90)
target_link_libraries(micelle2d.x PRIVATE ${CMAKE_Fortran_IMPLICIT_LINK_LIBRARIES})
install(TARGETS chain.x micelle2d.x DESTINATION ${CMAKE_INSTALL_BINDIR})
else()
message(WARNING "No suitable Fortran compiler found, skipping build of 'chain.x'")
message(WARNING "No suitable Fortran compiler found, skipping build of 'chain.x' and 'micelle2d.x'")
endif()
else()
message(WARNING "CMake build doesn't support fortran, skipping build of 'chain.x'")
message(WARNING "CMake build doesn't support Fortran, skipping build of 'chain.x' and 'micelle2d.x'")
endif()
enable_language(C)

View File

@ -1,7 +1,28 @@
[
{ include: [ "<bits/types/struct_rusage.h>", private, "<sys/resource.h>", public ] },
{ include: [ "<bits/exception.h>", public, "<exception>", public ] },
{ include: [ "@<Eigen/.*>", private, "<Eigen/Eigen>", public ] },
{ include: [ "@<gtest/.*>", private, "\"gtest/gtest.h\"", public ] },
{ include: [ "@<gmock/.*>", private, "\"gmock/gmock.h\"", public ] },
{ include: [ "@<gmock/.*>", private, "\"gmock/gmock.h\"", public ] },
{ include: [ "@<(cell|c_loops|container).hh>", private, "<voro++.hh>", public ] },
{ include: [ "@\"atom_vec_.*.h\"", public, "\"style_atom.h\"", public ] },
{ include: [ "@\"body_.*.h\"", public, "\"style_body.h\"", public ] },
{ include: [ "@\"compute_.*.h\"", public, "\"style_compute.h\"", public ] },
{ include: [ "@\"fix_.*.h\"", public, "\"style_fix.h\"", public ] },
{ include: [ "@\"dump_.*.h\"", public, "\"style_dump.h\"", public ] },
{ include: [ "@\"min_.*.h\"", public, "\"style_minimize.h\"", public ] },
{ include: [ "@\"reader_.*.h\"", public, "\"style_reader.h\"", public ] },
{ include: [ "@\"region_.*.h\"", public, "\"style_region.h\"", public ] },
{ include: [ "@\"pair_.*.h\"", public, "\"style_pair.h\"", public ] },
{ include: [ "@\"angle_.*.h\"", public, "\"style_angle.h\"", public ] },
{ include: [ "@\"bond_.*.h\"", public, "\"style_bond.h\"", public ] },
{ include: [ "@\"dihedral_.*.h\"", public, "\"style_dihedral.h\"", public ] },
{ include: [ "@\"improper_.*.h\"", public, "\"style_improper.h\"", public ] },
{ include: [ "@\"kspace_.*.h\"", public, "\"style_kspace.h\"", public ] },
{ include: [ "@\"nbin_.*.h\"", public, "\"style_nbin.h\"", public ] },
{ include: [ "@\"npair_.*.h\"", public, "\"style_npair.h\"", public ] },
{ include: [ "@\"nstenci_.*.h\"", public, "\"style_nstencil.h\"", public ] },
{ include: [ "@\"ntopo_.*.h\"", public, "\"style_ntopo.h\"", public ] },
{ include: [ "<float.h>", public, "<cfloat>", public ] },
{ include: [ "<limits.h>", public, "<climits>", public ] },
{ include: [ "<bits/types/struct_tm.h>", private, "<ctime>", public ] },
]

View File

@ -10,9 +10,9 @@ set(CMAKE_Fortran_COMPILER ${CLANG_FORTRAN} CACHE STRING "" FORCE)
set(CMAKE_CXX_FLAGS_DEBUG "-Wall -Wextra -g" CACHE STRING "" FORCE)
set(CMAKE_CXX_FLAGS_RELWITHDEBINFO "-Wall -Wextra -g -O2 -DNDEBUG" CACHE STRING "" FORCE)
set(CMAKE_CXX_FLAGS_RELEASE "-O3 -DNDEBUG" CACHE STRING "" FORCE)
set(CMAKE_Fortran_FLAGS_DEBUG "-Wall -Wextra -g -std=f95" CACHE STRING "" FORCE)
set(CMAKE_Fortran_FLAGS_RELWITHDEBINFO "-Wall -Wextra -g -O2 -DNDEBUG -std=f95" CACHE STRING "" FORCE)
set(CMAKE_Fortran_FLAGS_RELEASE "-O3 -DNDEBUG -std=f95" CACHE STRING "" FORCE)
set(CMAKE_Fortran_FLAGS_DEBUG "-Wall -Wextra -g -std=f2003" CACHE STRING "" FORCE)
set(CMAKE_Fortran_FLAGS_RELWITHDEBINFO "-Wall -Wextra -g -O2 -DNDEBUG -std=f2003" CACHE STRING "" FORCE)
set(CMAKE_Fortran_FLAGS_RELEASE "-O3 -DNDEBUG -std=f2003" CACHE STRING "" FORCE)
set(CMAKE_C_FLAGS_DEBUG "-Wall -Wextra -g" CACHE STRING "" FORCE)
set(CMAKE_C_FLAGS_RELWITHDEBINFO "-Wall -Wextra -g -O2 -DNDEBUG" CACHE STRING "" FORCE)
set(CMAKE_C_FLAGS_RELEASE "-O3 -DNDEBUG" CACHE STRING "" FORCE)

View File

@ -1,4 +1,4 @@
# preset that will restore gcc/g++ with support for MPI and OpenMP (on Linux boxes)
# preset that will explicitly request gcc/g++ compilers with support for MPI and OpenMP
set(CMAKE_CXX_COMPILER "g++" CACHE STRING "" FORCE)
set(CMAKE_C_COMPILER "gcc" CACHE STRING "" FORCE)
@ -15,9 +15,9 @@ set(CMAKE_C_FLAGS_RELWITHDEBINFO "-g -O2 -DNDEBUG" CACHE STRING "" FORCE)
set(CMAKE_C_FLAGS_RELEASE "-O3 -DNDEBUG" CACHE STRING "" FORCE)
set(MPI_Fortran "gfortran" CACHE STRING "" FORCE)
set(MPI_Fortran_COMPILER "mpifort" CACHE STRING "" FORCE)
set(CMAKE_Fortran_FLAGS_DEBUG "-Wall -g" CACHE STRING "" FORCE)
set(CMAKE_Fortran_FLAGS_RELWITHDEBINFO "-g -O2 -DNDEBUG" CACHE STRING "" FORCE)
set(CMAKE_Fortran_FLAGS_RELEASE "-O3 -DNDEBUG" CACHE STRING "" FORCE)
set(CMAKE_Fortran_FLAGS_DEBUG "-Wall -g -std=f2003" CACHE STRING "" FORCE)
set(CMAKE_Fortran_FLAGS_RELWITHDEBINFO "-g -O2 -DNDEBUG -std=f2003" CACHE STRING "" FORCE)
set(CMAKE_Fortran_FLAGS_RELEASE "-O3 -DNDEBUG -std=f2003" CACHE STRING "" FORCE)
unset(HAVE_OMP_H_INCLUDE CACHE)
set(OpenMP_C "gcc" CACHE STRING "" FORCE)

View File

@ -1,12 +1,26 @@
# preset that will enable hipcc plus gcc with support for MPI and OpenMP (on Linux boxes)
# preset that will enable hipcc plus gcc/gfortran with support for MPI and OpenMP (on Linux boxes)
set(CMAKE_CXX_COMPILER "hipcc" CACHE STRING "" FORCE)
set(CMAKE_C_COMPILER "gcc" CACHE STRING "" FORCE)
set(CMAKE_Fortran_COMPILER gfortran CACHE STRING "" FORCE)
set(CMAKE_CXX_FLAGS_DEBUG "-Wall -Wextra -g" CACHE STRING "" FORCE)
set(CMAKE_CXX_FLAGS_RELWITHDEBINFO "-Wall -Wextra -g -O2 -DNDEBUG" CACHE STRING "" FORCE)
unset(HAVE_OMP_H_INCLUDE CACHE)
set(CMAKE_CXX_FLAGS_RELEASE "-O3 -DNDEBUG" CACHE STRING "" FORCE)
set(CMAKE_Fortran_FLAGS_DEBUG "-Wall -Wextra -g -std=f2003" CACHE STRING "" FORCE)
set(CMAKE_Fortran_FLAGS_RELWITHDEBINFO "-Wall -Wextra -g -O2 -DNDEBUG -std=f2003" CACHE STRING "" FORCE)
set(CMAKE_Fortran_FLAGS_RELEASE "-O3 -DNDEBUG -std=f2003" CACHE STRING "" FORCE)
set(CMAKE_C_FLAGS_DEBUG "-Wall -Wextra -g" CACHE STRING "" FORCE)
set(CMAKE_C_FLAGS_RELWITHDEBINFO "-Wall -Wextra -g -O2 -DNDEBUG" CACHE STRING "" FORCE)
set(CMAKE_C_FLAGS_RELEASE "-O3 -DNDEBUG" CACHE STRING "" FORCE)
set(OpenMP_CXX "hipcc" CACHE STRING "" FORCE)
set(MPI_CXX "hipcc" CACHE STRING "" FORCE)
set(MPI_CXX_COMPILER "mpicxx" CACHE STRING "" FORCE)
unset(HAVE_OMP_H_INCLUDE CACHE)
set(OpenMP_C "gcc" CACHE STRING "" FORCE)
set(OpenMP_C_FLAGS "-fopenmp" CACHE STRING "" FORCE)
set(OpenMP_C_LIB_NAMES "gomp" CACHE STRING "" FORCE)
set(OpenMP_CXX_FLAGS "-fopenmp" CACHE STRING "" FORCE)
set(OpenMP_CXX "hipcc" CACHE STRING "" FORCE)
set(OpenMP_CXX_LIB_NAMES "omp" CACHE STRING "" FORCE)
set(OpenMP_omp_LIBRARY "libomp.so" CACHE PATH "" FORCE)

View File

@ -0,0 +1,30 @@
# preset that will enable hip (clang/clang++) with support for MPI and OpenMP (on Linux boxes)
# prefer flang over gfortran, if available
find_program(CLANG_FORTRAN NAMES flang gfortran f95)
set(ENV{OMPI_FC} ${CLANG_FORTRAN})
set(CMAKE_CXX_COMPILER "hipcc" CACHE STRING "" FORCE)
set(CMAKE_C_COMPILER "hipcc" CACHE STRING "" FORCE)
set(CMAKE_Fortran_COMPILER ${CLANG_FORTRAN} CACHE STRING "" FORCE)
set(CMAKE_CXX_FLAGS_DEBUG "-Wall -Wextra -g" CACHE STRING "" FORCE)
set(CMAKE_CXX_FLAGS_RELWITHDEBINFO "-Wall -Wextra -g -O2 -DNDEBUG" CACHE STRING "" FORCE)
set(CMAKE_CXX_FLAGS_RELEASE "-O3 -DNDEBUG" CACHE STRING "" FORCE)
set(CMAKE_Fortran_FLAGS_DEBUG "-Wall -Wextra -g -std=f2003" CACHE STRING "" FORCE)
set(CMAKE_Fortran_FLAGS_RELWITHDEBINFO "-Wall -Wextra -g -O2 -DNDEBUG -std=f2003" CACHE STRING "" FORCE)
set(CMAKE_Fortran_FLAGS_RELEASE "-O3 -DNDEBUG -std=f2003" CACHE STRING "" FORCE)
set(CMAKE_C_FLAGS_DEBUG "-Wall -Wextra -g" CACHE STRING "" FORCE)
set(CMAKE_C_FLAGS_RELWITHDEBINFO "-Wall -Wextra -g -O2 -DNDEBUG" CACHE STRING "" FORCE)
set(CMAKE_C_FLAGS_RELEASE "-O3 -DNDEBUG" CACHE STRING "" FORCE)
set(MPI_CXX "hipcc" CACHE STRING "" FORCE)
set(MPI_CXX_COMPILER "mpicxx" CACHE STRING "" FORCE)
unset(HAVE_OMP_H_INCLUDE CACHE)
set(OpenMP_C "hipcc" CACHE STRING "" FORCE)
set(OpenMP_C_FLAGS "-fopenmp" CACHE STRING "" FORCE)
set(OpenMP_C_LIB_NAMES "omp" CACHE STRING "" FORCE)
set(OpenMP_CXX "hipcc" CACHE STRING "" FORCE)
set(OpenMP_CXX_FLAGS "-fopenmp" CACHE STRING "" FORCE)
set(OpenMP_CXX_LIB_NAMES "omp" CACHE STRING "" FORCE)
set(OpenMP_omp_LIBRARY "libomp.so" CACHE PATH "" FORCE)

View File

@ -24,6 +24,7 @@ set(ALL_PACKAGES
DRUDE
EFF
EXTRA-COMPUTE
EXTRA-DUMP
EXTRA-FIX
EXTRA-MOLECULE
EXTRA-PAIR

View File

@ -230,7 +230,7 @@ $(VENV):
)
$(MATHJAX):
@git clone -b 3.2.0 -c advice.detachedHead=0 --depth 1 git://github.com/mathjax/MathJax.git $@
@git clone -b 3.2.0 -c advice.detachedHead=0 --depth 1 https://github.com/mathjax/MathJax.git $@
$(ANCHORCHECK): $(VENV)
@( \

View File

@ -6,7 +6,7 @@ choices the LAMMPS developers have agreed on. Git and GitHub provide the
tools, but do not set policies, so it is up to the developers to come to
an agreement as to how to define and interpret policies. This document
is likely to change as our experiences and needs change and we try to
adapt accordingly. Last change 2018-12-19.
adapt accordingly. Last change 2021-09-02.
## Table of Contents
@ -23,10 +23,10 @@ adapt accordingly. Last change 2018-12-19.
In the interest of consistency, ONLY ONE of the core LAMMPS developers
should doing the merging itself. This is currently
[@akohlmey](https://github.com/akohlmey) (Axel Kohlmeyer).
If this assignment needs to be changed, it shall be done right after a
stable release. If the currently assigned developer cannot merge outstanding pull
requests in a timely manner, or in other extenuating circumstances,
[@akohlmey](https://github.com/akohlmey) (Axel Kohlmeyer). If this
assignment needs to be changed, it shall be done right after a stable
release. If the currently assigned developer cannot merge outstanding
pull requests in a timely manner, or in other extenuating circumstances,
other core LAMMPS developers with merge rights can merge pull requests,
when necessary.
@ -55,13 +55,14 @@ the required changes or ask the submitter of the pull request to implement
them. Even though, all LAMMPS developers may have write access to pull
requests (if enabled by the submitter, which is the default), only the
submitter or the assignee of a pull request may do so. During this
period the `work_in_progress` label shall be applied to the pull
period the `work_in_progress` label may be applied to the pull
request. The assignee gets to decide what happens to the pull request
next, e.g. whether it should be assigned to a different developer for
additional checks and changes, or is recommended to be merged. Removing
the `work_in_progress` label and assigning the pull request to the
developer tasked with merging signals that a pull request is ready to be
merged.
merged. In addition, a `ready_for_merge` label may also be assigned
to signal urgency to merge this pull request quickly.
### Pull Request Reviews
@ -97,108 +98,50 @@ rationale behind choices made. Exceptions to this policy are technical
discussions, that are centered on tools or policies themselves
(git, GitHub, c++) rather than on the content of the pull request.
### Checklist for Pull Requests
Here are some items to check:
* source and text files should not have CR/LF line endings (use dos2unix to remove)
* every new command or style should have documentation. The names of
source files (c++ and manual) should follow the name of the style.
(example: `src/fix_nve.cpp`, `src/fix_nve.h` for `fix nve` command,
implementing the class `FixNVE`, documented in `doc/src/fix_nve.rst`)
* all new style names should be lower case, the must be no dashes,
blanks, or underscores separating words, only forward slashes.
* new style docs should be added to the "overview" files in
`doc/src/Commands_*.rst`, `doc/src/{fixes,computes,pairs,bonds,...}.rst`
* check whether manual cleanly translates with `make html` and `make pdf`
* if documentation is (still) provided as a .txt file, convert to .rst
and remove the .txt file. For files in doc/txt the conversion is automatic.
* remove all .txt files in `doc/txt` that are out of sync with their .rst counterparts in `doc/src`
* check spelling of manual with `make spelling` in doc folder
* check style tables and command lists with `make style_check`
* new source files in packages should be added to `src/.gitignore`
* removed or renamed files in packages should be added to `src/Purge.list`
* C++ source files should use C++ style include files for accessing
C-library APIs, e.g. `#include <cstdlib>` instead of `#include <stdlib.h>`.
And they should use angular brackets instead of double quotes. Full list:
* assert.h -> cassert
* ctype.h -> cctype
* errno.h -> cerrno
* float.h -> cfloat
* limits.h -> climits
* math.h -> cmath
* complex.h -> complex
* setjmp.h -> csetjmp
* signal.h -> csignal
* stddef.h -> cstddef
* stdint.h -> cstdint
* stdio.h -> cstdio
* stdlib.h -> cstdlib
* string.h -> cstring
* time.h -> ctime
* Do NOT replace (as they are C++-11): `inttypes.h` and `stdint.h`.
* Code must follow the C++-11 standard. C++98-only is no longer accepted
* Code should use `nullptr` instead of `NULL` where applicable.
in individual special purpose packages
* indentation is 2 spaces per level
* there should be NO tabs and no trailing whitespace (review the "checkstyle" test on pull requests)
* header files, especially of new styles, should not include any
other headers, except the header with the base class or cstdio.
Forward declarations should be used instead when possible.
* iostreams should be avoided. LAMMPS uses stdio from the C-library.
* use of STL in headers and class definitions should be avoided.
exception is <string>, but it won't need to be explicitly included
since pointers.h already includes it. so std::string can be used directly.
* there MUST NOT be any "using namespace XXX;" statements in headers.
* static class members should be avoided at all cost.
* anything storing atom IDs should be using `tagint` and not `int`.
This can be flagged by the compiler only for pointers and only when
compiling LAMMPS with `-DLAMMPS_BIGBIG`.
* when including both `lmptype.h` (and using defines or macros from it)
and `mpi.h`, `lmptype.h` must be included first.
* see https://github.com/lammps/lammps/blob/master/doc/include-file-conventions.md
for general include file conventions and best practices
* when pair styles are added, check if settings for flags like
`single_enable`, `writedata`, `reinitflag`, `manybody_flag`
and others are correctly set and supported.
## GitHub Issues
The GitHub issue tracker is the location where the LAMMPS developers
and other contributors or LAMMPS users can report issues or bugs with
the LAMMPS code or request new features to be added. Feature requests
are usually indicated by a `[Feature Request]` marker in the subject.
Issues are assigned to a person, if this person is working on this
feature or working to resolve an issue. Issues that have nobody working
on them at the moment, have the label `volunteer needed` attached.
the LAMMPS code or request new features to be added. Bug reports have
a `[Bug]` marker in the subject line; suggestions for changes or
adding new functionality are indicated by a `[Feature Request]`
marker in the subject. This is automatically done when using the
corresponding template for submitting an issue. Issues may be assigned
to one or more developers, if they are working on this feature or
working to resolve an issue. Issues that have nobody working
on them at the moment or in the near future, have the label
`volunteer needed` attached.
When an issue, say `#125` is resolved by a specific pull request,
the comment for the pull request shall contain the text `closes #125`
or `fixes #125`, so that the issue is automatically deleted when
the pull request is merged.
the pull request is merged. The template for pull requests includes
a header where connections between pull requests and issues can be listed
and thus were this comment should be placed.
## Milestones and Release Planning
LAMMPS uses a continuous release development model with incremental
changes, i.e. significant effort is made - including automated pre-merge
testing - that the code in the branch "master" does not get broken.
More extensive testing (including regression testing) is performed after
code is merged to the "master" branch. There are patch releases of
LAMMPS every 1-3 weeks at a point, when the LAMMPS developers feel, that
a sufficient amount of changes have happened, and the post-merge testing
has been successful. These patch releases are marked with a
`patch_<version date>` tag and the "unstable" branch follows only these
versions (and thus is always supposed to be of production quality,
unlike "master", which may be temporary broken, in the case of larger
change sets or unexpected incompatibilities or side effects.
testing - that the code in the branch "master" does not get easily
broken. These tests are run after every update to a pull request. More
extensive and time consuming tests (including regression testing) are
performed after code is merged to the "master" branch. There are patch
releases of LAMMPS every 3-5 weeks at a point, when the LAMMPS
developers feel, that a sufficient amount of changes have happened, and
the post-merge testing has been successful. These patch releases are
marked with a `patch_<version date>` tag and the "unstable" branch
follows only these versions (and thus is always supposed to be of
production quality, unlike "master", which may be temporary broken, in
the case of larger change sets or unexpected incompatibilities or side
effects.
About 3-4 times each year, there are going to be "stable" releases
of LAMMPS. These have seen additional, manual testing and review of
About 1-2 times each year, there are going to be "stable" releases of
LAMMPS. These have seen additional, manual testing and review of
results from testing with instrumented code and static code analysis.
Also, in the last 2-3 patch releases before a stable release are
"release candidate" versions which only contain bugfixes and
documentation updates. For release planning and the information of
code contributors, issues and pull requests being actively worked on
are assigned a "milestone", which corresponds to the next stable
release or the stable release after that, with a tentative release
date.
Also, the last 1-3 patch releases before a stable release are "release
candidate" versions which only contain bugfixes and documentation
updates. For release planning and the information of code contributors,
issues and pull requests being actively worked on are assigned a
"milestone", which corresponds to the next stable release or the stable
release after that, with a tentative release date.

View File

@ -1,128 +0,0 @@
# Outline of include file conventions in LAMMPS
This purpose of this document is to provide a point of reference
for LAMMPS developers and contributors as to what include files
and definitions to put where into LAMMPS source.
Last change 2020-08-31
## Table of Contents
* [Motivation](#motivation)
* [Rules](#rules)
* [Tools](#tools)
* [Legacy Code](#legacy-code)
## Motivation
The conventions outlined in this document are supposed to help make
maintenance of the LAMMPS software easier. By trying to achieve
consistency across files contributed by different developers, it will
become easier for the code maintainers to modify and adjust files and,
overall, the chance for errors or portability issues will be reduced.
The rules employed are supposed to minimize naming conflicts and
simplify dependencies between files and thus speed up compilation. They
may, as well, make otherwise hidden dependencies visible.
## Rules
Below are the various rules that are applied. Not all are enforced
strictly and automatically. If there are no significant side effects,
exceptions may be possible for cases where a full compliance to the
rules may require a large effort compared to the benefit.
### Core Files Versus Package Files
All rules listed below are most strictly observed for core LAMMPS files,
which are the files that are not part of a package, and the files of the
packages MOLECULE, MANYBODY, KSPACE, and RIGID. On the other end of
the spectrum are USER packages and legacy packages that predate these
rules and thus may not be fully compliant. Also, new contributions
will be checked more closely, while existing code will be incrementally
adapted to the rules as time and required effort permits.
### System Versus Local Header Files
All system- or library-provided include files are included with angular
brackets (examples: `#include <cstring>` or `#include <mpi.h>`) while
include files provided with LAMMPS are included with double quotes
(examples: `#include "pointers.h"` or `#include "compute_temp.h"`).
For headers declaring functions of the C-library, the corresponding
C++ versions should be included (examples: `#include <cstdlib>` or
`#include <cctypes>` instead of `#include <stdlib.h>` or
`#include<ctypes.h>` ).
### C++ Standard Compliance
LAMMPS core files use standard conforming C++ compatible with the
C++11 standard, unless explicitly noted. Also, LAMMPS uses the C-style
stdio library for I/O instead of iostreams. Since using both at the
same time can cause problems, iostreams should be avoided where possible.
### Lean Header Files
Header files will typically contain the definition of a (single) class.
These header files should have as few include statements as possible.
This is particularly important for classes that implement a "style" and
thus use a macro of the kind `SomeStyle(some/name,SomeName)`. These will
all be included in the auto-generated `"some_style.h"` files which
results in a high potential for direct or indirect symbol name clashes.
In the ideal case, the header would only include one file defining the
parent class. That would typically be either `#include "pointers.h"` for
the `Pointers` class, or a header of a class derived from it like
`#include "pair.h"` for the `Pair` class and so on. References to other
classes inside the class should be make through pointers, for which forward
declarations (inside the `LAMMPS_NS` or the new class' namespace) can
be employed. The full definition will then be included into the corresponding
implementation file. In the given example from above, the header file
would be called `some_name.h` and the implementation `some_name.cpp` (all
lower case with underscores, while the class itself would be in camel case
and no underscores `SomeName`, and the style name with lower case names separated by
a forward slash).
### Implementation Files
In the implementation files (typically, those would have the same base name
as the corresponding header with a .cpp extension instead of .h) include
statements should follow the "include what you use" principle.
### Order of Include Statements
Include files should be included in this order:
* the header matching the implementation (`some_class.h` for file `some_class.cpp`)
* mpi.h (only if needed)
* LAMMPS local headers (preferably in alphabetical order)
* system and library headers (anything that is using angular brackets; preferably in alphabetical order)
* conditional include statements (i.e. anything bracketed with ifdefs)
### Special Cases and Exceptions
#### pointers.h
The `pointer.h` header file also includes (in this order) `lmptype.h`,
`mpi.h`, `cstddef`, `cstdio`, `string`, `utils.h`, and `fmt/format.h`
and through `lmptype.h` indirectly also `climits`, `cstdlib`, `cinttypes`.
This means any header including `pointers.h` can assume that `FILE`,
`NULL`, `INT_MAX` are defined, and the may freely use the std::string
for arguments. Corresponding implementation files do not need to include
those headers.
## Tools
The [Include What You Use tool](https://include-what-you-use.org/)
can be used to provide supporting information about compliance with
the rules listed here. Through setting `-DENABLE_IWYU=on` when running
CMake, a custom build target is added that will enable recording
the compilation commands and then run the `iwyu_tool` using the
recorded compilation commands information when typing `make iwyu`.
## Legacy Code
A lot of code predates the application of the rules in this document
and the rules themselves are a moving target. So there are going to be
significant chunks of code that do not fully comply. This applies
for example to the REAXFF, or the ATC package. The LAMMPS
developers are dedicated to make an effort to improve the compliance
and welcome volunteers wanting to help with the process.

View File

@ -1,4 +1,4 @@
.TH LAMMPS "28 July 2021" "2021-07-28"
.TH LAMMPS "29 September 2021" "2021-09-29"
.SH NAME
.B LAMMPS
\- Molecular Dynamics Simulator.
@ -54,7 +54,7 @@ using
this <machine name> parameter can be chosen arbitrarily at configuration
time, but more common is to just use
.B lmp
without a suffix. In this manpage we will use
without a suffix. In this man page we will use
.B lmp
to represent any of those names.
@ -94,7 +94,7 @@ Enable or disable general KOKKOS support, as provided by the KOKKOS
package. Even if LAMMPS is built with this package, this switch must
be set to \fBon\fR to enable running with KOKKOS-enabled styles. More
details on this switch and its optional keyword value pairs are discussed
at: https://lammps.sandia.gov/doc/Run_options.html
at: https://docs.lammps.org/Run_options.html
.TP
\fB\-l <log file>\fR or \fB\-log <log file>\fR
Specify a log file for LAMMPS to write status information to.
@ -122,6 +122,38 @@ to perform client/server messaging with another application.
.B LAMMPS
can act as either a client or server (or both).
.TP
\fB\-mdi '<mdi_flags>'\fR
This flag is only recognized and used when
.B LAMMPS
has support for the MolSSI
Driver Interface (MDI) included as part of the MDI package. This flag is
specific to the MDI library and controls how
.B LAMMPS
interacts with MDI. There are usually multiple flags that have to follow it
and those have to be placed in quotation marks. For more information about
how to launch LAMMPS in MDI client/server mode please refer to the
MDI How-to at https://docs.lammps.org/Howto_mdi.html
.TP
\fB\-c\fR or \fB\-cite <style or filename>\fR
Select how and where to output a reminder about citing contributions
to the
.B LAMMPS
code that were used during the run. Available keywords
for styles are "both", "none", "screen", or "log". Any other keyword
will be considered a file name to write the detailed citation info to
instead of logfile or screen. Default is the "log" style where there
is a short summary in the screen output and detailed citations
in BibTeX format in the logfile. The option "both" selects the detailed
output for both, "none", the short output for both, and "screen" will
write the detailed info to the screen and the short version to the log
file. If a dedicated citation info file is requested, the screen and
log file output will be in the short format (same as with "none").
See https://docs.lammps.org/Intro_citing.html for more details on
how to correctly reference and cite
.B LAMMPS
.
.TP
\fB\-nc\fR or \fB\-nocite\fR
Disable writing the "log.cite" file which is normally written to
list references for specific cite-able features used during a
@ -202,7 +234,7 @@ the standard output. If <file name> is "none", (most) screen
output will be suppressed. In multi-partition mode only
some high-level all-partition information is written to the
screen or "<file name>" file, the remainder is written in a
per-partition file "screen.N" or "<file name>.N"
per-partition file "screen.N" or "<file name>.N"
with "N" being the respective partition number, and unless
overridden by the \-pscreen flag (see above).
.TP
@ -218,8 +250,19 @@ and then "omp") and thus requires two arguments. Along with the
"-package" command-line switch, this is a convenient mechanism for
invoking styles from accelerator packages and setting their options
without having to edit an input script.
.TP
\fB\-sr\fR or \fB\-skiprun\fR
Insert the command "timer timeout 0 every 1" at the
beginning of an input file or after a "clear" command.
This has the effect that the entire
.B LAMMPS
input script is processed without executing actual
"run" or "minimize" or similar commands (their main loops are skipped).
This can be helpful and convenient to test input scripts of long running
calculations for correctness to avoid having them crash after a
long time due to a typo or syntax error in the middle or at the end.
See https://lammps.sandia.gov/doc/Run_options.html for additional
See https://docs.lammps.org/Run_options.html for additional
details and discussions on command-line options.
.SH LAMMPS BASICS
@ -254,7 +297,7 @@ the chapter on errors in the
manual gives some additional information about error messages, if possible.
.SH COPYRIGHT
© 2003--2020 Sandia Corporation
© 2003--2021 Sandia Corporation
This package is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License version 2 as

View File

@ -98,7 +98,7 @@ msi2lmp decane -c 0 -f oplsaa
.SH COPYRIGHT
© 2003--2019 Sandia Corporation
© 2003--2021 Sandia Corporation
This package is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License version 2 as

View File

@ -22,4 +22,5 @@ page.
Build_extras
Build_manual
Build_windows
Build_diskspace
Build_development

View File

@ -1,15 +1,15 @@
Development build options (CMake only)
======================================
Development build options
=========================
The CMake build procedure of LAMMPS offers a few extra options which are
The build procedures in LAMMPS offers a few extra options which are
useful during development, testing or debugging.
----------
.. _compilation:
Monitor compilation flags
-------------------------
Monitor compilation flags (CMake only)
--------------------------------------
Sometimes it is necessary to verify the complete sequence of compilation flags
generated by the CMake build. To enable a more verbose output during
@ -30,8 +30,8 @@ variable VERBOSE set to 1:
.. _clang-tidy:
Enable static code analysis with clang-tidy
-------------------------------------------
Enable static code analysis with clang-tidy (CMake only)
--------------------------------------------------------
The `clang-tidy tool <https://clang.llvm.org/extra/clang-tidy/>`_ is a
static code analysis tool to diagnose (and potentially fix) typical
@ -52,20 +52,22 @@ significantly more time consuming than the compilation itself.
.. _iwyu_processing:
Report missing and unneeded '#include' statements
-------------------------------------------------
Report missing and unneeded '#include' statements (CMake only)
--------------------------------------------------------------
The conventions for how and when to use and order include statements in
LAMMPS are `documented in a separate file <https://github.com/lammps/lammps/blob/master/doc/include-file-conventions.md>`_
(also included in the source code distribution). To assist with following
LAMMPS are documented in :doc:`Modify_style`. To assist with following
these conventions one can use the `Include What You Use tool <https://include-what-you-use.org/>`_.
This is still under development and for large and complex projects like LAMMPS
This tool is still under development and for large and complex projects like LAMMPS
there are some false positives, so suggested changes need to be verified manually.
It is recommended to use at least version 0.14, which has much fewer incorrect
reports than earlier versions.
It is recommended to use at least version 0.16, which has much fewer incorrect
reports than earlier versions. To install the IWYU toolkit, you need to have
the clang compiler **and** its development package installed. Download the IWYU
version that matches the version of the clang compiler, configure, build, and
install it.
The necessary steps to generate the report can be enabled via a
CMake variable:
The necessary steps to generate the report can be enabled via a CMake variable
during CMake configuration.
.. code-block:: bash
@ -86,8 +88,8 @@ on recording all commands required to do the compilation.
.. _sanitizer:
Address, Undefined Behavior, and Thread Sanitizer Support
---------------------------------------------------------
Address, Undefined Behavior, and Thread Sanitizer Support (CMake only)
----------------------------------------------------------------------
Compilers such as GCC and Clang support generating instrumented binaries
which use different sanitizer libraries to detect problems in the code
@ -116,8 +118,8 @@ compilation and linking stages. This is done through setting the
.. _testing:
Code Coverage and Unit Testing
------------------------------
Code Coverage and Unit Testing (CMake only)
-------------------------------------------
The LAMMPS code is subject to multiple levels of automated testing
during development: integration testing (i.e. whether the code compiles
@ -464,7 +466,8 @@ Coding style utilities
To aid with enforcing some of the coding style conventions in LAMMPS
some additional build targets have been added. These require Python 3.5
or later and will only work on Unix-like operating and file systems.
or later and will only work properly on Unix-like operating and file systems.
The following options are available.
.. code-block:: bash
@ -476,17 +479,43 @@ The following options are available.
make check-permissions # search for files with permissions issues
make fix-permissions # correct permissions issues in files
These should help to replace all TAB characters with blanks and remove
any trailing whitespace. Also all LAMMPS homepage URL references can be
updated to the location change from Sandia to the lammps.org domain.
And the permission check can remove executable permissions from non-executable
files (like source code).
Clang-format support
--------------------
For the code in the ``unittest`` and ``src`` trees we are transitioning
to use the `clang-format` tool to assist with having a consistent source
code style. The `clang-format` command bundled with Clang version 8.0
or later is required. The configuration is in files ``.clang-format``
in the respective folders. Since the modifications from `clang-format`
can be significant and - especially for "legacy style code" - also is
not always improving readability, a large number of files currently have
a ``// clang-format off`` at the top, which will disable the processing.
Over time, files will be refactored and updated to that `clang-format`
may be applied to them (at least in part).
code formatting style. The `clang-format` command bundled with Clang
version 8.0 or later is required. The configuration is in files called
``.clang-format`` in the respective folders. Since the modifications
from `clang-format` can be significant and - especially for "legacy
style code" - they are not always improving readability, a large number
of files currently have a ``// clang-format off`` at the top, which will
disable the processing. As of fall 2021 all files have been either
"protected" this way or are enabled for full or partial `clang-format`
processing. Over time, the "protected" files will be refactored and
updated so that `clang-format` may be applied to them as well.
If `clang-format` is available, the source code files in the ``unittest``
tree can be updated to conform to the formatting settings using
``make format-tests`` and the files in ``src`` with ``make format-src``.
It is recommended for all newly contributed files to use the clang-format
processing while writing the code or do the coding style processing
(including the scripts mentioned in the previous paragraph)
If `clang-format` is available, files can be updated individually with
commands like the following:
.. code-block:: bash
$ clang-format -i some_file.cpp
The following target are available for both, GNU make and CMake:
.. code-block:: bash
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

View File

@ -0,0 +1,45 @@
Notes for saving disk space when building LAMMPS from source
------------------------------------------------------------
LAMMPS is a large software project with a large number of source files,
extensive documentation, and a large collection of example files.
When downloading LAMMPS by cloning the
`git repository from GitHub <https://github.com/lammps/lammps>`_ this
will by default also download the entire commit history since September 2006.
Compiling LAMMPS will add the storage requirements of the compiled object
files and libraries to the tally.
In a user account on an HPC cluster with filesystem quotas or in other
environments with restricted disk space capacity it may be needed to
reduce the storage requirements. Here are some suggestions:
- Create a so-called shallow repository by cloning only the last commit
instead of the full project history by using ``git clone git@github.com:lammps/lammps --depth=1 --branch=master``.
This reduces the downloaded size to about half. With ``--depth=1`` it is not possible to check out different
versions/branches of LAMMPS, using ``--depth=1000`` will make multiple recent versions available at little
extra storage needs (the entire git history had nearly 30,000 commits in fall 2021).
- Download a tar archive from either the `download section on the LAMMPS homepage <https://www.lammps.org/download.html>`_
or from the `LAMMPS releases page on GitHub <https://github.com/lammps/lammps/releases>`_ these will not
contain the git history at all.
- Build LAMMPS without the debug flag (remove ``-g`` from the machine makefile or use ``-DCMAKE_BUILD_TYPE=Release``)
or use the ``strip`` command on the LAMMPS executable when no more debugging would be needed. The strip command
may also be applied to the LAMMPS shared library. The static library may be deleted entirely.
- Delete compiled object files and libraries after copying the LAMMPS executable to a permanent location.
When using the traditional build process, one may use ``make clean-<machine>`` or ``make clean-all``
to delete object files in the src folder. For CMake based builds, one may use ``make clean`` or just
delete the entire build folder.
- The folders containing the documentation tree (doc), the examples (examples) are not needed to build and
run LAMMPS and can be safely deleted. Some files in the potentials folder are large and may be deleted,
if not needed. The largest of those files (occupying about 120 MBytes combined) will only be downloaded on
demand, when the corresponding package is installed.
- When using the CMake build procedure, the compilation can be done on a (local) scratch storage that will not
count toward the quota. A local scratch file system may offer the additional benefit of speeding up creating
object files and linking with libraries compared to a networked file system. Also with CMake (and unlike with
the traditional make) it is possible to compile LAMMPS executables with different settings and packages included
from the same source tree since all the configuration information is stored in the build folder. So it is
not necessary to have multiple copies of LAMMPS.

View File

@ -22,7 +22,6 @@ files. Here is a list with descriptions:
.gitignore # list of files and folders to be ignored by git
doxygen-warn.log # logfile with warnings from running doxygen
github-development-workflow.md # notes on the LAMMPS development workflow
include-file-conventions.md # notes on LAMMPS' include file conventions
If you downloaded LAMMPS as a tarball from `the LAMMPS website <lws_>`_,
the html folder and the PDF files should be included.
@ -75,8 +74,8 @@ folder. The following ``make`` commands are available:
.. code-block:: bash
make html # generate HTML in html dir using Sphinx
make pdf # generate PDF as Manual.pdf using Sphinx and pdflatex
make fetch # fetch HTML pages and PDF files from LAMMPS web site
make pdf # generate PDF as Manual.pdf using Sphinx and PDFLaTeX
make fetch # fetch HTML pages and PDF files from LAMMPS website
# and unpack into the html_www folder and Manual_www.pdf
make epub # generate LAMMPS.epub in ePUB format using Sphinx
make mobi # generate LAMMPS.mobi in MOBI format using ebook-convert

View File

@ -71,7 +71,8 @@ LAMMPS can use them if they are available on your system.
-D FFTW3_INCLUDE_DIR=path # path to FFTW3 include files
-D FFTW3_LIBRARY=path # path to FFTW3 libraries
-D FFT_FFTW_THREADS=on # enable using threaded FFTW3 libraries
-D FFTW3_OMP_LIBRARY=path # path to FFTW3 OpenMP wrapper libraries
-D FFT_FFTW_THREADS=on # enable using OpenMP threaded FFTW3 libraries
-D MKL_INCLUDE_DIR=path # ditto for Intel MKL library
-D FFT_MKL_THREADS=on # enable using threaded FFTs with MKL libraries
-D MKL_LIBRARY=path # path to MKL libraries

View File

@ -152,7 +152,7 @@ KOKKOS, o = OPENMP, t = OPT.
* :doc:`temp/chunk <compute_temp_chunk>`
* :doc:`temp/com <compute_temp_com>`
* :doc:`temp/cs <compute_temp_cs>`
* :doc:`temp/deform <compute_temp_deform>`
* :doc:`temp/deform (k) <compute_temp_deform>`
* :doc:`temp/deform/eff <compute_temp_deform_eff>`
* :doc:`temp/drude <compute_temp_drude>`
* :doc:`temp/eff <compute_temp_eff>`

View File

@ -148,7 +148,7 @@ OPT.
* :doc:`nvt/body <fix_nvt_body>`
* :doc:`nvt/eff <fix_nh_eff>`
* :doc:`nvt/manifold/rattle <fix_nvt_manifold_rattle>`
* :doc:`nvt/sllod (io) <fix_nvt_sllod>`
* :doc:`nvt/sllod (iko) <fix_nvt_sllod>`
* :doc:`nvt/sllod/eff <fix_nvt_sllod_eff>`
* :doc:`nvt/sphere (o) <fix_nvt_sphere>`
* :doc:`nvt/uef <fix_nh_uef>`
@ -236,6 +236,7 @@ OPT.
* :doc:`ti/spring <fix_ti_spring>`
* :doc:`tmd <fix_tmd>`
* :doc:`ttm <fix_ttm>`
* :doc:`ttm/grid <fix_ttm>`
* :doc:`ttm/mod <fix_ttm>`
* :doc:`tune/kspace <fix_tune_kspace>`
* :doc:`vector <fix_vector>`

View File

@ -1,55 +1,75 @@
LAMMPS input scripts
====================
LAMMPS executes by reading commands from a input script (text file),
one line at a time. When the input script ends, LAMMPS exits. Each
command causes LAMMPS to take some action. It may set an internal
variable, read in a file, or run a simulation. Most commands have
default settings, which means you only need to use the command if you
wish to change the default.
LAMMPS executes calculations by reading commands from a input script (text file), one
line at a time. When the input script ends, LAMMPS exits. This is different
from programs that read and process the entire input before starting a calculation.
Each command causes LAMMPS to take some immediate action without regard
for any commands that may be processed later. Commands may set an
internal variable, read in a file, or run a simulation. These actions
can be grouped into three categories:
a) commands that change a global setting (examples: timestep, newton,
echo, log, thermo, restart),
b) commands that add, modify, remove, or replace "styles" that are
executed during a "run" (examples: pair_style, fix, compute, dump,
thermo_style, pair_modify), and
c) commands that execute a "run" or perform some other computation or
operation (examples: print, run, minimize, temper, write_dump, rerun,
read_data, read_restart)
Commands in category a) have default settings, which means you only
need to use the command if you wish to change the defaults.
In many cases, the ordering of commands in an input script is not
important. However the following rules apply:
important, but can have consequences when the global state is changed
between commands in the c) category. The following rules apply:
(1) LAMMPS does not read your entire input script and then perform a
simulation with all the settings. Rather, the input script is read
one line at a time and each command takes effect when it is read.
Thus this sequence of commands:
simulation with all the settings. Rather, the input script is read
one line at a time and each command takes effect when it is read.
Thus this sequence of commands:
.. code-block:: LAMMPS
.. code-block:: LAMMPS
timestep 0.5
run 100
run 100
timestep 0.5
run 100
run 100
does something different than this sequence:
does something different than this sequence:
.. code-block:: LAMMPS
.. code-block:: LAMMPS
run 100
timestep 0.5
run 100
run 100
timestep 0.5
run 100
In the first case, the specified timestep (0.5 fs) is used for two
simulations of 100 timesteps each. In the second case, the default
timestep (1.0 fs) is used for the first 100 step simulation and a 0.5 fs
timestep is used for the second one.
In the first case, the specified timestep (0.5 fs) is used for two
simulations of 100 timesteps each. In the second case, the default
timestep (1.0 fs) is used for the first 100 step simulation and a
0.5 fs timestep is used for the second one.
(2) Some commands are only valid when they follow other commands. For
example you cannot set the temperature of a group of atoms until atoms
have been defined and a group command is used to define which atoms
belong to the group.
example you cannot set the temperature of a group of atoms until
atoms have been defined and a group command is used to define which
atoms belong to the group.
(3) Sometimes command B will use values that can be set by command A.
This means command A must precede command B in the input script if it
is to have the desired effect. For example, the
:doc:`read_data <read_data>` command initializes the system by setting
up the simulation box and assigning atoms to processors. If default
values are not desired, the :doc:`processors <processors>` and
:doc:`boundary <boundary>` commands need to be used before read_data to
tell LAMMPS how to map processors to the simulation box.
This means command A must precede command B in the input script if
it is to have the desired effect. For example, the :doc:`read_data
<read_data>` command initializes the system by setting up the
simulation box and assigning atoms to processors. If default values
are not desired, the :doc:`processors <processors>` and
:doc:`boundary <boundary>` commands need to be used before read_data
to tell LAMMPS how to map processors to the simulation box.
Many input script errors are detected by LAMMPS and an ERROR or
WARNING message is printed. The :doc:`Errors <Errors>` page gives
more information on what errors mean. The documentation for each
command lists restrictions on how the command can be used.
You can use the :ref:`-skiprun <skiprun>` command line flag
to have LAMMPS skip the execution of any "run", "minimize", or similar
commands to check the entire input for correct syntax to avoid crashes
on typos or syntax errors in long runs.

View File

@ -24,6 +24,7 @@ OPT.
* :doc:`ewald (o) <kspace_style>`
* :doc:`ewald/disp <kspace_style>`
* :doc:`ewald/disp/dipole <kspace_style>`
* :doc:`ewald/dipole <kspace_style>`
* :doc:`ewald/dipole/spin <kspace_style>`
* :doc:`msm (o) <kspace_style>`

View File

@ -29,7 +29,7 @@ OPT.
* :doc:`hybrid/scaled <pair_hybrid>`
* :doc:`kim <pair_kim>`
* :doc:`list <pair_list>`
*
* :doc:`tracker <pair_tracker>`
*
*
*
@ -75,6 +75,7 @@ OPT.
* :doc:`coul/debye (gko) <pair_coul>`
* :doc:`coul/diel (o) <pair_coul_diel>`
* :doc:`coul/dsf (gko) <pair_coul>`
* :doc:`coul/exclude <pair_coul>`
* :doc:`coul/long (gko) <pair_coul>`
* :doc:`coul/long/cs (g) <pair_cs>`
* :doc:`coul/long/dielectric <pair_dielectric>`
@ -273,7 +274,6 @@ OPT.
* :doc:`tip4p/cut (o) <pair_coul>`
* :doc:`tip4p/long (o) <pair_coul>`
* :doc:`tip4p/long/soft (o) <pair_fep_soft>`
* :doc:`tracker <pair_tracker>`
* :doc:`tri/lj <pair_tri_lj>`
* :doc:`ufm (got) <pair_ufm>`
* :doc:`vashishta (gko) <pair_vashishta>`

View File

@ -11,6 +11,7 @@ of time and requests from the LAMMPS user community.
:maxdepth: 1
Developer_org
Developer_parallel
Developer_flow
Developer_write
Developer_notes

View File

@ -0,0 +1,120 @@
Communication
^^^^^^^^^^^^^
Following the partitioning scheme in use 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
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.
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
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.
.. _ghost-atom-comm:
.. figure:: img/ghost-comm.png
:align: center
ghost atom communication
This figure shows the ghost atom communication patterns between
sub-domains 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
includes its ghost atoms. The red- and blue-shaded boxes are the
regions of communicated ghost atoms.
Efficient communication patterns are needed to update the "ghost" atom
data, since that needs to be done at every MD time step or minimization
step. The diagrams of the `ghost-atom-comm` figure illustrate how ghost
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.
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,
ranks 3 and 4 send atoms in their blue-shaded regions to rank 0, which
includes ghost atoms they received in the *x* stage. Rank 0 thus
acquires all its ghost atoms; atoms in the solid blue corner regions
are communicated twice before rank 0 receives them.
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
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
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
partitioning case, it can still proceed in two stages (three in 3d)
via atom exchanges with only neighboring processors.
When attributes of owned atoms are sent to neighboring processors to
become attributes of their ghost atoms, LAMMPS calls this a "forward"
communication. On timesteps when atoms migrate to new owning processors
and neighbor lists are rebuilt, each processor creates a list of its
owned atoms which are ghost atoms in each of its neighbor processors.
These lists are used to pack per-atom coordinates (for example) into
message buffers in subsequent steps until the next reneighboring.
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
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
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
additional details about how these communication operations are
performed in LAMMPS:
- When exchanging data with different processors, forward and reverse
communication is done using ``MPI_Send()`` and ``MPI_IRecv()`` calls.
If a processor is "exchanging" atoms with itself, only the pack and
unpack operations are performed, e.g. to create ghost atoms across
periodic boundaries when running on a single processor.
- For forward communication of owned atom coordinates, periodic box
lengths are added and subtracted when the receiving processor is
across a periodic boundary from the sender. There is then no need to
apply a minimum image convention when calculating distances between
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,
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
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
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
in each dimension are detected.

View File

@ -0,0 +1,188 @@
Long-range interactions
^^^^^^^^^^^^^^^^^^^^^^^
For charged systems, LAMMPS can compute long-range Coulombic
interactions via the FFT-based particle-particle/particle-mesh (PPPM)
method implemented in :doc:`kspace style pppm and its variants
<kspace_style>`. For that Coulombic interactions are partitioned into
short- and long-range components. The short-ranged portion is computed
in real space as a loop over pairs of charges within a cutoff distance,
using neighbor lists. The long-range portion is computed in reciprocal
space using a kspace style. For the PPPM implementation the simulation
cell is overlaid with a regular FFT grid in 3d. It proceeds in several stages:
a) each atom's point charge is interpolated to nearby FFT grid points,
b) a forward 3d FFT is performed,
c) a convolution operation is performed in reciprocal space,
d) one or more inverse 3d FFTs are performed, and
e) electric field values from grid points near each atom are interpolated to compute
its forces.
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
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
performed similar to the corresponding :doc:`atom data communication
<Developer_par_comm>`. In this case, electric field values on owned
grid points are sent to neighboring processors to become ghost point
values. Likewise charge values on ghost points are sent and summed to
values on owned points.
For triclinic simulation boxes, the FFT grid planes are parallel to
the box faces, but the mapping of charge and electric field values
to/from grid points is done in reduced coordinates where the tilted
box is conceptually a unit cube, so that the stencil and FFT
operations are unchanged. However the FFT grid size required for a
given accuracy is larger for triclinic domains than it is for
orthogonal boxes.
.. _fft-parallel:
.. figure:: img/fft-decomp-parallel.png
:align: center
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.
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
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.
Initially (far left), each processor owns a brick of same-color grid
cells (actually grid points) contained within in its sub-domain. 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
a 1d FFT on each pencil of data it wholly owns using a call to the
configured FFT library. A pencil-to-pencil communication then converts
this layout to pencils in the *y* dimension (center right) which
effectively transposes the *x* and *y* dimensions of the grid, followed
by 1d FFTs in *y*. A final transpose of pencils from *y* to *z* (far
right) followed by 1d FFTs in *z* completes the forward FFT. The data
is left in a *z*-pencil layout for the convolution operation. One or
more inverse FFTs then perform the sequence of 1d FFTs and communication
steps in reverse order; the final layout of resulting grid values is the
same as the initial brick layout.
Each communication operation within the FFT (brick-to-pencil or
pencil-to-pencil or pencil-to-brick) converts one tiling of the 3d grid
to another, where a tiling in this context means an assignment of a
small brick-shaped subset of grid points to each processor, the union of
which comprise the entire grid. The parallel `fftMPI library
<https://lammps.github.io/fftmpi/>`_ written for LAMMPS allows arbitrary
definitions of the tiling so that an irregular partitioning of the
simulation domain can use it directly. Transforming data from one
tiling to another is implemented in `fftMPI` using point-to-point
communication, where each processor sends data to a few other
processors, since each tile in the initial tiling overlaps with a
handful of tiles in the final tiling.
The transformations could also be done using collective communication
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
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
processors, as illustrated by the 4 colors. More generally, a
brick-to-pencil communication can be performed by partitioning *P*
processors into :math:`P^{\frac{2}{3}}` subgroups of
:math:`P^{\frac{1}{3}}` processors each. Each subgroup performs
collective communication only within its subgroup. Similarly,
pencil-to-pencil communication can be performed by partitioning *P*
processors into :math:`P^{\frac{1}{2}}` subgroups of
:math:`P^{\frac{1}{2}}` processors each. This is illustrated in the
figure for the :math:`y \Rightarrow z` communication (center). An
eight-processor subgroup owns the front *yz* plane of data and performs
collective communication within the subgroup to transpose from a
*y*-pencil to *z*-pencil layout.
LAMMPS invokes point-to-point communication by default, but also
provides the option of partitioned collective communication when using a
:doc:`kspace_modify collective yes <kspace_modify>` command to switch to
that mode. In the latter case, the code detects the size of the
disjoint subgroups and partitions the single *P*-size communicator into
multiple smaller communicators, each of which invokes collective
communication. Testing on a large IBM Blue Gene/Q machine at Argonne
National Labs showed a significant improvement in FFT performance for
large processor counts; partitioned collective communication was faster
than point-to-point communication or global collective communication
involving all *P* processors.
Here are some additional details about FFTs for long-range and related
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
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}})`.
- For efficiency in performing 1d FFTs, the grid transpose
operations illustrated in Figure \ref{fig:fft} also involve
reordering the 3d data so that a different dimension is contiguous
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.
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.
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
and bonded forces and energies are computed on the larger partition
and the PPPM kspace computation concurrently on the smaller partition.
- LAMMPS also implements PPPM-based solvers for other long-range
interactions, dipole and dispersion (Lennard-Jones), which can be used
in conjunction with long-range Coulombics for point charges.
- 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
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
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
transfer between atoms (particles) and electrons (continuum gas) where
spatial variations in the electron temperature are computed by finite
differences of a discretized heat equation on a regular grid. The
:doc:`fix ttm/grid <fix_ttm>` command uses the ``GridComm`` class
internally to perform its grid operations on a distributed grid
instead of the original :doc:`fix ttm <fix_ttm>` which uses a
replicated grid.

View File

@ -0,0 +1,159 @@
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
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 +
\Delta_s`, where :math:`R_f` is the (largest) force cutoff defined by
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
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
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
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
same bin are adjacent in the vector. Atom sorting can be disabled or
its settings modified with the :doc:`atom_modify <atom_modify>` command.
.. _neighbor-stencil:
.. figure:: img/neigh-stencil.png
:align: center
neighbor list stencils
A 2d simulation sub-domain (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
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).
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
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
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
contains the atom whose neighbors are being searched for. A stencil
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.
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.
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
vector to create a linked list of atom indices within each bin. It then
performs a triply-nested loop over its owned atoms *i*, the stencil of
bins surrounding atom *i*'s bin, and the *j* atoms in each stencil bin
(including ghost atoms). If the distance :math:`r_{ij} < R_n`, then
atom *j* is added to the vector of atom *i*'s neighbors.
Here are additional details about neighbor list build options LAMMPS
supports:
- The choice of bin size is an option; a size half of :math:`R_n` has
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),
with bins near the corners of the square eliminated due to their
distance from the origin bin.
- Depending on the interatomic potential(s) and other commands used in
an input script, multiple neighbor lists and stencils with different
attributes may be needed. This includes lists with different cutoff
distances, e.g. for force computation versus occasional diagnostic
computations such as a radial distribution function, or for the
r-RESPA time integrator which can partition pairwise forces by
distance into subsets computed at different time intervals. It
includes "full" lists (as opposed to half lists) where each *i,j* pair
appears twice, stored once with *i* and *j*, and which use a larger
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
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.
- When using :doc:`pair style hybrid <pair_hybrid>` multiple sub-lists
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
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
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.
Another is a model of polydisperse finite-size granular particles;
pairs of particles interact only when they are in contact with each
other. Mixtures with particle size ratios as high as 10-100x may be
used to model realistic systems. Efficient neighbor list building
algorithms for these kinds of systems are available in LAMMPS. They
include a method which uses different stencils for different cutoff
lengths and trims the stencil to only include bins that straddle the
cutoff sphere surface. More recently a method which uses both
multiple stencils and multiple bin sizes was developed; it builds
neighbor lists efficiently for systems with particles of any size
ratio, though other considerations (timestep size, force computations)
may limit the ability to model systems with huge polydispersity.
- 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
using the :doc:`neighbor nsq <neighbor>` command.
- Dependent on the "pair" setting of the :doc:`newton <newton>` command,
the "half" neighbor lists may contain **all** pairs of atoms where
atom *j* is a ghost atom (i.e. when the newton pair setting is *off*)
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
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.

View File

@ -0,0 +1,114 @@
OpenMP Parallelism
^^^^^^^^^^^^^^^^^^
The styles in the INTEL, KOKKOS, and OPENMP package offer to use OpenMP
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
and KOKKOS package offer additional options and are more complex since
they support more features and different hardware like co-processors
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
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
in the OPT package), b) keeping the structure in the modified code very
similar so that side-by-side comparisons are still useful, and c)
offloading additional functionality and multi-thread support functions
into three separate classes ``ThrOMP``, ``ThrData``, and ``FixOMP``.
``ThrOMP`` provides additional, multi-thread aware functionality not
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
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
state" like settings and access to per-thread storage, it is activated
by the :doc:`package omp <package>` command.
Avoiding data races
"""""""""""""""""""
A key problem when implementing thread parallelism in an MD code is
to avoid data races when updating accumulated properties like forces,
energies, and stresses. When interactions are computed, they always
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
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
compute these interactions multiple times, once on each thread that
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
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
maintainable. Option 1 would require extensive code changes,
particularly to the neighbor list code; options 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
slows down the serial case although not quite as bad as option 2. The
downside of option 5 is that the overhead of the reduction operations
grows with the number of threads used, so there would be a crossover
point where options 2 or 4 would result in faster executing. That is
why option 2 for example is used in the GPU package because a GPU is a
processor with a massive number of threads. However, since the MPI
parallelization is generally more effective for typical MD systems, the
expectation is that thread parallelism is only used for a smaller number
of threads (2-8). At the time of its implementation, that number was
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
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
stored in their global counterparts at the end of the force computation.
Loop scheduling
"""""""""""""""
Multi-thread parallelization is applied by distributing (outer) loops
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
across threads are not common and typically happen for systems where
also the MPI parallelization would be unbalanced, which would typically
have a more pronounced impact on the performance. This same loop
scheduling scheme can also be applied to the reduction operations on
per-atom data to try and reduce the overhead of the reduction operation.
Neighbor list parallelization
"""""""""""""""""""""""""""""
In addition to the parallelization of force computations, also the
generation of the neighbor lists is parallelized. As explained
previously, neighbor lists are built by looping over "owned" atoms and
storing the neighbors in "pages". In the OPENMP variants of the
neighbor list code, each thread operates on a different chunk of "owned"
atoms and allocates and fills its own set of pages with neighbor list
data. This is achieved by each thread keeping its own instance of the
:cpp:class:`MyPage <LAMMPS_NS::MyPage>` page allocator class.

View File

@ -0,0 +1,89 @@
Partitioning
^^^^^^^^^^^^
The underlying spatial decomposition strategy used by LAMMPS for
distributed-memory parallelism is set with the :doc:`comm_style command
<comm_style>` and can be either "brick" (a regular grid) or "tiled".
.. _domain-decomposition:
.. figure:: img/domain-decomp.png
:align: center
domain decomposition
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.
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.
For distributed-memory MPI parallelism, the simulation box is spatially
decomposed (partitioned) into non-overlapping sub-domains 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
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.
For models with non-uniform density, the number of particles per
processor can be load-imbalanced with the default partitioning. This
reduces parallel efficiency, as the overall simulation rate is limited
by the slowest processor, i.e. the one with the largest computational
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.
This can be changed with the :doc:`processors command <processors>`.
- The parallel planes defining the size of the sub-domains 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.
.. |decomp1| image:: img/decomp-regular.png
:width: 24%
.. |decomp2| image:: img/decomp-processors.png
:width: 24%
.. |decomp3| image:: img/decomp-balance.png
:width: 24%
.. |decomp4| image:: img/decomp-rcb.png
:width: 24%
|decomp1| |decomp2| |decomp3| |decomp4|
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.
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).

View File

@ -0,0 +1,28 @@
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
proportional to the system size). Additional parallelization using GPUs
or OpenMP can also be applied within the sub-domain 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.
.. note::
The text and most of the figures in this chapter were adapted
for the manual from the section on parallel algorithms in the
:ref:`new LAMMPS paper <lammps_paper>`.
.. toctree::
:maxdepth: 1
Developer_par_part
Developer_par_comm
Developer_par_neigh
Developer_par_long
Developer_par_openmp

View File

@ -203,9 +203,15 @@ Convenience functions
.. doxygenfunction:: date2num
:project: progguide
.. doxygenfunction:: current_date
:project: progguide
Customized standard functions
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
.. doxygenfunction:: binary_search
:project: progguide
.. doxygenfunction:: merge_sort
:project: progguide
@ -334,10 +340,11 @@ arguments of commands in LAMMPS are parsed and to make abstractions of
repetitive tasks.
The :cpp:class:`LAMMPS_NS::ArgInfo` class provides an abstraction
for parsing references to compute or fix styles or variables. These
would start with a "c\_", "f\_", "v\_" followed by the ID or name of
than instance and may be postfixed with one or two array indices
"[<number>]" with numbers > 0.
for parsing references to compute or fix styles, variables or custom
integer or double properties handled by :doc:`fix property/atom <fix_property_atom>`.
These would start with a "c\_", "f\_", "v\_", "d\_", "d2\_", "i\_", or "i2\_"
followed by the ID or name of than instance and may be postfixed with
one or two array indices "[<number>]" with numbers > 0.
A typical code segment would look like this:

View File

@ -40,11 +40,10 @@ 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::
$ ./lmp -in in.melt
LAMMPS (19 Mar 2020)
OMP_NUM_THREADS environment is not set. Defaulting to 1 thread. (src/comm.cpp:94)
using 1 OpenMP thread(s) per MPI task
Lattice spacing in x,y,z = 1.6796 1.6796 1.6796
Created orthogonal box = (0 0 0) to (16.796 16.796 16.796)

View File

@ -714,7 +714,7 @@ Doc page with :doc:`WARNING messages <Errors_warnings>`
*Cannot create/grow a vector/array of pointers for %s*
LAMMPS code is making an illegal call to the templated memory
allocaters, to create a vector or array of pointers.
allocators, to create a vector or array of pointers.
*Cannot create_atoms after reading restart file with per-atom info*
The per-atom info was stored to be used when by a fix that you may
@ -7879,19 +7879,19 @@ keyword to allow for additional bonds to be formed
*Unexpected end of -reorder file*
Self-explanatory.
*Unexpected empty line in AngleCoeffs section*
*Unexpected empty line in Angle Coeffs section*
Read a blank line where there should be coefficient data.
*Unexpected empty line in BondCoeffs section*
*Unexpected empty line in Bond Coeffs section*
Read a blank line where there should be coefficient data.
*Unexpected empty line in DihedralCoeffs section*
*Unexpected empty line in Dihedral Coeffs section*
Read a blank line where there should be coefficient data.
*Unexpected empty line in ImproperCoeffs section*
*Unexpected empty line in Improper Coeffs section*
Read a blank line where there should be coefficient data.
*Unexpected empty line in PairCoeffs section*
*Unexpected empty line in Pair Coeffs section*
Read a blank line where there should be coefficient data.
*Unexpected end of custom file*

View File

@ -27,7 +27,7 @@ be quickly post-processed into a movie using commands described on the
:doc:`dump image <dump_image>` doc page.
Animations of many of the examples can be viewed on the Movies section
of the `LAMMPS web site <https://www.lammps.org/movies.html>`_.
of the `LAMMPS website <https://www.lammps.org/movies.html>`_.
There are two kinds of sub-directories in the examples folder. Lower
case named directories contain one or a few simple, quick-to-run
@ -169,7 +169,7 @@ Running the simulation produces the files *dump.indent* and
*log.lammps*\ . You can visualize the dump file of snapshots with a
variety of third-party tools highlighted on the
`Visualization <https://www.lammps.org/viz.html>`_ page of the LAMMPS
web site.
website.
If you uncomment the :doc:`dump image <dump_image>` line(s) in the input
script a series of JPG images will be produced by the run (assuming

View File

@ -54,6 +54,7 @@ Analysis howto
Howto_kappa
Howto_viscosity
Howto_diffusion
Howto_structured_data
Force fields howto
==================

View File

@ -0,0 +1,154 @@
Output structured data from LAMMPS
##################################
LAMMPS can output structured data with the :doc:`print <print>` and :doc:`fix
print <fix_print>` command. This gives you flexibility since you can build
custom data formats that contain system properties, thermo data, and variables
values. This output can be directed to the screen and/or to a file for post
processing.
Writing the current system state, thermo data, variable values
==============================================================
Use the :doc:`print <print>` command to output the current system state, which
can include system properties, thermo data and variable values.
YAML
----
.. code-block:: LAMMPS
print """---
timestep: $(step)
pe: $(pe)
ke: $(ke)""" file current_state.yaml screen no
.. code-block:: yaml
:caption: current_state.yaml
---
timestep: 250
pe: -4.7774327356321810711
ke: 2.4962152903997174569
JSON
----
.. code-block:: LAMMPS
print """{
"timestep": $(step),
"pe": $(pe),
"ke": $(ke)
}""" file current_state.json screen no
.. code-block:: JSON
:caption: current_state.json
{
"timestep": 250,
"pe": -4.7774327356321810711,
"ke": 2.4962152903997174569
}
Writing continuous data during a simulation
===========================================
The :doc:`fix print <fix_print>` command allows you to output an arbitrary string at defined times during a simulation run.
YAML
----
.. code-block:: LAMMPS
fix extra all print 50 """
- timestep: $(step)
pe: $(pe)
ke: $(ke)""" file output.yaml screen no
.. code-block:: yaml
:caption: output.yaml
# Fix print output for fix extra
- timestep: 0
pe: -6.77336805325924729
ke: 4.4988750000000026219
- timestep: 50
pe: -4.8082494418323200591
ke: 2.5257981827119797558
- timestep: 100
pe: -4.7875608875581505686
ke: 2.5062598821985102582
- timestep: 150
pe: -4.7471033686005483787
ke: 2.466095925545450207
- timestep: 200
pe: -4.7509052858544134068
ke: 2.4701136792591693592
- timestep: 250
pe: -4.7774327356321810711
ke: 2.4962152903997174569
Post-processing of YAML files can be easily be done with Python and other
scripting languages. In case of Python the `yaml` package allows you to load the
data files and obtain a list of dictionaries.
.. code-block:: python
import yaml
with open("output.yaml") as f:
data = yaml.load(f, Loader=yaml.FullLoader)
print(data)
.. code-block::
[{'timestep': 0, 'pe': -6.773368053259247, 'ke': 4.498875000000003}, {'timestep': 50, 'pe': -4.80824944183232, 'ke': 2.5257981827119798}, {'timestep': 100, 'pe': -4.787560887558151, 'ke': 2.5062598821985103}, {'timestep': 150, 'pe': -4.747103368600548, 'ke': 2.46609592554545}, {'timestep': 200, 'pe': -4.750905285854413, 'ke': 2.4701136792591694}, {'timestep': 250, 'pe': -4.777432735632181, 'ke': 2.4962152903997175}]
Line Delimited JSON (LD-JSON)
-----------------------------
The JSON format itself is very strict when it comes to delimiters. For continuous
output/streaming data it is beneficial use the *line delimited JSON* format.
Each line represents one JSON object.
.. code-block:: LAMMPS
fix extra all print 50 """{"timestep": $(step), "pe": $(pe), "ke": $(ke)}""" title "" file output.json screen no
.. code-block:: json
:caption: output.json
{"timestep": 0, "pe": -6.77336805325924729, "ke": 4.4988750000000026219}
{"timestep": 50, "pe": -4.8082494418323200591, "ke": 2.5257981827119797558}
{"timestep": 100, "pe": -4.7875608875581505686, "ke": 2.5062598821985102582}
{"timestep": 150, "pe": -4.7471033686005483787, "ke": 2.466095925545450207}
{"timestep": 200, "pe": -4.7509052858544134068, "ke": 2.4701136792591693592}
{"timestep": 250, "pe": -4.7774327356321810711, "ke": 2.4962152903997174569}
One simple way to load this data into a Python script is to use the `pandas`
package. It can directly load these files into a data frame:
.. code-block:: python
import pandas as pd
data = pd.read_json('output.json', lines=True)
print(data)
.. code-block:: bash
timestep pe ke
0 0 -6.773368 4.498875
1 50 -4.808249 2.525798
2 100 -4.787561 2.506260
3 150 -4.747103 2.466096
4 200 -4.750905 2.470114
5 250 -4.777433 2.496215

View File

@ -137,9 +137,9 @@ changed. How to do this depends on the build system you are using.
.. admonition:: Git protocols
:class: note
The servers at github.com support the "git://" and "https://" access
protocols for anonymous, read-only access. If you have a suitably
configured GitHub account, you may also use SSH protocol with the
The servers at github.com support the "https://" access protocol for
anonymous, read-only access. If you have a suitably configured GitHub
account, you may also use SSH protocol with the
URL "git@github.com:lammps/lammps.git".
The LAMMPS GitHub project is currently managed by Axel Kohlmeyer

View File

@ -12,7 +12,7 @@ Note that each installer package has a date in its name, which
corresponds to the LAMMPS version of the same date. Installers for
current and older versions of LAMMPS are available. 32-bit and 64-bit
installers are available, and each installer contains both a serial
and parallel executable. The installer web site also explains how to
and parallel executable. The installer website also explains how to
install the Windows MPI package (MPICH2 from Argonne National Labs),
needed to run in parallel with MPI.

View File

@ -29,7 +29,7 @@ The following folks deserve special recognition. Many of the packages
they have written are unique for an MD code and LAMMPS would not be as
general-purpose as it is without their expertise and efforts.
* Metin Aktulga (MSU), REAXFF package for C version of ReaxFF
* Metin Aktulga (MSU), REAXFF package for C/C++ version of ReaxFF
* Mike Brown (Intel), GPU and INTEL packages
* Colin Denniston (U Western Ontario), LATBOLTZ package
* Georg Ganzenmuller (EMI), MACHDYN and SPH packages
@ -37,9 +37,10 @@ general-purpose as it is without their expertise and efforts.
* Reese Jones (Sandia) and colleagues, ATC package for atom/continuum coupling
* Christoph Kloss (DCS Computing), LIGGGHTS code for granular materials, built on top of LAMMPS
* Rudra Mukherjee (JPL), POEMS package for articulated rigid body motion
* Trung Ngyuen (Northwestern U), GPU and RIGID and BODY packages
* Trung Ngyuen (Northwestern U), GPU, RIGID, BODY, and DIELECTRIC packages
* Mike Parks (Sandia), PERI package for Peridynamics
* Roy Pollock (LLNL), Ewald and PPPM solvers
* Julien Tranchida (Sandia), SPIN package
* Christian Trott (Sandia), CUDA and KOKKOS packages
* Ilya Valuev (JIHT), AWPMD package for wave packet MD
* Greg Wagner (Northwestern U), MEAM package for MEAM potential

View File

@ -4,28 +4,41 @@ Citing LAMMPS
Core Algorithms
^^^^^^^^^^^^^^^
Since LAMMPS is a community project, there is not a single one
publication or reference that describes **all** of LAMMPS.
The canonical publication that describes the foundation, that is
the basic spatial decomposition approach, the neighbor finding,
and basic communications algorithms used in LAMMPS is:
The paper mentioned below is the best overview of LAMMPS, but there are
also publications describing particular models or algorithms implemented
in LAMMPS or complementary software that is has interfaces to. Please
see below for how to cite contributions to LAMMPS.
`S. Plimpton, Fast Parallel Algorithms for Short-Range Molecular Dynamics, J Comp Phys, 117, 1-19 (1995). <http://www.sandia.gov/~sjplimp/papers/jcompphys95.pdf>`_
.. _lammps_paper:
So any project using LAMMPS (or a derivative application using LAMMPS as
a simulation engine) should cite this paper. A new publication
describing the developments and improvements of LAMMPS in the 25 years
since then is currently in preparation.
The latest canonical publication that describes the basic features, the
source code design, the program structure, the spatial decomposition
approach, the neighbor finding, basic communications algorithms, and how
users and developers have contributed to LAMMPS is:
`LAMMPS - A flexible simulation tool for particle-based materials modeling at the atomic, meso, and continuum scales, Comp. Phys. Comm. 271, 108171 (2022) <https://doi.org/10.1016/j.cpc.2021.108171>`_
So a project using LAMMPS or a derivative application that uses LAMMPS
as a simulation engine should cite this paper. The paper is expected to
be published in its final form under the same DOI in the first half
of 2022. Please also give the URL of the LAMMPS website in your paper,
namely https://www.lammps.org.
The original publication describing the parallel algorithms used in the
initial versions of LAMMPS is:
`S. Plimpton, Fast Parallel Algorithms for Short-Range Molecular Dynamics, J Comp Phys, 117, 1-19 (1995). <http://www.sandia.gov/~sjplimp/papers/jcompphys95.pdf>`_
DOI for the LAMMPS code
^^^^^^^^^^^^^^^^^^^^^^^
LAMMPS developers use the `Zenodo service at CERN
<https://zenodo.org/>`_ to create digital object identifies (DOI) for
stable releases of the LAMMPS code. There are two types of DOIs for the
LAMMPS source code: the canonical DOI for **all** versions of LAMMPS,
which will always point to the **latest** stable release version is:
LAMMPS developers use the `Zenodo service at CERN <https://zenodo.org/>`_
to create digital object identifies (DOI) for stable releases of the
LAMMPS source code. There are two types of DOIs for the LAMMPS source code.
The canonical DOI for **all** versions of LAMMPS, which will always
point to the **latest** stable release version is:
- DOI: `10.5281/zenodo.3726416 <https://dx.doi.org/10.5281/zenodo.3726416>`_
@ -45,11 +58,13 @@ about LAMMPS and its features.
Citing contributions
^^^^^^^^^^^^^^^^^^^^
LAMMPS has many features and that use either previously published
methods and algorithms or novel features. It also includes potential
parameter filed for specific models. Where available, a reminder about
references for optional features used in a specific run is printed to
the screen and log file. Style and output location can be selected with
the :ref:`-cite command-line switch <cite>`. Additional references are
LAMMPS has many features that use either previously published methods
and algorithms or novel features. It also includes potential parameter
files for specific models. Where available, a reminder about references
for optional features used in a specific run is printed to the screen
and log file. Style and output location can be selected with the
:ref:`-cite command-line switch <cite>`. Additional references are
given in the documentation of the :doc:`corresponding commands
<Commands_all>` or in the :doc:`Howto tutorials <Howto>`.
<Commands_all>` or in the :doc:`Howto tutorials <Howto>`. So please
make certain, that you provide the proper acknowledgments and citations
in any published works using LAMMPS.

View File

@ -27,19 +27,19 @@ General features
* distributed memory message-passing parallelism (MPI)
* shared memory multi-threading parallelism (OpenMP)
* spatial decomposition of simulation domain for MPI parallelism
* particle decomposition inside of spatial decomposition for OpenMP parallelism
* particle decomposition inside of spatial decomposition for OpenMP and GPU parallelism
* GPLv2 licensed open-source distribution
* highly portable C++-11
* modular code with most functionality in optional packages
* only depends on MPI library for basic parallel functionality
* only depends on MPI library for basic parallel functionality, MPI stub for serial compilation
* other libraries are optional and only required for specific packages
* GPU (CUDA and OpenCL), Intel Xeon Phi, and OpenMP support for many code features
* GPU (CUDA, OpenCL, HIP, SYCL), Intel Xeon Phi, and OpenMP support for many code features
* easy to extend with new features and functionality
* runs from an input script
* syntax for defining and using variables and formulas
* syntax for looping over runs and breaking out of loops
* run one or multiple simulations simultaneously (in parallel) from one script
* build as library, invoke LAMMPS through library interface or provided Python wrapper
* build as library, invoke LAMMPS through library interface or provided Python wrapper or SWIG based wrappers
* couple with other codes: LAMMPS calls other code, other code calls LAMMPS, umbrella code calls both
.. _particle:
@ -57,9 +57,11 @@ Particle and model types
* granular materials
* coarse-grained mesoscale models
* finite-size spherical and ellipsoidal particles
* finite-size line segment (2d) and triangle (3d) particles
* finite-size line segment (2d) and triangle (3d) particles
* finite-size rounded polygons (2d) and polyhedra (3d) particles
* point dipole particles
* rigid collections of particles
* particles with magnetic spin
* rigid collections of n particles
* hybrid combinations of these
.. _ff:
@ -74,24 +76,28 @@ commands)
* pairwise potentials: Lennard-Jones, Buckingham, Morse, Born-Mayer-Huggins, Yukawa, soft, class 2 (COMPASS), hydrogen bond, tabulated
* charged pairwise potentials: Coulombic, point-dipole
* many-body potentials: EAM, Finnis/Sinclair EAM, modified EAM (MEAM), embedded ion method (EIM), EDIP, ADP, Stillinger-Weber, Tersoff, REBO, AIREBO, ReaxFF, COMB, SNAP, Streitz-Mintmire, 3-body polymorphic
* long-range interactions for charge, point-dipoles, and LJ dispersion: Ewald, Wolf, PPPM (similar to particle-mesh Ewald)
* many-body potentials: EAM, Finnis/Sinclair EAM, modified EAM (MEAM), embedded ion method (EIM), EDIP, ADP, Stillinger-Weber, Tersoff, REBO, AIREBO, ReaxFF, COMB, Streitz-Mintmire, 3-body polymorphic, BOP, Vashishta
* machine learning potentials: SNAP, GAP, ACE, N2P2, RANN, AGNI
* long-range interactions for charge, point-dipoles, and LJ dispersion: Ewald, Wolf, PPPM (similar to particle-mesh Ewald), MSM
* polarization models: :doc:`QEq <fix_qeq>`, :doc:`core/shell model <Howto_coreshell>`, :doc:`Drude dipole model <Howto_drude>`
* charge equilibration (QEq via dynamic, point, shielded, Slater methods)
* coarse-grained potentials: DPD, GayBerne, REsquared, colloidal, DLVO
* mesoscopic potentials: granular, Peridynamics, SPH
* mesoscopic potentials: granular, Peridynamics, SPH, mesoscopic tubular potential (MESONT)
* semi-empirical potentials: multi-ion generalized pseudopotential theory (MGPT), second moment tight binding + QEq (SMTB-Q), density functional tight-binding (LATTE)
* electron force field (eFF, AWPMD)
* bond potentials: harmonic, FENE, Morse, nonlinear, class 2, quartic (breakable)
* angle potentials: harmonic, CHARMM, cosine, cosine/squared, cosine/periodic, class 2 (COMPASS)
* dihedral potentials: harmonic, CHARMM, multi-harmonic, helix, class 2 (COMPASS), OPLS
* improper potentials: harmonic, cvff, umbrella, class 2 (COMPASS)
* bond potentials: harmonic, FENE, Morse, nonlinear, class 2, quartic (breakable), tabulated
* angle potentials: harmonic, CHARMM, cosine, cosine/squared, cosine/periodic, class 2 (COMPASS), tabulated
* dihedral potentials: harmonic, CHARMM, multi-harmonic, helix, class 2 (COMPASS), OPLS, tabulated
* improper potentials: harmonic, cvff, umbrella, class 2 (COMPASS), tabulated
* polymer potentials: all-atom, united-atom, bead-spring, breakable
* water potentials: TIP3P, TIP4P, SPC
* water potentials: TIP3P, TIP4P, SPC, SPC/E and variants
* interlayer potentials for graphene and analogues
* metal-organic framework potentials (QuickFF, MO-FF)
* implicit solvent potentials: hydrodynamic lubrication, Debye
* force-field compatibility with common CHARMM, AMBER, DREIDING, OPLS, GROMACS, COMPASS options
* force-field compatibility with common CHARMM, AMBER, DREIDING, OPLS, GROMACS, COMPASS options
* access to the `OpenKIM Repository <http://openkim.org>`_ of potentials via :doc:`kim command <kim_commands>`
* hybrid potentials: multiple pair, bond, angle, dihedral, improper potentials can be used in one simulation
* overlaid potentials: superposition of multiple pair potentials
* hybrid potentials: multiple pair, bond, angle, dihedral, improper potentials can be used in one simulation
* overlaid potentials: superposition of multiple pair potentials (including many-body) with optional scale factor
.. _create:
@ -124,9 +130,10 @@ Ensembles, constraints, and boundary conditions
* harmonic (umbrella) constraint forces
* rigid body constraints
* SHAKE bond and angle constraints
* Monte Carlo bond breaking, formation, swapping
* motion constraints to manifold surfaces
* Monte Carlo bond breaking, formation, swapping, template based reaction modeling
* atom/molecule insertion and deletion
* walls of various kinds
* walls of various kinds, static and moving
* non-equilibrium molecular dynamics (NEMD)
* variety of additional boundary conditions and constraints
@ -150,6 +157,7 @@ Diagnostics
^^^^^^^^^^^
* see various flavors of the :doc:`fix <fix>` and :doc:`compute <compute>` commands
* introspection command for system, simulation, and compile time settings and configurations
.. _output:
@ -164,8 +172,9 @@ Output
* parallel I/O of dump and restart files
* per-atom quantities (energy, stress, centro-symmetry parameter, CNA, etc)
* user-defined system-wide (log file) or per-atom (dump file) calculations
* spatial and time averaging of per-atom quantities
* time averaging of system-wide quantities
* custom partitioning (chunks) for binning, and static or dynamic grouping of atoms for analysis
* spatial, time, and per-chunk averaging of per-atom quantities
* time averaging and histogramming of system-wide quantities
* atom snapshots in native, XYZ, XTC, DCD, CFG formats
.. _replica1:
@ -178,7 +187,7 @@ Multi-replica models
* :doc:`parallel replica dynamics <prd>`
* :doc:`temperature accelerated dynamics <tad>`
* :doc:`parallel tempering <temper>`
* :doc:`path-integral MD <fix_pimd>`
* path-integral MD: `first variant <fix_pimd>`, `second variant <fix_ipi>`
* multi-walker collective variables with :doc:`Colvars <fix_colvars>` and :doc:`Plumed <fix_plumed>`
.. _prepost:
@ -210,11 +219,12 @@ page for details.
These are LAMMPS capabilities which you may not think of as typical
classical MD options:
* :doc:`static <balance>` and :doc:`dynamic load-balancing <fix_balance>`
* :doc:`static <balance>` and :doc:`dynamic load-balancing <fix_balance>`, optional with recursive bisectioning decomposition
* :doc:`generalized aspherical particles <Howto_body>`
* :doc:`stochastic rotation dynamics (SRD) <fix_srd>`
* :doc:`real-time visualization and interactive MD <fix_imd>`
* :doc:`real-time visualization and interactive MD <fix_imd>`, :doc:`built-in renderer for images and movies <dump_image>`
* calculate :doc:`virtual diffraction patterns <compute_xrd>`
* calculate :doc:`finite temperature phonon dispersion <fix_phonon>` and the :doc:`dynamical matrix of minimized structures <dynamical_matrix>`
* :doc:`atom-to-continuum coupling <fix_atc>` with finite elements
* coupled rigid body integration via the :doc:`POEMS <fix_poems>` library
* :doc:`QM/MM coupling <fix_qmmm>`

View File

@ -1,40 +1,61 @@
LAMMPS open-source license
--------------------------
LAMMPS is a freely-available open-source code, distributed under the
terms of the `GNU Public License Version 2 <gpl_>`_, which means you can
use or modify the code however you wish for your own purposes, but have
to adhere to certain rules when redistributing it or software derived
GPL version of LAMMPS
^^^^^^^^^^^^^^^^^^^^^
LAMMPS is an open-source code, available free-of-charge, and distributed
under the terms of the `GNU Public License Version 2 <gpl_>`_ (GPLv2),
which means you can use or modify the code however you wish for your own
purposes, but have to adhere to certain rules when redistributing it -
specifically in binary form - or are distributing software derived
from it or that includes parts of it.
LAMMPS comes with no warranty of any kind. As each source file states
in its header, it is a copyrighted code that is distributed free-of-
charge, under the terms of the `GNU Public License Version 2 <gpl_>`_
(GPLv2). This is often referred to as open-source distribution - see
`www.gnu.org <gnuorg_>`_ or `www.opensource.org <opensource_>`_. The
legal text of the GPL is in the LICENSE file included in the LAMMPS
distribution.
LAMMPS comes with no warranty of any kind.
As each source file states in its header, it is a copyrighted code, and
thus not in the public domain. For more information about open-source
software and open-source distribution, see `www.gnu.org <gnuorg_>`_
or `www.opensource.org <opensource_>`_. The legal text of the GPL as it
applies to LAMMPS is in the LICENSE file included in the LAMMPS distribution.
.. _gpl: https://github.com/lammps/lammps/blob/master/LICENSE
.. _lgpl: https://www.gnu.org/licenses/old-licenses/lgpl-2.1.html
.. _gnuorg: http://www.gnu.org
.. _opensource: http://www.opensource.org
Here is a summary of what the GPL means for LAMMPS users:
Here is a more specific summary of what the GPL means for LAMMPS users:
(1) Anyone is free to use, modify, or extend LAMMPS in any way they
(1) Anyone is free to use, copy, modify, or extend LAMMPS in any way they
choose, including for commercial purposes.
(2) If you **distribute** a modified version of LAMMPS, it must remain
open-source, meaning you distribute **all** of it under the terms of
the GPL. You should clearly annotate such a code as a derivative version
of LAMMPS.
open-source, meaning you are required to distribute **all** of it under
the terms of the GPL. You should clearly annotate such a modified code
as a derivative version of LAMMPS.
(3) If you release any code that includes or uses LAMMPS source code,
then it must also be open-sourced, meaning you distribute it under
the terms of the GPL.
the terms of the GPL. You may write code that interfaces LAMMPS to
a differently licensed library. In that case the code that provides
the interface must be licensed GPL, but not necessarily that library
unless you are distributing binaries that require the library to run.
(4) If you give LAMMPS files to someone else, the GPL LICENSE file and
source file headers (including the copyright and GPL notices) should
remain part of the code.
LGPL version of LAMMPS
^^^^^^^^^^^^^^^^^^^^^^
We occasionally make stable LAMMPS releases available under the `GNU
Lesser Public License v2.1 <lgpl_>`_. This is on request only and with
non-LGPL compliant files removed. This allows uses linking non-GPL
compatible software with the (otherwise unmodified) LAMMPS library
or loading it dynamically at runtime. Any **modifications** to
the LAMMPS code however, even with the LGPL licensed version, must still
be made available under the same open source terms as LAMMPS itself.

View File

@ -10,24 +10,26 @@ conditions. It can model 2d or 3d systems with only a few particles
up to millions or billions.
LAMMPS can be built and run on a laptop or desktop machine, but is
designed for parallel computers. It will run on any parallel machine
that supports the `MPI <mpi_>`_ message-passing library. This includes
shared-memory boxes and distributed-memory clusters and
supercomputers.
designed for parallel computers. It will run in serial and on any
parallel machine that supports the `MPI <mpi_>`_ message-passing
library. This includes shared-memory boxes and distributed-memory
clusters and supercomputers. Parts of LAMMPS also support
`OpenMP multi-threading <omp_>`_, vectorization and GPU acceleration.
.. _mpi: https://en.wikipedia.org/wiki/Message_Passing_Interface
.. _lws: https://www.lammps.org
.. _omp: https://www.openmp.org
LAMMPS is written in C++ and requires a compiler that is at least
compatible with the C++-11 standard.
Earlier versions were written in F77 and F90. See the `History page
compatible with the C++-11 standard. Earlier versions were written in
F77, F90, and C++-98. See the `History page
<https://www.lammps.org/history.html>`_ of the website for details. All
versions can be downloaded from the `LAMMPS website <lws_>`_.
versions can be downloaded as source code from the `LAMMPS website
<lws_>`_.
LAMMPS is designed to be easy to modify or extend with new
capabilities, such as new force fields, atom types, boundary
conditions, or diagnostics. See the :doc:`Modify <Modify>` page for
more details.
LAMMPS is designed to be easy to modify or extend with new capabilities,
such as new force fields, atom types, boundary conditions, or
diagnostics. See the :doc:`Modify <Modify>` page for more details.
In the most general sense, LAMMPS integrates Newton's equations of
motion for a collection of interacting particles. A single particle
@ -47,4 +49,5 @@ MPI parallelization to partition the simulation domain into small
sub-domains of equal computational cost, one of which is assigned to
each processor. Processors communicate and store "ghost" atom
information for atoms that border their sub-domain. Multi-threading
parallelization with with particle-decomposition can be used in addition.
parallelization and GPU acceleration with with particle-decomposition
can be used in addition.

View File

@ -26,7 +26,7 @@ available online are listed below.
* `Tutorials <https://www.lammps.org/tutorials.html>`_
* `Pre- and post-processing tools for LAMMPS <https://www.lammps.org/prepost.html>`_
* `Other software usable with LAMMPS <https://www.lammps.org/offsite.html>`_
* `Other software usable with LAMMPS <https://www.lammps.org/external.html>`_
* `Viz tools usable with LAMMPS <https://www.lammps.org/viz.html>`_
* `Benchmark performance <https://www.lammps.org/bench.html>`_

View File

@ -10,6 +10,7 @@ This section documents the following functions:
- :cpp:func:`lammps_mpi_init`
- :cpp:func:`lammps_mpi_finalize`
- :cpp:func:`lammps_kokkos_finalize`
- :cpp:func:`lammps_python_finalize`
--------------------
@ -33,7 +34,7 @@ simple example demonstrating its use:
int lmpargc = sizeof(lmpargv)/sizeof(const char *);
/* create LAMMPS instance */
handle = lammps_open_no_mpi(lmpargc, lmpargv, NULL);
handle = lammps_open_no_mpi(lmpargc, (char **)lmpargv, NULL);
if (handle == NULL) {
printf("LAMMPS initialization failed");
lammps_mpi_finalize();
@ -104,3 +105,13 @@ calling program.
.. doxygenfunction:: lammps_mpi_finalize
:project: progguide
-----------------------
.. doxygenfunction:: lammps_kokkos_finalize
:project: progguide
-----------------------
.. doxygenfunction:: lammps_python_finalize
:project: progguide

View File

@ -2,12 +2,21 @@ What does a LAMMPS version mean
-------------------------------
The LAMMPS "version" is the date when it was released, such as 1 May
2014. LAMMPS is updated continuously. Whenever we fix a bug or add a
feature, we release it in the next *patch* release, which are
typically made every couple of weeks. Info on patch releases are on
`this website page <https://www.lammps.org/bug.html>`_. Every few
months, the latest patch release is subjected to more thorough testing
and labeled as a *stable* version.
2014. LAMMPS is updated continuously and we aim to keep it working
correctly and reliably at all times. You can follow its development
in a public `git repository on GitHub <https://github.com/lammps/lammps>`_.
Whenever we fix a bug or update or add a feature, it will be merged into
the `master` branch of the git repository. When a sufficient number of
changes have accumulated *and* the software passes a set of automated
tests, we release it in the next *patch* release, which are made every
few weeks. Info on patch releases are on `this website page
<https://www.lammps.org/bug.html>`_.
Once or twice a year, only bug fixes and small, non-intrusive changes are
included for a period of time, and the code is subjected to more detailed
and thorough testing than the default automated testing. The latest
patch release after such a period is then labeled as a *stable* version.
Each version of LAMMPS contains all the features and bug-fixes up to
and including its version date.

View File

@ -9,13 +9,15 @@ this.
If you add a new feature to LAMMPS and think it will be of interest to
general users, we encourage you to submit it for inclusion in LAMMPS
as a pull request on our `GitHub site <https://github.com/lammps/lammps>`_,
after reading :doc:`this page <Modify_contribute>`.
after reading about :doc:`how to prepare your code for submission <Modify_contribute>`
and :doc:`the style requirements and recommendations <Modify_style>`.
.. toctree::
:maxdepth: 1
Modify_overview
Modify_contribute
Modify_style
.. toctree::
:maxdepth: 1

View File

@ -1,22 +1,20 @@
Submitting new features for inclusion in LAMMPS
===============================================
We encourage users to submit new features or modifications for LAMMPS to
`the core developers <https://www.lammps.org/authors.html>`_ so they
can be added to the LAMMPS distribution. The preferred way to manage and
coordinate this is via the LAMMPS project on `GitHub
<https://github.com/lammps/lammps>`_. Please see the :doc:`GitHub
Tutorial <Howto_github>` for a demonstration on how to do that. An
alternative is to contact the LAMMPS developers or the indicated
developer of a package or feature directly and send in your contribution
via e-mail, but that can add a significant delay on getting your
contribution included, depending on how busy the respective developer
is, how complex a task it would be to integrate that code, and how
many - if any - changes are required before the code can be included.
We encourage LAMMPS users to submit new features they wrote for LAMMPS
to be included into the LAMMPS distribution and thus become easily
accessible to all LAMMPS users. The LAMMPS source code is managed with
git and public development is hosted on `GitHub
<https://github.com/lammps/lammps>`_. You can monitor the repository to
be notified of releases, follow the ongoing development, and comment on
topics of interest to you.
Communication with the LAMMPS developers
----------------------------------------
For any larger modifications or programming project, you are encouraged
to contact the LAMMPS developers ahead of time in order to discuss
implementation strategies and coding guidelines. That will make it
implementation strategies and coding guidelines. That will make it
easier to integrate your contribution and results in less work for
everybody involved. You are also encouraged to search through the list
of `open issues on GitHub <https://github.com/lammps/lammps/issues>`_
@ -24,235 +22,105 @@ and submit a new issue for a planned feature, so you would not duplicate
the work of others (and possibly get scooped by them) or have your work
duplicated by others.
For informal communication with (some of) the LAMMPS developers you may
ask to join the `LAMMPS developers on Slack
<https://lammps.slack.com>`_. This slack work space is by invitation
only. Thus for access, please send an e-mail to ``slack@lammps.org``
explaining what part of LAMMPS you are working on. Only discussions
related to LAMMPS development are tolerated, so this is **NOT** for
people that look for help with compiling, installing, or using
LAMMPS. Please contact the
`lammps-users mailing list <https://www.lammps.org/mail.html>`_ or the
`LAMMPS forum <https://www.lammps.org/forum.html>`_ for those purposes
instead.
For informal communication with the LAMMPS developers you may ask to
join the `LAMMPS developers on Slack <https://lammps.slack.com>`_. This
slack work space is by invitation only. Thus for access, please send an
e-mail to ``slack@lammps.org`` explaining what part of LAMMPS you are
working on. Only discussions related to LAMMPS development are
tolerated in that work space, so this is **NOT** for people that look for
help with compiling, installing, or using LAMMPS. Please post a message
to the `lammps-users mailing list <https://www.lammps.org/mail.html>`_
or the `LAMMPS forum <https://www.lammps.org/forum.html>`_ for those
purposes.
How quickly your contribution will be integrated depends largely on how
much effort it will cause to integrate and test it, how many and what
kind of changes it requires to the core codebase, and of how much
interest it is to the larger LAMMPS community. Please see below for a
checklist of typical requirements. Once you have prepared everything,
see the :doc:`LAMMPS GitHub Tutorial <Howto_github>` page for
instructions on how to submit your changes or new files through a GitHub
pull request. If you prefer to submit patches or full files, you should
first make certain, that your code works correctly with the latest
patch-level version of LAMMPS and contains all bug fixes from it. Then
create a gzipped tar file of all changed or added files or a
corresponding patch file using 'diff -u' or 'diff -c' and compress it
with gzip. Please only use gzip compression, as this works well and is
available on all platforms.
Packages versus individual files
--------------------------------
The remainder of this chapter describes how to add new "style" files of
various kinds to LAMMPS. Packages are simply collections of one or more
such new class files which are invoked as a new style within a LAMMPS
input script. In some cases also collections of supporting functions or
classes are included as separate files in a package, especially when
they can be shared between multiple styles. If designed correctly, these
additions typically do not require any changes to the core code of
LAMMPS; they are simply add-on files that are compiled with the rest of
LAMMPS. To make those styles work, you may need some trivial changes to
the core code; an example of a trivial change is making a parent-class
method "virtual" when you derive a new child class from it.
If you think your new feature or package requires some non-trivial
changes in core LAMMPS files, you should communicate with the LAMMPS
developers `on Slack <https://lammps.org/slack.html>`_, `on GitHub
<https://github.com/lammps/lammps/issues>`_, or `via email
<https://www.lammps.org/authors.html>`_, since we may have
recommendations about what changes to do where, or may not want to
include certain changes for some reason and thus you would need to look
for alternatives.
Time and effort required
------------------------
How quickly your contribution will be integrated can vary a lot. It
depends largely on how much effort it will cause the LAMMPS developers
to integrate and test it, how many and what kind of changes to the core
code are required, how quickly you can address them and of how much
interest it is to the larger LAMMPS community. Please see the section
on :doc:`LAMMPS programming style and requirements <Modify_style>` for
instructions, recommendations, and formal requirements. A small,
modular, well written contribution may be integrated within hours, but a
complex change that will require a redesign of some core functionality
in LAMMPS for a clean integration can take many months until it is
considered ready for inclusion (though this is rare).
Submission procedure
--------------------
All changes to LAMMPS (including those from LAMMPS developers) are
integrated via pull requests on GitHub and cannot be merged without
passing the automated testing and an approving review by a LAMMPS core
developer. Thus before submitting your contribution, you should first
make certain, that your added or modified code compiles and works
correctly with the latest patch-level or development version of LAMMPS
and contains all bug fixes from it.
Once you have prepared everything, see the :doc:`LAMMPS GitHub Tutorial
<Howto_github>` page for instructions on how to submit your changes or
new files through a GitHub pull request yourself. If you are unable or
unwilling to submit via GitHub yourself, you may also submit patch files
or full files to the LAMMPS developers and ask them to submit a pull
request on GitHub on your behalf. Then create a gzipped tar file of
all changed or added files or a corresponding patch file using
'diff -u' or 'diff -c' format and compress it with gzip. Please only
use gzip compression, as this works well and is available on all platforms.
If the new features/files are broadly useful we may add them as core
files to LAMMPS or as part of a :doc:`package <Packages_list>`. All
packages are listed and described on the :doc:`Packages details
<Packages_details>` doc page.
Note that by providing us files to release, you are agreeing to make
them open-source, i.e. we can release them under the terms of the GPL
(version 2), used as a license for the rest of LAMMPS. And as part of
a LGPL (version 2.1) distribution that we make available to developers
on request only and with files that are authorized for that kind of
distribution removed (e.g. interface to FFTW). See the
Licensing
---------
Note that by providing us files to release, you agree to make them
open-source, i.e. we can release them under the terms of the GPL
(version 2) with the rest of LAMMPS. And similarly as part of a LGPL
(version 2.1) distribution of LAMMPS that we make available to
developers on request only and with files that are not authorized for
that kind of distribution removed (e.g. interface to FFTW). See the
:doc:`LAMMPS license <Intro_opensource>` page for details.
.. note::
External contributions
----------------------
If you prefer to actively develop and support your add-on feature
yourself, then you may wish to make it available for download from
your own website, as a user package that LAMMPS users can add to
their copy of LAMMPS. See the `Offsite LAMMPS packages and tools
<https://www.lammps.org/offsite.html>`_ page of the LAMMPS web site
for examples of groups that do this. We are happy to advertise your
package and web site from that page. Simply email the `developers
<https://www.lammps.org/authors.html>`_ with info about your package
and we will post it there. We recommend to name external packages
USER-\<name\> so they can be easily distinguished from bundled packages
that do not have the USER- prefix.
If you prefer to do so, you can also develop and support your add-on
feature **without** having it included in the LAMMPS distribution, for
example as a download from a website of your own. See the `External
LAMMPS packages and tools <https://www.lammps.org/external.html>`_ page
of the LAMMPS website for examples of groups that do this. We are happy
to advertise your package and website from that page. Simply email the
`developers <https://www.lammps.org/authors.html>`_ with info about your
package and we will post it there. We recommend to name external
packages USER-\<name\> so they can be easily distinguished from bundled
packages that do not have the USER- prefix.
.. _lws: https://www.lammps.org
The previous sections of this page describe how to add new "style"
files of various kinds to LAMMPS. Packages are simply collections of
one or more new class files which are invoked as a new style within a
LAMMPS input script. If designed correctly, these additions typically
do not require changes to the main core of LAMMPS; they are simply
add-on files. If you think your new feature requires non-trivial
changes in core LAMMPS files, you should `communicate with the
developers <https://www.lammps.org/authors.html>`_, since we may or
may not want to include those changes for some reason. An example of a
trivial change is making a parent-class method "virtual" when you derive
a new child class from it.
Here is a checklist of steps you need to follow to submit a single file
or package for our consideration. Following these steps will save
both you and us time. Please have a look at the existing files in
packages in the src directory for examples. If you are uncertain, please ask.
* All source files you provide must compile with the most current
version of LAMMPS with multiple configurations. In particular you
need to test compiling LAMMPS from scratch with -DLAMMPS_BIGBIG
set in addition to the default -DLAMMPS_SMALLBIG setting. Your code
will need to work correctly in serial and in parallel using MPI.
* For consistency with the rest of LAMMPS and especially, if you want
your contribution(s) to be added to main LAMMPS code or one of its
standard packages, it needs to be written in a style compatible with
other LAMMPS source files. This means: 2-character indentation per
level, **no tabs**, no lines over 100 characters. I/O is done via
the C-style stdio library (mixing of stdio and iostreams is generally
discouraged), class header files should not import any system headers
outside of <cstdio>, STL containers should be avoided in headers,
system header from the C library should use the C++-style names
(<cstdlib>, <cstdio>, or <cstring>) instead of the C-style names
<stdlib.h>, <stdio.h>, or <string.h>), and forward declarations
used where possible or needed to avoid including headers.
All added code should be placed into the LAMMPS_NS namespace or a
sub-namespace; global or static variables should be avoided, as they
conflict with the modular nature of LAMMPS and the C++ class structure.
Header files must **not** import namespaces with *using*\ .
This all is so the developers can more easily understand, integrate,
and maintain your contribution and reduce conflicts with other parts
of LAMMPS. This basically means that the code accesses data
structures, performs its operations, and is formatted similar to other
LAMMPS source files, including the use of the error class for error
and warning messages.
* To simplify reformatting contributed code in a way that is compatible
with the LAMMPS formatting styles, you can use clang-format (version 8
or later). The LAMMPS distribution includes a suitable ``.clang-format``
file which will be applied if you run ``clang-format -i some_file.cpp``
on your files inside the LAMMPS src tree. Please only reformat files
that you have contributed. For header files containing a
``SomeStyle(keyword, ClassName)`` macros it is required to have this
macro embedded with a pair of ``// clang-format off``, ``// clang-format on``
commends and the line must be terminated with a semi-colon (;).
Example:
.. code-block:: c++
#ifdef COMMAND_CLASS
// clang-format off
CommandStyle(run,Run);
// clang-format on
#else
#ifndef LMP_RUN_H
[...]
You may also use ``// clang-format on/off`` throughout your file
to protect sections of the file from being reformatted.
* Please review the list of :doc:`available Packages <Packages_details>`
to see if your contribution could be added to be added to one of them.
It should fit into the general purposed of that package. If it does not
fit well, it can be added to one of the EXTRA- packages or the MISC package.
* If your contribution has several related features that are not covered
by one of the existing packages or is dependent on a library (bundled
or external), it is best to make it a package directory with a name
like FOO. In addition to your new files, the directory should contain
a README text file. The README should contain your name and contact
information and a brief description of what your new package does. If
your files depend on other LAMMPS style files also being installed
(e.g. because your file is a derived class from the other LAMMPS
class), then an Install.sh file is also needed to check for those
dependencies and modifications to src/Depend.sh to trigger the checks.
See other README and Install.sh files in other directories as examples.
Similarly for CMake support changes need to be made to cmake/CMakeLists.txt,
the files in cmake/presets, and possibly a file to cmake/Modules/Packages/
added. Please check out how this is handled for existing packages and
ask the LAMMPS developers if you need assistance. Please submit a pull
request on GitHub or send us a tarball of this FOO directory and all
modified files. Pull requests are strongly encouraged since they greatly
reduce the effort required to integrate a contribution and simplify the
process of adjusting the contributed code to cleanly fit into the
LAMMPS distribution.
* Your new source files need to have the LAMMPS copyright, GPL notice,
and your name and email address at the top, like other
user-contributed LAMMPS source files. They need to create a class
that is inside the LAMMPS namespace. To simplify maintenance, we
may ask to adjust the programming style and formatting style to closer
match the rest of LAMMPS. We bundle a clang-format configuration file
that can help with adjusting the formatting, although this is not a
strict requirement.
* You **must** also create a **documentation** file for each new command
or style you are adding to LAMMPS. For simplicity and convenience,
the documentation of groups of closely related commands or styles may
be combined into a single file. This will be one file for a
single-file feature. For a package, it might be several files. These
are text files with a .rst extension using the `reStructuredText
<rst_>`_ markup language, that are then converted to HTML and PDF
using the `Sphinx <sphinx_>`_ documentation generator tool. Running
Sphinx with the included configuration requires Python 3.x.
Configuration settings and custom extensions for this conversion are
included in the source distribution, and missing python packages will
be transparently downloaded into a virtual environment via pip. Thus,
if your local system is missing required packages, you need access to
the internet. The translation can be as simple as doing "make html
pdf" in the doc folder. As appropriate, the text files can include
inline mathematical expression or figures (see doc/JPG for examples).
Additional PDF files with further details (see doc/PDF for examples)
may also be included. The page should also include literature
citations as appropriate; see the bottom of doc/fix_nh.rst for
examples and the earlier part of the same file for how to format the
cite itself. Citation labels must be unique across all .rst files.
The "Restrictions" section of the page should indicate if your
command is only available if LAMMPS is built with the appropriate
FOO package. See other package doc files for examples of
how to do this. Please run at least "make html" and "make spelling"
and carefully inspect and proofread the resulting HTML format doc page
before submitting your code. Upon submission of a pull request,
checks for error free completion of the HTML and PDF build will be
performed and also a spell check, a check for correct anchors and
labels, and a check for completeness of references all styles in their
corresponding tables and lists is run. In case the spell check
reports false positives they can be added to the file
doc/utils/sphinx-config/false_positives.txt
* For a new package (or even a single command) you should include one or
more example scripts demonstrating its use. These should run in no
more than a couple minutes, even on a single processor, and not require
large data files as input. See directories under examples/PACKAGES for
examples of input scripts other users provided for their packages.
These example inputs are also required for validating memory accesses
and testing for memory leaks with valgrind
* If there is a paper of yours describing your feature (either the
algorithm/science behind the feature itself, or its initial usage, or
its implementation in LAMMPS), you can add the citation to the \*.cpp
source file. See src/EFF/atom_vec_electron.cpp for an example.
A LaTeX citation is stored in a variable at the top of the file and
a single line of code registering this variable is added to the
constructor of the class. If there is additional functionality (which
may have been added later) described in a different publication,
additional citation descriptions may be added for as long as they
are only registered when the corresponding keyword activating this
functionality is used. With these options it is possible to have
LAMMPS output a specific citation reminder whenever a user invokes
your feature from their input script. Note that you should only use
this for the most relevant paper for a feature and a publication that
you or your group authored. E.g. adding a citation in the code for
a paper by Nose and Hoover if you write a fix that implements their
integrator is not the intended usage. That kind of citation should
just be included in the documentation page you provide describing
your contribution. If you are not sure what the best option would
be, please contact the LAMMPS developers for advice.
Finally, as a general rule-of-thumb, the more clear and
self-explanatory you make your documentation and README files, and the
easier you make it for people to get started, e.g. by providing example
scripts, the more likely it is that users will try out your new feature.
.. _rst: https://docutils.readthedocs.io/en/sphinx-docs/user/rst/quickstart.html
.. _sphinx: https://sphinx-doc.org

View File

@ -40,8 +40,10 @@ then your pair_foo.h file should be structured as follows:
.. code-block:: c++
#ifdef PAIR_CLASS
PairStyle(foo,PairFoo)
// clang-format off
PairStyle(foo,PairFoo);
#else
// clanf-format on
...
(class definition for PairFoo)
...

439
doc/src/Modify_style.rst Normal file
View File

@ -0,0 +1,439 @@
LAMMPS programming style and requirements for contributions
===========================================================
The following is a summary of the current requirements and
recommendations for including contributed source code or documentation
into the LAMMPS software distribution.
Motivation
----------
The LAMMPS developers are committed to providing a software package that
is versatile, reliable, high-quality, efficient, portable, and easy to
maintain and modify. Achieving all of these goals is challenging since
a large part of LAMMPS consists of contributed code from many different
authors and not many of them are professionally trained programmers and
familiar with the idiosyncrasies of maintaining a large software
package. In addition, changes that interfere with the parallel
efficiency of the core code must be avoided. As LAMMPS continues to
grow and more features and functionality are added, it becomes a
necessity to be more discriminating with new contributions while also
working at the same time to improve the existing code.
The following requirements and recommendations are provided to help
maintaining or improving that status. Where possible we utilize
available continuous integration tools to search for common programming
mistakes, portability limitations, incompatible formatting, and
undesired side effects. It is indicated which requirements are strict,
and which represent a preference and thus are negotiable or optional.
Please feel free to contact the LAMMPS core developers in case you need
additional explanations or clarifications or in case you need assistance
in realizing the (strict) requirements for your contributions.
Licensing requirements (strict)
-------------------------------
Contributing authors agree when submitting a pull request that their
contributions can be distributed under the LAMMPS license
conditions. This is the GNU public license in version 2 (not 3 or later)
for the publicly distributed versions, e.g. on the LAMMPS homepage or on
GitHub. On request we also make a version of LAMMPS available under
LGPL 2.1 terms; this will usually be the latest available or a previous
stable version with a few LGPL 2.1 incompatible files removed.
Your new source files should have the LAMMPS copyright, GPL notice, and
your name and email address at the top, like other user-contributed
LAMMPS source files.
Contributions may be under a different license for long as that
license does not conflict with the aforementioned terms. Contributions
that use code with a conflicting license can be split into two parts:
1. the core parts (i.e. parts that must be in the `src` tree) that are
licensed under compatible terms and bundled with the LAMMPS sources
2. an external library that must be downloaded and compiled (either
separately or as part of the LAMMPS compilation)
Please note, that this split licensed mode may complicate including the
contribution in binary packages.
Using Pull Requests on GitHub (preferred)
-----------------------------------------
All contributions to LAMMPS are processed as pull requests on GitHub
(this also applies to the work of the core LAMMPS developers). A
:doc:`tutorial for submitting pull requests on GitHub <Howto_github>` is
provided. If this is still problematic, contributors may contact any of
the core LAMMPS developers for help or to create a pull request on their
behalf. This latter way of submission may delay the integration as it
depends on the amount of time required to prepare the pull request and
free time available by the LAMMPS developer in question to spend on this
task.
Integration Testing (strict)
----------------------------
Contributed code, like all pull requests, must pass the automated
tests on GitHub before it can be merged with the LAMMPS distribution.
These tests compile LAMMPS in a variety of environments and settings and
run the bundled unit tests. At the discretion of the LAMMPS developer
managing the pull request, additional tests may be activated that test
for "side effects" on running a collection of input decks and create
consistent results. Also, the translation of the documentation to HTML
and PDF is tested for.
More specifically, this means that contributed source code **must**
compile with the most current version of LAMMPS with ``-DLAMMPS_BIGBIG``
in addition to the default setting of ``-DLAMMPS_SMALLBIG``. The code
needs to work correctly in both cases and also in serial and parallel
using MPI.
Some "disruptive" changes may break tests and require updates to the
testing tools or scripts or tests themselves. This is rare. If in
doubt, contact the LAMMPS developer that is assigned to the pull request
for further details and explanations and suggestions of what needs to be
done.
Documentation (strict)
----------------------
Contributions that add new styles or commands or augment existing ones
must include the corresponding new or modified documentation in
`ReStructuredText format <rst>`_ (.rst files in the ``doc/src/`` folder). The
documentation shall be written in American English and the .rst file
must use only ASCII characters so it can be cleanly translated to PDF
files (via `sphinx <sphinx>`_ and PDFLaTeX). Special characters may be included via
embedded math expression typeset in a LaTeX subset.
.. _rst: https://docutils.readthedocs.io/en/sphinx-docs/user/rst/quickstart.html
When adding new commands, they need to be integrated into the sphinx
documentation system, and the corresponding command tables and lists
updated. When translating the documentation into html files there should
be no warnings. When adding a new package also some lists describing
packages must be updated as well as a package specific description added
and, if necessary, some package specific build instructions included.
As appropriate, the text files with the documentation can include inline
mathematical expression or figures (see ``doc/JPG`` for examples).
Additional PDF files with further details (see ``doc/PDF`` for examples) may
also be included. The page should also include literature citations as
appropriate; see the bottom of ``doc/fix_nh.rst`` for examples and the
earlier part of the same file for how to format the cite itself.
Citation labels must be unique across **all** .rst files. The
"Restrictions" section of the page should indicate if your command is
only available if LAMMPS is built with the appropriate FOO package. See
other package doc files for examples of how to do this.
Please run at least "make html" and "make spelling" and carefully
inspect and proofread the resulting HTML format doc page before
submitting your code. Upon submission of a pull request, checks for
error free completion of the HTML and PDF build will be performed and
also a spell check, a check for correct anchors and labels, and a check
for completeness of references all styles in their corresponding tables
and lists is run. In case the spell check reports false positives they
can be added to the file doc/utils/sphinx-config/false_positives.txt
Contributions that add or modify the library interface or "public" APIs
from the C++ code or the Fortran module must include suitable doxygen
comments in the source and corresponding changes to the documentation
sources for the "Programmer Guide" guide section of the LAMMPS manual.
Examples (preferred)
--------------------
In most cases, it is preferred that example scripts (simple, small, fast
to complete on 1 CPU) are included that demonstrate the use of new or
extended functionality. These are typically under the examples or
examples/PACKAGES directory. A few guidelines for such example input
decks.
- commands that generate output should be commented out (except when the
output is the sole purpose or the feature, e.g. for a new compute).
- commands like :doc:`log <log>`, :doc:`echo <echo>`, :doc:`package
<package>`, :doc:`processors <processors>`, :doc:`suffix <suffix>` may
**not** be used in the input file (exception: "processors * * 1" or
similar is acceptable when used to avoid unwanted domain decomposition
of empty volumes).
- outside of the log files no generated output should be included
- custom thermo_style settings may not include output measuring CPU or other time
as that makes comparing the thermo output between different runs more complicated.
- input files should be named ``in.name``, data files should be named
``data.name`` and log files should be named ``log.version.name.<compiler>.<ncpu>``
- the total file size of all the inputs and outputs should be small
- where possible potential files from the "potentials" folder or data
file from other folders should be re-used through symbolic links
Howto document (optional)
-------------------------
If your feature requires some more complex steps and explanations to be
used correctly or some external or bundled tools or scripts, we
recommend that you also contribute a :doc:`Howto document <Howto>`
providing some more background information and some tutorial material.
This can also be used to provide more in-depth explanations for bundled
examples.
As a general rule-of-thumb, the more clear and self-explanatory you make
your documentation, README files and examples, and the easier you make
it for people to get started, the more likely it is that users will try
out your new feature.
Programming Style Requirements (varied)
---------------------------------------
The LAMMPS developers aim to employ a consistent programming style and
naming conventions across the entire code base, as this helps with
maintenance, debugging, and understanding the code, both for developers
and users.
The files `pair_lj_cut.h`, `pair_lj_cut.cpp`, `utils.h`, and `utils.cpp`
may serve as representative examples.
Command or Style names, file names, and keywords (mostly strict)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
All user-visible command or style names should be all lower case and
should only use letters, numbers, or forward slashes. They should be
descriptive and initialisms should be avoided unless they are well
established (e.g. lj for Lennard-Jones). For a compute style
"some/name" the source files must be called `compute_some_name.h` and
`compute_some_name.cpp`. The "include guard" would then be
`LMP_COMPUTE_SOME_NAME_H` and the class name `ComputeSomeName`.
Whitespace and permissions (preferred)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
Source files should not contain TAB characters unless required by the
syntax (e.g. in makefiles) and no trailing whitespace. Text files
should be added with Unix-style line endings (LF-only). Git will
automatically convert those in both directions when running on Windows;
use dos2unix on Linux machines to convert files. Text files should have
a line ending on the last line.
All files should have 0644 permissions, i.e writable to the user only
and readable by all and no executable permissions. Executable
permissions (0755) should only be on shell scripts or python or similar
scripts for interpreted script languages.
Indentation and Placement of Braces (strongly preferred)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
LAMMPS uses 2 characters per indentation level and lines should be
kept within 100 characters wide.
For new files added to the "src" tree, a `clang-format
<https://clang.llvm.org/docs/ClangFormat.html>`_ configuration file is
provided under the name `.clang-format`. This file is compatible with
clang-format version 8 and later. With that file present files can be
reformatted according to the configuration with a command like:
`clang-format -i new-file.cpp`. Ideally, this is done while writing the
code or before a pull request is submitted. Blocks of code where the
reformatting from clang-format yields undesirable output may be
protected with placing a pair `// clang-format off` and `// clang-format
on` comments around that block.
Programming language standards (required)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
The core of LAMMPS is written in C++11 in a style that can be mostly
described as "C with classes". Advanced C++ features like operator
overloading or excessive use of templates are avoided with the intent to
keep the code readable to programmers that have limited C++ programming
experience. C++ constructs are acceptable when they help improving the
readability and reliability of the code, e.g. when using the
`std::string` class instead of manipulating pointers and calling the
string functions of the C library. In addition and number of convenient
:doc:`utility functions and classes <Developer_utils>` for recurring
tasks are provided.
Included Fortran code has to be compatible with the Fortran 2003
standard. Python code must be compatible with Python 3.5. Large parts
or LAMMPS (including the :ref:`PYTHON package <PKG-PYTHON>`) are also
compatible with Python 2.7. Compatibility with Python 2.7 is
desirable, but compatibility with Python 3.5 is **required**.
Compatibility with these older programming language standards is very
important to maintain portability, especially with HPC cluster
environments, which tend to be running older software stacks and LAMMPS
users may be required to use those older tools or not have the option to
install newer compilers.
Programming conventions (varied)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
The following is a collection of conventions that should be applied when
writing code for LAMMPS. Following these steps will make it much easier
to integrate your contribution. Please have a look at the existing files
in packages in the src directory for examples. As a demonstration for
how can be adapted to these conventions you may compare the REAXFF
package with the what it looked like when it was called USER-REAXC. If
you are uncertain, please ask.
- system headers or from installed libraries are include with angular
brackets (example: ``#include <vector>``), while local include file
use double quotes (example: ``#include "atom.h"``).
- when including system header files from the C library use the
C++-style names (``<cstdlib>`` or ``<cstring>``) instead of the
C-style names (``<stdlib.h>`` or ``<string.h>``)
- the order of ``#include`` statements in a file ``some_name.cpp`` that
implements a class ``SomeName`` defined in a header file
``some_name.h`` should be as follows:
- ``#include "some_name.h"`` followed by an empty line
- LAMMPS include files e.g. ``#include "comm.h"`` or ``#include
"modify.h"`` in alphabetical order followed by an empty line
- system header files from the C++ or C standard library followed by
an empty line
- ``using namespace LAMMPS_NS`` or other namespace imports.
- I/O is done via the C-style stdio library and **not** iostreams.
- Output to the screen and the logfile should be using the corresponding
FILE pointers and only be done on MPI rank 0. Use the :cpp:func:`utils::logmesg`
convenience function where possible.
- Header files, especially those defining a "style", should only use
the absolute minimum number of include files and **must not** contain
any ``using`` statements. Typically that would be only the header for
the base class. Instead any include statements should be put into the
corresponding implementation files and forward declarations be used.
For implementation files, the "include what you use" principle should
be employed. However, there is the notable exception that when the
``pointers.h`` header is included (or one of the base classes derived
from it) certain headers will always be included and thus do not need
to be explicitly specified.
These are: `mpi.h`, `cstddef`, `cstdio`, `cstdlib`, `string`, `utils.h`,
`vector`, `fmt/format.h`, `climits`, `cinttypes`.
This also means any such file can assume that `FILE`, `NULL`, and
`INT_MAX` are defined.
- Header files that define a new LAMMPS style (i.e. that have a
``SomeStyle(some/name,SomeName);`` macro in them) should only use the
include file for the base class and otherwise use forward declarations
and pointers; when interfacing to a library use the PIMPL (pointer
to implementation) approach where you have a pointer to a struct
that contains all library specific data (and thus requires the library
header) but use a forward declaration and define the struct only in
the implementation file. This is a **strict** requirement since this
is where type clashes between packages and hard to find bugs have
regularly manifested in the past.
- Please use clang-format only to reformat files that you have
contributed. For header files containing a ``SomeStyle(keyword,
ClassName)`` macros it is required to have this macro embedded with a
pair of ``// clang-format off``, ``// clang-format on`` commends and
the line must be terminated with a semi-colon (;). Example:
.. code-block:: c++
#ifdef COMMAND_CLASS
// clang-format off
CommandStyle(run,Run);
// clang-format on
#else
#ifndef LMP_RUN_H
[...]
You may also use ``// clang-format on/off`` throughout your files
to protect individual sections from being reformatted.
- We rarely accept new styles in the core src folder. Thus please
review the list of :doc:`available Packages <Packages_details>` to see
if your contribution could be added to be added to one of them. It
should fit into the general purposed of that package. If it does not
fit well, it may be added to one of the EXTRA- packages or the MISC
package.
Contributing a package
----------------------
If your contribution has several related features that are not covered
by one of the existing packages or is dependent on a library (bundled or
external), it is best to make it a package directory with a name like
FOO. In addition to your new files, the directory should contain a
README text file. The README should contain your name and contact
information and a brief description of what your new package does.
Build system (strongly preferred)
---------------------------------
LAMMPS currently supports two build systems: one that is based on
:doc:`traditional Makefiles <Build_make>` and one that is based on
:doc:`CMake <Build_cmake>`. Thus your contribution must be compatible
with and support both.
For a single pair of header and implementation files that are an
independent feature, it is usually only required to add them to
`src/.gitignore``.
For traditional make, if your contributed files or package depend on
other LAMMPS style files or packages also being installed (e.g. because
your file is a derived class from the other LAMMPS class), then an
Install.sh file is also needed to check for those dependencies and
modifications to src/Depend.sh to trigger the checks. See other README
and Install.sh files in other directories as examples.
Similarly for CMake support, changes may need to be made to
cmake/CMakeLists.txt, some of the files in cmake/presets, and possibly a
file with specific instructions needs to be added to
cmake/Modules/Packages/. Please check out how this is handled for
existing packages and ask the LAMMPS developers if you need assistance.
Citation reminder (suggested)
-----------------------------
If there is a paper of yours describing your feature (either the
algorithm/science behind the feature itself, or its initial usage, or
its implementation in LAMMPS), you can add the citation to the \*.cpp
source file. See ``src/DIFFRACTION/compute_saed.cpp`` for an example.
A BibTeX format citation is stored in a string variable at the top
of the file and a single line of code registering this variable is
added to the constructor of the class. When your feature is used,
by default, LAMMPS will print the brief info and the DOI
in the first line to the screen and the full citation to the log file.
If there is additional functionality (which may have been added later)
described in a different publication, additional citation descriptions
may be added for as long as they are only registered when the
corresponding keyword activating this functionality is used. With these
options it is possible to have LAMMPS output a specific citation
reminder whenever a user invokes your feature from their input script.
Please note that you should *only* use this for the *most* relevant
paper for a feature and a publication that you or your group authored.
E.g. adding a citation in the code for a paper by Nose and Hoover if you
write a fix that implements their integrator is not the intended usage.
That latter kind of citation should just be included in the
documentation page you provide describing your contribution. If you are
not sure what the best option would be, please contact the LAMMPS
developers for advice.
Testing (optional)
------------------
If your contribution contains new utility functions or a supporting class
(i.e. anything that does not depend on a LAMMPS object), new unit tests
should be added to a suitable folder in the ``unittest`` tree.
When adding a new LAMMPS style computing forces or selected fixes,
a ``.yaml`` file with a test configuration and reference data should be
added for the styles where a suitable tester program already exists
(e.g. pair styles, bond styles, etc.). Please see
:ref:`this section in the manual <testing>` for more information on
how to enable, run, and expand testing.

Binary file not shown.

View File

@ -915,7 +915,7 @@ This package has :ref:`specific installation instructions <gpu>` on the :doc:`Bu
* :doc:`package gpu <package>`
* :doc:`Commands <Commands_all>` pages (:doc:`pair <Commands_pair>`, :doc:`kspace <Commands_kspace>`)
for styles followed by (g)
* `Benchmarks page <https://www.lammps.org/bench.html>`_ of web site
* `Benchmarks page <https://www.lammps.org/bench.html>`_ of website
----------
@ -1027,7 +1027,7 @@ This package has :ref:`specific installation instructions <intel>` on the :doc:`
* Search the :doc:`commands <Commands_all>` pages (:doc:`fix <Commands_fix>`, :doc:`compute <Commands_compute>`,
:doc:`pair <Commands_pair>`, :doc:`bond, angle, dihedral, improper <Commands_bond>`, :doc:`kspace <Commands_kspace>`) for styles followed by (i)
* src/INTEL/TEST
* `Benchmarks page <https://www.lammps.org/bench.html>`_ of web site
* `Benchmarks page <https://www.lammps.org/bench.html>`_ of website
----------
@ -1164,7 +1164,7 @@ This package has :ref:`specific installation instructions <kokkos>` on the :doc:
* Search the :doc:`commands <Commands_all>` pages (:doc:`fix <Commands_fix>`, :doc:`compute <Commands_compute>`,
:doc:`pair <Commands_pair>`, :doc:`bond, angle, dihedral, improper <Commands_bond>`,
:doc:`kspace <Commands_kspace>`) for styles followed by (k)
* `Benchmarks page <https://www.lammps.org/bench.html>`_ of web site
* `Benchmarks page <https://www.lammps.org/bench.html>`_ of website
----------
@ -1242,7 +1242,7 @@ A fix command which wraps the LATTE DFTB code, so that molecular
dynamics can be run with LAMMPS using density-functional tight-binding
quantum forces calculated by LATTE.
More information on LATTE can be found at this web site:
More information on LATTE can be found at this website:
`https://github.com/lanl/LATTE <latte-home_>`_. A brief technical
description is given with the :doc:`fix latte <fix_latte>` command.
@ -2017,7 +2017,7 @@ the :doc:`Build extras <Build_extras>` page.
* Search the :doc:`commands <Commands_all>` pages (:doc:`fix <Commands_fix>`, :doc:`compute <Commands_compute>`,
:doc:`pair <Commands_pair>`, :doc:`bond, angle, dihedral, improper <Commands_bond>`,
:doc:`kspace <Commands_kspace>`) for styles followed by (o)
* `Benchmarks page <https://www.lammps.org/bench.html>`_ of web site
* `Benchmarks page <https://www.lammps.org/bench.html>`_ of website
----------
@ -2051,7 +2051,7 @@ This package has :ref:`specific installation instructions <opt>` on the :doc:`Bu
* :doc:`OPT package <Speed_opt>`
* :doc:`Section 2.6 -sf opt <Run_options>`
* Search the :doc:`pair style <Commands_pair>` page for styles followed by (t)
* `Benchmarks page <https://www.lammps.org/bench.html>`_ of web site
* `Benchmarks page <https://www.lammps.org/bench.html>`_ of website
.. _PKG-ORIENT:
@ -2248,16 +2248,16 @@ PYTHON package
A :doc:`python <python>` command which allow you to execute Python code
from a LAMMPS input script. The code can be in a separate file or
embedded in the input script itself. See the :doc:`Python call <Python_call>` page for an overview of using Python from
LAMMPS in this manner and all the :doc:`Python <Python_head>` manual pages
for other ways to use LAMMPS and Python together.
embedded in the input script itself. See the :doc:`Python call
<Python_call>` page for an overview of using Python from LAMMPS in this
manner and all the :doc:`Python <Python_head>` manual pages for other
ways to use LAMMPS and Python together.
.. note::
Building with the PYTHON package assumes you have a Python
shared library available on your system, which needs to be a Python 2
version, 2.6 or later. Python 3 is not yet supported. See the
lib/python/README for more details.
Building with the PYTHON package assumes you have a Python development
environment (headers and libraries) available on your system, which needs
to be either Python version 2.7 or Python 3.5 and later.
**Install:**

View File

@ -2,17 +2,25 @@ Basics of running LAMMPS
========================
LAMMPS is run from the command line, reading commands from a file via
the -in command line flag, or from standard input.
Using the "-in in.file" variant is recommended:
the -in command line flag, or from standard input. Using the "-in
in.file" variant is recommended (see note below). The name of the
LAMMPS executable is either ``lmp`` or ``lmp_<machine>`` with
`<machine>` being the machine string used when compiling LAMMPS. This
is required when compiling LAMMPS with the traditional build system
(e.g. with ``make mpi``), but optional when using CMake to configure and
build LAMMPS:
.. code-block:: bash
$ lmp_serial -in in.file
$ lmp_serial < in.file
$ lmp -in in.file
$ lmp < in.file
$ /path/to/lammps/src/lmp_serial -i in.file
$ mpirun -np 4 lmp_mpi -in in.file
$ mpiexec -np 4 lmp -in in.file
$ mpirun -np 8 /path/to/lammps/src/lmp_mpi -in in.file
$ mpirun -np 6 /usr/local/bin/lmp -in in.file
$ mpiexec -n 6 /usr/local/bin/lmp -in in.file
You normally run the LAMMPS command in the directory where your input
script is located. That is also where output files are produced by
@ -23,7 +31,7 @@ executable itself can be placed elsewhere.
.. note::
The redirection operator "<" will not always work when running
in parallel with mpirun; for those systems the -in form is required.
in parallel with mpirun or mpiexec; for those systems the -in form is required.
As LAMMPS runs it prints info to the screen and a logfile named
*log.lammps*\ . More info about output is given on the

View File

@ -2,7 +2,7 @@ Command-line options
====================
At run time, LAMMPS recognizes several optional command-line switches
which may be used in any order. Either the full word or a one-or-two
which may be used in any order. Either the full word or a one or two
letter abbreviation can be used:
* :ref:`-e or -echo <echo>`
@ -22,6 +22,7 @@ letter abbreviation can be used:
* :ref:`-r2data or -restart2data <restart2data>`
* :ref:`-r2dump or -restart2dump <restart2dump>`
* :ref:`-sc or -screen <screen>`
* :ref:`-sr or skiprun <skiprun>`
* :ref:`-sf or -suffix <suffix>`
* :ref:`-v or -var <var>`
@ -241,10 +242,11 @@ links with from the lib/message directory. See the
**-cite style** or **file name**
Select how and where to output a reminder about citing contributions
to the LAMMPS code that were used during the run. Available styles are
"both", "none", "screen", or "log". Any flag will be considered a file
name to write the detailed citation info to. Default is the "log" style
where there is a short summary in the screen output and detailed citations
to the LAMMPS code that were used during the run. Available keywords
for styles are "both", "none", "screen", or "log". Any other keyword
will be considered a file name to write the detailed citation info to
instead of logfile or screen. Default is the "log" style where there
is a short summary in the screen output and detailed citations
in BibTeX format in the logfile. The option "both" selects the detailed
output for both, "none", the short output for both, and "screen" will
write the detailed info to the screen and the short version to the log
@ -532,6 +534,21 @@ partition screen files file.N.
----------
.. _skiprun:
**-skiprun**
Insert the command :doc:`timer timeout 0 every 1 <timer>` at the
beginning of an input file or after a :doc:`clear <clear>` command.
This has the effect that the entire LAMMPS input script is processed
without executing actual :doc:`run <run>` or :doc:`minimize <minimize>`
and similar commands (their main loops are skipped). This can be
helpful and convenient to test input scripts of long running
calculations for correctness to avoid having them crash after a
long time due to a typo or syntax error in the middle or at the end.
----------
.. _suffix:
**-suffix style args**

View File

@ -13,7 +13,7 @@ for certain kinds of hardware, including multi-core CPUs, GPUs, and
Intel Xeon Phi co-processors.
The `Benchmark page <https://www.lammps.org/bench.html>`_ of the LAMMPS
web site gives performance results for the various accelerator
website gives performance results for the various accelerator
packages discussed on the :doc:`Speed packages <Speed_packages>` doc
page, for several of the standard LAMMPS benchmark problems, as a
function of problem size and number of compute nodes, on different

View File

@ -153,7 +153,7 @@ usually resulting in inferior performance compared to using LAMMPS' native
threading and vectorization support in the OPENMP and INTEL packages.
See the `Benchmark page <https://www.lammps.org/bench.html>`_ of the
LAMMPS web site for performance of the GPU package on various
LAMMPS website for performance of the GPU package on various
hardware, including the Titan HPC platform at ORNL.
You should also experiment with how many MPI tasks per GPU to use to

View File

@ -407,7 +407,7 @@ Generally speaking, the following rules of thumb apply:
by switching to single or mixed precision mode.
See the `Benchmark page <https://www.lammps.org/bench.html>`_ of the
LAMMPS web site for performance of the KOKKOS package on different
LAMMPS website for performance of the KOKKOS package on different
hardware.
Advanced Kokkos options

View File

@ -144,7 +144,7 @@ sub-directories with Make.py commands and input scripts for using all
the accelerator packages on various machines. See the README files in
those directories.
As mentioned above, the `Benchmark page <https://www.lammps.org/bench.html>`_ of the LAMMPS web site gives
As mentioned above, the `Benchmark page <https://www.lammps.org/bench.html>`_ of the LAMMPS website gives
performance results for the various accelerator packages for several
of the standard LAMMPS benchmark problems, as a function of problem
size and number of compute nodes, on different hardware platforms.

View File

@ -7,7 +7,7 @@ steps are often necessary to setup and analyze a simulation. A list
of such tools can be found on the `LAMMPS webpage <lws_>`_ at these links:
* `Pre/Post processing <https://www.lammps.org/prepost.html>`_
* `Offsite LAMMPS packages & tools <https://www.lammps.org/offsite.html>`_
* `External LAMMPS packages & tools <https://www.lammps.org/external.html>`_
* `Pizza.py toolkit <pizza_>`_
The last link for `Pizza.py <pizza_>`_ is a Python-based tool developed at
@ -172,7 +172,7 @@ Chris Lorenz (chris.lorenz at kcl.ac.uk), King's College London.
chain tool
----------------------
The file chain.f creates a LAMMPS data file containing bead-spring
The file chain.f90 creates a LAMMPS data file containing bead-spring
polymer chains and/or monomer solvent atoms. It uses a text file
containing chain definition parameters as an input. The created
chains and solvent atoms can strongly overlap, so LAMMPS needs to run

View File

@ -53,7 +53,8 @@ Restrictions
""""""""""""
This angle style can only be used if LAMMPS was built with the
MOLECULE package.
EXTRA-MOLECULE package. See the :doc:`Build package <Build_package>` doc
page for more info.
Related commands
""""""""""""""""

View File

@ -64,7 +64,7 @@ Restrictions
""""""""""""
This angle style can only be used if LAMMPS was built with the
MOLECULE package. See the :doc:`Build package <Build_package>` doc
EXTRA-MOLECULE package. See the :doc:`Build package <Build_package>` doc
page for more info.
Related commands

View File

@ -50,7 +50,7 @@ Restrictions
""""""""""""
This angle style can only be used if LAMMPS was built with the
MOLECULE package. See the :doc:`Build package <Build_package>` doc
EXTRA-MOLECULE package. See the :doc:`Build package <Build_package>` doc
page for more info.
Related commands

View File

@ -49,7 +49,7 @@ Restrictions
""""""""""""
This angle style can only be used if LAMMPS was built with the
MOLECULE package. See the :doc:`Build package <Build_package>` doc
EXTRA-MOLECULE package. See the :doc:`Build package <Build_package>` doc
page for more info.
Related commands

View File

@ -49,7 +49,7 @@ Restrictions
""""""""""""
This angle style can only be used if LAMMPS was built with the
MOLECULE package. See the :doc:`Build package <Build_package>` doc
EXTRA-MOLECULE package. See the :doc:`Build package <Build_package>` doc
page for more info.
Related commands

View File

@ -57,7 +57,7 @@ Restrictions
""""""""""""
This angle style can only be used if LAMMPS was built with the
MOLECULE package. See the :doc:`Build package <Build_package>` doc
EXTRA-MOLECULE package. See the :doc:`Build package <Build_package>` doc
page for more info.
Related commands

View File

@ -477,12 +477,18 @@ atom-style variables can reference the position of a particle, its
velocity, the volume of its Voronoi cell, etc.
The *store* weight style does not compute a weight factor. Instead it
stores the current accumulated weights in a custom per-atom property
specified by *name*\ . This must be a property defined as *d_name* via
the :doc:`fix property/atom <fix_property_atom>` command. Note that
these custom per-atom properties can be output in a :doc:`dump <dump>`
file, so this is a way to examine, debug, or visualize the
per-particle weights computed during the load-balancing operation.
stores the current accumulated weights in a custom per-atom vector
specified by *name*\ . This must be a vector defined as *d_name* via
the :doc:`fix property/atom <fix_property_atom>` command. This means
the values in the vector can be read as part of a data file with the
:doc:`read_data <read_data>` command or specified with the :doc:`set
<set>` command. These weights can also be output in a :doc:`dump
<dump>` file, so this is a way to examine, debug, or visualize the
per-particle weights used during the load-balancing operation.
Note that the name of the custom per-atom vector is specified just
as *name*, not as *d_name* as it is for other commands that use
different kinds of custom atom vectors or arrays as arguments.
----------

View File

@ -50,7 +50,7 @@ Restrictions
""""""""""""
This bond style can only be used if LAMMPS was built with the
MOLECULE package. See the :doc:`Build package <Build_package>` doc
EXTRA-MOLECULE package. See the :doc:`Build package <Build_package>` doc
page for more info.
Related commands

View File

@ -56,7 +56,7 @@ Restrictions
""""""""""""
This bond style can only be used if LAMMPS was built with the
MOLECULE package. See the :doc:`Build package <Build_package>` doc
EXTRA-MOLECULE package. See the :doc:`Build package <Build_package>` doc
page for more info.
Related commands

View File

@ -54,7 +54,7 @@ Restrictions
""""""""""""
This bond style can only be used if LAMMPS was built with the
MOLECULE package. See the :doc:`Build package <Build_package>` doc
EXTRA-MOLECULE package. See the :doc:`Build package <Build_package>` doc
page for more info.
Related commands

View File

@ -99,10 +99,10 @@ duplexes or arrays of DNA/RNA duplexes can be found in
examples/PACKAGES/cgdna/util/.
Please cite :ref:`(Henrich) <Henrich0>` in any publication that uses
this implementation. The article contains general information
this implementation. An updated documentation that contains general information
on the model, its implementation and performance as well as the structure of
the data and input file. The preprint version of the article can be found
`here <PDF/CG-DNA.pdf>`_.
the data and input file can be found `here <PDF/CG-DNA.pdf>`_.
Please cite also the relevant oxDNA/oxRNA publications. These are
:ref:`(Ouldridge) <Ouldridge0>` and
:ref:`(Ouldridge-DPhil) <Ouldridge-DPhil0>` for oxDNA,

View File

@ -23,22 +23,23 @@ Examples
Description
"""""""""""
Define a computation that extracts the angle energy calculated by each
of the angle sub-styles used in the doc:`angle_style hybrid <angle_hybrid>`
command. These values are made accessible
for output or further processing by other commands. The group
specified for this command is ignored.
Define a computation that extracts the angle energy calculated by each of the
angle sub-styles used in the :doc:`angle_style hybrid <angle_hybrid>` command.
These values are made accessible for output or further processing by other
commands. The group specified for this command is ignored.
This compute is useful when using :doc:`angle_style hybrid <angle_hybrid>` if you want to know the portion of the total
energy contributed by one or more of the hybrid sub-styles.
This compute is useful when using :doc:`angle_style hybrid <angle_hybrid>` if
you want to know the portion of the total energy contributed by one or more of
the hybrid sub-styles.
Output info
"""""""""""
This compute calculates a global vector of length N where N is the
number of sub_styles defined by the :doc:`angle_style hybrid <angle_style>` command, which can be accessed by indices
1-N. These values can be used by any command that uses global scalar
or vector values from a compute as input. See the :doc:`Howto output <Howto_output>` page for an overview of LAMMPS output
This compute calculates a global vector of length N where N is the number of
sub_styles defined by the :doc:`angle_style hybrid <angle_style>` command,
which can be accessed by indices 1-N. These values can be used by any command
that uses global scalar or vector values from a compute as input. See the
:doc:`Howto output <Howto_output>` page for an overview of LAMMPS output
options.
The vector values are "extensive" and will be in energy
@ -46,7 +47,8 @@ The vector values are "extensive" and will be in energy
Restrictions
""""""""""""
none
none
Related commands
""""""""""""""""

View File

@ -20,7 +20,8 @@ Syntax
x, y, z, xs, ys, zs, xu, yu, zu, ix, iy, iz,
vx, vy, vz, fx, fy, fz,
q, mux, muy, muz, mu,
sp, spx, spy, spz, fmx, fmy, fmz,
spx, spy, spz, sp, fmx, fmy, fmz,
nbonds,
radius, diameter, omegax, omegay, omegaz,
angmomx, angmomy, angmomz,
shapex,shapey, shapez,
@ -29,42 +30,42 @@ Syntax
corner1x, corner1y, corner1z,
corner2x, corner2y, corner2z,
corner3x, corner3y, corner3z,
nbonds,
buckling,
vfrac, s0,
spin, eradius, ervel, erforce,
rho, drho, e, de, cv,
i_name, d_name
i_name, d_name, i2_name[I], d2_name[I],
vfrac, s0, spin, eradius, ervel, erforce,
rho, drho, e, de, cv, buckling,
.. parsed-literal::
id = atom ID
mol = molecule ID
proc = ID of processor that owns atom
type = atom type
mass = atom mass
x,y,z = unscaled atom coordinates
xs,ys,zs = scaled atom coordinates
xu,yu,zu = unwrapped atom coordinates
ix,iy,iz = box image that the atom is in
vx,vy,vz = atom velocities
fx,fy,fz = forces on atoms
q = atom charge
mux,muy,muz = orientation of dipole moment of atom
mu = magnitude of dipole moment of atom
sp = atomic magnetic spin moment
spx, spy, spz = direction of the atomic magnetic spin
fmx, fmy, fmz = magnetic force
radius,diameter = radius,diameter of spherical particle
omegax,omegay,omegaz = angular velocity of spherical particle
angmomx,angmomy,angmomz = angular momentum of aspherical particle
shapex,shapey,shapez = 3 diameters of aspherical particle
quatw,quati,quatj,quatk = quaternion components for aspherical or body particles
tqx,tqy,tqz = torque on finite-size particles
end12x, end12y, end12z = end points of line segment
corner123x, corner123y, corner123z = corner points of triangle
nbonds = number of bonds assigned to an atom
buckling = buckling flag used in mesoscopic simulation of nanotubes
*id* = atom ID
*mol* = molecule ID
*proc* = ID of processor that owns atom
*type* = atom type
*mass* = atom mass
*x,y,z* = unscaled atom coordinates
*xs,ys,zs* = scaled atom coordinates
*xu,yu,zu* = unwrapped atom coordinates
*ix,iy,iz* = box image that the atom is in
*vx,vy,vz* = atom velocities
*fx,fy,fz* = forces on atoms
*q* = atom charge
*mux,muy,muz* = orientation of dipole moment of atom
*mu* = magnitude of dipole moment of atom
*spx, spy, spz* = direction of the atomic magnetic spin
*sp* = magintude of atomic magnetic spin moment
*fmx, fmy, fmz* = magnetic force
*nbonds* = number of bonds assigned to an atom
*radius,diameter* = radius,diameter of spherical particle
*omegax,omegay,omegaz* = angular velocity of spherical particle
*angmomx,angmomy,angmomz* = angular momentum of aspherical particle
*shapex,shapey,shapez* = 3 diameters of aspherical particle
*quatw,quati,quatj,quatk* = quaternion components for aspherical or body particles
*tqx,tqy,tqz* = torque on finite-size particles
*end12x, end12y, end12z* = end points of line segment
*corner123x, corner123y, corner123z* = corner points of triangle
*i_name* = custom integer vector with name
*d_name* = custom floating point vector with name
*i2_name[I]* = Ith column of custom integer array with name
*d2_name[I]* = Ith column of custom floating-point array with name
.. parsed-literal::
@ -91,9 +92,8 @@ Syntax
.. parsed-literal::
:doc:`fix property/atom <fix_property_atom>` per-atom properties:
i_name = custom integer vector with name
d_name = custom integer vector with name
MESONT package per-atom properties:
buckling = buckling flag used in mesoscopic simulation of nanotubes
Examples
""""""""
@ -104,6 +104,7 @@ Examples
compute 2 all property/atom type
compute 1 all property/atom ix iy iz
compute 3 all property/atom sp spx spy spz
compute 1 all property/atom i_myFlag d_Sxyz[1] d_Sxyz[3]
Description
"""""""""""
@ -116,20 +117,37 @@ ave/atom <fix_ave_atom>`, :doc:`fix ave/histo <fix_ave_histo>`,
:doc:`fix ave/chunk <fix_ave_chunk>`, and :doc:`atom-style variable
<variable>` commands.
The list of possible attributes is the same as that used by the
:doc:`dump custom <dump>` command, which describes their meaning, with
some additional quantities that are only defined for certain
:doc:`atom styles <atom_style>`. Basically, this augmented list gives
an input script access to any per-atom quantity stored by LAMMPS.
The list of possible attributes is essentially the same as that used
by the :doc:`dump custom <dump>` command, which describes their
meaning, with some additional quantities that are only defined for
certain :doc:`atom styles <atom_style>`. The goal of this augmented
list gives an input script access to any per-atom quantity stored by
LAMMPS.
The values are stored in a per-atom vector or array as discussed
below. Zeroes are stored for atoms not in the specified group or for
quantities that are not defined for a particular particle in the group
(e.g. *shapex* if the particle is not an ellipsoid).
Attributes *i_name*, *d_name*, *i2_name*, *d2_name* refer to custom
per-atom integer and floating-point vectors or arrays that have been
added via the :doc:`fix property/atom <fix_property_atom>` command.
When that command is used specific names are given to each attribute
which are the "name" portion of these attributes. For arrays *i2_name*
and *d2_name*, the column of the array must also be included following
the name in brackets: e.g. d2_xyz[2], i2_mySpin[3].
The additional quantities only accessible via this command, and not
directly via the :doc:`dump custom <dump>` command, are as follows.
*Nbonds* is available for all molecular atom styles and refers to the
number of explicit bonds assigned to an atom. Note that if the
:doc:`newton bond <newton>` command is set to *on*\ , which is the
default, then every bond in the system is assigned to only one of the
two atoms in the bond. Thus a bond between atoms I,J may be tallied
for either atom I or atom J. If :doc:`newton bond off <newton>` is
set, it will be tallied with both atom I and atom J.
*Shapex*, *shapey*, and *shapez* are defined for ellipsoidal particles
and define the 3d shape of each particle.
@ -146,19 +164,8 @@ line segment.
*corner2z*, *corner3x*, *corner3y*, *corner3z*, are defined for
triangular particles and define the corner points of each triangle.
*Nbonds* is available for all molecular atom styles and refers to the
number of explicit bonds assigned to an atom. Note that if the
:doc:`newton bond <newton>` command is set to *on*, which is the
default, then every bond in the system is assigned to only one of the
two atoms in the bond. Thus a bond between atoms I,J may be tallied
for either atom I or atom J. If :doc:`newton bond off <newton>` is
set, it will be tallied with both atom I and atom J.
The *i_name* and *d_name* attributes refer to custom integer and
floating-point properties that have been added to each atom via the
:doc:`fix property/atom <fix_property_atom>` command. When that
command is used specific names are given to each attribute which are
what is specified as the "name" portion of *i_name* or *d_name*.
In addition, the various per-atom quantities listed above for specific
packages are only accessible by this command.
Output info
"""""""""""

View File

@ -1,8 +1,11 @@
.. index:: compute temp/deform
.. index:: compute temp/deform/kk
compute temp/deform command
===========================
Accelerator Variants: *temp/deform/kk*
Syntax
""""""

View File

@ -54,8 +54,8 @@ or :doc:`read_restart <read_restart>` commands:
Restrictions
""""""""""""
This angle style can only be used if LAMMPS was built with the
MOLECULE package. See the :doc:`Build package <Build_package>` doc
This dihedral style can only be used if LAMMPS was built with the
EXTRA-MOLECULE package. See the :doc:`Build package <Build_package>` doc
page for more info.
Related commands

View File

@ -57,7 +57,7 @@ If *class2* is one of the dihedral hybrid styles, the same rule holds
for specifying additional AngleTorsion (and EndBondTorsion, etc)
coefficients either via the input script or in the data file.
I.e. *class2* must be added to each line after the dihedral type. For
lines in the AngleTorsion (or EndBondTorsion, etc) section of the data
lines in the AngleTorsion (or EndBondTorsion, etc) Coeffs section of the data
file for dihedral types that are not *class2*, you must use an
dihedral style of *skip* as a placeholder, e.g.

View File

@ -50,8 +50,8 @@ or :doc:`read_restart <read_restart>` commands:
Restrictions
""""""""""""
This angle style can only be used if LAMMPS was built with the
MOLECULE package. See the :doc:`Build package <Build_package>` doc
This dihedral style can only be used if LAMMPS was built with the
EXTRA-MOLECULE package. See the :doc:`Build package <Build_package>` doc
page for more info.
Related commands

View File

@ -55,8 +55,8 @@ radian\^2.
Restrictions
""""""""""""
This angle style can only be used if LAMMPS was built with the
MOLECULE package. See the :doc:`Build package <Build_package>` doc
This dihedral style can only be used if LAMMPS was built with the
EXTRA-MOLECULE package. See the :doc:`Build package <Build_package>` doc
page for more info.
Related commands

View File

@ -89,7 +89,7 @@ Restrictions
""""""""""""
This dihedral style can only be used if LAMMPS was built with the
MOLECULE package. See the :doc:`Build package <Build_package>` doc
EXTRA-MOLECULE package. See the :doc:`Build package <Build_package>` doc
page for more info.
Related commands

View File

@ -244,9 +244,10 @@ script after reading the restart file.
Restrictions
""""""""""""
These dihedral styles can only be used if LAMMPS was built with the
MOLECULE package. See the :doc:`Build package <Build_package>` doc
page for more info.
The *table* dihedral style can only be used if LAMMPS was built with the
MOLECULE package. The *table/cut* dihedral style can only be used if
LAMMPS was built with the EXTRA-MOLECULE package. See the
:doc:`Build package <Build_package>` doc page for more info.
Related commands
""""""""""""""""

View File

@ -80,7 +80,8 @@ Syntax
q, mux, muy, muz, mu,
radius, diameter, omegax, omegay, omegaz,
angmomx, angmomy, angmomz, tqx, tqy, tqz,
c_ID, c_ID[N], f_ID, f_ID[N], v_name
c_ID, c_ID[I], f_ID, f_ID[I], v_name,
i_name, d_name, i2_name[I], d2_name[I]
.. parsed-literal::
@ -110,8 +111,10 @@ Syntax
f_ID = per-atom vector calculated by a fix with ID
f_ID[I] = Ith column of per-atom array calculated by a fix with ID, I can include wildcard (see below)
v_name = per-atom vector calculated by an atom-style variable with name
d_name = per-atom floating point vector with name, managed by fix property/atom
i_name = per-atom integer vector with name, managed by fix property/atom
i_name = custom integer vector with name
d_name = custom floating point vector with name
i2_name[I] = Ith column of custom integer array with name, I can include wildcard (see below)
d2_name[I] = Ith column of custom floating point vector with name, I can include wildcard (see below)
* *local* or *local/gz* or *local/zstd* args = list of local attributes
@ -474,16 +477,15 @@ styles.
----------
Note that in the discussion which follows, for styles which can
reference values from a compute or fix, like the *custom*, *cfg*, or
*local* styles, the bracketed index I can be specified using a
wildcard asterisk with the index to effectively specify multiple
values. This takes the form "\*" or "\*n" or "n\*" or "m\*n". If N = the
size of the vector (for *mode* = scalar) or the number of columns in
the array (for *mode* = vector), then an asterisk with no numeric
values means all indices from 1 to N. A leading asterisk means all
indices from 1 to n (inclusive). A trailing asterisk means all
indices from n to N (inclusive). A middle asterisk means all indices
from m to n (inclusive).
reference values from a compute or fix or custom atom property, like
the *custom*\ , *cfg*\ , or *local* styles, the bracketed index I can
be specified using a wildcard asterisk with the index to effectively
specify multiple values. This takes the form "\*" or "\*n" or "n\*"
or "m\*n". If N = the number of columns in the array, then an
asterisk with no numeric values means all column indices from 1 to N.
A leading asterisk means all indices from 1 to n (inclusive). A
trailing asterisk means all indices from n to N (inclusive). A middle
asterisk means all indices from m to n (inclusive).
Using a wildcard is the same as if the individual columns of the array
had been listed one by one. E.g. these 2 dump commands are
@ -521,8 +523,9 @@ bonds and angles.
Note that computes which calculate global or per-atom quantities, as
opposed to local quantities, cannot be output in a dump local command.
Instead, global quantities can be output by the :doc:`thermo_style custom <thermo_style>` command, and per-atom quantities can be
output by the dump custom command.
Instead, global quantities can be output by the :doc:`thermo_style
custom <thermo_style>` command, and per-atom quantities can be output
by the dump custom command.
If *c_ID* is used as a attribute, then the local vector calculated by
the compute is printed. If *c_ID[I]* is used, then I must be in the
@ -566,10 +569,11 @@ Nprocs-1) that currently owns the atom. *Procp1* is the proc ID+1,
which can be convenient in place of a *type* attribute (1 to Ntypes)
for coloring atoms in a visualization program. *Type* is the atom
type (1 to Ntypes). *Element* is typically the chemical name of an
element, which you must assign to each type via the :doc:`dump_modify element <dump_modify>` command. More generally, it can be any
string you wish to associated with an atom type. *Mass* is the atom
mass. *Vx*, *vy*, *vz*, *fx*, *fy*, *fz*, and *q* are components of
atom velocity and force and atomic charge.
element, which you must assign to each type via the :doc:`dump_modify
element <dump_modify>` command. More generally, it can be any string
you wish to associated with an atom type. *Mass* is the atom mass.
*Vx*, *vy*, *vz*, *fx*, *fy*, *fz*, and *q* are components of atom
velocity and force and atomic charge.
There are several options for outputting atom coordinates. The *x*,
*y*, *z* attributes write atom coordinates "unscaled", in the
@ -643,11 +647,12 @@ above for how I can be specified with a wildcard asterisk to
effectively specify multiple values.
The *f_ID* and *f_ID[I]* attributes allow vector or array per-atom
quantities calculated by a :doc:`fix <fix>` to be output. The ID in the
attribute should be replaced by the actual ID of the fix that has been
defined previously in the input script. The :doc:`fix ave/atom <fix_ave_atom>` command is one that calculates per-atom
quantities. Since it can time-average per-atom quantities produced by
any :doc:`compute <compute>`, :doc:`fix <fix>`, or atom-style
quantities calculated by a :doc:`fix <fix>` to be output. The ID in
the attribute should be replaced by the actual ID of the fix that has
been defined previously in the input script. The :doc:`fix ave/atom
<fix_ave_atom>` command is one that calculates per-atom quantities.
Since it can time-average per-atom quantities produced by any
:doc:`compute <compute>`, :doc:`fix <fix>`, or atom-style
:doc:`variable <variable>`, this allows those time-averaged results to
be written to a dump file.
@ -664,14 +669,21 @@ should be replaced by the actual name of the variable that has been
defined previously in the input script. Only an atom-style variable
can be referenced, since it is the only style that generates per-atom
values. Variables of style *atom* can reference individual atom
attributes, per-atom attributes, thermodynamic keywords, or
invoke other computes, fixes, or variables when they are evaluated, so
this is a very general means of creating quantities to output to a
dump file.
attributes, per-atom attributes, thermodynamic keywords, or invoke
other computes, fixes, or variables when they are evaluated, so this
is a very general means of creating quantities to output to a dump
file.
The *d_name* and *i_name* attributes allow to output custom per atom
floating point or integer properties that are managed by
:doc:`fix property/atom <fix_property_atom>`.
The *i_name*, *d_name*, *i2_name*, *d2_name* attributes refer to
per-atom integer and floating-point vectors or arrays that have been
added via the :doc:`fix property/atom <fix_property_atom>` command.
When that command is used specific names are given to each attribute
which are the "name" portion of these keywords. For arrays *i2_name*
and *d2_name*, the column of the array must also be included following
the name in brackets: e.g. d2_xyz[I], i2_mySpin[I], where I is in the
range from 1-M, where M is the number of columns in the custom array.
See the discussion above for how I can be specified with a wildcard
asterisk to effectively specify multiple values.
See the :doc:`Modify <Modify>` page for information on how to add
new compute and fix styles to LAMMPS to calculate per-atom quantities

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