make code-block formatting more consistent and align with documented conventions

This commit is contained in:
Axel Kohlmeyer
2022-12-30 06:46:09 -05:00
parent 406289d0f9
commit 33711ac36e
19 changed files with 312 additions and 266 deletions

View File

@ -276,7 +276,7 @@ LAMMPS.
Parallel build (see ``src/MAKE/Makefile.mpi``): Parallel build (see ``src/MAKE/Makefile.mpi``):
.. code-block:: bash .. code-block:: make
CC = mpicxx CC = mpicxx
CCFLAGS = -g -O3 CCFLAGS = -g -O3
@ -296,7 +296,7 @@ LAMMPS.
If compilation stops with a message like the following: If compilation stops with a message like the following:
.. code-block:: .. code-block:: output
g++ -g -O3 -DLAMMPS_GZIP -DLAMMPS_MEMALIGN=64 -I../STUBS -c ../main.cpp g++ -g -O3 -DLAMMPS_GZIP -DLAMMPS_MEMALIGN=64 -I../STUBS -c ../main.cpp
In file included from ../pointers.h:24:0, In file included from ../pointers.h:24:0,

View File

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

View File

@ -12,11 +12,11 @@ in addition to
- Traditional make - Traditional make
* - .. code-block:: bash * - .. code-block:: bash
$ cmake -D PKG_NAME=yes cmake -D PKG_NAME=yes
- .. code-block:: bash - .. code-block:: console
$ make yes-name make yes-name
as described on the :doc:`Build_package <Build_package>` page. as described on the :doc:`Build_package <Build_package>` page.
@ -242,10 +242,10 @@ script with the specified args:
.. code-block:: bash .. code-block:: bash
$ make lib-gpu # print help message make lib-gpu # print help message
$ make lib-gpu args="-b" # build GPU library with default Makefile.linux make lib-gpu args="-b" # build GPU library with default Makefile.linux
$ make lib-gpu args="-m xk7 -p single -o xk7.single" # create new Makefile.xk7.single, altered for single-precision make lib-gpu args="-m xk7 -p single -o xk7.single" # create new Makefile.xk7.single, altered for single-precision
$ make lib-gpu args="-m mpi -a sm_60 -p mixed -b" # build GPU library with mixed precision and P100 using other settings in Makefile.mpi make lib-gpu args="-m mpi -a sm_60 -p mixed -b" # build GPU library with mixed precision and P100 using other settings in Makefile.mpi
Note that this procedure starts with a Makefile.machine in lib/gpu, as Note that this procedure starts with a Makefile.machine in lib/gpu, as
specified by the "-m" switch. For your convenience, machine makefiles specified by the "-m" switch. For your convenience, machine makefiles
@ -358,13 +358,13 @@ minutes to hours) to build. Of course you only need to do that once.)
.. code-block:: bash .. code-block:: bash
$ make lib-kim # print help message make lib-kim # print help message
$ make lib-kim args="-b " # (re-)install KIM API lib with only example models make lib-kim args="-b " # (re-)install KIM API lib with only example models
$ make lib-kim args="-b -a Glue_Ercolessi_Adams_Al__MO_324507536345_001" # ditto plus one model make lib-kim args="-b -a Glue_Ercolessi_Adams_Al__MO_324507536345_001" # ditto plus one model
$ make lib-kim args="-b -a everything" # install KIM API lib with all models make lib-kim args="-b -a everything" # install KIM API lib with all models
$ make lib-kim args="-n -a EAM_Dynamo_Ackland_W__MO_141627196590_002" # add one model or model driver make lib-kim args="-n -a EAM_Dynamo_Ackland_W__MO_141627196590_002" # add one model or model driver
$ make lib-kim args="-p /usr/local" # use an existing KIM API installation at the provided location make lib-kim args="-p /usr/local" # use an existing KIM API installation at the provided location
$ make lib-kim args="-p /usr/local -a EAM_Dynamo_Ackland_W__MO_141627196590_002" # ditto but add one model or driver make lib-kim args="-p /usr/local -a EAM_Dynamo_Ackland_W__MO_141627196590_002" # ditto but add one model or driver
When using the "-b " option, the KIM library is built using its native When using the "-b " option, the KIM library is built using its native
cmake build system. The ``lib/kim/Install.py`` script supports a cmake build system. The ``lib/kim/Install.py`` script supports a
@ -376,7 +376,7 @@ minutes to hours) to build. Of course you only need to do that once.)
.. code-block:: bash .. code-block:: bash
$ CMAKE=cmake3 CXX=g++-11 CC=gcc-11 FC=gfortran-11 make lib-kim args="-b " # (re-)install KIM API lib using cmake3 and gnu v11 compilers with only example models CMAKE=cmake3 CXX=g++-11 CC=gcc-11 FC=gfortran-11 make lib-kim args="-b " # (re-)install KIM API lib using cmake3 and gnu v11 compilers with only example models
Settings for debugging OpenKIM web queries discussed below need to Settings for debugging OpenKIM web queries discussed below need to
be applied by adding them to the ``LMP_INC`` variable through be applied by adding them to the ``LMP_INC`` variable through
@ -859,10 +859,10 @@ library.
.. code-block:: bash .. code-block:: bash
$ make lib-latte # print help message make lib-latte # print help message
$ make lib-latte args="-b" # download and build in lib/latte/LATTE-master make lib-latte args="-b" # download and build in lib/latte/LATTE-master
$ make lib-latte args="-p $HOME/latte" # use existing LATTE installation in $HOME/latte make lib-latte args="-p $HOME/latte" # use existing LATTE installation in $HOME/latte
$ make lib-latte args="-b -m gfortran" # download and build in lib/latte and make lib-latte args="-b -m gfortran" # download and build in lib/latte and
# copy Makefile.lammps.gfortran to Makefile.lammps # copy Makefile.lammps.gfortran to Makefile.lammps
Note that 3 symbolic (soft) links, ``includelink`` and ``liblink`` Note that 3 symbolic (soft) links, ``includelink`` and ``liblink``
@ -962,12 +962,12 @@ more details.
.. code-block:: bash .. code-block:: bash
$ make lib-mscg # print help message make lib-mscg # print help message
$ make lib-mscg args="-b -m serial" # download and build in lib/mscg/MSCG-release-master make lib-mscg args="-b -m serial" # download and build in lib/mscg/MSCG-release-master
# with the settings compatible with "make serial" # with the settings compatible with "make serial"
$ make lib-mscg args="-b -m mpi" # download and build in lib/mscg/MSCG-release-master make lib-mscg args="-b -m mpi" # download and build in lib/mscg/MSCG-release-master
# with the settings compatible with "make mpi" # with the settings compatible with "make mpi"
$ make lib-mscg args="-p /usr/local/mscg-release" # use the existing MS-CG installation in /usr/local/mscg-release make lib-mscg args="-p /usr/local/mscg-release" # use the existing MS-CG installation in /usr/local/mscg-release
Note that 2 symbolic (soft) links, ``includelink`` and ``liblink``, Note that 2 symbolic (soft) links, ``includelink`` and ``liblink``,
will be created in ``lib/mscg`` to point to the MS-CG will be created in ``lib/mscg`` to point to the MS-CG
@ -1019,10 +1019,10 @@ POEMS package
.. code-block:: bash .. code-block:: bash
$ make lib-poems # print help message make lib-poems # print help message
$ make lib-poems args="-m serial" # build with GNU g++ compiler (settings as with "make serial") make lib-poems args="-m serial" # build with GNU g++ compiler (settings as with "make serial")
$ make lib-poems args="-m mpi" # build with default MPI C++ compiler (settings as with "make mpi") make lib-poems args="-m mpi" # build with default MPI C++ compiler (settings as with "make mpi")
$ make lib-poems args="-m icc" # build with Intel icc compiler make lib-poems args="-m icc" # build with Intel icc compiler
The build should produce two files: ``lib/poems/libpoems.a`` and The build should produce two files: ``lib/poems/libpoems.a`` and
``lib/poems/Makefile.lammps``. The latter is copied from an ``lib/poems/Makefile.lammps``. The latter is copied from an
@ -1108,10 +1108,10 @@ binary package provided by your operating system.
.. code-block:: bash .. code-block:: bash
$ make lib-voronoi # print help message make lib-voronoi # print help message
$ make lib-voronoi args="-b" # download and build the default version in lib/voronoi/voro++-<version> make lib-voronoi args="-b" # download and build the default version in lib/voronoi/voro++-<version>
$ make lib-voronoi args="-p $HOME/voro++" # use existing Voro++ installation in $HOME/voro++ make lib-voronoi args="-p $HOME/voro++" # use existing Voro++ installation in $HOME/voro++
$ make lib-voronoi args="-b -v voro++0.4.6" # download and build the 0.4.6 version in lib/voronoi/voro++-0.4.6 make lib-voronoi args="-b -v voro++0.4.6" # download and build the 0.4.6 version in lib/voronoi/voro++-0.4.6
Note that 2 symbolic (soft) links, ``includelink`` and Note that 2 symbolic (soft) links, ``includelink`` and
``liblink``, are created in lib/voronoi to point to the Voro++ ``liblink``, are created in lib/voronoi to point to the Voro++
@ -1152,13 +1152,13 @@ systems.
.. code-block:: bash .. code-block:: bash
$ make yes-adios make yes-adios
otherwise, set ADIOS2_DIR environment variable when turning on the package: otherwise, set ADIOS2_DIR environment variable when turning on the package:
.. code-block:: bash .. code-block:: bash
$ ADIOS2_DIR=path make yes-adios # path is where ADIOS 2.x is installed ADIOS2_DIR=path make yes-adios # path is where ADIOS 2.x is installed
---------- ----------
@ -1187,10 +1187,10 @@ The ATC package requires the MANYBODY package also be installed.
.. code-block:: bash .. code-block:: bash
$ make lib-atc # print help message make lib-atc # print help message
$ make lib-atc args="-m serial" # build with GNU g++ compiler and MPI STUBS (settings as with "make serial") make lib-atc args="-m serial" # build with GNU g++ compiler and MPI STUBS (settings as with "make serial")
$ make lib-atc args="-m mpi" # build with default MPI compiler (settings as with "make mpi") make lib-atc args="-m mpi" # build with default MPI compiler (settings as with "make mpi")
$ make lib-atc args="-m icc" # build with Intel icc compiler make lib-atc args="-m icc" # build with Intel icc compiler
The build should produce two files: ``lib/atc/libatc.a`` and The build should produce two files: ``lib/atc/libatc.a`` and
``lib/atc/Makefile.lammps``. The latter is copied from an ``lib/atc/Makefile.lammps``. The latter is copied from an
@ -1209,10 +1209,10 @@ The ATC package requires the MANYBODY package also be installed.
.. code-block:: bash .. code-block:: bash
$ make lib-linalg # print help message make lib-linalg # print help message
$ make lib-linalg args="-m serial" # build with GNU Fortran compiler (settings as with "make serial") make lib-linalg args="-m serial" # build with GNU Fortran compiler (settings as with "make serial")
$ make lib-linalg args="-m mpi" # build with default MPI Fortran compiler (settings as with "make mpi") make lib-linalg args="-m mpi" # build with default MPI Fortran compiler (settings as with "make mpi")
$ make lib-linalg args="-m gfortran" # build with GNU Fortran compiler make lib-linalg args="-m gfortran" # build with GNU Fortran compiler
---------- ----------
@ -1238,10 +1238,10 @@ AWPMD package
.. code-block:: bash .. code-block:: bash
$ make lib-awpmd # print help message make lib-awpmd # print help message
$ make lib-awpmd args="-m serial" # build with GNU g++ compiler and MPI STUBS (settings as with "make serial") make lib-awpmd args="-m serial" # build with GNU g++ compiler and MPI STUBS (settings as with "make serial")
$ make lib-awpmd args="-m mpi" # build with default MPI compiler (settings as with "make mpi") make lib-awpmd args="-m mpi" # build with default MPI compiler (settings as with "make mpi")
$ make lib-awpmd args="-m icc" # build with Intel icc compiler make lib-awpmd args="-m icc" # build with Intel icc compiler
The build should produce two files: ``lib/awpmd/libawpmd.a`` and The build should produce two files: ``lib/awpmd/libawpmd.a`` and
``lib/awpmd/Makefile.lammps``. The latter is copied from an ``lib/awpmd/Makefile.lammps``. The latter is copied from an
@ -1260,10 +1260,10 @@ AWPMD package
.. code-block:: bash .. code-block:: bash
$ make lib-linalg # print help message make lib-linalg # print help message
$ make lib-linalg args="-m serial" # build with GNU Fortran compiler (settings as with "make serial") make lib-linalg args="-m serial" # build with GNU Fortran compiler (settings as with "make serial")
$ make lib-linalg args="-m mpi" # build with default MPI Fortran compiler (settings as with "make mpi") make lib-linalg args="-m mpi" # build with default MPI Fortran compiler (settings as with "make mpi")
$ make lib-linalg args="-m gfortran" # build with GNU Fortran compiler make lib-linalg args="-m gfortran" # build with GNU Fortran compiler
---------- ----------
@ -1301,10 +1301,10 @@ be built for the most part with all major versions of the C++ language.
.. code-block:: bash .. code-block:: bash
$ make lib-colvars # print help message make lib-colvars # print help message
$ make lib-colvars args="-m serial" # build with GNU g++ compiler (settings as with "make serial") make lib-colvars args="-m serial" # build with GNU g++ compiler (settings as with "make serial")
$ make lib-colvars args="-m mpi" # build with default MPI compiler (settings as with "make mpi") make lib-colvars args="-m mpi" # build with default MPI compiler (settings as with "make mpi")
$ make lib-colvars args="-m g++-debug" # build with GNU g++ compiler and colvars debugging enabled make lib-colvars args="-m g++-debug" # build with GNU g++ compiler and colvars debugging enabled
The "machine" argument of the "-m" flag is used to find a The "machine" argument of the "-m" flag is used to find a
Makefile.machine to use as build recipe. If it does not already Makefile.machine to use as build recipe. If it does not already
@ -1316,8 +1316,8 @@ be built for the most part with all major versions of the C++ language.
.. code-block:: bash .. code-block:: bash
$ COLVARS_DEBUG=yes make lib-colvars args="-m machine" # Build with debug code (much slower) COLVARS_DEBUG=yes make lib-colvars args="-m machine" # Build with debug code (much slower)
$ COLVARS_LEPTON=no make lib-colvars args="-m machine" # Build without Lepton (included otherwise) COLVARS_LEPTON=no make lib-colvars args="-m machine" # Build without Lepton (included otherwise)
The build should produce two files: the library ``lib/colvars/libcolvars.a`` The build should produce two files: the library ``lib/colvars/libcolvars.a``
(which also includes Lepton objects if enabled) and the specification file (which also includes Lepton objects if enabled) and the specification file
@ -1351,9 +1351,9 @@ This package depends on the KSPACE package.
.. code-block:: bash .. code-block:: bash
$ make lib-electrode # print help message make lib-electrode # print help message
$ make lib-electrode args="-m serial" # build with GNU g++ compiler and MPI STUBS (settings as with "make serial") make lib-electrode args="-m serial" # build with GNU g++ compiler and MPI STUBS (settings as with "make serial")
$ make lib-electrode args="-m mpi" # build with default MPI compiler (settings as with "make mpi") make lib-electrode args="-m mpi" # build with default MPI compiler (settings as with "make mpi")
Note that the ``Makefile.lammps`` file has settings for the BLAS Note that the ``Makefile.lammps`` file has settings for the BLAS
@ -1364,10 +1364,10 @@ This package depends on the KSPACE package.
.. code-block:: bash .. code-block:: bash
$ make lib-linalg # print help message make lib-linalg # print help message
$ make lib-linalg args="-m serial" # build with GNU Fortran compiler (settings as with "make serial") make lib-linalg args="-m serial" # build with GNU Fortran compiler (settings as with "make serial")
$ make lib-linalg args="-m mpi" # build with default MPI Fortran compiler (settings as with "make mpi") make lib-linalg args="-m mpi" # build with default MPI Fortran compiler (settings as with "make mpi")
$ make lib-linalg args="-m gfortran" # build with GNU Fortran compiler make lib-linalg args="-m gfortran" # build with GNU Fortran compiler
The package itself is activated with ``make yes-KSPACE`` and The package itself is activated with ``make yes-KSPACE`` and
``make yes-ELECTRODE`` ``make yes-ELECTRODE``
@ -1407,8 +1407,8 @@ at: `https://github.com/ICAMS/lammps-user-pace/ <https://github.com/ICAMS/lammps
.. code-block:: bash .. code-block:: bash
$ make lib-pace # print help message make lib-pace # print help message
$ make lib-pace args="-b" # download and build the default version in lib/pace make lib-pace args="-b" # download and build the default version in lib/pace
You should not need to edit the ``lib/pace/Makefile.lammps`` file. You should not need to edit the ``lib/pace/Makefile.lammps`` file.
@ -1435,10 +1435,10 @@ ML-POD package
.. code-block:: bash .. code-block:: bash
$ make lib-mlpod # print help message make lib-mlpod # print help message
$ make lib-mlpod args="-m serial" # build with GNU g++ compiler and MPI STUBS (settings as with "make serial") make lib-mlpod args="-m serial" # build with GNU g++ compiler and MPI STUBS (settings as with "make serial")
$ make lib-mlpod args="-m mpi" # build with default MPI compiler (settings as with "make mpi") make lib-mlpod args="-m mpi" # build with default MPI compiler (settings as with "make mpi")
$ make lib-mlpod args="-m mpi -e linalg" # same as above but use the bundled linalg lib make lib-mlpod args="-m mpi -e linalg" # same as above but use the bundled linalg lib
Note that the ``Makefile.lammps`` file has settings to use the BLAS Note that the ``Makefile.lammps`` file has settings to use the BLAS
and LAPACK linear algebra libraries. These can either exist on and LAPACK linear algebra libraries. These can either exist on
@ -1448,10 +1448,10 @@ ML-POD package
.. code-block:: bash .. code-block:: bash
$ make lib-linalg # print help message make lib-linalg # print help message
$ make lib-linalg args="-m serial" # build with GNU Fortran compiler (settings as with "make serial") make lib-linalg args="-m serial" # build with GNU Fortran compiler (settings as with "make serial")
$ make lib-linalg args="-m mpi" # build with default MPI Fortran compiler (settings as with "make mpi") make lib-linalg args="-m mpi" # build with default MPI Fortran compiler (settings as with "make mpi")
$ make lib-linalg args="-m gfortran" # build with GNU Fortran compiler make lib-linalg args="-m gfortran" # build with GNU Fortran compiler
The package itself is activated with ``make yes-ML-POD``. The package itself is activated with ``make yes-ML-POD``.
@ -1550,10 +1550,10 @@ LAMMPS build.
.. code-block:: bash .. code-block:: bash
$ make lib-plumed # print help message make lib-plumed # print help message
$ make lib-plumed args="-b" # download and build PLUMED in lib/plumed/plumed2 make lib-plumed args="-b" # download and build PLUMED in lib/plumed/plumed2
$ make lib-plumed args="-p $HOME/.local" # use existing PLUMED installation in $HOME/.local make lib-plumed args="-p $HOME/.local" # use existing PLUMED installation in $HOME/.local
$ make lib-plumed args="-p /usr/local -m shared" # use existing PLUMED installation in make lib-plumed args="-p /usr/local -m shared" # use existing PLUMED installation in
# /usr/local and use shared linkage mode # /usr/local and use shared linkage mode
Note that 2 symbolic (soft) links, ``includelink`` and ``liblink`` Note that 2 symbolic (soft) links, ``includelink`` and ``liblink``
@ -1566,8 +1566,8 @@ LAMMPS build.
.. code-block:: bash .. code-block:: bash
$ make yes-plumed make yes-plumed
$ make machine make machine
Once this compilation completes you should be able to run LAMMPS Once this compilation completes you should be able to run LAMMPS
in the usual way. For shared linkage mode, libplumed.so must be in the usual way. For shared linkage mode, libplumed.so must be
@ -1619,8 +1619,8 @@ the HDF5 library.
.. code-block:: bash .. code-block:: bash
$ make lib-h5md # print help message make lib-h5md # print help message
$ make lib-h5md args="-m h5cc" # build with h5cc compiler make lib-h5md args="-m h5cc" # build with h5cc compiler
The build should produce two files: ``lib/h5md/libch5md.a`` and The build should produce two files: ``lib/h5md/libch5md.a`` and
``lib/h5md/Makefile.lammps``. The latter is copied from an ``lib/h5md/Makefile.lammps``. The latter is copied from an
@ -1674,10 +1674,10 @@ details please see ``lib/hdnnp/README`` and the `n2p2 build documentation
.. code-block:: bash .. code-block:: bash
$ make lib-hdnnp # print help message make lib-hdnnp # print help message
$ make lib-hdnnp args="-b" # download and build in lib/hdnnp/n2p2-... make lib-hdnnp args="-b" # download and build in lib/hdnnp/n2p2-...
$ make lib-hdnnp args="-b -v 2.1.4" # download and build specific version make lib-hdnnp args="-b -v 2.1.4" # download and build specific version
$ make lib-hdnnp args="-p /usr/local/n2p2" # use the existing n2p2 installation in /usr/local/n2p2 make lib-hdnnp args="-p /usr/local/n2p2" # use the existing n2p2 installation in /usr/local/n2p2
Note that 3 symbolic (soft) links, ``includelink``, ``liblink`` and Note that 3 symbolic (soft) links, ``includelink``, ``liblink`` and
``Makefile.lammps``, will be created in ``lib/hdnnp`` to point to ``Makefile.lammps``, will be created in ``lib/hdnnp`` to point to
@ -1777,8 +1777,8 @@ MDI package
.. code-block:: bash .. code-block:: bash
$ python Install.py -m gcc # build using gcc compiler python Install.py -m gcc # build using gcc compiler
$ python Install.py -m icc # build using icc compiler python Install.py -m icc # build using icc compiler
The build should produce two files: ``lib/mdi/includelink/mdi.h`` The build should produce two files: ``lib/mdi/includelink/mdi.h``
and ``lib/mdi/liblink/libmdi.so``\ . and ``lib/mdi/liblink/libmdi.so``\ .
@ -1812,9 +1812,9 @@ they will be downloaded the first time this package is installed.
.. code-block:: bash .. code-block:: bash
$ make lib-mesont # print help message make lib-mesont # print help message
$ make lib-mesont args="-m gfortran" # build with GNU g++ compiler (settings as with "make serial") make lib-mesont args="-m gfortran" # build with GNU g++ compiler (settings as with "make serial")
$ make lib-mesont args="-m ifort" # build with Intel icc compiler make lib-mesont args="-m ifort" # build with Intel icc compiler
The build should produce two files: ``lib/mesont/libmesont.a`` and The build should produce two files: ``lib/mesont/libmesont.a`` and
``lib/mesont/Makefile.lammps``\ . The latter is copied from an ``lib/mesont/Makefile.lammps``\ . The latter is copied from an
@ -1981,10 +1981,10 @@ verified to work in February 2020 with Quantum Espresso versions 6.3 to
.. code-block:: bash .. code-block:: bash
$ make lib-qmmm # print help message make lib-qmmm # print help message
$ make lib-qmmm args="-m serial" # build with GNU Fortran compiler (settings as in "make serial") make lib-qmmm args="-m serial" # build with GNU Fortran compiler (settings as in "make serial")
$ make lib-qmmm args="-m mpi" # build with default MPI compiler (settings as in "make mpi") make lib-qmmm args="-m mpi" # build with default MPI compiler (settings as in "make mpi")
$ make lib-qmmm args="-m gfortran" # build with GNU Fortran compiler make lib-qmmm args="-m gfortran" # build with GNU Fortran compiler
The build should produce two files: ``lib/qmmm/libqmmm.a`` and The build should produce two files: ``lib/qmmm/libqmmm.a`` and
``lib/qmmm/Makefile.lammps``. The latter is copied from an ``lib/qmmm/Makefile.lammps``. The latter is copied from an
@ -2133,9 +2133,9 @@ Eigen3 is a template library, so you do not need to build it.
.. code-block:: bash .. code-block:: bash
$ make lib-smd # print help message make lib-smd # print help message
$ make lib-smd args="-b" # download to lib/smd/eigen3 make lib-smd args="-b" # download to lib/smd/eigen3
$ make lib-smd args="-p /usr/include/eigen3" # use existing Eigen installation in /usr/include/eigen3 make lib-smd args="-p /usr/include/eigen3" # use existing Eigen installation in /usr/include/eigen3
Note that a symbolic (soft) link named ``includelink`` is created Note that a symbolic (soft) link named ``includelink`` is created
in ``lib/smd`` to point to the Eigen dir. When LAMMPS builds it in ``lib/smd`` to point to the Eigen dir. When LAMMPS builds it

View File

@ -209,7 +209,7 @@ You can verify whether all required shared libraries are found with the
.. code-block:: bash .. code-block:: bash
$ LD_LIBRARY_PATH=/home/user/lammps/src ldd caller LD_LIBRARY_PATH=/home/user/lammps/src ldd caller
linux-vdso.so.1 (0x00007ffe729e0000) linux-vdso.so.1 (0x00007ffe729e0000)
liblammps.so => /home/user/lammps/src/liblammps.so (0x00007fc91bb9e000) liblammps.so => /home/user/lammps/src/liblammps.so (0x00007fc91bb9e000)
libstdc++.so.6 => /lib64/libstdc++.so.6 (0x00007fc91b984000) libstdc++.so.6 => /lib64/libstdc++.so.6 (0x00007fc91b984000)
@ -222,7 +222,7 @@ If a required library is missing, you would get a 'not found' entry:
.. code-block:: bash .. code-block:: bash
$ ldd caller ldd caller
linux-vdso.so.1 (0x00007ffd672fe000) linux-vdso.so.1 (0x00007ffd672fe000)
liblammps.so => not found liblammps.so => not found
libstdc++.so.6 => /usr/lib64/libstdc++.so.6 (0x00007fb7c7e86000) libstdc++.so.6 => /usr/lib64/libstdc++.so.6 (0x00007fb7c7e86000)

View File

@ -489,7 +489,7 @@ to update the YAML files. Running a command like
.. code-block:: bash .. code-block:: bash
$ test_pair_style mol-pair-lennard_mdf.yaml -g new.yaml test_pair_style mol-pair-lennard_mdf.yaml -g new.yaml
will read the settings from the ``mol-pair-lennard_mdf.yaml`` file and then compute will read the settings from the ``mol-pair-lennard_mdf.yaml`` file and then compute
the reference data and write a new file with to ``new.yaml``. If this step fails, the reference data and write a new file with to ``new.yaml``. If this step fails,
@ -500,13 +500,13 @@ It is also possible to do an update in place with:
.. code-block:: bash .. code-block:: bash
$ test_pair_style mol-pair-lennard_mdf.yaml -u test_pair_style mol-pair-lennard_mdf.yaml -u
And one can finally run the full set of tests with: And one can finally run the full set of tests with:
.. code-block:: bash .. code-block:: bash
$ test_pair_style mol-pair-lennard_mdf.yaml test_pair_style mol-pair-lennard_mdf.yaml
This will just print a summary of the groups of tests. When using the "-v" flag This will just print a summary of the groups of tests. When using the "-v" flag
the test will also keep any LAMMPS output and when using the "-s" flag, there the test will also keep any LAMMPS output and when using the "-s" flag, there

View File

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

View File

@ -2391,7 +2391,7 @@ Procedures Bound to the :f:type:`lammps` Derived Type
mode. The function should have Fortran language bindings with the following mode. The function should have Fortran language bindings with the following
interface, which depends on how LAMMPS was compiled: interface, which depends on how LAMMPS was compiled:
.. code-block:: Fortran .. code-block:: fortran
ABSTRACT INTERFACE ABSTRACT INTERFACE
SUBROUTINE external_callback(caller, timestep, ids, x, fexternal) SUBROUTINE external_callback(caller, timestep, ids, x, fexternal)
@ -2450,7 +2450,7 @@ Procedures Bound to the :f:type:`lammps` Derived Type
with ``-DLAMMPS_SMALLBIG``) that applies something akin to Hooke's Law with ``-DLAMMPS_SMALLBIG``) that applies something akin to Hooke's Law
(with each atom having a different *k* value) is shown below. (with each atom having a different *k* value) is shown below.
.. code-block:: Fortran .. code-block:: fortran
MODULE stuff MODULE stuff
USE, INTRINSIC :: ISO_C_BINDING, ONLY : c_int, c_double, c_int64_t USE, INTRINSIC :: ISO_C_BINDING, ONLY : c_int, c_double, c_int64_t

View File

@ -56,7 +56,7 @@ You should change into the top level directory of the LAMMPS source tree all
paths mentioned in the tutorial are relative to that. Immediately after downloading paths mentioned in the tutorial are relative to that. Immediately after downloading
it should look like this: it should look like this:
.. code-block:: bash .. code-block:: console
$ ls $ ls
bench doc lib potentials README tools bench doc lib potentials README tools
@ -104,7 +104,7 @@ the progress of the configuration printed to the screen followed by a
summary of the enabled features, options and compiler settings. A typical summary of the enabled features, options and compiler settings. A typical
summary screen will look like this: summary screen will look like this:
.. code-block:: .. code-block:: console
$ cmake ../cmake/ $ cmake ../cmake/
-- The CXX compiler identification is GNU 8.2.0 -- The CXX compiler identification is GNU 8.2.0

View File

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

View File

@ -41,7 +41,7 @@ create a local copy of the LAMMPS repository with a command like:
.. code-block:: bash .. code-block:: bash
$ git clone -b release https://github.com/lammps/lammps.git mylammps git clone -b release https://github.com/lammps/lammps.git mylammps
where "mylammps" is the name of the directory you wish to create on where "mylammps" is the name of the directory you wish to create on
your machine and "release" is one of the 3 branches listed above. your machine and "release" is one of the 3 branches listed above.
@ -78,10 +78,10 @@ from within the "mylammps" directory:
.. code-block:: bash .. code-block:: bash
$ git checkout release # not needed if you always stay in this branch git checkout release # not needed if you always stay in this branch
$ git checkout stable # use one of these 3 checkout commands git checkout stable # use one of these 3 checkout commands
$ git checkout develop # to choose the branch to follow git checkout develop # to choose the branch to follow
$ git pull git pull
Doing a "pull" will not change any files you have added to the LAMMPS Doing a "pull" will not change any files you have added to the LAMMPS
directory structure. It will also not change any existing LAMMPS directory structure. It will also not change any existing LAMMPS
@ -97,7 +97,7 @@ this is as follows.
.. code-block:: bash .. code-block:: bash
$ git checkout tagID git checkout tagID
Stable versions and what tagID to use for a particular stable version Stable versions and what tagID to use for a particular stable version
are discussed on `this page <https://www.lammps.org/bug.html#version>`_. are discussed on `this page <https://www.lammps.org/bug.html#version>`_.
@ -138,13 +138,13 @@ changed. How to do this depends on the build system you are using.
.. code-block:: bash .. code-block:: bash
$ make purge # remove any deprecated src files make purge # remove any deprecated src files
$ make package-update # sync package files with src files make package-update # sync package files with src files
$ make foo # re-build for your machine (mpi, serial, etc) make foo # re-build for your machine (mpi, serial, etc)
to enforce consistency of the source between the src folder to enforce consistency of the source between the src folder
and package directories. This is OK to do even if you don't and package directories. This is OK to do even if you don't
use any packages. The "make purge" command removes any deprecated use any packages. The ``make purge`` command removes any deprecated
src files if they were removed by the patch from a package src files if they were removed by the patch from a package
sub-directory. sub-directory.
@ -160,9 +160,9 @@ changed. How to do this depends on the build system you are using.
:class: note :class: note
The servers at github.com support the "https://" access protocol for The servers at github.com support the "https://" access protocol for
anonymous, read-only access. If you have a suitably configured GitHub anonymous, read-only access. If you have a suitably configured
account, you may also use SSH protocol with the GitHub account, you may also use SSH protocol with the URL
URL "git@github.com:lammps/lammps.git". "git@github.com:lammps/lammps.git".
The LAMMPS GitHub project is currently managed by Axel Kohlmeyer The LAMMPS GitHub project is currently managed by Axel Kohlmeyer
(Temple U, akohlmey at gmail.com). (Temple U, akohlmey at gmail.com).

View File

@ -34,7 +34,7 @@ To install LAMMPS do the following once:
.. code-block:: bash .. code-block:: bash
$ sudo apt-get install lammps sudo apt-get install lammps
This downloads an executable named ``lmp`` to your box and multiple This downloads an executable named ``lmp`` to your box and multiple
packages with supporting data, examples and libraries as well as any packages with supporting data, examples and libraries as well as any
@ -43,13 +43,13 @@ to run input scripts:
.. code-block:: bash .. code-block:: bash
$ lmp -in in.lj lmp -in in.lj
To update LAMMPS to the latest packaged version, do the following: To update LAMMPS to the latest packaged version, do the following:
.. code-block:: bash .. code-block:: bash
$ sudo apt-get update sudo apt-get update
which will also update other packages on your system. which will also update other packages on your system.
@ -61,14 +61,14 @@ package
.. code-block:: bash .. code-block:: bash
$ sudo apt-get install openkim-models sudo apt-get install openkim-models
Or use the KIM-API commands to download and install individual models. Or use the KIM-API commands to download and install individual models.
To un-install LAMMPS, do the following: To un-install LAMMPS, do the following:
.. code-block:: bash .. code-block:: bash
$ sudo apt-get remove lammps sudo apt-get remove lammps
Please use ``lmp -help`` to see which compilation options, packages, Please use ``lmp -help`` to see which compilation options, packages,
and styles are included in the binary. and styles are included in the binary.
@ -103,9 +103,9 @@ To install LAMMPS with OpenMPI and run an input ``in.lj`` with 2 CPUs do:
.. code-block:: bash .. code-block:: bash
$ dnf install lammps-openmpi dnf install lammps-openmpi
$ module load mpi/openmpi-x86_64 module load mpi/openmpi-x86_64
$ mpirun -np 2 lmp -in in.lj mpirun -np 2 lmp -in in.lj
The ``dnf install`` command is needed only once. In case of a new LAMMPS The ``dnf install`` command is needed only once. In case of a new LAMMPS
stable release, ``dnf update`` will automatically update to the newer stable release, ``dnf update`` will automatically update to the newer
@ -121,7 +121,7 @@ can install the `openkim-models` package
.. code-block:: bash .. code-block:: bash
$ dnf install openkim-models dnf install openkim-models
Please use ``lmp -help`` to see which compilation options, packages, Please use ``lmp -help`` to see which compilation options, packages,
and styles are included in the binary. and styles are included in the binary.
@ -162,14 +162,14 @@ in OpenSuse as of Leap 15.0. You can install the package with:
.. code-block:: bash .. code-block:: bash
$ zypper install lammps zypper install lammps
This includes support for OpenMPI. The name of the LAMMPS executable This includes support for OpenMPI. The name of the LAMMPS executable
is ``lmp``. Thus to run an input in parallel on 2 CPUs you would do: is ``lmp``. Thus to run an input in parallel on 2 CPUs you would do:
.. code-block:: bash .. code-block:: bash
$ mpirun -np 2 lmp -in in.lj mpirun -np 2 lmp -in in.lj
Please use ``lmp -help`` to see which compilation options, packages, Please use ``lmp -help`` to see which compilation options, packages,
and styles are included in the binary. and styles are included in the binary.
@ -181,7 +181,7 @@ can install the `openkim-models` package
.. code-block:: bash .. code-block:: bash
$ zypper install openkim-models zypper install openkim-models
Thanks to Christoph Junghans (LANL) for making LAMMPS available in OpenSuse. Thanks to Christoph Junghans (LANL) for making LAMMPS available in OpenSuse.
@ -229,10 +229,10 @@ any of the above names in-place of lammps.
.. code-block:: bash .. code-block:: bash
$ git clone https://aur.archlinux.org/lammps.git git clone https://aur.archlinux.org/lammps.git
$ cd lammps cd lammps
$ makepkg -s makepkg -s
$ makepkg -i makepkg -i
To update, you may repeat the above, or change into the cloned directory, To update, you may repeat the above, or change into the cloned directory,
and execute the following, after which, if there are any changes, you may and execute the following, after which, if there are any changes, you may
@ -240,7 +240,7 @@ use makepkg as above.
.. code-block:: bash .. code-block:: bash
$ git pull git pull
Alternatively, you may use an AUR helper to install these packages. Alternatively, you may use an AUR helper to install these packages.

View File

@ -26,7 +26,7 @@ command:
.. code-block:: bash .. code-block:: bash
$ tar -xzvf lammps*.tar.gz tar -xzvf lammps*.tar.gz
This will create a LAMMPS directory with the version date This will create a LAMMPS directory with the version date
in its name, e.g. lammps-23Jun18. in its name, e.g. lammps-23Jun18.
@ -40,7 +40,7 @@ with the following command, to create a lammps-<version> dir:
.. code-block:: bash .. code-block:: bash
$ unzip lammps*.zip unzip lammps*.zip
This version corresponds to the selected LAMMPS patch or stable This version corresponds to the selected LAMMPS patch or stable
release. release.

View File

@ -214,7 +214,7 @@ folder that the dynamic loader searches or inside of the installed
.. code-block:: bash .. code-block:: bash
$ python install.py -p <python package> -l <shared library> [-n] python install.py -p <python package> -l <shared library> [-n]
* The ``-p`` flag points to the ``lammps`` Python package folder to be installed, * The ``-p`` flag points to the ``lammps`` Python package folder to be installed,
* the ``-l`` flag points to the LAMMPS shared library file to be installed, * the ``-l`` flag points to the LAMMPS shared library file to be installed,
@ -343,7 +343,7 @@ Python interpreter, load the ``lammps`` Python module and create a
LAMMPS instance. This should not generate an error message and produce LAMMPS instance. This should not generate an error message and produce
output similar to the following: output similar to the following:
.. code-block:: bash .. code-block:: console
$ python $ python
Python 3.8.5 (default, Sep 5 2020, 10:50:12) Python 3.8.5 (default, Sep 5 2020, 10:50:12)
@ -403,7 +403,7 @@ follows:
- Via ``pip`` into a virtual environment (see above): - Via ``pip`` into a virtual environment (see above):
.. code-block:: bash .. code-block:: console
$ source $HOME/myenv/activate $ source $HOME/myenv/activate
(myenv)$ pip install mpi4py (myenv)$ pip install mpi4py
@ -449,7 +449,7 @@ on a simple test script
.. code-block:: bash .. code-block:: bash
$ mpirun -np 4 python3 test.py mpirun -np 4 python3 test.py
where ``test.py`` contains the lines where ``test.py`` contains the lines
@ -459,11 +459,11 @@ where ``test.py`` contains the lines
comm = MPI.COMM_WORLD comm = MPI.COMM_WORLD
print("Proc %d out of %d procs" % (comm.Get_rank(),comm.Get_size())) print("Proc %d out of %d procs" % (comm.Get_rank(),comm.Get_size()))
and see one line of output for each processor you run on. and see one line of output for each processor you run on. Please note
that the order of the lines is not deterministic
.. code-block:: bash .. code-block:: console
# NOTE: the line order is not deterministic
$ mpirun -np 4 python3 test.py $ mpirun -np 4 python3 test.py
Proc 0 out of 4 procs Proc 0 out of 4 procs
Proc 1 out of 4 procs Proc 1 out of 4 procs

View File

@ -6,15 +6,15 @@ interactively from the ``bench`` directory:
.. code-block:: python .. code-block:: python
>>> from lammps import lammps from lammps import lammps
>>> lmp = lammps() lmp = lammps()
>>> lmp.file("in.lj") lmp.file("in.lj")
Or put the same lines in the file ``test.py`` and run it as Or put the same lines in the file ``test.py`` and run it as
.. code-block:: bash .. code-block:: bash
$ python3 test.py python3 test.py
Either way, you should see the results of running the ``in.lj`` benchmark Either way, you should see the results of running the ``in.lj`` benchmark
on a single processor appear on the screen, the same as if you had on a single processor appear on the screen, the same as if you had
@ -46,13 +46,13 @@ You can run the script in parallel as:
.. code-block:: bash .. code-block:: bash
$ mpirun -np 4 python3 test.py mpirun -np 4 python3 test.py
and you should see the same output as if you had typed and you should see the same output as if you had typed
.. code-block:: bash .. code-block:: bash
$ mpirun -np 4 lmp_mpi -in in.lj mpirun -np 4 lmp_mpi -in in.lj
Note that without the mpi4py specific lines from ``test.py`` Note that without the mpi4py specific lines from ``test.py``
@ -82,9 +82,9 @@ one of several ways:
.. code-block:: bash .. code-block:: bash
$ python script.py python script.py
$ python -i script.py python -i script.py
$ ./script.py ./script.py
The last command requires that the first line of the script be The last command requires that the first line of the script be
something like this: something like this:
@ -92,17 +92,23 @@ something like this:
.. code-block:: bash .. code-block:: bash
#!/usr/bin/python #!/usr/bin/python
#!/usr/bin/python -i
where the path points to where you have Python installed, and that you or
have made the script file executable:
.. code-block:: bash .. code-block:: bash
$ chmod +x script.py #!/usr/bin/env python
where the path in the first case needs to point to where you have Python
installed (the second option is workaround for when this may change),
and that you have made the script file executable:
.. code-block:: bash
chmod +x script.py
Without the ``-i`` flag, Python will exit when the script finishes. Without the ``-i`` flag, Python will exit when the script finishes.
With the ``-i`` flag, you will be left in the Python interpreter when With the ``-i`` flag, you will be left in the Python interpreter when
the script finishes, so you can type subsequent commands. As the script finishes, so you can type subsequent commands. As mentioned
mentioned above, you can only run Python interactively when running above, you can only run Python interactively when running Python on a
Python on a single processor, not in parallel. single processor, not in parallel.

View File

@ -32,7 +32,7 @@ standard Python distribution since version 2.5. You can check which
version of Python you have by simply typing "python" at a shell prompt. version of Python you have by simply typing "python" at a shell prompt.
Below is an example output for Python version 3.8.5. Below is an example output for Python version 3.8.5.
.. code-block:: .. code-block:: console
$ python $ python
Python 3.8.5 (default, Aug 12 2020, 00:00:00) Python 3.8.5 (default, Aug 12 2020, 00:00:00)
@ -43,12 +43,16 @@ Below is an example output for Python version 3.8.5.
.. warning:: .. warning::
The options described in this section of the manual for using Python with The options described in this section of the manual for using Python
LAMMPS currently support either Python 2 or 3. Specifically version 2.7 or with LAMMPS currently support either Python 2 or 3. Specifically
later and 3.6 or later. Since the Python community no longer maintains Python version 2.7 or later and 3.6 or later. Since the Python community no
2 (see `this notice <https://www.python.org/doc/sunset-python-2/>`_), we longer maintains Python 2 (see `this notice
recommend use of Python 3 with LAMMPS. While Python 2 code should continue to <https://www.python.org/doc/sunset-python-2/>`_), we recommend use of
work, that is not something we can guarantee long-term. Python 3 with LAMMPS. While Python 2 code should continue to work,
that is not something we can guarantee long-term. If you notice
Python code in the LAMMPS distribution that is not compatible with
Python 3, please contact the LAMMPS developers or submit `and issue
on GitHub <https://github.com/lammps/lammps/issues>`_
--------- ---------

View File

@ -12,15 +12,15 @@ build LAMMPS:
.. code-block:: bash .. code-block:: bash
$ lmp_serial -in in.file lmp_serial -in in.file
$ lmp_serial < in.file lmp_serial < in.file
$ lmp -in in.file lmp -in in.file
$ lmp < in.file lmp < in.file
$ /path/to/lammps/src/lmp_serial -i in.file /path/to/lammps/src/lmp_serial -i in.file
$ mpirun -np 4 lmp_mpi -in in.file mpirun -np 4 lmp_mpi -in in.file
$ mpiexec -np 4 lmp -in in.file mpiexec -np 4 lmp -in in.file
$ mpirun -np 8 /path/to/lammps/src/lmp_mpi -in in.file mpirun -np 8 /path/to/lammps/src/lmp_mpi -in in.file
$ mpiexec -n 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 You normally run the LAMMPS command in the directory where your input
script is located. That is also where output files are produced by script is located. That is also where output files are produced by
@ -78,8 +78,8 @@ variable OMP_NUM_THREADS, before you launch LAMMPS:
.. code-block:: bash .. code-block:: bash
$ export OMP_NUM_THREADS=2 # bash export OMP_NUM_THREADS=2 # bash
$ setenv OMP_NUM_THREADS 2 # csh or tcsh setenv OMP_NUM_THREADS 2 # csh or tcsh
This can also be done via the :doc:`package <package>` command or via This can also be done via the :doc:`package <package>` command or via
the :doc:`-pk command-line switch <Run_options>` which invokes the the :doc:`-pk command-line switch <Run_options>` which invokes the

View File

@ -31,8 +31,8 @@ For example, the lmp_mpi executable might be launched as follows:
.. code-block:: bash .. code-block:: bash
$ mpirun -np 16 lmp_mpi -v f tmp.out -l my.log -sc none -i in.alloy mpirun -np 16 lmp_mpi -v f tmp.out -l my.log -sc none -i in.alloy
$ mpirun -np 16 lmp_mpi -var f tmp.out -log my.log -screen none -in in.alloy mpirun -np 16 lmp_mpi -var f tmp.out -log my.log -screen none -in in.alloy
---------- ----------

View File

@ -683,7 +683,7 @@ or (as administrator) to ``/etc/magic`` (for a system-wide
installation). Afterwards the ``file`` command should be able to installation). Afterwards the ``file`` command should be able to
detect most LAMMPS restarts, dump, data and log files. Examples: detect most LAMMPS restarts, dump, data and log files. Examples:
.. code-block:: bash .. code-block:: console
$ file *.* $ file *.*
dihedral-quadratic.restart: LAMMPS binary restart file (rev 2), Version 10 Mar 2021, Little Endian dihedral-quadratic.restart: LAMMPS binary restart file (rev 2), Version 10 Mar 2021, Little Endian
@ -1100,18 +1100,18 @@ for Tcl with:
.. code-block:: bash .. code-block:: bash
$ swig -tcl -module tcllammps lammps.i swig -tcl -module tcllammps lammps.i
$ gcc -fPIC -shared $(pkgconf --cflags tcl) -o tcllammps.so \ gcc -fPIC -shared $(pkgconf --cflags tcl) -o tcllammps.so \
lammps_wrap.c -L ../src/ -llammps lammps_wrap.c -L ../src/ -llammps
$ tclsh tclsh
Or one can build an extended Tcl shell command with the wrapped Or one can build an extended Tcl shell command with the wrapped
functions included with: functions included with:
.. code-block:: bash .. code-block:: bash
$ swig -tcl -module tcllmps lammps_shell.i swig -tcl -module tcllmps lammps_shell.i
$ gcc -o tcllmpsh lammps_wrap.c -Xlinker -export-dynamic \ gcc -o tcllmpsh lammps_wrap.c -Xlinker -export-dynamic \
-DHAVE_CONFIG_H $(pkgconf --cflags tcl) \ -DHAVE_CONFIG_H $(pkgconf --cflags tcl) \
$(pkgconf --libs tcl) -L ../src -llammps $(pkgconf --libs tcl) -L ../src -llammps
@ -1142,20 +1142,20 @@ For illustration purposes below is a part of the Tcl example script.
.. code-block:: tcl .. code-block:: tcl
% load ./tcllammps.so load ./tcllammps.so
% set lmp [lammps_open_no_mpi 0 NULL NULL] set lmp [lammps_open_no_mpi 0 NULL NULL]
% lammps_command $lmp "units real" lammps_command $lmp "units real"
% lammps_command $lmp "lattice fcc 2.5" lammps_command $lmp "lattice fcc 2.5"
% lammps_command $lmp "region box block -5 5 -5 5 -5 5" lammps_command $lmp "region box block -5 5 -5 5 -5 5"
% lammps_command $lmp "create_box 1 box" lammps_command $lmp "create_box 1 box"
% lammps_command $lmp "create_atoms 1 box" lammps_command $lmp "create_atoms 1 box"
%
% set dt [doublep_value [voidp_to_doublep [lammps_extract_global $lmp dt]]] set dt [doublep_value [voidp_to_doublep [lammps_extract_global $lmp dt]]]
% puts "LAMMPS version $ver" puts "LAMMPS version $ver"
% puts [format "Number of created atoms: %g" [lammps_get_natoms $lmp]] puts [format "Number of created atoms: %g" [lammps_get_natoms $lmp]]
% puts "Current size of timestep: $dt" puts "Current size of timestep: $dt"
% puts "LAMMPS version: [lammps_version $lmp]" puts "LAMMPS version: [lammps_version $lmp]"
% lammps_close $lmp lammps_close $lmp
---------- ----------

View File

@ -161,7 +161,7 @@ snapshot was written on for the *native* or *adios* formats.
The list of timestamps available in an adios .bp file is stored in the The list of timestamps available in an adios .bp file is stored in the
variable *ntimestep*: variable *ntimestep*:
.. parsed-literal:: .. parsed-literal:: console
$ bpls dump.bp -d ntimestep $ bpls dump.bp -d ntimestep
uint64_t ntimestep 5*scalar uint64_t ntimestep 5*scalar
@ -253,7 +253,7 @@ except for the *q* charge field.
The list of fields stored in an adios .bp file is recorded in the attributes The list of fields stored in an adios .bp file is recorded in the attributes
*columns* (array of short strings) and *columnstr* (space-separated single string). *columns* (array of short strings) and *columnstr* (space-separated single string).
.. parsed-literal:: .. parsed-literal:: console
$ bpls -la dump.bp column* $ bpls -la dump.bp column*
string columns attr = {"id", "type", "x", "y", "z", "vx", "vy", "vz"} string columns attr = {"id", "type", "x", "y", "z", "vx", "vy", "vz"}