13
.github/CODEOWNERS
vendored
13
.github/CODEOWNERS
vendored
@ -10,6 +10,7 @@ lib/molfile/* @akohlmey
|
||||
lib/qmmm/* @akohlmey
|
||||
lib/vtk/* @rbberger
|
||||
lib/kim/* @ellio167
|
||||
lib/mesont/* @iafoss
|
||||
|
||||
# whole packages
|
||||
src/COMPRESS/* @akohlmey
|
||||
@ -25,6 +26,7 @@ src/USER-COLVARS/* @giacomofiorin
|
||||
src/USER-INTEL/* @wmbrownintel
|
||||
src/USER-MANIFOLD/* @Pakketeretet2
|
||||
src/USER-MEAMC/* @martok
|
||||
src/USER-MESONT/* @iafoss
|
||||
src/USER-MOFFF/* @hheenen
|
||||
src/USER-MOLFILE/* @akohlmey
|
||||
src/USER-NETCDF/* @pastewka
|
||||
@ -45,7 +47,7 @@ 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/fix_bond_react.* @jrgissing
|
||||
src/USER-REACTION/fix_bond_react.* @jrgissing
|
||||
src/USER-MISC/*_grem.* @dstelter92
|
||||
src/USER-MISC/compute_stress_mop*.* @RomainVermorel
|
||||
|
||||
@ -111,14 +113,23 @@ src/fix_nh.* @athomps
|
||||
src/info.* @akohlmey @rbberger
|
||||
src/timer.* @akohlmey
|
||||
src/min* @sjplimp @stanmoore1
|
||||
src/utils.* @akohlmey @rbberger
|
||||
|
||||
# tools
|
||||
tools/msi2lmp/* @akohlmey
|
||||
tools/emacs/* @HaoZeke
|
||||
tools/singularity/* @akohlmey @rbberger
|
||||
tools/code_standard/* @rbberger
|
||||
tools/valgrind/* @akohlmey
|
||||
|
||||
# tests
|
||||
unittest/* @akohlmey @rbberger
|
||||
|
||||
# cmake
|
||||
cmake/* @junghans @rbberger
|
||||
cmake/Modules/Packages/USER-COLVARS.cmake @junghans @rbberger @giacomofiorin
|
||||
cmake/Modules/Packages/KIM.cmake @junghans @rbberger @ellio167
|
||||
cmake/presets/*.cmake @junghans @rbberger @akohlmey
|
||||
|
||||
# python
|
||||
python/* @rbberger
|
||||
|
||||
4
.github/CONTRIBUTING.md
vendored
4
.github/CONTRIBUTING.md
vendored
@ -75,7 +75,9 @@ Here is a checklist of steps you need to follow to submit a single file or user
|
||||
* 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 USER-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/USER 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/USER-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.
|
||||
* 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/USER-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.
|
||||
|
||||
|
||||
12
.github/ISSUE_TEMPLATE/bug_report.md
vendored
12
.github/ISSUE_TEMPLATE/bug_report.md
vendored
@ -9,24 +9,24 @@ assignees: ''
|
||||
|
||||
**Summary**
|
||||
|
||||
_Please provide a clear and concise description of what the bug is._
|
||||
<!--Please provide a clear and concise description of what the bug is.-->
|
||||
|
||||
**LAMMPS Version and Platform**
|
||||
|
||||
_Please specify precisely which LAMMPS version this issue was detected with (the first line of the output) and what platform (operating system and its version, hardware) you are running on. If possible, test with the most recent LAMMPS patch version_
|
||||
<!--Please specify precisely which LAMMPS version this issue was detected with (the first line of the output) and what platform (operating system and its version, hardware) you are running on. If possible, test with the most recent LAMMPS patch version-->
|
||||
|
||||
**Expected Behavior**
|
||||
|
||||
_Describe the expected behavior. Quote from the LAMMPS manual where needed, or explain why the expected behavior is meaningful, especially when it differs from the manual_
|
||||
<!--Describe the expected behavior. Quote from the LAMMPS manual where needed, or explain why the expected behavior is meaningful, especially when it differs from the manual-->
|
||||
|
||||
**Actual Behavior**
|
||||
|
||||
_Describe the actual behavior, how it differs from the expected behavior, and how this can be observed. Try to be specific and do **not** use vague terms like "doesn't work" or "wrong result". Do not assume that the person reading this has any experience with or knowledge of your specific area of research._
|
||||
<!--Describe the actual behavior, how it differs from the expected behavior, and how this can be observed. Try to be specific and do **not** use vague terms like "doesn't work" or "wrong result". Do not assume that the person reading this has any experience with or knowledge of your specific area of research.-->
|
||||
|
||||
**Steps to Reproduce**
|
||||
|
||||
_Describe the steps required to (quickly) reproduce the issue. You can attach (small) files to the section below or add URLs where to download an archive with all necessary files. Please try to create an input set that is as minimal and small as possible and reproduces the bug as quickly as possible. **NOTE:** the less effort and time it takes to reproduce your reported bug, the more likely it becomes, that somebody will look into it and fix the problem._
|
||||
<!--Describe the steps required to (quickly) reproduce the issue. You can attach (small) files to the section below or add URLs where to download an archive with all necessary files. Please try to create an input set that is as minimal and small as possible and reproduces the bug as quickly as possible. **NOTE:** the less effort and time it takes to reproduce your reported bug, the more likely it becomes, that somebody will look into it and fix the problem.-->
|
||||
|
||||
**Further Information, Files, and Links**
|
||||
|
||||
_Put any additional information here, attach relevant text or image files and URLs to external sites, e.g. relevant publications_
|
||||
<!--Put any additional information here, attach relevant text or image files and URLs to external sites, e.g. relevant publications-->
|
||||
|
||||
6
.github/ISSUE_TEMPLATE/feature_request.md
vendored
6
.github/ISSUE_TEMPLATE/feature_request.md
vendored
@ -9,12 +9,12 @@ assignees: ''
|
||||
|
||||
**Summary**
|
||||
|
||||
_Please provide a brief and concise description of the suggested feature or change_
|
||||
<!--Please provide a brief and concise description of the suggested feature or change-->
|
||||
|
||||
**Detailed Description**
|
||||
|
||||
_Please explain how you would like to see LAMMPS enhanced, what feature(s) you are looking for, what specific problems this will solve. If possible, provide references to relevant background information like publications or web pages, and whether you are planning to implement the enhancement yourself or would like to participate in the implementation. If applicable add a reference to an existing bug report or issue that this will address._
|
||||
<!--Please explain how you would like to see LAMMPS enhanced, what feature(s) you are looking for, what specific problems this will solve. If possible, provide references to relevant background information like publications or web pages, and whether you are planning to implement the enhancement yourself or would like to participate in the implementation. If applicable add a reference to an existing bug report or issue that this will address.-->
|
||||
|
||||
**Further Information, Files, and Links**
|
||||
|
||||
_Put any additional information here, attach relevant text or image files and URLs to external sites, e.g. relevant publications_
|
||||
<!--Put any additional information here, attach relevant text or image files and URLs to external sites, e.g. relevant publications-->
|
||||
|
||||
6
.github/ISSUE_TEMPLATE/generic.md
vendored
6
.github/ISSUE_TEMPLATE/generic.md
vendored
@ -9,13 +9,13 @@ assignees: ''
|
||||
|
||||
**Summary**
|
||||
|
||||
_Please provide a clear and concise description of what this issue report is about._
|
||||
<!--Please provide a clear and concise description of what this issue report is about.-->
|
||||
|
||||
**LAMMPS Version and Platform**
|
||||
|
||||
_Please specify precisely which LAMMPS version this issue was detected with (the first line of the output) and what platform (operating system and its version, hardware) you are running on. If possible, test with the most recent LAMMPS patch version_
|
||||
<!--Please specify precisely which LAMMPS version this issue was detected with (the first line of the output) and what platform (operating system and its version, hardware) you are running on. If possible, test with the most recent LAMMPS patch version-->
|
||||
|
||||
**Details**
|
||||
|
||||
_Please explain the issue in detail here_
|
||||
<!--Please explain the issue in detail here-->
|
||||
|
||||
|
||||
15
.github/PULL_REQUEST_TEMPLATE.md
vendored
15
.github/PULL_REQUEST_TEMPLATE.md
vendored
@ -1,14 +1,14 @@
|
||||
**Summary**
|
||||
|
||||
_Briefly describe the new feature(s), enhancement(s), or bugfix(es) included in this pull request._
|
||||
<!--Briefly describe the new feature(s), enhancement(s), or bugfix(es) included in this pull request.-->
|
||||
|
||||
**Related Issues**
|
||||
|
||||
_If this addresses an open GitHub issue for this project, please mention the issue number here, and describe the relation. Use the phrases `fixes #221` or `closes #135`, when you want an issue to be automatically closed when the pull request is merged_
|
||||
<!--If this addresses an open GitHub issue for this project, please mention the issue number here, and describe the relation. Use the phrases `fixes #221` or `closes #135`, when you want an issue to be automatically closed when the pull request is merged-->
|
||||
|
||||
**Author(s)**
|
||||
|
||||
_Please state name and affiliation of the author or authors that should be credited with the changes in this pull request. If this pull request adds new files to the distribution, please also provide a suitable "long-lived" e-mail address (ideally something that can outlive your institution's e-mail, in case you change jobs) for the *corresponding* author, i.e. the person the LAMMPS developers can contact directly with questions and requests related to maintenance and support of this contributed code._
|
||||
<!--Please state name and affiliation of the author or authors that should be credited with the changes in this pull request. If this pull request adds new files to the distribution, please also provide a suitable "long-lived" e-mail address (ideally something that can outlive your institution's e-mail, in case you change jobs) for the *corresponding* author, i.e. the person the LAMMPS developers can contact directly with questions and requests related to maintenance and support of this contributed code.-->
|
||||
|
||||
**Licensing**
|
||||
|
||||
@ -16,15 +16,15 @@ By submitting this pull request, I agree, that my contribution will be included
|
||||
|
||||
**Backward Compatibility**
|
||||
|
||||
_Please state whether any changes in the pull request will break backward compatibility for inputs, and - if yes - explain what has been changed and why_
|
||||
<!--Please state whether any changes in the pull request will break backward compatibility for inputs, and - if yes - explain what has been changed and why-->
|
||||
|
||||
**Implementation Notes**
|
||||
|
||||
_Provide any relevant details about how the changes are implemented, how correctness was verified, how other features - if any - in LAMMPS are affected_
|
||||
<!--Provide any relevant details about how the changes are implemented, how correctness was verified, how other features - if any - in LAMMPS are affected-->
|
||||
|
||||
**Post Submission Checklist**
|
||||
|
||||
_Please check the fields below as they are completed **after** the pull request has been submitted. Delete lines that don't apply_
|
||||
<!--Please check the fields below as they are completed **after** the pull request has been submitted. Delete lines that don't apply-->
|
||||
|
||||
- [ ] The feature or features in this pull request is complete
|
||||
- [ ] Licensing information is complete
|
||||
@ -34,11 +34,12 @@ _Please check the fields below as they are completed **after** the pull request
|
||||
- [ ] The added/updated documentation is integrated and tested with the documentation build system
|
||||
- [ ] The feature has been verified to work with the conventional build system
|
||||
- [ ] The feature has been verified to work with the CMake based build system
|
||||
- [ ] Suitable tests have been added to the unittest tree.
|
||||
- [ ] A package specific README file has been included or updated
|
||||
- [ ] One or more example input decks are included
|
||||
|
||||
**Further Information, Files, and Links**
|
||||
|
||||
_Put any additional information here, attach relevant text or image files, and URLs to external sites (e.g. DOIs or webpages)_
|
||||
<!--Put any additional information here, attach relevant text or image files, and URLs to external sites (e.g. DOIs or webpages)-->
|
||||
|
||||
|
||||
|
||||
14
.github/PULL_REQUEST_TEMPLATE/bug_fix.md
vendored
14
.github/PULL_REQUEST_TEMPLATE/bug_fix.md
vendored
@ -9,15 +9,15 @@ assignees: ''
|
||||
|
||||
**Summary**
|
||||
|
||||
_Briefly describe the bug or bugs, that are eliminated by this pull request._
|
||||
<!--Briefly describe the bug or bugs, that are eliminated by this pull request.-->
|
||||
|
||||
**Related Issue(s)**
|
||||
|
||||
_If this request addresses or is related to an existing (open) GitHub issue, e.g. a bug report, mention the issue number number here following a pound sign (aka hashmark), e.g.`#222`._
|
||||
<!--If this request addresses or is related to an existing (open) GitHub issue, e.g. a bug report, mention the issue number number here following a pound sign (aka hashmark), e.g.`#222`.-->
|
||||
|
||||
**Author(s)**
|
||||
|
||||
_Please state name and affiliation of the author or authors that should be credited with the changes in this pull request_
|
||||
<!--Please state name and affiliation of the author or authors that should be credited with the changes in this pull request-->
|
||||
|
||||
**Licensing**
|
||||
|
||||
@ -25,18 +25,18 @@ By submitting this pull request I implicitly accept, that my submission is subje
|
||||
|
||||
**Backward Compatibility**
|
||||
|
||||
_Please state whether any changes in the pull request break backward compatibility for inputs, and - if yes - explain what has been changed and why_
|
||||
<!--Please state whether any changes in the pull request break backward compatibility for inputs, and - if yes - explain what has been changed and why-->
|
||||
|
||||
**Detailed Description**
|
||||
|
||||
_Provide any relevant details about how the fixed bug can be reproduced, how the changes are implemented, how correctness was verified, how other features - if any - in LAMMPS are affected_
|
||||
<!--Provide any relevant details about how the fixed bug can be reproduced, how the changes are implemented, how correctness was verified, how other features - if any - in LAMMPS are affected-->
|
||||
|
||||
## Post Submission Checklist
|
||||
|
||||
_Please check the fields below as they are completed *after* the pull request is submitted_
|
||||
<!--Please check the fields below as they are completed *after* the pull request is submitted-->
|
||||
- [ ] The code in this pull request is complete
|
||||
- [ ] The source code follows the LAMMPS formatting guidelines
|
||||
|
||||
## Further Information, Files, and Links
|
||||
|
||||
_Put any additional information here, attach relevant text or image files, and URLs to external sites (e.g. to download input decks for testing)_
|
||||
<!--Put any additional information here, attach relevant text or image files, and URLs to external sites (e.g. to download input decks for testing)-->
|
||||
|
||||
@ -9,15 +9,15 @@ assignees: ''
|
||||
|
||||
**Summary**
|
||||
|
||||
_Briefly describe the included changes._
|
||||
<!--Briefly describe the included changes.-->
|
||||
|
||||
**Related Issue(s)**
|
||||
|
||||
_If this request addresses or is related to an existing (open) GitHub issue, e.g. a bug report, mention the issue number number here following a pound sign (aka hashmark), e.g.`#222`.
|
||||
<!--If this request addresses or is related to an existing (open) GitHub issue, e.g. a bug report, mention the issue number number here following a pound sign (aka hashmark), e.g.`#222`.
|
||||
|
||||
**Author(s)**
|
||||
|
||||
_Please state name and affiliation of the author or authors that should be credited with the changes in this pull request_
|
||||
<!--Please state name and affiliation of the author or authors that should be credited with the changes in this pull request-->
|
||||
|
||||
**Licensing**
|
||||
|
||||
@ -25,11 +25,11 @@ By submitting this pull request I implicitly accept, that my submission is subje
|
||||
|
||||
**Detailed Description**
|
||||
|
||||
_Provide any relevant details about the included changes._
|
||||
<!--Provide any relevant details about the included changes.-->
|
||||
|
||||
## Post Submission Checklist
|
||||
|
||||
_Please check the fields below as they are completed *after* the pull request is submitted_
|
||||
<!--Please check the fields below as they are completed *after* the pull request is submitted-->
|
||||
- [ ] The pull request is complete
|
||||
- [ ] The source code follows the LAMMPS formatting guidelines
|
||||
|
||||
|
||||
16
.github/PULL_REQUEST_TEMPLATE/new_feature.md
vendored
16
.github/PULL_REQUEST_TEMPLATE/new_feature.md
vendored
@ -9,34 +9,34 @@ assignees: ''
|
||||
|
||||
**Summary**
|
||||
|
||||
_Briefly describe the new feature(s) included in this pull request._
|
||||
<!--Briefly describe the new feature(s) included in this pull request.-->
|
||||
|
||||
**Related Issues**
|
||||
|
||||
_If this addresses an existing (open) GitHub issue, e.g. a feature request, mention the issue number here following a pound sign (aka hashmark), e.g. `#331`._
|
||||
<!--If this addresses an existing (open) GitHub issue, e.g. a feature request, mention the issue number here following a pound sign (aka hashmark), e.g. `#331`.-->
|
||||
|
||||
**Author(s)**
|
||||
|
||||
_Please state name and affiliation of the author or authors that should be credited with the features added in this pull request. Please provide a suitable "long-lived" e-mail address (e.g. from gmail, yahoo, outlook, etc.) for the *corresponding* author, i.e. the person the LAMMPS developers can contact directly with questions and requests related to maintenance and support of this code. now and in the future_
|
||||
<!--Please state name and affiliation of the author or authors that should be credited with the features added in this pull request. Please provide a suitable "long-lived" e-mail address (e.g. from gmail, yahoo, outlook, etc.) for the *corresponding* author, i.e. the person the LAMMPS developers can contact directly with questions and requests related to maintenance and support of this code. now and in the future-->
|
||||
|
||||
**Licensing**
|
||||
|
||||
_Please add *yes* or *no* to the following two statements (please contact @lammps/core if you have questions about this)_
|
||||
<!--Please add *yes* or *no* to the following two statements (please contact @lammps/core if you have questions about this)-->
|
||||
|
||||
My contribution may be licensed as GPL v2 (default LAMMPS license):
|
||||
My contribution may be licensed as LGPL (for use as a library with proprietary software):
|
||||
|
||||
**Backward Compatibility**
|
||||
|
||||
_Please state if any of the changes in this pull request will affect backward compatibility for inputs, and - if yes - explain what has been changed and why_
|
||||
<!--Please state if any of the changes in this pull request will affect backward compatibility for inputs, and - if yes - explain what has been changed and why-->
|
||||
|
||||
**Implementation Notes**
|
||||
|
||||
_Provide any relevant details about how the new features are implemented, how correctness was verified, what platforms (OS, compiler, MPI, hardware, number of processors, accelerator(s)) it was tested on_
|
||||
<!--Provide any relevant details about how the new features are implemented, how correctness was verified, what platforms (OS, compiler, MPI, hardware, number of processors, accelerator(s)) it was tested on-->
|
||||
|
||||
## Post Submission Checklist
|
||||
|
||||
_Please check the fields below as they are completed *after* the pull request has been submitted_
|
||||
<!--Please check the fields below as they are completed *after* the pull request has been submitted-->
|
||||
|
||||
- [ ] The feature or features in this pull request is complete
|
||||
- [ ] Licensing information is complete
|
||||
@ -51,6 +51,6 @@ _Please check the fields below as they are completed *after* the pull request ha
|
||||
|
||||
## Further Information, Files, and Links
|
||||
|
||||
_Put any additional information here, attach relevant text or image files, and URLs to external sites (e.g. DOIs or webpages)_
|
||||
<!--Put any additional information here, attach relevant text or image files, and URLs to external sites (e.g. DOIs or webpages)-->
|
||||
|
||||
|
||||
|
||||
@ -9,11 +9,11 @@ assignees: ''
|
||||
|
||||
**Summary**
|
||||
|
||||
_Briefly describe what kind of updates or enhancements for a package or feature are included. If you are not the original author of the package or feature, please mention, whether your contribution was created independently or in collaboration/cooperation with the original author._
|
||||
<!--Briefly describe what kind of updates or enhancements for a package or feature are included. If you are not the original author of the package or feature, please mention, whether your contribution was created independently or in collaboration/cooperation with the original author.-->
|
||||
|
||||
**Author(s)**
|
||||
|
||||
_Please state name and affiliation of the author or authors that should be credited with the changes in this pull request_
|
||||
<!--Please state name and affiliation of the author or authors that should be credited with the changes in this pull request-->
|
||||
|
||||
**Licensing**
|
||||
|
||||
@ -21,15 +21,15 @@ By submitting this pull request I implicitly accept, that my submission is subje
|
||||
|
||||
**Backward Compatibility**
|
||||
|
||||
_Please state whether any changes in the pull request break backward compatibility for inputs, and - if yes - explain what has been changed and why_
|
||||
<!--Please state whether any changes in the pull request break backward compatibility for inputs, and - if yes - explain what has been changed and why-->
|
||||
|
||||
**Implementation Notes**
|
||||
|
||||
_Provide any relevant details about how the changes are implemented, how correctness was verified, how other features - if any - in LAMMPS are affected_
|
||||
<!--Provide any relevant details about how the changes are implemented, how correctness was verified, how other features - if any - in LAMMPS are affected-->
|
||||
|
||||
**Post Submission Checklist**
|
||||
|
||||
_Please check the fields below as they are completed_
|
||||
<!--Please check the fields below as they are completed-->
|
||||
- [ ] The feature or features in this pull request is complete
|
||||
- [ ] Suitable updates to the existing docs are included
|
||||
- [ ] One or more example input decks are included
|
||||
@ -37,6 +37,6 @@ _Please check the fields below as they are completed_
|
||||
|
||||
**Further Information, Files, and Links**
|
||||
|
||||
_Put any additional information here, attach relevant text or image files, and URLs to external sites (e.g. DOIs or webpages)_
|
||||
<!--Put any additional information here, attach relevant text or image files, and URLs to external sites (e.g. DOIs or webpages)-->
|
||||
|
||||
|
||||
|
||||
@ -1,51 +0,0 @@
|
||||
These are input scripts used to run versions of several of the
|
||||
benchmarks in the top-level bench directory using the GPU accelerator
|
||||
package. The results of running these scripts on two different machines
|
||||
(a desktop with 2 Tesla GPUs and the ORNL Titan supercomputer) are shown
|
||||
on the "GPU (Fermi)" section of the Benchmark page of the LAMMPS WWW
|
||||
site: lammps.sandia.gov/bench.
|
||||
|
||||
Examples are shown below of how to run these scripts. This assumes
|
||||
you have built 3 executables with the GPU package
|
||||
installed, e.g.
|
||||
|
||||
lmp_linux_single
|
||||
lmp_linux_mixed
|
||||
lmp_linux_double
|
||||
|
||||
------------------------------------------------------------------------
|
||||
|
||||
To run on just CPUs (without using the GPU styles),
|
||||
do something like the following:
|
||||
|
||||
mpirun -np 1 lmp_linux_double -v x 8 -v y 8 -v z 8 -v t 100 < in.lj
|
||||
mpirun -np 12 lmp_linux_double -v x 16 -v y 16 -v z 16 -v t 100 < in.eam
|
||||
|
||||
The "xyz" settings determine the problem size. The "t" setting
|
||||
determines the number of timesteps.
|
||||
|
||||
These mpirun commands run on a single node. To run on multiple
|
||||
nodes, scale up the "-np" setting.
|
||||
|
||||
------------------------------------------------------------------------
|
||||
|
||||
To run with the GPU package, do something like the following:
|
||||
|
||||
mpirun -np 12 lmp_linux_single -sf gpu -v x 32 -v y 32 -v z 64 -v t 100 < in.lj
|
||||
mpirun -np 8 lmp_linux_mixed -sf gpu -pk gpu 2 -v x 32 -v y 32 -v z 64 -v t 100 < in.eam
|
||||
|
||||
The "xyz" settings determine the problem size. The "t" setting
|
||||
determines the number of timesteps. The "np" setting determines how
|
||||
many MPI tasks (per node) the problem will run on. The numeric
|
||||
argument to the "-pk" setting is the number of GPUs (per node); 1 GPU
|
||||
is the default. Note that you can use more MPI tasks than GPUs (per
|
||||
node) with the GPU package.
|
||||
|
||||
These mpirun commands run on a single node. To run on multiple nodes,
|
||||
scale up the "-np" setting, and control the number of MPI tasks per
|
||||
node via a "-ppn" setting.
|
||||
|
||||
------------------------------------------------------------------------
|
||||
|
||||
If the script has "titan" in its name, it was run on the Titan
|
||||
supercomputer at ORNL.
|
||||
@ -1,24 +0,0 @@
|
||||
# bulk Cu lattice
|
||||
|
||||
units metal
|
||||
atom_style atomic
|
||||
|
||||
lattice fcc 3.615
|
||||
region box block 0 $x 0 $y 0 $z
|
||||
create_box 1 box
|
||||
create_atoms 1 box
|
||||
|
||||
pair_style eam
|
||||
pair_coeff 1 1 Cu_u3.eam
|
||||
|
||||
velocity all create 1600.0 376847 loop geom
|
||||
|
||||
neighbor 1.0 bin
|
||||
neigh_modify every 1 delay 5 check yes
|
||||
|
||||
fix 1 all nve
|
||||
|
||||
timestep 0.005
|
||||
thermo 50
|
||||
|
||||
run $t
|
||||
@ -1,37 +0,0 @@
|
||||
# bulk Cu lattice
|
||||
|
||||
newton off
|
||||
package gpu force/neigh 0 0 1
|
||||
processors * * * grid numa
|
||||
|
||||
variable x index 1
|
||||
variable y index 1
|
||||
variable z index 1
|
||||
|
||||
variable xx equal 20*$x
|
||||
variable yy equal 20*$y
|
||||
variable zz equal 20*$z
|
||||
|
||||
units metal
|
||||
atom_style atomic
|
||||
|
||||
lattice fcc 3.615
|
||||
region box block 0 ${xx} 0 ${yy} 0 ${zz}
|
||||
create_box 1 box
|
||||
create_atoms 1 box
|
||||
|
||||
pair_style eam/gpu
|
||||
pair_coeff 1 1 Cu_u3.eam
|
||||
|
||||
velocity all create 1600.0 376847 loop geom
|
||||
|
||||
neighbor 1.0 bin
|
||||
neigh_modify every 1 delay 5 check yes
|
||||
|
||||
fix 1 all nve
|
||||
|
||||
timestep 0.005
|
||||
thermo 50
|
||||
|
||||
run 15
|
||||
run 100
|
||||
@ -1,22 +0,0 @@
|
||||
# 3d Lennard-Jones melt
|
||||
|
||||
units lj
|
||||
atom_style atomic
|
||||
|
||||
lattice fcc 0.8442
|
||||
region box block 0 $x 0 $y 0 $z
|
||||
create_box 1 box
|
||||
create_atoms 1 box
|
||||
mass 1 1.0
|
||||
|
||||
velocity all create 1.44 87287 loop geom
|
||||
|
||||
pair_style lj/cut 2.5
|
||||
pair_coeff 1 1 1.0 1.0 2.5
|
||||
|
||||
neighbor 0.3 bin
|
||||
neigh_modify delay 0 every 20 check no
|
||||
|
||||
fix 1 all nve
|
||||
|
||||
run $t
|
||||
@ -1,35 +0,0 @@
|
||||
# 3d Lennard-Jones melt
|
||||
|
||||
newton off
|
||||
package gpu force/neigh 0 0 1
|
||||
processors * * * grid numa
|
||||
|
||||
variable x index 1
|
||||
variable y index 1
|
||||
variable z index 1
|
||||
|
||||
variable xx equal 20*$x
|
||||
variable yy equal 20*$y
|
||||
variable zz equal 20*$z
|
||||
|
||||
units lj
|
||||
atom_style atomic
|
||||
|
||||
lattice fcc 0.8442
|
||||
region box block 0 ${xx} 0 ${yy} 0 ${zz}
|
||||
create_box 1 box
|
||||
create_atoms 1 box
|
||||
mass 1 1.0
|
||||
|
||||
velocity all create 1.44 87287 loop geom
|
||||
|
||||
pair_style lj/cut/gpu 2.5
|
||||
pair_coeff 1 1 1.0 1.0 2.5
|
||||
|
||||
neighbor 0.3 bin
|
||||
neigh_modify delay 0 every 20 check no
|
||||
|
||||
fix 1 all nve
|
||||
|
||||
run 15
|
||||
run 100
|
||||
@ -1,30 +0,0 @@
|
||||
# Rhodopsin model
|
||||
|
||||
units real
|
||||
neigh_modify delay 5 every 1
|
||||
|
||||
atom_style full
|
||||
atom_modify map hash
|
||||
bond_style harmonic
|
||||
angle_style charmm
|
||||
dihedral_style charmm
|
||||
improper_style harmonic
|
||||
pair_style lj/charmm/coul/long 8.0 10.0
|
||||
pair_modify mix arithmetic
|
||||
kspace_style pppm 1e-4
|
||||
|
||||
read_data data.rhodo
|
||||
|
||||
replicate $x $y $z
|
||||
|
||||
fix 1 all shake 0.0001 5 0 m 1.0 a 232
|
||||
fix 2 all npt temp 300.0 300.0 100.0 &
|
||||
z 0.0 0.0 1000.0 mtk no pchain 0 tchain 1
|
||||
|
||||
special_bonds charmm
|
||||
|
||||
thermo 50
|
||||
thermo_style multi
|
||||
timestep 2.0
|
||||
|
||||
run $t
|
||||
@ -1,39 +0,0 @@
|
||||
# Rhodopsin model
|
||||
|
||||
newton off
|
||||
package gpu force/neigh 0 0 1
|
||||
processors * * * grid numa
|
||||
|
||||
variable x index 1
|
||||
variable y index 1
|
||||
variable z index 1
|
||||
|
||||
units real
|
||||
neigh_modify delay 5 every 1
|
||||
|
||||
atom_style full
|
||||
atom_modify map hash
|
||||
bond_style harmonic
|
||||
angle_style charmm
|
||||
dihedral_style charmm
|
||||
improper_style harmonic
|
||||
pair_style lj/charmm/coul/long/gpu 8.0 ${cutoff}
|
||||
pair_modify mix arithmetic
|
||||
kspace_style pppm/gpu 1e-4
|
||||
|
||||
read_data data.rhodo
|
||||
|
||||
replicate $x $y $z
|
||||
|
||||
fix 1 all shake 0.0001 5 0 m 1.0 a 232
|
||||
fix 2 all npt temp 300.0 300.0 100.0 &
|
||||
z 0.0 0.0 1000.0 mtk no pchain 0 tchain 1
|
||||
|
||||
special_bonds charmm
|
||||
|
||||
thermo 50
|
||||
# thermo_style multi
|
||||
timestep 2.0
|
||||
|
||||
run 15
|
||||
run 100
|
||||
@ -1,42 +0,0 @@
|
||||
# Rhodopsin model
|
||||
|
||||
newton off
|
||||
package gpu force/neigh 0 0 1
|
||||
partition yes 1 processors * * * grid twolevel ${grid} * * * &
|
||||
part 1 2 multiple
|
||||
partition yes 2 processors * * * part 1 2 multiple
|
||||
|
||||
variable x index 1
|
||||
variable y index 1
|
||||
variable z index 1
|
||||
|
||||
units real
|
||||
neigh_modify delay 5 every 1
|
||||
|
||||
atom_style full
|
||||
atom_modify map hash
|
||||
bond_style harmonic
|
||||
angle_style charmm
|
||||
dihedral_style charmm
|
||||
improper_style harmonic
|
||||
pair_style lj/charmm/coul/long/gpu 8.0 ${cutoff}
|
||||
pair_modify mix arithmetic
|
||||
kspace_style pppm/gpu 1e-4
|
||||
|
||||
read_data data.rhodo
|
||||
|
||||
replicate $x $y $z
|
||||
|
||||
fix 1 all shake 0.0001 5 0 m 1.0 a 232
|
||||
fix 2 all npt temp 300.0 300.0 100.0 &
|
||||
z 0.0 0.0 1000.0 mtk no pchain 0 tchain 1
|
||||
|
||||
special_bonds charmm
|
||||
|
||||
thermo 50
|
||||
# thermo_style multi
|
||||
timestep 2.0
|
||||
|
||||
run_style verlet/split
|
||||
run 15
|
||||
run 100
|
||||
@ -1,2 +0,0 @@
|
||||
rc = 4.0
|
||||
delr = 0.1
|
||||
1
bench/POTENTIALS/Ni.meam
Symbolic link
1
bench/POTENTIALS/Ni.meam
Symbolic link
@ -0,0 +1 @@
|
||||
../../potentials/Ni.meam
|
||||
@ -1,17 +0,0 @@
|
||||
# Stillinger-Weber parameters for various elements and mixtures
|
||||
# multiple entries can be added to this file, LAMMPS reads the ones it needs
|
||||
# these entries are in LAMMPS "metal" units:
|
||||
# epsilon = eV; sigma = Angstroms
|
||||
# other quantities are unitless
|
||||
|
||||
# format of a single entry (one or more lines):
|
||||
# element 1, element 2, element 3,
|
||||
# epsilon, sigma, a, lambda, gamma, costheta0, A, B, p, q, tol
|
||||
|
||||
# Here are the original parameters in metal units, for Silicon from:
|
||||
#
|
||||
# Stillinger and Weber, Phys. Rev. B, v. 31, p. 5262, (1985)
|
||||
#
|
||||
|
||||
Si Si Si 2.1683 2.0951 1.80 21.0 1.20 -0.333333333333
|
||||
7.049556277 0.6022245584 4.0 0.0 0.0
|
||||
1
bench/POTENTIALS/Si.sw
Symbolic link
1
bench/POTENTIALS/Si.sw
Symbolic link
@ -0,0 +1 @@
|
||||
../../potentials/Si.sw
|
||||
@ -1,16 +0,0 @@
|
||||
# Tersoff parameters for various elements and mixtures
|
||||
# multiple entries can be added to this file, LAMMPS reads the ones it needs
|
||||
# these entries are in LAMMPS "metal" units:
|
||||
# A,B = eV; lambda1,lambda2,lambda3 = 1/Angstroms; R,D = Angstroms
|
||||
# other quantities are unitless
|
||||
|
||||
# This is the Si parameterization from a particular Tersoff paper:
|
||||
# J. Tersoff, PRB, 37, 6991 (1988)
|
||||
# See the SiCGe.tersoff file for different Si variants.
|
||||
|
||||
# format of a single entry (one or more lines):
|
||||
# element 1, element 2, element 3,
|
||||
# m, gamma, lambda3, c, d, costheta0, n, beta, lambda2, B, R, D, lambda1, A
|
||||
|
||||
Si Si Si 3.0 1.0 1.3258 4.8381 2.0417 0.0000 22.956
|
||||
0.33675 1.3258 95.373 3.0 0.2 3.2394 3264.7
|
||||
1
bench/POTENTIALS/Si.tersoff
Symbolic link
1
bench/POTENTIALS/Si.tersoff
Symbolic link
@ -0,0 +1 @@
|
||||
../../potentials/Si.tersoff
|
||||
@ -1,24 +0,0 @@
|
||||
# bulk Ni in MEAM
|
||||
|
||||
units metal
|
||||
atom_style atomic
|
||||
|
||||
lattice fcc 3.52
|
||||
region box block 0 20 0 20 0 20
|
||||
create_box 1 box
|
||||
create_atoms 1 box
|
||||
|
||||
pair_style meam
|
||||
pair_coeff * * library.meam Ni4 Ni.meam Ni4
|
||||
|
||||
velocity all create 1600.0 376847 loop geom
|
||||
|
||||
neighbor 1.0 bin
|
||||
neigh_modify delay 5 every 1
|
||||
|
||||
fix 1 all nve
|
||||
|
||||
timestep 0.005
|
||||
thermo 50
|
||||
|
||||
run 100
|
||||
@ -1,22 +0,0 @@
|
||||
# ReaxFF benchmark: simulation of PETN crystal, replicated unit cell
|
||||
|
||||
units real
|
||||
atom_style charge
|
||||
|
||||
read_data data.reax
|
||||
|
||||
#replicate 7 8 10
|
||||
replicate 7 8 5
|
||||
|
||||
velocity all create 300.0 9999
|
||||
|
||||
pair_style reax
|
||||
pair_coeff * * ffield.reax 1 2 3 4
|
||||
|
||||
timestep 0.1
|
||||
fix 2 all nve
|
||||
|
||||
thermo 10
|
||||
thermo_style custom step temp ke pe pxx pyy pzz etotal
|
||||
|
||||
run 100
|
||||
@ -1,162 +0,0 @@
|
||||
# meam data from vax files fcc,bcc,dia 11/4/92
|
||||
# elt lat z ielement atwt
|
||||
# alpha b0 b1 b2 b3 alat esub asub
|
||||
# t0 t1 t2 t3 rozero ibar
|
||||
|
||||
'Sn5' 'dia' 4. 50 118.
|
||||
5.09 5.00 16.0 04.0 5.0 6.483 3.14 1.00
|
||||
1.0 2.00 5.756 -0.30 1. 0
|
||||
'Sn' 'dia' 4. 50 118.
|
||||
5.09 5.42 8.0 5.0 6.0 6.483 3.14 1.12
|
||||
1.0 3.0 5.707 +0.30 1. 0
|
||||
'Cu' 'fcc' 12. 29 63.54
|
||||
5.10570729 3.634 2.20 6 2.20 3.62 3.54 1.07
|
||||
1.0 3.13803254 2.49438711 2.95269237 1. 0
|
||||
'Ag' 'fcc' 12. 47 107.870
|
||||
5.89222008 4.456 2.20 6 2.20 4.08 2.85 1.06
|
||||
1.0 5.54097609 2.45015783 1.28843988 1. 0
|
||||
'Au' 'fcc' 12. 79 196.967
|
||||
6.34090112 5.449 2.20 6 2.20 4.07 3.93 1.04
|
||||
1.0 1.58956328 1.50776392 2.60609758 1. 0
|
||||
'Ni1' 'fcc' 12. 28 58.71
|
||||
4.99 2.45 2.20 6 2.20 3.52 4.45 1.10
|
||||
1.0 3.57 1.60 3.70 1.0 0
|
||||
'Ni2' 'fcc' 12. 28 58.71
|
||||
4.99 2.45 2.20 6 2.20 3.52 4.45 1.10
|
||||
1.0 3.57 1.60 3.70 1.0 3
|
||||
'Ni3' 'fcc' 12. 28 58.71
|
||||
4.99 2.45 1.50 6 1.50 3.52 4.45 1.10
|
||||
1.0 3.57 1.60 3.70 1.0 3
|
||||
'Ni4' 'fcc' 12. 28 58.71
|
||||
4.99 2.45 1.50 6 1.50 3.52 4.45 1.10
|
||||
1.0 3.57 1.60 3.70 1.0 0
|
||||
'Ni' 'fcc' 12. 28 58.71
|
||||
4.99 2.64 1.50 4.50 1.50 3.52 4.45 1.10
|
||||
1.0 1.692 4.987 3.683 1.0 1
|
||||
'Nix' 'fcc' 12. 28 58.71
|
||||
4.99 2.64 1.50 4.50 1.50 3.52 4.45 1.10
|
||||
1.0 0.00 0.000 3.683 1.0 1
|
||||
'Ni' 'fcc' 12. 28 58.71
|
||||
4.99 3.25 0.80 4 1.50 3.52 4.45 1.07
|
||||
1.0 -4.052 13.14 3.786 1.0 1
|
||||
'Pd' 'fcc' 12. 46 106.4
|
||||
6.43230473 4.975 2.20 6 2.20 3.89 3.91 1.01
|
||||
1.0 2.33573516 1.38343023 4.47989049 1. 0
|
||||
'Pt' 'fcc' 12. 78 195.09
|
||||
6.44221724 4.673 2.20 6 2.20 3.92 5.77 1.04
|
||||
1.0 2.73335406 -1.3759593 3.29322278 1. 0
|
||||
'Al' 'fcc' 12. 13 26.9815
|
||||
4.61 2.21 2.20 6.0 2.20 4.05 3.58 1.07
|
||||
1.0 -1.78 -2.21 8.01 0.6 0
|
||||
'Al' 'fcc' 12. 13 26.9815
|
||||
4.69 1.56 4.00 5.5 0.60 4.05 3.36 1.09
|
||||
1.0 -0.251 -3.450 8.298 0.6 1
|
||||
'Al' 'fcc' 12. 13 26.9815
|
||||
4.69 1.58 1.00 6.0 0.60 4.05 3.36 1.09
|
||||
1.0 -0.808 -2.614 8.298 0.6 1
|
||||
'Pb' 'fcc' 12. 82 207.19
|
||||
6.0564428 5.306 2.20 6 2.20 4.95 2.04 1.01
|
||||
1.0 2.74022352 3.06323991 1.2 1. 0
|
||||
'Rh' 'fcc' 12. 45 102.905
|
||||
6.0045385 1.131 1.00 2 1.00 3.8 5.75 1.05
|
||||
1.0 2.9900 4.60231784 4.8 1. 0
|
||||
'Ir' 'fcc' 12. 77 192.2
|
||||
6.52315787 1.13 1.00 2 1.00 3.84 6.93 1.05
|
||||
1.0 1.50000 8.09942666 4.8 1. 0
|
||||
'Li' 'bcc' 8. 3 6.939
|
||||
2.97244804 1.425 1.00 1.00169907 1.00 3.509 1.65 0.87
|
||||
1.0 0.26395017 0.44431129 -0.2 1. 0
|
||||
'Na' 'bcc' 8. 11 22.9898
|
||||
3.64280541 2.313 1.00 1.00173951 1.00 4.291 1.13 0.9
|
||||
1.0 3.55398839 0.68807569 -0.2 1. 0
|
||||
'K' 'bcc' 8. 19 39.102
|
||||
3.90128376 2.687 1.00 1.00186667 1.00 5.344 0.94 0.92
|
||||
1.0 5.09756981 0.69413264 -0.2 1. 0
|
||||
'V' 'bcc' 8. 23 50.942
|
||||
4.83265262 4.113 1.00 1.00095022 1.00 3.04 5.3 1
|
||||
1.0 4.20161301 4.09946561 -1 1. 0
|
||||
'Nb' 'bcc' 8. 41 92.906
|
||||
4.79306197 4.374 1.00 1.00101441 1.00 3.301 7.47 1
|
||||
1.0 3.75762849 3.82514598 -1 1. 0
|
||||
'Ta' 'bcc' 8. 73 180.948
|
||||
4.89528669 3.709 1.00 1.00099783 1.00 3.303 8.09 0.99
|
||||
1.0 6.08617812 3.35255804 -2.9 1. 0
|
||||
'Cr' 'bcc' 8. 24 51.996
|
||||
5.12169218 3.224 1.00 1.00048646 1.00 2.885 4.1 0.94
|
||||
1.0 -0.207535 12.2600006 -1.9 1. 0
|
||||
'Mo' 'bcc' 8. 42 95.94
|
||||
5.84872871 4.481 1.00 1.00065204 1.00 3.15 6.81 0.99
|
||||
1.0 3.47727181 9.48582009 -2.9 1. 0
|
||||
'W' 'bcc' 8. 74 183.85
|
||||
5.62777409 3.978 1.00 1.00065894 1.00 3.165 8.66 0.98
|
||||
1.0 3.16353338 8.24586928 -2.7 1. 0
|
||||
'WL' 'bcc' 8 74 183.85
|
||||
5.6831 6.54 1 1 1 3.1639 8.66 0.4
|
||||
1 -0.6 0.3 -8.7 1 3
|
||||
'Fe' 'bcc' 8. 26 55.847
|
||||
5.07292627 2.935 1.00 1.00080073 1.00 2.866 4.29 0.89
|
||||
1.0 5.13579244 4.12042448 -2.7 1. 0
|
||||
'Si' 'dia' 4. 14 28.086
|
||||
4.87 4.8 4.8 4.8 4.8 5.431 4.63 1.
|
||||
1.0 3.30 5.105 -0.80 1. 1
|
||||
'Si97' 'dia' 4. 14 28.086
|
||||
4.87 4.4 5.5 5.5 5.5 5.431 4.63 1.
|
||||
1.0 3.13 4.47 -1.80 2.05 0
|
||||
'Si92' 'dia' 4. 14 28.086
|
||||
4.87 4.4 5.5 5.5 5.5 5.431 4.63 1.
|
||||
1.0 3.13 4.47 -1.80 2.35 0
|
||||
'Six' 'dia' 4 14 28.086
|
||||
4.87 4.4 5.5 5.5 5.5 5.431 4.63 1.0
|
||||
1.0 2.05 4.47 -1.8 2.05 0
|
||||
'Sixb' 'dia' 4 14 28.086
|
||||
4.87 4.4 5.5 5.5 5.5 5.431 4.63 1.0
|
||||
1.0 2.05 4.47 -1.8 2.5 0
|
||||
'Mg' 'hcp' 12. 12 24.305
|
||||
5.45 2.70 0.0 0.35 3.0 3.20 1.55 1.11
|
||||
1.0 8.00 04.1 -02.0 1.0 0
|
||||
'C' 'dia' 4. 6 12.0111
|
||||
4.38 4.10 4.200 5.00 3.00 3.567 7.37 1.000
|
||||
1.0 5.0 9.34 -1.00 2.25 1
|
||||
'C' 'dia' 4. 6 12.0111
|
||||
4.38 5.20 3.87 4.00 4.50 3.567 7.37 1.278
|
||||
1.0 15. 2.09 -6.00 2.5 1
|
||||
'C' 'dia' 4. 6 12.0111
|
||||
4.38 4.50 4.00 3.50 4.80 3.567 7.37 1.00
|
||||
1.0 10.5 1.54 -8.75 3.2 1
|
||||
'C' 'dia' 4. 6 12.0111
|
||||
4.38 3.30 2.80 1.50 3.20 3.567 7.37 1.00
|
||||
1.0 10.3 1.54 -8.80 2.5 1
|
||||
'C' 'dia' 4. 6 12.0111
|
||||
4.38 4.60 3.45 4.00 4.20 3.567 7.37 1.061
|
||||
1.0 15.0 1.74 -8.00 2.5 1
|
||||
'C' 'dia' 4. 6 12.0111
|
||||
4.38 4.50 4.00 3.50 4.80 3.567 7.37 1.00
|
||||
1.0 10.5 1.54 -8.75 3.2 1
|
||||
'h' 'dim' 1. 1 1.0079
|
||||
2.96 2.70 3.5 3.4 3.4 0.74 2.235 2.27
|
||||
1.0 0.19 0.00 0.00 20.00 0
|
||||
'h' 'dim' 1. 1 1.0079
|
||||
2.96 2.00 4.0 4.0 0.0 0.74 2.235 1.00
|
||||
1.0 -0.60 -0.80 -0.0 01.0 1
|
||||
'H' 'dim' 1. 1 1.0079
|
||||
2.96 2.96 3.0 3.0 3.0 0.74 2.235 2.50
|
||||
1.0 0.20 -0.10 0.0 0.5 0
|
||||
'H' 'dim' 1. 1 1.0079
|
||||
2.96 2.0 3.0 4.0 0.0 0.74 2.225 1.00
|
||||
1.0 -0.5 -1.00 0.0 0.15 1
|
||||
'H' 'dim' 1. 1 1.0079
|
||||
2.96 2.00 2.0 2.0 2.0 0.74 2.235 1.00
|
||||
1.0 -0.60 -0.80 -0.0 01.0 2
|
||||
'Hni' 'dim' 1. 1 1.0079
|
||||
2.96 2.96 3.0 3.0 3.0 0.74 2.235 2.50
|
||||
1.0 0.2 -0.1 0.0 0.5 0
|
||||
'Hni' 'dim' 1. 1 1.0079
|
||||
2.96 2.96 3.0 2.0 3.0 0.74 2.235 36.4
|
||||
1.0 0.2 6.0 0.0 22.8 0
|
||||
'Vac' 'fcc' 12. 1 1.
|
||||
0 0 0.0 0 0.0 1E+08 0 1
|
||||
0 0 0 0 1. 0
|
||||
'zz' 'zzz' 99. 1 1.
|
||||
0 0 0.0 0 0.0 0. 0. 0.
|
||||
0 0 0 0 1. 0
|
||||
|
||||
1
bench/POTENTIALS/library.meam
Symbolic link
1
bench/POTENTIALS/library.meam
Symbolic link
@ -0,0 +1 @@
|
||||
../../potentials/library.meam
|
||||
@ -1,84 +0,0 @@
|
||||
LAMMPS (16 Mar 2018)
|
||||
OMP_NUM_THREADS environment is not set. Defaulting to 1 thread. (../comm.cpp:90)
|
||||
using 1 OpenMP thread(s) per MPI task
|
||||
# bulk Ni in MEAM
|
||||
|
||||
units metal
|
||||
atom_style atomic
|
||||
|
||||
lattice fcc 3.52
|
||||
Lattice spacing in x,y,z = 3.52 3.52 3.52
|
||||
region box block 0 20 0 20 0 20
|
||||
create_box 1 box
|
||||
Created orthogonal box = (0 0 0) to (70.4 70.4 70.4)
|
||||
1 by 1 by 1 MPI processor grid
|
||||
create_atoms 1 box
|
||||
Created 32000 atoms
|
||||
Time spent = 0.00186539 secs
|
||||
|
||||
pair_style meam
|
||||
WARNING: The pair_style meam command is unsupported. Please use pair_style meam/c instead (../pair_meam.cpp:51)
|
||||
pair_coeff * * library.meam Ni4 Ni.meam Ni4
|
||||
|
||||
velocity all create 1600.0 376847 loop geom
|
||||
|
||||
neighbor 1.0 bin
|
||||
neigh_modify delay 5 every 1
|
||||
|
||||
fix 1 all nve
|
||||
|
||||
timestep 0.005
|
||||
thermo 50
|
||||
|
||||
run 100
|
||||
Neighbor list info ...
|
||||
update every 1 steps, delay 5 steps, check yes
|
||||
max neighbors/atom: 2000, page size: 100000
|
||||
master list distance cutoff = 5
|
||||
ghost atom cutoff = 5
|
||||
binsize = 2.5, bins = 29 29 29
|
||||
2 neighbor lists, perpetual/occasional/extra = 2 0 0
|
||||
(1) pair meam, perpetual
|
||||
attributes: full, newton on
|
||||
pair build: full/bin/atomonly
|
||||
stencil: full/bin/3d
|
||||
bin: standard
|
||||
(2) pair meam, perpetual, half/full from (1)
|
||||
attributes: half, newton on
|
||||
pair build: halffull/newton
|
||||
stencil: none
|
||||
bin: none
|
||||
Per MPI rank memory allocation (min/avg/max) = 55.91 | 55.91 | 55.91 Mbytes
|
||||
Step Temp E_pair E_mol TotEng Press
|
||||
0 1600 -142400 0 -135782.09 20259.18
|
||||
50 885.10702 -139411.51 0 -135750.54 32425.433
|
||||
100 895.5097 -139454.3 0 -135750.3 31804.187
|
||||
Loop time of 30.6278 on 1 procs for 100 steps with 32000 atoms
|
||||
|
||||
Performance: 1.410 ns/day, 17.015 hours/ns, 3.265 timesteps/s
|
||||
99.8% CPU use with 1 MPI tasks x 1 OpenMP threads
|
||||
|
||||
MPI task timing breakdown:
|
||||
Section | min time | avg time | max time |%varavg| %total
|
||||
---------------------------------------------------------------
|
||||
Pair | 30.088 | 30.088 | 30.088 | 0.0 | 98.24
|
||||
Neigh | 0.48914 | 0.48914 | 0.48914 | 0.0 | 1.60
|
||||
Comm | 0.015916 | 0.015916 | 0.015916 | 0.0 | 0.05
|
||||
Output | 0.00022554 | 0.00022554 | 0.00022554 | 0.0 | 0.00
|
||||
Modify | 0.025481 | 0.025481 | 0.025481 | 0.0 | 0.08
|
||||
Other | | 0.009055 | | | 0.03
|
||||
|
||||
Nlocal: 32000 ave 32000 max 32000 min
|
||||
Histogram: 1 0 0 0 0 0 0 0 0 0
|
||||
Nghost: 13576 ave 13576 max 13576 min
|
||||
Histogram: 1 0 0 0 0 0 0 0 0 0
|
||||
Neighs: 780360 ave 780360 max 780360 min
|
||||
Histogram: 1 0 0 0 0 0 0 0 0 0
|
||||
FullNghs: 1.56072e+06 ave 1.56072e+06 max 1.56072e+06 min
|
||||
Histogram: 1 0 0 0 0 0 0 0 0 0
|
||||
|
||||
Total # of neighbors = 1560720
|
||||
Ave neighs/atom = 48.7725
|
||||
Neighbor list builds = 8
|
||||
Dangerous builds = 0
|
||||
Total wall time: 0:00:30
|
||||
@ -1,84 +0,0 @@
|
||||
LAMMPS (16 Mar 2018)
|
||||
OMP_NUM_THREADS environment is not set. Defaulting to 1 thread. (../comm.cpp:90)
|
||||
using 1 OpenMP thread(s) per MPI task
|
||||
# bulk Ni in MEAM
|
||||
|
||||
units metal
|
||||
atom_style atomic
|
||||
|
||||
lattice fcc 3.52
|
||||
Lattice spacing in x,y,z = 3.52 3.52 3.52
|
||||
region box block 0 20 0 20 0 20
|
||||
create_box 1 box
|
||||
Created orthogonal box = (0 0 0) to (70.4 70.4 70.4)
|
||||
1 by 2 by 2 MPI processor grid
|
||||
create_atoms 1 box
|
||||
Created 32000 atoms
|
||||
Time spent = 0.000587463 secs
|
||||
|
||||
pair_style meam
|
||||
WARNING: The pair_style meam command is unsupported. Please use pair_style meam/c instead (../pair_meam.cpp:51)
|
||||
pair_coeff * * library.meam Ni4 Ni.meam Ni4
|
||||
|
||||
velocity all create 1600.0 376847 loop geom
|
||||
|
||||
neighbor 1.0 bin
|
||||
neigh_modify delay 5 every 1
|
||||
|
||||
fix 1 all nve
|
||||
|
||||
timestep 0.005
|
||||
thermo 50
|
||||
|
||||
run 100
|
||||
Neighbor list info ...
|
||||
update every 1 steps, delay 5 steps, check yes
|
||||
max neighbors/atom: 2000, page size: 100000
|
||||
master list distance cutoff = 5
|
||||
ghost atom cutoff = 5
|
||||
binsize = 2.5, bins = 29 29 29
|
||||
2 neighbor lists, perpetual/occasional/extra = 2 0 0
|
||||
(1) pair meam, perpetual
|
||||
attributes: full, newton on
|
||||
pair build: full/bin/atomonly
|
||||
stencil: full/bin/3d
|
||||
bin: standard
|
||||
(2) pair meam, perpetual, half/full from (1)
|
||||
attributes: half, newton on
|
||||
pair build: halffull/newton
|
||||
stencil: none
|
||||
bin: none
|
||||
Per MPI rank memory allocation (min/avg/max) = 17.41 | 17.41 | 17.41 Mbytes
|
||||
Step Temp E_pair E_mol TotEng Press
|
||||
0 1600 -142400 0 -135782.09 20259.18
|
||||
50 885.10702 -139411.51 0 -135750.54 32425.433
|
||||
100 895.5097 -139454.3 0 -135750.3 31804.187
|
||||
Loop time of 8.21941 on 4 procs for 100 steps with 32000 atoms
|
||||
|
||||
Performance: 5.256 ns/day, 4.566 hours/ns, 12.166 timesteps/s
|
||||
99.2% CPU use with 4 MPI tasks x 1 OpenMP threads
|
||||
|
||||
MPI task timing breakdown:
|
||||
Section | min time | avg time | max time |%varavg| %total
|
||||
---------------------------------------------------------------
|
||||
Pair | 8.0277 | 8.0384 | 8.0504 | 0.3 | 97.80
|
||||
Neigh | 0.12555 | 0.12645 | 0.12713 | 0.2 | 1.54
|
||||
Comm | 0.024279 | 0.036776 | 0.048389 | 4.5 | 0.45
|
||||
Output | 9.4414e-05 | 0.00011903 | 0.00018597 | 0.0 | 0.00
|
||||
Modify | 0.01252 | 0.012608 | 0.012795 | 0.1 | 0.15
|
||||
Other | | 0.005028 | | | 0.06
|
||||
|
||||
Nlocal: 8000 ave 8045 max 7947 min
|
||||
Histogram: 1 0 0 1 0 0 0 1 0 1
|
||||
Nghost: 6066.75 ave 6120 max 6021 min
|
||||
Histogram: 1 0 1 0 0 0 1 0 0 1
|
||||
Neighs: 195090 ave 196403 max 193697 min
|
||||
Histogram: 1 0 0 1 0 0 0 1 0 1
|
||||
FullNghs: 390180 ave 392616 max 387490 min
|
||||
Histogram: 1 0 0 1 0 0 0 1 0 1
|
||||
|
||||
Total # of neighbors = 1560720
|
||||
Ave neighs/atom = 48.7725
|
||||
Neighbor list builds = 8
|
||||
Dangerous builds = 0
|
||||
Total wall time: 0:00:08
|
||||
@ -1,86 +0,0 @@
|
||||
LAMMPS (16 Mar 2018)
|
||||
OMP_NUM_THREADS environment is not set. Defaulting to 1 thread. (../comm.cpp:90)
|
||||
using 1 OpenMP thread(s) per MPI task
|
||||
# ReaxFF benchmark: simulation of PETN crystal, replicated unit cell
|
||||
|
||||
units real
|
||||
atom_style charge
|
||||
|
||||
read_data data.reax
|
||||
orthogonal box = (0 0 0) to (9.49107 9.49107 6.99123)
|
||||
1 by 1 by 1 MPI processor grid
|
||||
reading atoms ...
|
||||
58 atoms
|
||||
|
||||
#replicate 7 8 10
|
||||
replicate 7 8 5
|
||||
orthogonal box = (0 0 0) to (66.4375 75.9285 34.9562)
|
||||
1 by 1 by 1 MPI processor grid
|
||||
16240 atoms
|
||||
Time spent = 0.000834942 secs
|
||||
|
||||
velocity all create 300.0 9999
|
||||
|
||||
pair_style reax
|
||||
WARNING: The pair_style reax command is unsupported. Please switch to pair_style reax/c instead (../pair_reax.cpp:49)
|
||||
pair_coeff * * ffield.reax 1 2 3 4
|
||||
|
||||
timestep 0.1
|
||||
fix 2 all nve
|
||||
|
||||
thermo 10
|
||||
thermo_style custom step temp ke pe pxx pyy pzz etotal
|
||||
|
||||
run 100
|
||||
Neighbor list info ...
|
||||
update every 1 steps, delay 10 steps, check yes
|
||||
max neighbors/atom: 2000, page size: 100000
|
||||
master list distance cutoff = 12
|
||||
ghost atom cutoff = 12
|
||||
binsize = 6, bins = 12 13 6
|
||||
1 neighbor lists, perpetual/occasional/extra = 1 0 0
|
||||
(1) pair reax, perpetual
|
||||
attributes: half, newton off
|
||||
pair build: half/bin/newtoff
|
||||
stencil: half/bin/3d/newtoff
|
||||
bin: standard
|
||||
Per MPI rank memory allocation (min/avg/max) = 115.8 | 115.8 | 115.8 Mbytes
|
||||
Step Temp KinEng PotEng Pxx Pyy Pzz TotEng
|
||||
0 300 14521.612 -1616144.2 22296.712 -29858.677 5721.0921 -1601622.5
|
||||
10 298.98728 14472.591 -1616093.9 21955.847 -24067.096 7389.148 -1601621.3
|
||||
20 294.76158 14268.045 -1615890.1 19179.258 -10513.494 10789.925 -1601622
|
||||
30 288.56967 13968.323 -1615591.2 13854.377 5833.02 13949.731 -1601622.9
|
||||
40 282.06725 13653.571 -1615278.2 6259.9845 19406.33 14947.939 -1601624.6
|
||||
50 274.84112 13303.787 -1614931.9 -2009.6832 26964.336 13346.855 -1601628.2
|
||||
60 266.20153 12885.585 -1614519.7 -8441.1641 28485.532 10195.429 -1601634.1
|
||||
70 259.17085 12545.262 -1614184.2 -11426.993 24941.516 6572.2953 -1601638.9
|
||||
80 259.73004 12572.33 -1614216.7 -10867.598 16928.461 3033.9021 -1601644.3
|
||||
90 269.2352 13032.431 -1614679 -7962.3129 4931.5317 -280.22164 -1601646.6
|
||||
100 280.67181 13586.024 -1615234.3 -3606.1519 -8769.8482 -2527.5887 -1601648.3
|
||||
Loop time of 358.104 on 1 procs for 100 steps with 16240 atoms
|
||||
|
||||
Performance: 0.002 ns/day, 9947.338 hours/ns, 0.279 timesteps/s
|
||||
99.8% CPU use with 1 MPI tasks x 1 OpenMP threads
|
||||
|
||||
MPI task timing breakdown:
|
||||
Section | min time | avg time | max time |%varavg| %total
|
||||
---------------------------------------------------------------
|
||||
Pair | 358.07 | 358.07 | 358.07 | 0.0 | 99.99
|
||||
Neigh | 0 | 0 | 0 | 0.0 | 0.00
|
||||
Comm | 0.01623 | 0.01623 | 0.01623 | 0.0 | 0.00
|
||||
Output | 0.0013328 | 0.0013328 | 0.0013328 | 0.0 | 0.00
|
||||
Modify | 0.012679 | 0.012679 | 0.012679 | 0.0 | 0.00
|
||||
Other | | 0.006895 | | | 0.00
|
||||
|
||||
Nlocal: 16240 ave 16240 max 16240 min
|
||||
Histogram: 1 0 0 0 0 0 0 0 0 0
|
||||
Nghost: 32428 ave 32428 max 32428 min
|
||||
Histogram: 1 0 0 0 0 0 0 0 0 0
|
||||
Neighs: 6.69975e+06 ave 6.69975e+06 max 6.69975e+06 min
|
||||
Histogram: 1 0 0 0 0 0 0 0 0 0
|
||||
|
||||
Total # of neighbors = 6699752
|
||||
Ave neighs/atom = 412.546
|
||||
Neighbor list builds = 0
|
||||
Dangerous builds = 0
|
||||
Total wall time: 0:06:02
|
||||
@ -1,86 +0,0 @@
|
||||
LAMMPS (16 Mar 2018)
|
||||
OMP_NUM_THREADS environment is not set. Defaulting to 1 thread. (../comm.cpp:90)
|
||||
using 1 OpenMP thread(s) per MPI task
|
||||
# ReaxFF benchmark: simulation of PETN crystal, replicated unit cell
|
||||
|
||||
units real
|
||||
atom_style charge
|
||||
|
||||
read_data data.reax
|
||||
orthogonal box = (0 0 0) to (9.49107 9.49107 6.99123)
|
||||
2 by 2 by 1 MPI processor grid
|
||||
reading atoms ...
|
||||
58 atoms
|
||||
|
||||
#replicate 7 8 10
|
||||
replicate 7 8 5
|
||||
orthogonal box = (0 0 0) to (66.4375 75.9285 34.9562)
|
||||
2 by 2 by 1 MPI processor grid
|
||||
16240 atoms
|
||||
Time spent = 0.000491619 secs
|
||||
|
||||
velocity all create 300.0 9999
|
||||
|
||||
pair_style reax
|
||||
WARNING: The pair_style reax command is unsupported. Please switch to pair_style reax/c instead (../pair_reax.cpp:49)
|
||||
pair_coeff * * ffield.reax 1 2 3 4
|
||||
|
||||
timestep 0.1
|
||||
fix 2 all nve
|
||||
|
||||
thermo 10
|
||||
thermo_style custom step temp ke pe pxx pyy pzz etotal
|
||||
|
||||
run 100
|
||||
Neighbor list info ...
|
||||
update every 1 steps, delay 10 steps, check yes
|
||||
max neighbors/atom: 2000, page size: 100000
|
||||
master list distance cutoff = 12
|
||||
ghost atom cutoff = 12
|
||||
binsize = 6, bins = 12 13 6
|
||||
1 neighbor lists, perpetual/occasional/extra = 1 0 0
|
||||
(1) pair reax, perpetual
|
||||
attributes: half, newton off
|
||||
pair build: half/bin/newtoff
|
||||
stencil: half/bin/3d/newtoff
|
||||
bin: standard
|
||||
Per MPI rank memory allocation (min/avg/max) = 35.58 | 35.68 | 35.77 Mbytes
|
||||
Step Temp KinEng PotEng Pxx Pyy Pzz TotEng
|
||||
0 300 14521.612 -1616144.1 22296.712 -29858.677 5721.0922 -1601622.5
|
||||
10 298.98728 14472.591 -1616093.8 21955.847 -24067.094 7389.149 -1601621.3
|
||||
20 294.76158 14268.044 -1615890 19179.258 -10513.494 10789.925 -1601622
|
||||
30 288.56967 13968.323 -1615591.2 13854.38 5833.0219 13949.731 -1601622.9
|
||||
40 282.06725 13653.571 -1615278.2 6259.981 19406.327 14947.938 -1601624.7
|
||||
50 274.84112 13303.787 -1614931.9 -2009.6844 26964.334 13346.855 -1601628.1
|
||||
60 266.20153 12885.585 -1614519.8 -8441.1628 28485.533 10195.428 -1601634.2
|
||||
70 259.17085 12545.262 -1614184.2 -11426.992 24941.517 6572.295 -1601639
|
||||
80 259.73004 12572.33 -1614216.8 -10867.596 16928.464 3033.9024 -1601644.5
|
||||
90 269.2352 13032.431 -1614679 -7962.3097 4931.5336 -280.21988 -1601646.5
|
||||
100 280.67181 13586.024 -1615234.3 -3606.1482 -8769.8463 -2527.5874 -1601648.3
|
||||
Loop time of 97.054 on 4 procs for 100 steps with 16240 atoms
|
||||
|
||||
Performance: 0.009 ns/day, 2695.944 hours/ns, 1.030 timesteps/s
|
||||
99.0% CPU use with 4 MPI tasks x 1 OpenMP threads
|
||||
|
||||
MPI task timing breakdown:
|
||||
Section | min time | avg time | max time |%varavg| %total
|
||||
---------------------------------------------------------------
|
||||
Pair | 94.83 | 95.764 | 96.883 | 9.2 | 98.67
|
||||
Neigh | 0 | 0 | 0 | 0.0 | 0.00
|
||||
Comm | 0.16123 | 1.2801 | 2.2132 | 79.9 | 1.32
|
||||
Output | 0.00056076 | 0.00066662 | 0.00095987 | 0.0 | 0.00
|
||||
Modify | 0.0048354 | 0.0049006 | 0.0049515 | 0.1 | 0.01
|
||||
Other | | 0.004639 | | | 0.00
|
||||
|
||||
Nlocal: 4060 ave 4080 max 4040 min
|
||||
Histogram: 2 0 0 0 0 0 0 0 0 2
|
||||
Nghost: 14972 ave 14992 max 14952 min
|
||||
Histogram: 2 0 0 0 0 0 0 0 0 2
|
||||
Neighs: 1.8135e+06 ave 1.82186e+06 max 1.80514e+06 min
|
||||
Histogram: 2 0 0 0 0 0 0 0 0 2
|
||||
|
||||
Total # of neighbors = 7253988
|
||||
Ave neighs/atom = 446.674
|
||||
Neighbor list builds = 0
|
||||
Dangerous builds = 0
|
||||
Total wall time: 0:01:38
|
||||
@ -1,69 +0,0 @@
|
||||
#define PORTABLECOMMENTFLAG
|
||||
#ifndef PORTABLECOMMENTFLAG
|
||||
// This is just a way to have portable comments
|
||||
// for both C++ and FORTRAN preprocessing.
|
||||
/* ///:EOH~ */
|
||||
/* */
|
||||
/* This file contains array dimension parameters for all the main */
|
||||
/* ReaxFF data structures, some of which need to be directly accessed */
|
||||
/* by Grasp C++ functions. If they are set too small, the calculation */
|
||||
/* will run out of allocated memory. If they are set too big, the machine */
|
||||
/* will not be able to allocate enough memory. */
|
||||
/* */
|
||||
|
||||
/* NNEIGHMAXDEF = Max number of neighbors / NATDEF */
|
||||
/* NATDEF = Max number of atoms */
|
||||
/* NATTOTDEF = Max number of global atoms */
|
||||
/* NSORTDEF = Max number of atom types */
|
||||
/* MBONDDEF = Max number of bonds connected to one atom */
|
||||
/* NAVIBDEF = for 2nd derivatives */
|
||||
/* NBOTYMDEF = Max number of bond types */
|
||||
/* NVATYMDEF = Max number of valency angle types */
|
||||
/* NTOTYMDEF = Max number of torsion angle types */
|
||||
/* NHBTYMDEF = Max number of hydrogen bond types */
|
||||
/* NODMTYMDEF = Max number of off-diagonal Morse types */
|
||||
/* NBOALLMAXDEF = Max number of all bonds */
|
||||
/* NBOMAXDEF = Max number of bonds */
|
||||
/* NHBMAXDEF = Max number of hydrogen bonds */
|
||||
/* NVAMAXDEF = Max number of valency angles */
|
||||
/* NOPMAXDEF = Max number of out of plane angles */
|
||||
/* NTOMAXDEF = Max number of torsion angles */
|
||||
/* NPAMAXDEF = Max number of general parameters in force field */
|
||||
/* NMOLMAXDEF = Max number of molecules in system */
|
||||
/* NMOLSETDEF = Max number of molecules in training set */
|
||||
/* MRESTRADEF = Max number of restraints */
|
||||
/* MTREGDEF = Max number of temperature regimes */
|
||||
/* MTZONEDEF = Max number of temperature zones */
|
||||
/* MVREGDEF = Max number of volume regimes */
|
||||
/* MVZONEDEF = Max number of volume zones */
|
||||
/* MEREGDEF = Max number of electric field regimes */
|
||||
/* MEZONEDEF = Max number of electric field zones */
|
||||
#endif
|
||||
|
||||
#define NNEIGHMAXDEF 200
|
||||
#define NATDEF 50000
|
||||
#define NATTOTDEF 1
|
||||
#define NSORTDEF 20
|
||||
#define MBONDDEF 20
|
||||
#define NAVIBDEF 50
|
||||
#define NBOTYMDEF 200
|
||||
#define NVATYMDEF 200
|
||||
#define NTOTYMDEF 200
|
||||
#define NHBTYMDEF 200
|
||||
#define NODMTYMDEF 20
|
||||
#define NBOALLMAXDEF 180000
|
||||
#define NBOMAXDEF 90000
|
||||
#define NHBMAXDEF 400000
|
||||
#define NVAMAXDEF 300000
|
||||
#define NOPMAXDEF 00010
|
||||
#define NTOMAXDEF 200000
|
||||
#define NPAMAXDEF 50
|
||||
#define NMOLMAXDEF 2000
|
||||
#define NMOLSETDEF 1500
|
||||
#define MRESTRADEF 100
|
||||
#define MTREGDEF 100
|
||||
#define MTZONEDEF 5
|
||||
#define MVREGDEF 100
|
||||
#define MVZONEDEF 6
|
||||
#define MEREGDEF 100
|
||||
#define MEZONEDEF 3
|
||||
@ -3,16 +3,24 @@
|
||||
# This file is part of LAMMPS
|
||||
# Created by Christoph Junghans and Richard Berger
|
||||
cmake_minimum_required(VERSION 3.10)
|
||||
# set policy to silence warnings about ignoring <PackageName>_ROOT but use it
|
||||
if(POLICY CMP0074)
|
||||
cmake_policy(SET CMP0074 NEW)
|
||||
endif()
|
||||
########################################
|
||||
|
||||
project(lammps CXX)
|
||||
set(SOVERSION 0)
|
||||
get_filename_component(LAMMPS_SOURCE_DIR ${CMAKE_CURRENT_SOURCE_DIR}/../src ABSOLUTE)
|
||||
get_filename_component(LAMMPS_LIB_SOURCE_DIR ${CMAKE_CURRENT_SOURCE_DIR}/../lib ABSOLUTE)
|
||||
|
||||
get_filename_component(LAMMPS_DIR ${CMAKE_CURRENT_SOURCE_DIR}/.. ABSOLUTE)
|
||||
get_filename_component(LAMMPS_LIB_BINARY_DIR ${CMAKE_BINARY_DIR}/lib ABSOLUTE)
|
||||
get_filename_component(LAMMPS_DOC_DIR ${CMAKE_CURRENT_SOURCE_DIR}/../doc ABSOLUTE)
|
||||
get_filename_component(LAMMPS_TOOLS_DIR ${CMAKE_CURRENT_SOURCE_DIR}/../tools ABSOLUTE)
|
||||
get_filename_component(LAMMPS_PYTHON_DIR ${CMAKE_CURRENT_SOURCE_DIR}/../python ABSOLUTE)
|
||||
get_filename_component(LAMMPS_POTENTIALS_DIR ${CMAKE_CURRENT_SOURCE_DIR}/../potentials ABSOLUTE)
|
||||
|
||||
set(LAMMPS_SOURCE_DIR ${LAMMPS_DIR}/src)
|
||||
set(LAMMPS_LIB_SOURCE_DIR ${LAMMPS_DIR}/lib)
|
||||
set(LAMMPS_DOC_DIR ${LAMMPS_DIR}/doc)
|
||||
set(LAMMPS_TOOLS_DIR ${LAMMPS_DIR}/tools)
|
||||
set(LAMMPS_PYTHON_DIR ${LAMMPS_DIR}/python)
|
||||
set(LAMMPS_POTENTIALS_DIR ${LAMMPS_DIR}/potentials)
|
||||
|
||||
find_package(Git)
|
||||
|
||||
@ -24,6 +32,12 @@ endif()
|
||||
# Cmake modules/macros are in a subdirectory to keep this file cleaner
|
||||
set(CMAKE_MODULE_PATH ${CMAKE_CURRENT_SOURCE_DIR}/Modules)
|
||||
|
||||
# make sure LIBRARY_PATH is set if environment variable is set
|
||||
if (DEFINED ENV{LIBRARY_PATH})
|
||||
list(APPEND CMAKE_LIBRARY_PATH "$ENV{LIBRARY_PATH}")
|
||||
message(STATUS "Appending $ENV{LIBRARY_PATH} to CMAKE_LIBRARY_PATH: ${CMAKE_LIBRARY_PATH}")
|
||||
endif()
|
||||
|
||||
include(LAMMPSUtils)
|
||||
|
||||
get_lammps_version(${LAMMPS_SOURCE_DIR}/version.h PROJECT_VERSION)
|
||||
@ -43,7 +57,6 @@ check_for_autogen_files(${LAMMPS_SOURCE_DIR})
|
||||
# compiler tests
|
||||
# these need ot be done early (before further tests).
|
||||
#####################################################################
|
||||
include(CheckCCompilerFlag)
|
||||
include(CheckIncludeFileCXX)
|
||||
|
||||
# set required compiler flags and compiler/CPU arch specific optimizations
|
||||
@ -57,11 +70,11 @@ if(${CMAKE_CXX_COMPILER_ID} STREQUAL "Intel")
|
||||
endif()
|
||||
|
||||
if(${CMAKE_CXX_COMPILER_ID} STREQUAL "GNU")
|
||||
set(CMAKE_TUNE_DEFAULT "-ffast-math -march=native")
|
||||
set(CMAKE_TUNE_DEFAULT "-march=native")
|
||||
endif()
|
||||
|
||||
if(${CMAKE_CXX_COMPILER_ID} STREQUAL "Clang")
|
||||
set(CMAKE_TUNE_DEFAULT "-ffast-math -march=native")
|
||||
set(CMAKE_TUNE_DEFAULT "-march=native")
|
||||
endif()
|
||||
|
||||
# we require C++11 without extensions
|
||||
@ -69,15 +82,6 @@ set(CMAKE_CXX_STANDARD 11)
|
||||
set(CMAKE_CXX_STANDARD_REQUIRED ON)
|
||||
set(CMAKE_CXX_EXTENSIONS OFF)
|
||||
|
||||
# GNU compiler specific features for testing
|
||||
if (${CMAKE_CXX_COMPILER_ID} STREQUAL "GNU")
|
||||
option(ENABLE_COVERAGE "Enable collecting code coverage data" OFF)
|
||||
mark_as_advanced(ENABLE_COVERAGE)
|
||||
if(ENABLE_COVERAGE)
|
||||
set (CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} --coverage")
|
||||
endif()
|
||||
endif()
|
||||
|
||||
########################################################################
|
||||
# User input options #
|
||||
########################################################################
|
||||
@ -108,11 +112,11 @@ install(TARGETS lmp EXPORT LAMMPS_Targets DESTINATION ${CMAKE_INSTALL_BINDIR})
|
||||
option(CMAKE_VERBOSE_MAKEFILE "Generate verbose Makefiles" OFF)
|
||||
|
||||
set(STANDARD_PACKAGES ASPHERE BODY CLASS2 COLLOID COMPRESS DIPOLE
|
||||
GRANULAR KSPACE LATTE MANYBODY MC MESSAGE MISC MOLECULE PERI POEMS QEQ
|
||||
REPLICA RIGID SHOCK SPIN SNAP SRD KIM PYTHON MSCG MPIIO VORONOI
|
||||
GRANULAR KSPACE LATTE MANYBODY MC MESSAGE MISC MLIAP MOLECULE PERI POEMS
|
||||
QEQ REPLICA RIGID SHOCK SPIN SNAP SRD KIM PYTHON MSCG MPIIO VORONOI
|
||||
USER-ATC USER-AWPMD USER-BOCS USER-CGDNA USER-MESODPD USER-CGSDK USER-COLVARS
|
||||
USER-DIFFRACTION USER-DPD USER-DRUDE USER-EFF USER-FEP USER-H5MD USER-LB
|
||||
USER-MANIFOLD USER-MEAMC USER-MGPT USER-MISC USER-MOFFF USER-MOLFILE
|
||||
USER-MANIFOLD USER-MEAMC USER-MESONT USER-MGPT USER-MISC USER-MOFFF USER-MOLFILE
|
||||
USER-NETCDF USER-PHONON USER-PLUMED USER-PTM USER-QTB USER-REACTION
|
||||
USER-REAXC USER-SCAFACOS USER-SDPD USER-SMD USER-SMTBQ USER-SPH USER-TALLY
|
||||
USER-UEF USER-VTK USER-QUIP USER-QMMM USER-YAFF USER-ADIOS)
|
||||
@ -135,23 +139,20 @@ if(PKG_USER-ADIOS)
|
||||
target_link_libraries(lammps PRIVATE adios2::adios2)
|
||||
endif()
|
||||
|
||||
if (CMAKE_SYSTEM_NAME STREQUAL Windows)
|
||||
option(BUILD_MPI "Build MPI version" OFF)
|
||||
else()
|
||||
# do MPI detection after language activation,
|
||||
# in case MPI for these languages is required
|
||||
if(NOT CMAKE_CROSSCOMPILING)
|
||||
set(MPI_CXX_SKIP_MPICXX TRUE)
|
||||
find_package(MPI QUIET)
|
||||
option(BUILD_MPI "Build MPI version" ${MPI_FOUND})
|
||||
else()
|
||||
option(BUILD_MPI "Build MPI version" OFF)
|
||||
endif()
|
||||
|
||||
if(BUILD_MPI)
|
||||
# We use a non-standard procedure to compile with MPI on windows
|
||||
if (CMAKE_SYSTEM_NAME STREQUAL Windows)
|
||||
# We use a non-standard procedure to cross-compile with MPI on Windows
|
||||
if((CMAKE_SYSTEM_NAME STREQUAL Windows) AND CMAKE_CROSSCOMPILING)
|
||||
include(MPI4WIN)
|
||||
target_link_libraries(lammps PUBLIC MPI::MPI_CXX)
|
||||
else()
|
||||
set(MPI_CXX_SKIP_MPICXX ON)
|
||||
find_package(MPI REQUIRED)
|
||||
target_link_libraries(lammps PUBLIC MPI::MPI_CXX)
|
||||
option(LAMMPS_LONGLONG_TO_LONG "Workaround if your system or MPI version does not recognize 'long long' data types" OFF)
|
||||
@ -163,9 +164,6 @@ else()
|
||||
enable_language(C)
|
||||
file(GLOB MPI_SOURCES ${LAMMPS_SOURCE_DIR}/STUBS/mpi.c)
|
||||
add_library(mpi_stubs STATIC ${MPI_SOURCES})
|
||||
if(NOT BUILD_SHARED_LIBS)
|
||||
install(TARGETS mpi_stubs EXPORT LAMMPS_Targets LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR} ARCHIVE DESTINATION ${CMAKE_INSTALL_LIBDIR})
|
||||
endif()
|
||||
set_target_properties(mpi_stubs PROPERTIES OUTPUT_NAME lammps_mpi_stubs${LAMMPS_MACHINE})
|
||||
target_include_directories(mpi_stubs PUBLIC $<BUILD_INTERFACE:${LAMMPS_SOURCE_DIR}/STUBS> $<INSTALL_INTERFACE:${CMAKE_INSTALL_INCLUDEDIR}/lammps/mpi>)
|
||||
install(FILES ${LAMMPS_SOURCE_DIR}/STUBS/mpi.h DESTINATION ${CMAKE_INSTALL_INCLUDEDIR}/lammps/mpi)
|
||||
@ -202,6 +200,7 @@ endif()
|
||||
|
||||
# "hard" dependencies between packages resulting
|
||||
# in an error instead of skipping over files
|
||||
pkg_depends(MLIAP SNAP)
|
||||
pkg_depends(MPIIO MPI)
|
||||
pkg_depends(USER-ATC MANYBODY)
|
||||
pkg_depends(USER-LB MPI)
|
||||
@ -240,6 +239,48 @@ if(BUILD_OMP)
|
||||
target_link_libraries(lammps PRIVATE OpenMP::OpenMP_CXX)
|
||||
endif()
|
||||
|
||||
# Compiler specific features for testing
|
||||
if(${CMAKE_CXX_COMPILER_ID} STREQUAL "GNU")
|
||||
option(ENABLE_COVERAGE "Enable collecting code coverage data" OFF)
|
||||
mark_as_advanced(ENABLE_COVERAGE)
|
||||
if(ENABLE_COVERAGE)
|
||||
if(CMAKE_VERSION VERSION_LESS 3.13)
|
||||
if(CMAKE_CXX_FLAGS)
|
||||
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} --coverage")
|
||||
else()
|
||||
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_${CMAKE_BUILD_TYPE}_FLAGS} --coverage")
|
||||
endif()
|
||||
else()
|
||||
target_compile_options(lammps PUBLIC --coverage)
|
||||
target_link_options(lammps PUBLIC --coverage)
|
||||
endif()
|
||||
endif()
|
||||
endif()
|
||||
|
||||
set(ENABLE_SANITIZER "none" CACHE STRING "Select a code sanitizer option (none (default), address, leak, thread, undefined)")
|
||||
mark_as_advanced(ENABLE_SANITIZER)
|
||||
set(ENABLE_SANITIZER_VALUES none address leak thread undefined)
|
||||
set_property(CACHE ENABLE_SANITIZER PROPERTY STRINGS ${ENABLE_SANITIZER_VALUES})
|
||||
validate_option(ENABLE_SANITIZER ENABLE_SANITIZER_VALUES)
|
||||
string(TOLOWER ${ENABLE_SANITIZER} ENABLE_SANITIZER)
|
||||
if(NOT ENABLE_SANITIZER STREQUAL "none")
|
||||
if((${CMAKE_CXX_COMPILER_ID} STREQUAL "GNU") OR (${CMAKE_CXX_COMPILER_ID} STREQUAL "Clang"))
|
||||
if(CMAKE_VERSION VERSION_LESS 3.13)
|
||||
if(CMAKE_CXX_FLAGS)
|
||||
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -fsanitize=${ENABLE_SANITIZER}")
|
||||
else()
|
||||
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_${CMAKE_BUILD_TYPE}_FLAGS} -fsanitize=${ENABLE_SANITIZER}")
|
||||
endif()
|
||||
else()
|
||||
target_compile_options(lammps PUBLIC -fsanitize=${ENABLE_SANITIZER})
|
||||
target_link_options(lammps PUBLIC -fsanitize=${ENABLE_SANITIZER})
|
||||
endif()
|
||||
else()
|
||||
message(WARNING "ENABLE_SANITIZER option not supported by ${CMAKE_CXX_COMPILER_ID} compilers. Ignoring.")
|
||||
set(ENABLE_SANITIZER "none")
|
||||
endif()
|
||||
endif()
|
||||
|
||||
if(PKG_MSCG OR PKG_USER-ATC OR PKG_USER-AWPMD OR PKG_USER-QUIP OR PKG_LATTE)
|
||||
enable_language(C)
|
||||
find_package(LAPACK)
|
||||
@ -252,9 +293,6 @@ if(PKG_MSCG OR PKG_USER-ATC OR PKG_USER-AWPMD OR PKG_USER-QUIP OR PKG_LATTE)
|
||||
enable_language(Fortran)
|
||||
file(GLOB LAPACK_SOURCES ${LAMMPS_LIB_SOURCE_DIR}/linalg/[^.]*.[fF])
|
||||
add_library(linalg STATIC ${LAPACK_SOURCES})
|
||||
if(NOT BUILD_SHARED_LIBS)
|
||||
install(TARGETS linalg EXPORT LAMMPS_Targets LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR} ARCHIVE DESTINATION ${CMAKE_INSTALL_LIBDIR})
|
||||
endif()
|
||||
set_target_properties(linalg PROPERTIES OUTPUT_NAME lammps_linalg${LAMMPS_MACHINE})
|
||||
set(BLAS_LIBRARIES "$<TARGET_FILE:linalg>")
|
||||
set(LAPACK_LIBRARIES "$<TARGET_FILE:linalg>")
|
||||
@ -330,14 +368,8 @@ endforeach()
|
||||
|
||||
set(CMAKE_TUNE_FLAGS "${CMAKE_TUNE_DEFAULT}" CACHE STRING "Compiler specific optimization or instrumentation")
|
||||
separate_arguments(CMAKE_TUNE_FLAGS)
|
||||
include(CheckCXXCompilerFlag)
|
||||
foreach(_FLAG ${CMAKE_TUNE_FLAGS})
|
||||
check_cxx_compiler_flag("${_FLAG}" COMPILER_SUPPORTS${_FLAG})
|
||||
if(COMPILER_SUPPORTS${_FLAG})
|
||||
target_compile_options(lammps PRIVATE ${_FLAG})
|
||||
else()
|
||||
message(WARNING "${_FLAG} found in CMAKE_TUNE_FLAGS, but not supported by the compiler, skipping")
|
||||
endif()
|
||||
target_compile_options(lammps PRIVATE ${_FLAG})
|
||||
endforeach()
|
||||
########################################################################
|
||||
# Basic system tests (standard libraries, headers, functions, types) #
|
||||
@ -359,6 +391,15 @@ target_link_libraries(lammps PRIVATE ${MATH_LIBRARIES})
|
||||
include(StyleHeaderUtils)
|
||||
RegisterStyles(${LAMMPS_SOURCE_DIR})
|
||||
|
||||
########################################################
|
||||
# Fetch missing external files and archives for packages
|
||||
########################################################
|
||||
foreach(PKG ${STANDARD_PACKAGES} ${SUFFIX_PACKAGES})
|
||||
if(PKG_${PKG})
|
||||
FetchPotentials(${LAMMPS_SOURCE_DIR}/${PKG} ${LAMMPS_POTENTIALS_DIR})
|
||||
endif()
|
||||
endforeach()
|
||||
|
||||
##############################################
|
||||
# add sources of enabled packages
|
||||
############################################
|
||||
@ -405,17 +446,20 @@ endforeach()
|
||||
##############################################
|
||||
# add lib sources of (simple) enabled packages
|
||||
############################################
|
||||
foreach(SIMPLE_LIB POEMS USER-ATC USER-AWPMD USER-H5MD)
|
||||
foreach(SIMPLE_LIB POEMS USER-ATC USER-AWPMD USER-H5MD USER-MESONT)
|
||||
if(PKG_${SIMPLE_LIB})
|
||||
string(REGEX REPLACE "^USER-" "" PKG_LIB "${SIMPLE_LIB}")
|
||||
string(TOLOWER "${PKG_LIB}" PKG_LIB)
|
||||
file(GLOB_RECURSE ${PKG_LIB}_SOURCES
|
||||
${LAMMPS_LIB_SOURCE_DIR}/${PKG_LIB}/[^.]*.c
|
||||
${LAMMPS_LIB_SOURCE_DIR}/${PKG_LIB}/[^.]*.cpp)
|
||||
add_library(${PKG_LIB} STATIC ${${PKG_LIB}_SOURCES})
|
||||
if(NOT BUILD_SHARED_LIBS)
|
||||
install(TARGETS ${PKG_LIB} EXPORT LAMMPS_Targets LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR} ARCHIVE DESTINATION ${CMAKE_INSTALL_LIBDIR})
|
||||
if(PKG_LIB STREQUAL mesont)
|
||||
enable_language(Fortran)
|
||||
file(GLOB_RECURSE ${PKG_LIB}_SOURCES
|
||||
${LAMMPS_LIB_SOURCE_DIR}/${PKG_LIB}/[^.]*.f90)
|
||||
else()
|
||||
file(GLOB_RECURSE ${PKG_LIB}_SOURCES
|
||||
${LAMMPS_LIB_SOURCE_DIR}/${PKG_LIB}/[^.]*.c
|
||||
${LAMMPS_LIB_SOURCE_DIR}/${PKG_LIB}/[^.]*.cpp)
|
||||
endif()
|
||||
add_library(${PKG_LIB} STATIC ${${PKG_LIB}_SOURCES})
|
||||
set_target_properties(${PKG_LIB} PROPERTIES OUTPUT_NAME lammps_${PKG_LIB}${LAMMPS_MACHINE})
|
||||
target_link_libraries(lammps PRIVATE ${PKG_LIB})
|
||||
if(PKG_LIB STREQUAL awpmd)
|
||||
@ -436,7 +480,12 @@ if(PKG_USER-ATC)
|
||||
if(LAMMPS_SIZES STREQUAL BIGBIG)
|
||||
message(FATAL_ERROR "The USER-ATC Package is not compatible with -DLAMMPS_BIGBIG")
|
||||
endif()
|
||||
target_link_libraries(atc PRIVATE ${LAPACK_LIBRARIES} MPI::MPI_CXX)
|
||||
target_link_libraries(atc PRIVATE ${LAPACK_LIBRARIES})
|
||||
if(BUILD_MPI)
|
||||
target_link_libraries(atc PRIVATE MPI::MPI_CXX)
|
||||
else()
|
||||
target_link_libraries(atc PRIVATE mpi_stubs)
|
||||
endif()
|
||||
target_include_directories(atc PRIVATE ${LAMMPS_SOURCE_DIR})
|
||||
target_compile_definitions(atc PRIVATE -DLAMMPS_${LAMMPS_SIZES})
|
||||
endif()
|
||||
@ -497,7 +546,7 @@ execute_process(COMMAND ${CMAKE_COMMAND} -E copy_if_different "${LAMMPS_STYLE_HE
|
||||
# Generate lmpgitversion.h
|
||||
######################################
|
||||
add_custom_target(gitversion COMMAND ${CMAKE_COMMAND}
|
||||
-DCMAKE_CURRENT_SOURCE_DIR="${CMAKE_CURRENT_SOURCE_DIR}"
|
||||
-DLAMMPS_DIR="${LAMMPS_DIR}"
|
||||
-DGIT_EXECUTABLE="${GIT_EXECUTABLE}"
|
||||
-DGIT_FOUND="${GIT_FOUND}"
|
||||
-DLAMMPS_STYLE_HEADERS_DIR="${LAMMPS_STYLE_HEADERS_DIR}"
|
||||
@ -522,14 +571,15 @@ endif()
|
||||
|
||||
set_target_properties(lammps PROPERTIES OUTPUT_NAME lammps${LAMMPS_MACHINE})
|
||||
set_target_properties(lammps PROPERTIES SOVERSION ${SOVERSION})
|
||||
install(TARGETS lammps EXPORT LAMMPS_Targets LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR} ARCHIVE DESTINATION ${CMAKE_INSTALL_LIBDIR})
|
||||
target_include_directories(lammps PUBLIC $<INSTALL_INTERFACE:${CMAKE_INSTALL_INCLUDEDIR}>)
|
||||
file(MAKE_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}/includes/lammps)
|
||||
foreach(_HEADER ${LAMMPS_CXX_HEADERS})
|
||||
add_custom_command(OUTPUT ${CMAKE_CURRENT_BINARY_DIR}/includes/lammps/${_HEADER} COMMAND ${CMAKE_COMMAND} -E copy_if_different ${LAMMPS_SOURCE_DIR}/${_HEADER} ${CMAKE_CURRENT_BINARY_DIR}/includes/lammps/${_HEADER} DEPENDS ${LAMMPS_SOURCE_DIR}/${_HEADER})
|
||||
add_custom_target(${_HEADER} DEPENDS ${CMAKE_CURRENT_BINARY_DIR}/includes/lammps/${_HEADER})
|
||||
add_dependencies(lammps ${_HEADER})
|
||||
install(FILES ${LAMMPS_SOURCE_DIR}/${_HEADER} DESTINATION ${CMAKE_INSTALL_INCLUDEDIR}/lammps)
|
||||
if(BUILD_SHARED_LIBS)
|
||||
install(FILES ${LAMMPS_SOURCE_DIR}/${_HEADER} DESTINATION ${CMAKE_INSTALL_INCLUDEDIR}/lammps)
|
||||
endif()
|
||||
endforeach()
|
||||
target_include_directories(lammps INTERFACE $<BUILD_INTERFACE:${CMAKE_CURRENT_BINARY_DIR}/includes>)
|
||||
add_library(LAMMPS::lammps ALIAS lammps)
|
||||
@ -538,15 +588,16 @@ set(LAMMPS_API_DEFINES)
|
||||
foreach(_DEF ${LAMMPS_DEFINES})
|
||||
set(LAMMPS_API_DEFINES "${LAMMPS_API_DEFINES} -D${_DEF}")
|
||||
endforeach()
|
||||
configure_file(pkgconfig/liblammps.pc.in ${CMAKE_CURRENT_BINARY_DIR}/liblammps${LAMMPS_MACHINE}.pc @ONLY)
|
||||
install(FILES ${CMAKE_CURRENT_BINARY_DIR}/liblammps${LAMMPS_MACHINE}.pc DESTINATION ${CMAKE_INSTALL_LIBDIR}/pkgconfig)
|
||||
install(EXPORT LAMMPS_Targets FILE LAMMPS_Targets.cmake NAMESPACE LAMMPS:: DESTINATION ${CMAKE_INSTALL_LIBDIR}/cmake/LAMMPS)
|
||||
file(GLOB MODULE_FILES ${CMAKE_CURRENT_SOURCE_DIR}/Modules/Find*.cmake)
|
||||
install(FILES ${MODULE_FILES} DESTINATION ${CMAKE_INSTALL_LIBDIR}/cmake/LAMMPS)
|
||||
include(CMakePackageConfigHelpers)
|
||||
configure_file(LAMMPSConfig.cmake.in ${CMAKE_CURRENT_BINARY_DIR}/LAMMPSConfig.cmake @ONLY)
|
||||
write_basic_package_version_file("LAMMPSConfigVersion.cmake" VERSION ${PROJECT_VERSION} COMPATIBILITY ExactVersion)
|
||||
install(FILES "${CMAKE_CURRENT_BINARY_DIR}/LAMMPSConfig.cmake" "${CMAKE_CURRENT_BINARY_DIR}/LAMMPSConfigVersion.cmake" DESTINATION ${CMAKE_INSTALL_LIBDIR}/cmake/LAMMPS)
|
||||
if(BUILD_SHARED_LIBS)
|
||||
install(TARGETS lammps EXPORT LAMMPS_Targets LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR} ARCHIVE DESTINATION ${CMAKE_INSTALL_LIBDIR})
|
||||
configure_file(pkgconfig/liblammps.pc.in ${CMAKE_CURRENT_BINARY_DIR}/liblammps${LAMMPS_MACHINE}.pc @ONLY)
|
||||
install(FILES ${CMAKE_CURRENT_BINARY_DIR}/liblammps${LAMMPS_MACHINE}.pc DESTINATION ${CMAKE_INSTALL_LIBDIR}/pkgconfig)
|
||||
install(EXPORT LAMMPS_Targets FILE LAMMPS_Targets.cmake NAMESPACE LAMMPS:: DESTINATION ${CMAKE_INSTALL_LIBDIR}/cmake/LAMMPS)
|
||||
include(CMakePackageConfigHelpers)
|
||||
configure_file(LAMMPSConfig.cmake.in ${CMAKE_CURRENT_BINARY_DIR}/LAMMPSConfig.cmake @ONLY)
|
||||
write_basic_package_version_file("LAMMPSConfigVersion.cmake" VERSION ${PROJECT_VERSION} COMPATIBILITY ExactVersion)
|
||||
install(FILES "${CMAKE_CURRENT_BINARY_DIR}/LAMMPSConfig.cmake" "${CMAKE_CURRENT_BINARY_DIR}/LAMMPSConfigVersion.cmake" DESTINATION ${CMAKE_INSTALL_LIBDIR}/cmake/LAMMPS)
|
||||
endif()
|
||||
install(FILES ${LAMMPS_DOC_DIR}/lammps.1 DESTINATION ${CMAKE_INSTALL_MANDIR}/man1 RENAME ${LAMMPS_BINARY}.1)
|
||||
|
||||
if(BUILD_TOOLS)
|
||||
@ -556,10 +607,16 @@ if(BUILD_TOOLS)
|
||||
|
||||
include(CheckGeneratorSupport)
|
||||
if(CMAKE_GENERATOR_SUPPORT_FORTRAN)
|
||||
enable_language(Fortran)
|
||||
add_executable(chain.x ${LAMMPS_TOOLS_DIR}/chain.f)
|
||||
target_link_libraries(chain.x PRIVATE ${CMAKE_Fortran_IMPLICIT_LINK_LIBRARIES})
|
||||
install(TARGETS chain.x DESTINATION ${CMAKE_INSTALL_BINDIR})
|
||||
include(CheckLanguage)
|
||||
check_language(Fortran)
|
||||
if(CMAKE_Fortran_COMPILER)
|
||||
enable_language(Fortran)
|
||||
add_executable(chain.x ${LAMMPS_TOOLS_DIR}/chain.f)
|
||||
target_link_libraries(chain.x PRIVATE ${CMAKE_Fortran_IMPLICIT_LINK_LIBRARIES})
|
||||
install(TARGETS chain.x DESTINATION ${CMAKE_INSTALL_BINDIR})
|
||||
else()
|
||||
message(WARNING "No suitable Fortran compiler found, skipping building 'chain.x'")
|
||||
endif()
|
||||
else()
|
||||
message(WARNING "CMake build doesn't support fortran, skipping building 'chain.x'")
|
||||
endif()
|
||||
@ -600,6 +657,8 @@ install(
|
||||
###############################################################################
|
||||
if(BUILD_SHARED_LIBS)
|
||||
if(CMAKE_VERSION VERSION_LESS 3.12)
|
||||
# adjust so we find Python 3 versions before Python 2 on old systems with old CMake
|
||||
set(Python_ADDITIONAL_VERSIONS 3.8 3.7 3.6 3.5)
|
||||
find_package(PythonInterp) # Deprecated since version 3.12
|
||||
if(PYTHONINTERP_FOUND)
|
||||
set(Python_EXECUTABLE ${PYTHON_EXECUTABLE})
|
||||
@ -651,6 +710,7 @@ endif()
|
||||
|
||||
include(Testing)
|
||||
include(CodeCoverage)
|
||||
include(CodingStandard)
|
||||
|
||||
###############################################################################
|
||||
# Print package summary
|
||||
@ -705,6 +765,7 @@ else()
|
||||
endif()
|
||||
if(BUILD_MPI)
|
||||
message(STATUS "<<< MPI flags >>>
|
||||
-- MPI_defines: ${MPI_CXX_COMPILE_DEFINITIONS}
|
||||
-- MPI includes: ${MPI_CXX_INCLUDE_PATH}
|
||||
-- MPI libraries: ${MPI_CXX_LIBRARIES};${MPI_Fortran_LIBRARIES}")
|
||||
endif()
|
||||
@ -754,3 +815,6 @@ if(PKG_KSPACE)
|
||||
endif()
|
||||
endif()
|
||||
endif()
|
||||
if(BUILD_DOC)
|
||||
message(STATUS "<<< Building HTML Manual >>>")
|
||||
endif()
|
||||
|
||||
@ -1,87 +1,5 @@
|
||||
set(CMAKE_MODULE_PATH ${CMAKE_CURRENT_LIST_DIR})
|
||||
include(CMakeFindDependencyMacro)
|
||||
if(@BUILD_MPI@)
|
||||
find_dependency(MPI REQUIRED CXX)
|
||||
endif()
|
||||
if(@PKG_KSPACE@)
|
||||
if(@FFT@ STREQUAL "FFTW3")
|
||||
find_dependency(@FFTW@ REQUIRED MODULE)
|
||||
endif()
|
||||
endif()
|
||||
if(NOT @BUILD_SHARED_LIBS@)
|
||||
if(@BUILD_OMP@)
|
||||
find_dependency(OpenMP REQUIRED)
|
||||
endif()
|
||||
if(@WITH_JPEG@)
|
||||
find_dependency(JPEG REQUIRED)
|
||||
endif()
|
||||
if(@WITH_PNG@)
|
||||
find_dependency(PNG REQUIRED)
|
||||
find_dependency(ZLIB REQUIRED)
|
||||
endif()
|
||||
if(@PKG_KIM@)
|
||||
find_dependency(PkgConfig REQUIRED)
|
||||
pkg_check_modules(KIM-API REQUIRED IMPORTED_TARGET libkim-api>=@KIM-API_MIN_VERSION@)
|
||||
if(@CURL_FOUND@)
|
||||
find_dependency(CURL REQUIRED)
|
||||
endif()
|
||||
endif()
|
||||
if(@PKG_USER-SMD@)
|
||||
find_dependency(Eigen3 NO_MODULE REQUIRED)
|
||||
endif()
|
||||
if(@PKG_USER-SCAFACOS@)
|
||||
find_dependency(PkgConfig REQUIRED)
|
||||
find_ependency(GSL REQUIRED)
|
||||
find_dependency(MPI REQUIRED C Fortran)
|
||||
pkg_check_modules(SCAFACOS REQUIRED IMPORTED_TARGET scafacos)
|
||||
endif()
|
||||
if(@PKG_PYTHON@ AND NOT CMAKE_VERSION VERSION_LESS 3.12)
|
||||
find_package(Python REQUIRED COMPONENTS Development)
|
||||
endif()
|
||||
if(@PKG_COMPRESS@)
|
||||
find_dependency(ZLIB REQUIRED)
|
||||
endif()
|
||||
if(@PKG_KOKKOS@)
|
||||
if(@EXTERNAL_KOKKOS@)
|
||||
find_dependency(Kokkos 3 REQUIRED)
|
||||
endif()
|
||||
endif()
|
||||
if(@PKG_VORONOI@)
|
||||
find_dependency(VORO REQUIRED)
|
||||
endif()
|
||||
if(@PKG_USER-INTEL@)
|
||||
if(@INTEL_LRT_MODE@ STREQUAL "THREADS")
|
||||
find_dependency(Threads REQUIRED)
|
||||
endif()
|
||||
if(@TBB_MALLOC_FOUND@)
|
||||
find_ependency(TBB_MALLOC REQUIRED)
|
||||
endif()
|
||||
endif()
|
||||
if(@PKG_USER-ADIOS@)
|
||||
find_ependency(ADIOS2 REQUIRED)
|
||||
endif()
|
||||
if(@PKG_LATTE@)
|
||||
find_ependency(LATTE REQUIRED)
|
||||
endif()
|
||||
if(@PKG_MESSAGE@)
|
||||
if(@MESSAGE_ZMQ@)
|
||||
find_ependency(ZMQ REQUIRED)
|
||||
endif()
|
||||
endif()
|
||||
if(@PKG_MSCG@)
|
||||
find_ependency(GSL REQUIRED)
|
||||
find_ependency(MSCG REQUIRED)
|
||||
endif()
|
||||
if(@USER-NETCDF@)
|
||||
if(@NETCDF_FOUND@)
|
||||
find_ependency(NetCDF REQUIRED)
|
||||
endif()
|
||||
if(@PNETCDF_FOUND@)
|
||||
find_ependency(PNetCDF REQUIRED)
|
||||
endif()
|
||||
endif()
|
||||
if(@PKG_QUIP@)
|
||||
find_ependency(QUIP REQUIRED)
|
||||
endif()
|
||||
endif()
|
||||
include("${CMAKE_CURRENT_LIST_DIR}/LAMMPS_Targets.cmake")
|
||||
|
||||
@ -15,14 +15,35 @@ if(ENABLE_COVERAGE)
|
||||
gen_coverage_xml
|
||||
COMMAND ${GCOVR_BINARY} -s -x -r ${ABSOLUTE_LAMMPS_SOURCE_DIR} --object-directory=${CMAKE_BINARY_DIR} -o coverage.xml
|
||||
WORKING_DIRECTORY ${CMAKE_BINARY_DIR}
|
||||
COMMENT "Generating XML Coverage Report..."
|
||||
COMMENT "Generating XML coverage report..."
|
||||
)
|
||||
|
||||
set(COVERAGE_HTML_DIR ${CMAKE_BINARY_DIR}/coverage_html)
|
||||
|
||||
add_custom_target(coverage_html_folder
|
||||
COMMAND ${CMAKE_COMMAND} -E make_directory ${COVERAGE_HTML_DIR})
|
||||
|
||||
add_custom_target(
|
||||
gen_coverage_html
|
||||
COMMAND ${GCOVR_BINARY} -s --html --html-details -r ${ABSOLUTE_LAMMPS_SOURCE_DIR} --object-directory=${CMAKE_BINARY_DIR} -o coverage.html
|
||||
COMMAND ${GCOVR_BINARY} -s --html --html-details -r ${ABSOLUTE_LAMMPS_SOURCE_DIR} --object-directory=${CMAKE_BINARY_DIR} -o ${COVERAGE_HTML_DIR}/index.html
|
||||
WORKING_DIRECTORY ${CMAKE_BINARY_DIR}
|
||||
COMMENT "Generating HTML Coverage Report..."
|
||||
COMMENT "Generating HTML coverage report..."
|
||||
)
|
||||
add_dependencies(gen_coverage_html coverage_html_folder)
|
||||
|
||||
add_custom_target(clean_coverage_html
|
||||
${CMAKE_COMMAND} -E remove_directory ${COVERAGE_HTML_DIR}
|
||||
COMMENT "Deleting HTML coverage report..."
|
||||
)
|
||||
|
||||
add_custom_target(reset_coverage
|
||||
${CMAKE_COMMAND} -E remove -f */*.gcda */*/*.gcda */*/*/*.gcda
|
||||
*/*/*/*/*.gcda */*/*/*/*/*.gcda */*/*/*/*/*/*.gcda
|
||||
*/*/*/*/*/*/*/*.gcda */*/*/*/*/*/*/*/*.gcda
|
||||
*/*/*/*/*/*/*/*/*/*.gcda */*/*/*/*/*/*/*/*/*/*.gcda
|
||||
WORKIND_DIRECTORY ${CMAKE_BINARY_DIR}
|
||||
COMMENT "Deleting coverage data files..."
|
||||
)
|
||||
add_dependencies(reset_coverage clean_coverage_html)
|
||||
endif()
|
||||
endif()
|
||||
|
||||
34
cmake/Modules/CodingStandard.cmake
Normal file
34
cmake/Modules/CodingStandard.cmake
Normal file
@ -0,0 +1,34 @@
|
||||
if(CMAKE_VERSION VERSION_LESS 3.12)
|
||||
find_package(PythonInterp 3.5 QUIET) # Deprecated since version 3.12
|
||||
if(PYTHONINTERP_FOUND)
|
||||
set(Python3_EXECUTABLE ${PYTHON_EXECUTABLE})
|
||||
set(Python3_VERSION ${PYTHON_VERSION_STRING})
|
||||
endif()
|
||||
else()
|
||||
find_package(Python3 COMPONENTS Interpreter QUIET)
|
||||
endif()
|
||||
|
||||
if (Python3_EXECUTABLE)
|
||||
if(Python3_VERSION VERSION_GREATER_EQUAL 3.5)
|
||||
add_custom_target(
|
||||
check-whitespace
|
||||
${Python3_EXECUTABLE} ${LAMMPS_TOOLS_DIR}/coding_standard/whitespace.py .
|
||||
WORKING_DIRECTORY ${LAMMPS_DIR}
|
||||
COMMENT "Check for whitespace errors")
|
||||
add_custom_target(
|
||||
check-permissions
|
||||
${Python3_EXECUTABLE} ${LAMMPS_TOOLS_DIR}/coding_standard/permissions.py .
|
||||
WORKING_DIRECTORY ${LAMMPS_DIR}
|
||||
COMMENT "Check for permission errors")
|
||||
add_custom_target(
|
||||
fix-whitespace
|
||||
${Python3_EXECUTABLE} ${LAMMPS_TOOLS_DIR}/coding_standard/whitespace.py -f .
|
||||
WORKING_DIRECTORY ${LAMMPS_DIR}
|
||||
COMMENT "Fix whitespace errors")
|
||||
add_custom_target(
|
||||
fix-permissions
|
||||
${Python3_EXECUTABLE} ${LAMMPS_TOOLS_DIR}/coding_standard/permissions.py -f .
|
||||
WORKING_DIRECTORY ${LAMMPS_DIR}
|
||||
COMMENT "Fix permission errors")
|
||||
endif()
|
||||
endif()
|
||||
@ -2,10 +2,19 @@
|
||||
# Build documentation
|
||||
###############################################################################
|
||||
option(BUILD_DOC "Build LAMMPS HTML documentation" OFF)
|
||||
if(BUILD_DOC)
|
||||
find_package(PythonInterp 3 REQUIRED)
|
||||
|
||||
set(VIRTUALENV ${PYTHON_EXECUTABLE} -m virtualenv)
|
||||
if(BUILD_DOC)
|
||||
# Sphinx 3.x requires at least Python 3.5
|
||||
if(CMAKE_VERSION VERSION_LESS 3.12)
|
||||
find_package(PythonInterp 3.5 REQUIRED)
|
||||
set(VIRTUALENV ${PYTHON_EXECUTABLE} -m virtualenv -p ${PYTHON_EXECUTABLE})
|
||||
else()
|
||||
find_package(Python3 REQUIRED COMPONENTS Interpreter)
|
||||
if(Python3_VERSION VERSION_LESS 3.5)
|
||||
message(FATAL_ERROR "Python 3.5 and up is required to build the HTML documentation")
|
||||
endif()
|
||||
set(VIRTUALENV ${Python3_EXECUTABLE} -m virtualenv -p ${Python3_EXECUTABLE})
|
||||
endif()
|
||||
|
||||
file(GLOB DOC_SOURCES ${LAMMPS_DOC_DIR}/src/[^.]*.rst)
|
||||
|
||||
@ -25,11 +34,10 @@ if(BUILD_DOC)
|
||||
)
|
||||
|
||||
# download mathjax distribution and unpack to folder "mathjax"
|
||||
file(DOWNLOAD "https://github.com/mathjax/MathJax/archive/3.0.5.tar.gz"
|
||||
"${CMAKE_CURRENT_BINARY_DIR}/mathjax.tar.gz"
|
||||
EXPECTED_MD5 5d9d3799cce77a1a95eee6be04eb68e7)
|
||||
|
||||
if(NOT EXISTS ${CMAKE_CURRENT_BINARY_DIR}/mathjax)
|
||||
if(NOT EXISTS ${CMAKE_CURRENT_BINARY_DIR}/mathjax/es5)
|
||||
file(DOWNLOAD "https://github.com/mathjax/MathJax/archive/3.0.5.tar.gz"
|
||||
"${CMAKE_CURRENT_BINARY_DIR}/mathjax.tar.gz"
|
||||
EXPECTED_MD5 5d9d3799cce77a1a95eee6be04eb68e7)
|
||||
execute_process(COMMAND ${CMAKE_COMMAND} -E tar xzf mathjax.tar.gz WORKING_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR})
|
||||
file(GLOB MATHJAX_VERSION_DIR ${CMAKE_CURRENT_BINARY_DIR}/MathJax-*)
|
||||
execute_process(COMMAND ${CMAKE_COMMAND} -E rename ${MATHJAX_VERSION_DIR} ${CMAKE_CURRENT_BINARY_DIR}/mathjax)
|
||||
@ -37,11 +45,18 @@ if(BUILD_DOC)
|
||||
file(MAKE_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}/html/_static/mathjax)
|
||||
file(COPY ${CMAKE_CURRENT_BINARY_DIR}/mathjax/es5 DESTINATION ${CMAKE_CURRENT_BINARY_DIR}/html/_static/mathjax/)
|
||||
|
||||
# for increased browser compatibility
|
||||
if(NOT EXISTS ${CMAKE_CURRENT_BINARY_DIR}/html/_static/polyfill.js)
|
||||
file(DOWNLOAD "https://polyfill.io/v3/polyfill.min.js?features=es6"
|
||||
"${CMAKE_CURRENT_BINARY_DIR}/html/_static/polyfill.js")
|
||||
endif()
|
||||
|
||||
# note, this may run in parallel with other tasks, so we must not use multiple processes here
|
||||
add_custom_command(
|
||||
OUTPUT html
|
||||
DEPENDS ${DOC_SOURCES} docenv requirements.txt
|
||||
COMMAND ${DOCENV_BINARY_DIR}/sphinx-build -b html -c ${LAMMPS_DOC_DIR}/utils/sphinx-config -d ${CMAKE_BINARY_DIR}/doctrees ${LAMMPS_DOC_DIR}/src html
|
||||
COMMAND ${CMAKE_COMMAND} -E create_symlink Manual.html ${CMAKE_CURRENT_BINARY_DIR}/html/index.html
|
||||
)
|
||||
|
||||
# copy selected image files to html output tree
|
||||
@ -56,17 +71,17 @@ if(BUILD_DOC)
|
||||
set(HTML_IMAGE_TARGETS "")
|
||||
foreach(_IMG ${HTML_EXTRA_IMAGES})
|
||||
string(PREPEND _IMG JPG/)
|
||||
list(APPEND HTML_IMAGE_TARGETS "html/${_IMG}")
|
||||
list(APPEND HTML_IMAGE_TARGETS "${CMAKE_CURRENT_BINARY_DIR}/html/${_IMG}")
|
||||
add_custom_command(
|
||||
OUTPUT ${CMAKE_CURRENT_BINARY_DIR}/html/${_IMG}
|
||||
DEPENDS ${LAMMPS_DOC_DIR}/src/${_IMG} html/JPG
|
||||
DEPENDS ${LAMMPS_DOC_DIR}/src/${_IMG} ${CMAKE_CURRENT_BINARY_DIR}/html/JPG
|
||||
COMMAND ${CMAKE_COMMAND} -E copy ${LAMMPS_DOC_DIR}/src/${_IMG} ${CMAKE_BINARY_DIR}/html/${_IMG}
|
||||
)
|
||||
endforeach()
|
||||
|
||||
add_custom_target(
|
||||
doc ALL
|
||||
DEPENDS html html/_static/mathjax/es5 ${HTML_IMAGE_TARGETS}
|
||||
DEPENDS html ${CMAKE_CURRENT_BINARY_DIR}/html/_static/mathjax/es5 ${HTML_IMAGE_TARGETS}
|
||||
SOURCES ${LAMMPS_DOC_DIR}/utils/requirements.txt ${DOC_SOURCES}
|
||||
)
|
||||
|
||||
|
||||
46
cmake/Modules/FindClangFormat.cmake
Normal file
46
cmake/Modules/FindClangFormat.cmake
Normal file
@ -0,0 +1,46 @@
|
||||
# Find clang-format
|
||||
find_program(ClangFormat_EXECUTABLE NAMES clang-format
|
||||
clang-format-10.0
|
||||
clang-format-9.0
|
||||
clang-format-8.0
|
||||
clang-format-7.0
|
||||
clang-format-6.0
|
||||
DOC "clang-format executable")
|
||||
mark_as_advanced(ClangFormat_EXECUTABLE)
|
||||
|
||||
if(ClangFormat_EXECUTABLE)
|
||||
# find version
|
||||
execute_process(COMMAND ${ClangFormat_EXECUTABLE} --version
|
||||
OUTPUT_VARIABLE clang_format_version
|
||||
ERROR_QUIET OUTPUT_STRIP_TRAILING_WHITESPACE)
|
||||
|
||||
|
||||
if(clang_format_version MATCHES "^clang-format version .*")
|
||||
# Arch Linux
|
||||
# clang-format version 10.0.0
|
||||
|
||||
# Ubuntu 18.04 LTS Output
|
||||
# clang-format version 6.0.0-1ubuntu2 (tags/RELEASE_600/final)
|
||||
string(REGEX REPLACE "clang-format version ([0-9.]+).*"
|
||||
"\\1"
|
||||
ClangFormat_VERSION
|
||||
"${clang_format_version}")
|
||||
elseif(clang_format_version MATCHES ".*LLVM version .*")
|
||||
# CentOS 7 Output
|
||||
# LLVM (http://llvm.org/):
|
||||
# LLVM version 3.4.2
|
||||
# Optimized build.
|
||||
# Built Nov 1 2018 (15:06:24).
|
||||
# Default target: x86_64-redhat-linux-gnu
|
||||
# Host CPU: x86-64
|
||||
string(REGEX REPLACE ".*LLVM version ([0-9.]+).*"
|
||||
"\\1"
|
||||
ClangFormat_VERSION
|
||||
"${clang_format_version}")
|
||||
else()
|
||||
set(ClangFormat_VERSION "0.0")
|
||||
endif()
|
||||
endif()
|
||||
|
||||
include(FindPackageHandleStandardArgs)
|
||||
find_package_handle_standard_args(ClangFormat REQUIRED_VARS ClangFormat_EXECUTABLE VERSION_VAR ClangFormat_VERSION)
|
||||
@ -1,27 +0,0 @@
|
||||
# - Find latte
|
||||
# Find the native LATTE libraries.
|
||||
#
|
||||
# LATTE_LIBRARIES - List of libraries when using latte.
|
||||
# LATTE_FOUND - True if latte found.
|
||||
#
|
||||
|
||||
find_library(LATTE_LIBRARY NAMES latte)
|
||||
|
||||
include(FindPackageHandleStandardArgs)
|
||||
# handle the QUIETLY and REQUIRED arguments and set LATTE_FOUND to TRUE
|
||||
# if all listed variables are TRUE
|
||||
|
||||
find_package_handle_standard_args(LATTE DEFAULT_MSG LATTE_LIBRARY)
|
||||
|
||||
# Copy the results to the output variables and target.
|
||||
if(LATTE_FOUND)
|
||||
set(LATTE_LIBRARIES ${LATTE_LIBRARY})
|
||||
|
||||
if(NOT TARGET LATTE::latte)
|
||||
add_library(LATTE::latte UNKNOWN IMPORTED)
|
||||
set_target_properties(LATTE::latte PROPERTIES
|
||||
IMPORTED_LOCATION "${LATTE_LIBRARY}")
|
||||
endif()
|
||||
endif()
|
||||
|
||||
mark_as_advanced(LATTE_LIBRARY)
|
||||
@ -6,12 +6,12 @@
|
||||
# TBB_MALLOC_FOUND - True if tbb found.
|
||||
#
|
||||
|
||||
|
||||
########################################################
|
||||
# TBB Malloc
|
||||
|
||||
find_path(TBB_MALLOC_INCLUDE_DIR NAMES tbb/tbb.h PATHS $ENV{TBBROOT}/include)
|
||||
find_library(TBB_MALLOC_LIBRARY NAMES tbbmalloc PATHS $ENV{TBBROOT}/lib/intel64/gcc4.7
|
||||
find_library(TBB_MALLOC_LIBRARY NAMES tbbmalloc PATHS $ENV{TBBROOT}/lib/intel64/gcc4.8
|
||||
$ENV{TBBROOT}/lib/intel64/gcc4.7
|
||||
$ENV{TBBROOT}/lib/intel64/gcc4.4
|
||||
$ENV{TBBROOT}/lib/intel64/gcc4.1)
|
||||
|
||||
|
||||
30
cmake/Modules/FindYAML.cmake
Normal file
30
cmake/Modules/FindYAML.cmake
Normal file
@ -0,0 +1,30 @@
|
||||
# - Find libyaml
|
||||
# Find the native Yaml headers and libraries.
|
||||
#
|
||||
# YAML_INCLUDE_DIRS - where to find yaml.h
|
||||
# YAML_LIBRARIES - List of libraries when using libyaml
|
||||
# YAML_FOUND - True if libyaml is found.
|
||||
#
|
||||
|
||||
find_path(YAML_INCLUDE_DIR yaml.h PATH_SUFFIXES yaml)
|
||||
find_library(YAML_LIBRARY NAMES yaml)
|
||||
|
||||
# handle the QUIET and REQUIRED arguments and
|
||||
# set YAML_FOUND to TRUE if all variables are non-zero
|
||||
include(FindPackageHandleStandardArgs)
|
||||
find_package_handle_standard_args(YAML DEFAULT_MSG YAML_LIBRARY YAML_INCLUDE_DIR)
|
||||
|
||||
# Copy the results to the output variables and target.
|
||||
if(YAML_FOUND)
|
||||
set(YAML_LIBRARIES ${YAML_LIBRARY})
|
||||
set(YAML_INCLUDE_DIRS ${YAML_INCLUDE_DIR})
|
||||
|
||||
if(NOT TARGET Yaml::Yaml)
|
||||
add_library(Yaml::Yaml UNKNOWN IMPORTED)
|
||||
set_target_properties(Yaml::Yaml PROPERTIES
|
||||
IMPORTED_LOCATION "${YAML_LIBRARY}"
|
||||
INTERFACE_INCLUDE_DIRECTORIES "${YAML_INCLUDE_DIR}")
|
||||
endif()
|
||||
endif()
|
||||
|
||||
mark_as_advanced(YAML_INCLUDE_DIR YAML_LIBRARY)
|
||||
77
cmake/Modules/GTest.cmake
Normal file
77
cmake/Modules/GTest.cmake
Normal file
@ -0,0 +1,77 @@
|
||||
message(STATUS "Downloading and building Google Test library")
|
||||
|
||||
if(CMAKE_BUILD_TYPE STREQUAL Debug)
|
||||
set(GTEST_LIB_POSTFIX d)
|
||||
else()
|
||||
set(GTEST_LIB_POSTFIX)
|
||||
endif()
|
||||
|
||||
include(ExternalProject)
|
||||
ExternalProject_Add(googletest
|
||||
GIT_REPOSITORY https://github.com/google/googletest.git
|
||||
GIT_TAG release-1.10.0
|
||||
SOURCE_DIR "${CMAKE_BINARY_DIR}/gtest-src"
|
||||
BINARY_DIR "${CMAKE_BINARY_DIR}/gtest-build"
|
||||
CMAKE_ARGS ${CMAKE_REQUEST_PIC} ${CMAKE_EXTRA_GTEST_OPTS}
|
||||
-DCMAKE_CXX_COMPILER=${CMAKE_CXX_COMPILER}
|
||||
-DCMAKE_INSTALL_PREFIX=<INSTALL_DIR>
|
||||
-DCMAKE_BUILD_TYPE=${CMAKE_BUILD_TYPE}
|
||||
-DCMAKE_MAKE_PROGRAM=${CMAKE_MAKE_PROGRAM}
|
||||
-DCMAKE_TOOLCHAIN_FILE=${CMAKE_TOOLCHAIN_FILE}
|
||||
BUILD_BYPRODUCTS <BINARY_DIR>/lib/${CMAKE_FIND_LIBRARY_PREFIXES}gtest${GTEST_LIB_POSTFIX}.a
|
||||
<BINARY_DIR>/lib/${CMAKE_FIND_LIBRARY_PREFIXES}gmock${GTEST_LIB_POSTFIX}.a
|
||||
<BINARY_DIR>/lib/${CMAKE_FIND_LIBRARY_PREFIXES}gtest_main${GTEST_LIB_POSTFIX}.a
|
||||
<BINARY_DIR>/lib/${CMAKE_FIND_LIBRARY_PREFIXES}gmock_main${GTEST_LIB_POSTFIX}.a
|
||||
LOG_DOWNLOAD ON
|
||||
LOG_CONFIGURE ON
|
||||
LOG_BUILD ON
|
||||
INSTALL_COMMAND ""
|
||||
TEST_COMMAND "")
|
||||
|
||||
ExternalProject_Get_Property(googletest SOURCE_DIR)
|
||||
set(GTEST_INCLUDE_DIR ${SOURCE_DIR}/googletest/include)
|
||||
set(GMOCK_INCLUDE_DIR ${SOURCE_DIR}/googlemock/include)
|
||||
|
||||
# workaround for CMake 3.10 on ubuntu 18.04
|
||||
file(MAKE_DIRECTORY ${GTEST_INCLUDE_DIR})
|
||||
file(MAKE_DIRECTORY ${GMOCK_INCLUDE_DIR})
|
||||
|
||||
ExternalProject_Get_Property(googletest BINARY_DIR)
|
||||
set(GTEST_LIBRARY_PATH ${BINARY_DIR}/lib/${CMAKE_FIND_LIBRARY_PREFIXES}gtest${GTEST_LIB_POSTFIX}.a)
|
||||
set(GMOCK_LIBRARY_PATH ${BINARY_DIR}/lib/${CMAKE_FIND_LIBRARY_PREFIXES}gmock${GTEST_LIB_POSTFIX}.a)
|
||||
set(GTEST_MAIN_LIBRARY_PATH ${BINARY_DIR}/lib/${CMAKE_FIND_LIBRARY_PREFIXES}gtest_main${GTEST_LIB_POSTFIX}.a)
|
||||
set(GMOCK_MAIN_LIBRARY_PATH ${BINARY_DIR}/lib/${CMAKE_FIND_LIBRARY_PREFIXES}gmock_main${GTEST_LIB_POSTFIX}.a)
|
||||
|
||||
# Prevent GoogleTest from overriding our compiler/linker options
|
||||
# when building with Visual Studio
|
||||
set(gtest_force_shared_crt ON CACHE BOOL "" FORCE)
|
||||
|
||||
find_package(Threads QUIET)
|
||||
|
||||
add_library(GTest::GTest UNKNOWN IMPORTED)
|
||||
set_target_properties(GTest::GTest PROPERTIES
|
||||
IMPORTED_LOCATION ${GTEST_LIBRARY_PATH}
|
||||
INTERFACE_INCLUDE_DIRECTORIES ${GTEST_INCLUDE_DIR}
|
||||
IMPORTED_LINK_INTERFACE_LIBRARIES ${CMAKE_THREAD_LIBS_INIT})
|
||||
add_dependencies(GTest::GTest googletest)
|
||||
|
||||
add_library(GTest::GMock UNKNOWN IMPORTED)
|
||||
set_target_properties(GTest::GMock PROPERTIES
|
||||
IMPORTED_LOCATION ${GMOCK_LIBRARY_PATH}
|
||||
INTERFACE_INCLUDE_DIRECTORIES ${GMOCK_INCLUDE_DIR}
|
||||
IMPORTED_LINK_INTERFACE_LIBRARIES ${CMAKE_THREAD_LIBS_INIT})
|
||||
add_dependencies(GTest::GMock googletest)
|
||||
|
||||
add_library(GTest::GTestMain UNKNOWN IMPORTED)
|
||||
set_target_properties(GTest::GTestMain PROPERTIES
|
||||
IMPORTED_LOCATION ${GTEST_MAIN_LIBRARY_PATH}
|
||||
INTERFACE_INCLUDE_DIRECTORIES ${GTEST_INCLUDE_DIR}
|
||||
IMPORTED_LINK_INTERFACE_LIBRARIES ${CMAKE_THREAD_LIBS_INIT})
|
||||
add_dependencies(GTest::GTestMain googletest)
|
||||
|
||||
add_library(GTest::GMockMain UNKNOWN IMPORTED)
|
||||
set_target_properties(GTest::GMockMain PROPERTIES
|
||||
IMPORTED_LOCATION ${GMOCK_MAIN_LIBRARY_PATH}
|
||||
INTERFACE_INCLUDE_DIRECTORIES ${GMOCK_INCLUDE_DIR}
|
||||
IMPORTED_LINK_INTERFACE_LIBRARIES ${CMAKE_THREAD_LIBS_INIT})
|
||||
add_dependencies(GTest::GMockMain googletest)
|
||||
@ -85,3 +85,26 @@ function(GenerateBinaryHeader varname outfile files)
|
||||
file(APPEND ${outfile} "const unsigned int ${varname}_size = sizeof(${varname});\n")
|
||||
endforeach()
|
||||
endfunction(GenerateBinaryHeader)
|
||||
|
||||
# fetch missing potential files
|
||||
function(FetchPotentials pkgfolder potfolder)
|
||||
if (EXISTS "${pkgfolder}/potentials.txt")
|
||||
set(LAMMPS_POTENTIALS_URL "https://download.lammps.org/potentials")
|
||||
file(STRINGS "${pkgfolder}/potentials.txt" linelist REGEX "^[^#].")
|
||||
foreach(line ${linelist})
|
||||
string(FIND ${line} " " blank)
|
||||
math(EXPR plusone "${blank}+1")
|
||||
string(SUBSTRING ${line} 0 ${blank} pot)
|
||||
string(SUBSTRING ${line} ${plusone} -1 sum)
|
||||
if(EXISTS ${LAMMPS_POTENTIALS_DIR}/${pot})
|
||||
file(MD5 "${LAMMPS_POTENTIALS_DIR}/${pot}" oldsum)
|
||||
endif()
|
||||
if(NOT sum STREQUAL oldsum)
|
||||
message(STATUS "Checking external potential ${pot} from ${LAMMPS_POTENTIALS_URL}")
|
||||
file(DOWNLOAD "${LAMMPS_POTENTIALS_URL}/${pot}.${sum}" "${CMAKE_BINARY_DIR}/${pot}"
|
||||
EXPECTED_HASH MD5=${sum} SHOW_PROGRESS)
|
||||
file(COPY "${CMAKE_BINARY_DIR}/${pot}" DESTINATION ${LAMMPS_POTENTIALS_DIR})
|
||||
endif()
|
||||
endforeach()
|
||||
endif()
|
||||
endfunction(FetchPotentials)
|
||||
|
||||
@ -23,3 +23,8 @@ set_target_properties(MPI::MPI_CXX PROPERTIES
|
||||
INTERFACE_INCLUDE_DIRECTORIES "${SOURCE_DIR}/include"
|
||||
INTERFACE_COMPILE_DEFINITIONS "MPICH_SKIP_MPICXX")
|
||||
add_dependencies(MPI::MPI_CXX mpi4win_build)
|
||||
|
||||
# set variables for status reporting at the end of CMake run
|
||||
set(MPI_CXX_INCLUDE_PATH "${SOURCE_DIR}/include")
|
||||
set(MPI_CXX_COMPILE_DEFINITIONS "MPICH_SKIP_MPICXX")
|
||||
set(MPI_CXX_LIBRARIES "${SOURCE_DIR}/lib/libmpi.a")
|
||||
|
||||
@ -40,6 +40,17 @@ if(GPU_API STREQUAL "CUDA")
|
||||
|
||||
set(GPU_ARCH "sm_50" CACHE STRING "LAMMPS GPU CUDA SM primary architecture (e.g. sm_60)")
|
||||
|
||||
# ensure that no *cubin.h files exist from a compile in the lib/gpu folder
|
||||
file(GLOB GPU_LIB_OLD_CUBIN_HEADERS ${LAMMPS_LIB_SOURCE_DIR}/gpu/*_cubin.h)
|
||||
if (GPU_LIB_OLD_CUBIN_HEADERS)
|
||||
message(FATAL_ERROR "########################################################################\n"
|
||||
"Found file(s) generated by the make-based build system in lib/gpu\n"
|
||||
"Please run\n"
|
||||
" make -C ${LAMMPS_LIB_SOURCE_DIR}/gpu -f Makefile.serial clean\n"
|
||||
"to remove\n"
|
||||
"########################################################################")
|
||||
endif()
|
||||
|
||||
file(GLOB GPU_LIB_CU ${LAMMPS_LIB_SOURCE_DIR}/gpu/[^.]*.cu ${CMAKE_CURRENT_SOURCE_DIR}/gpu/[^.]*.cu)
|
||||
list(REMOVE_ITEM GPU_LIB_CU ${LAMMPS_LIB_SOURCE_DIR}/gpu/lal_pppm.cu)
|
||||
|
||||
@ -79,7 +90,7 @@ if(GPU_API STREQUAL "CUDA")
|
||||
string(APPEND GPU_CUDA_GENCODE "-gencode arch=compute_75,code=[sm_75,compute_75] ")
|
||||
endif()
|
||||
|
||||
cuda_compile_fatbin(GPU_GEN_OBJS ${GPU_LIB_CU} OPTIONS
|
||||
cuda_compile_fatbin(GPU_GEN_OBJS ${GPU_LIB_CU} OPTIONS ${CUDA_REQUEST_PIC}
|
||||
-DUNIX -O3 --use_fast_math -Wno-deprecated-gpu-targets -DNV_KERNEL -DUCL_CUDADR ${GPU_CUDA_GENCODE} -D_${GPU_PREC_SETTING})
|
||||
|
||||
cuda_compile(GPU_OBJS ${GPU_LIB_CUDPP_CU} OPTIONS ${CUDA_REQUEST_PIC}
|
||||
@ -115,7 +126,7 @@ if(GPU_API STREQUAL "CUDA")
|
||||
elseif(GPU_API STREQUAL "OPENCL")
|
||||
if(${CMAKE_SYSTEM_NAME} STREQUAL "Windows")
|
||||
# download and unpack support binaries for compilation of windows binaries.
|
||||
set(LAMMPS_THIRDPARTY_URL "http://download.lammps.org/thirdparty")
|
||||
set(LAMMPS_THIRDPARTY_URL "https://download.lammps.org/thirdparty")
|
||||
file(DOWNLOAD "${LAMMPS_THIRDPARTY_URL}/opencl-win-devel.tar.gz" "${CMAKE_CURRENT_BINARY_DIR}/opencl-win-devel.tar.gz"
|
||||
EXPECTED_MD5 2c00364888d5671195598b44c2e0d44d)
|
||||
execute_process(COMMAND ${CMAKE_COMMAND} -E tar xzf opencl-win-devel.tar.gz WORKING_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR})
|
||||
@ -257,10 +268,17 @@ elseif(GPU_API STREQUAL "HIP")
|
||||
if(HIP_PLATFORM STREQUAL "hcc")
|
||||
configure_file(${CU_FILE} ${CU_CPP_FILE} COPYONLY)
|
||||
|
||||
add_custom_command(OUTPUT ${CUBIN_FILE}
|
||||
VERBATIM COMMAND ${HIP_HIPCC_EXECUTABLE} --genco -t="${HIP_ARCH}" -f=\"-O3 -ffast-math -DUSE_HIP -D_${GPU_PREC_SETTING} -I${LAMMPS_LIB_SOURCE_DIR}/gpu\" -o ${CUBIN_FILE} ${CU_CPP_FILE}
|
||||
DEPENDS ${CU_CPP_FILE}
|
||||
COMMENT "Generating ${CU_NAME}.cubin")
|
||||
if(HIP_COMPILER STREQUAL "clang")
|
||||
add_custom_command(OUTPUT ${CUBIN_FILE}
|
||||
VERBATIM COMMAND ${HIP_HIPCC_EXECUTABLE} --genco --offload-arch=${HIP_ARCH} -O3 -ffast-math -DUSE_HIP -D_${GPU_PREC_SETTING} -I${LAMMPS_LIB_SOURCE_DIR}/gpu -o ${CUBIN_FILE} ${CU_CPP_FILE}
|
||||
DEPENDS ${CU_CPP_FILE}
|
||||
COMMENT "Generating ${CU_NAME}.cubin")
|
||||
else()
|
||||
add_custom_command(OUTPUT ${CUBIN_FILE}
|
||||
VERBATIM COMMAND ${HIP_HIPCC_EXECUTABLE} --genco -t="${HIP_ARCH}" -f=\"-O3 -ffast-math -DUSE_HIP -D_${GPU_PREC_SETTING} -I${LAMMPS_LIB_SOURCE_DIR}/gpu\" -o ${CUBIN_FILE} ${CU_CPP_FILE}
|
||||
DEPENDS ${CU_CPP_FILE}
|
||||
COMMENT "Generating ${CU_NAME}.cubin")
|
||||
endif()
|
||||
elseif(HIP_PLATFORM STREQUAL "nvcc")
|
||||
add_custom_command(OUTPUT ${CUBIN_FILE}
|
||||
VERBATIM COMMAND ${HIP_HIPCC_EXECUTABLE} --fatbin --use_fast_math -DUSE_HIP -D_${GPU_PREC_SETTING} ${HIP_CUDA_GENCODE} -I${LAMMPS_LIB_SOURCE_DIR}/gpu -o ${CUBIN_FILE} ${CU_FILE}
|
||||
@ -330,7 +348,7 @@ elseif(GPU_API STREQUAL "HIP")
|
||||
|
||||
if(HIP_PLATFORM STREQUAL "nvcc")
|
||||
target_compile_definitions(gpu PRIVATE -D__HIP_PLATFORM_NVCC__)
|
||||
target_include_directories(gpu PRIVATE ${HIP_ROOT_DIR}/include)
|
||||
target_include_directories(gpu PRIVATE ${HIP_ROOT_DIR}/../include)
|
||||
target_include_directories(gpu PRIVATE ${CUDA_INCLUDE_DIRS})
|
||||
target_link_libraries(gpu PRIVATE ${CUDA_LIBRARIES} ${CUDA_CUDA_LIBRARY})
|
||||
|
||||
@ -338,6 +356,12 @@ elseif(GPU_API STREQUAL "HIP")
|
||||
target_include_directories(hip_get_devices PRIVATE ${HIP_ROOT_DIR}/include)
|
||||
target_include_directories(hip_get_devices PRIVATE ${CUDA_INCLUDE_DIRS})
|
||||
target_link_libraries(hip_get_devices PRIVATE ${CUDA_LIBRARIES} ${CUDA_CUDA_LIBRARY})
|
||||
elseif(HIP_PLATFORM STREQUAL "hcc")
|
||||
target_compile_definitions(gpu PRIVATE -D__HIP_PLATFORM_HCC__)
|
||||
target_include_directories(gpu PRIVATE ${HIP_ROOT_DIR}/../include)
|
||||
|
||||
target_compile_definitions(hip_get_devices PRIVATE -D__HIP_PLATFORM_HCC__)
|
||||
target_include_directories(hip_get_devices PRIVATE ${HIP_ROOT_DIR}/../include)
|
||||
endif()
|
||||
|
||||
target_link_libraries(lammps PRIVATE gpu)
|
||||
@ -353,9 +377,11 @@ RegisterStylesExt(${GPU_SOURCES_DIR} gpu GPU_SOURCES)
|
||||
|
||||
get_property(GPU_SOURCES GLOBAL PROPERTY GPU_SOURCES)
|
||||
|
||||
target_link_libraries(gpu PRIVATE MPI::MPI_CXX)
|
||||
if(NOT BUILD_SHARED_LIBS)
|
||||
install(TARGETS gpu EXPORT LAMMPS_Targets LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR} ARCHIVE DESTINATION ${CMAKE_INSTALL_LIBDIR})
|
||||
if(NOT BUILD_MPI)
|
||||
# mpistubs is aliased to MPI::MPI_CXX, but older versions of cmake won't work forward the include path
|
||||
target_link_libraries(gpu PRIVATE mpi_stubs)
|
||||
else()
|
||||
target_link_libraries(gpu PRIVATE MPI::MPI_CXX)
|
||||
endif()
|
||||
target_compile_definitions(gpu PRIVATE -DLAMMPS_${LAMMPS_SIZES})
|
||||
set_target_properties(gpu PROPERTIES OUTPUT_NAME lammps_gpu${LAMMPS_MACHINE})
|
||||
|
||||
@ -1,7 +1,12 @@
|
||||
set(KIM-API_MIN_VERSION 2.1.3)
|
||||
find_package(CURL)
|
||||
if(CURL_FOUND)
|
||||
target_link_libraries(lammps PRIVATE CURL::libcurl)
|
||||
if(CMAKE_VERSION VERSION_LESS 3.12)
|
||||
target_include_directories(lammps PRIVATE ${CURL_INCLUDE_DIRS})
|
||||
target_link_libraries(lammps PRIVATE ${CURL_LIBRARIES})
|
||||
else()
|
||||
target_link_libraries(lammps PRIVATE CURL::libcurl)
|
||||
endif()
|
||||
target_compile_definitions(lammps PRIVATE -DLMP_KIM_CURL)
|
||||
set(LMP_DEBUG_CURL OFF CACHE STRING "Set libcurl verbose mode on/off. If on, it displays a lot of verbose information about its operations.")
|
||||
mark_as_advanced(LMP_DEBUG_CURL)
|
||||
@ -51,9 +56,6 @@ if(DOWNLOAD_KIM)
|
||||
INTERFACE_INCLUDE_DIRECTORIES "${INSTALL_DIR}/include/kim-api")
|
||||
target_link_libraries(lammps PRIVATE LAMMPS::KIM)
|
||||
add_dependencies(LAMMPS::KIM kim_build)
|
||||
if(NOT BUILD_SHARED_LIBS)
|
||||
install(CODE "MESSAGE(FATAL_ERROR \"Installing liblammps with downloaded libraries is currently not supported.\")")
|
||||
endif()
|
||||
else()
|
||||
find_package(PkgConfig REQUIRED)
|
||||
pkg_check_modules(KIM-API REQUIRED IMPORTED_TARGET libkim-api>=${KIM-API_MIN_VERSION})
|
||||
|
||||
@ -14,16 +14,30 @@ endif()
|
||||
option(EXTERNAL_KOKKOS "Build against external kokkos library" OFF)
|
||||
option(DOWNLOAD_KOKKOS "Download the KOKKOS library instead of using the bundled one" OFF)
|
||||
if(DOWNLOAD_KOKKOS)
|
||||
# extract Kokkos-related variables and values so we can forward them to the Kokkos library build
|
||||
get_cmake_property(_VARS VARIABLES)
|
||||
list(FILTER _VARS INCLUDE REGEX ^Kokkos_)
|
||||
foreach(_VAR IN LISTS _VARS)
|
||||
list(APPEND KOKKOS_LIB_BUILD_ARGS "-D${_VAR}=${${_VAR}}")
|
||||
endforeach()
|
||||
message(STATUS "KOKKOS download requested - we will build our own")
|
||||
file(DOWNLOAD https://github.com/kokkos/kokkos/compare/3.0.00...stanmoore1:lammps.diff ${CMAKE_CURRENT_BINARY_DIR}/kokkos-lammps.patch)
|
||||
list(APPEND KOKKOS_LIB_BUILD_ARGS "-DCMAKE_INSTALL_PREFIX=<INSTALL_DIR>")
|
||||
if(CMAKE_REQUEST_PIC)
|
||||
list(APPEND KOKKOS_LIB_BUILD_ARGS ${CMAKE_REQUEST_PIC})
|
||||
endif()
|
||||
# append other CMake variables that need to be forwarded to CMAKE_ARGS
|
||||
list(APPEND KOKKOS_LIB_BUILD_ARGS "-DCMAKE_BUILD_TYPE=${CMAKE_BUILD_TYPE}")
|
||||
list(APPEND KOKKOS_LIB_BUILD_ARGS "-DCMAKE_INSTALL_LIBDIR=lib")
|
||||
list(APPEND KOKKOS_LIB_BUILD_ARGS "-DCMAKE_MAKE_PROGRAM=${CMAKE_MAKE_PROGRAM}")
|
||||
list(APPEND KOKKOS_LIB_BUILD_ARGS "-DCMAKE_CXX_COMPILER=${CMAKE_CXX_COMPILER}")
|
||||
list(APPEND KOKKOS_LIB_BUILD_ARGS "-DCMAKE_CXX_STANDARD=${CMAKE_CXX_STANDARD}")
|
||||
list(APPEND KOKKOS_LIB_BUILD_ARGS "-DCMAKE_CXX_EXTENSIONS=${CMAKE_CXX_EXTENSIONS}")
|
||||
list(APPEND KOKKOS_LIB_BUILD_ARGS "-DCMAKE_TOOLCHAIN_FILE=${CMAKE_TOOLCHAIN_FILE}")
|
||||
include(ExternalProject)
|
||||
ExternalProject_Add(kokkos_build
|
||||
URL https://github.com/kokkos/kokkos/archive/3.0.00.tar.gz
|
||||
URL_MD5 281c7093aa3a603276e93abdf4be23b9
|
||||
PATCH_COMMAND patch -p1 < ${CMAKE_CURRENT_BINARY_DIR}/kokkos-lammps.patch
|
||||
CMAKE_ARGS -DCMAKE_INSTALL_PREFIX=<INSTALL_DIR> ${CMAKE_REQUEST_PIC}
|
||||
-DCMAKE_BUILD_TYPE=${CMAKE_BUILD_TYPE} -DCMAKE_INSTALL_LIBDIR=lib
|
||||
-DCMAKE_MAKE_PROGRAM=${CMAKE_MAKE_PROGRAM} -DCMAKE_TOOLCHAIN_FILE=${CMAKE_TOOLCHAIN_FILE}
|
||||
URL https://github.com/kokkos/kokkos/archive/3.1.01.tar.gz
|
||||
URL_MD5 3ccb2100f7fc316891e7dad3bc33fa37
|
||||
CMAKE_ARGS ${KOKKOS_LIB_BUILD_ARGS}
|
||||
BUILD_BYPRODUCTS <INSTALL_DIR>/lib/libkokkoscore.a
|
||||
)
|
||||
ExternalProject_get_property(kokkos_build INSTALL_DIR)
|
||||
@ -35,14 +49,8 @@ if(DOWNLOAD_KOKKOS)
|
||||
INTERFACE_LINK_LIBRARIES ${CMAKE_DL_LIBS})
|
||||
target_link_libraries(lammps PRIVATE LAMMPS::KOKKOS)
|
||||
add_dependencies(LAMMPS::KOKKOS kokkos_build)
|
||||
if(NOT BUILD_SHARED_LIBS)
|
||||
install(CODE "MESSAGE(FATAL_ERROR \"Installing liblammps with downloaded libraries is currently not supported.\")")
|
||||
endif()
|
||||
elseif(EXTERNAL_KOKKOS)
|
||||
find_package(Kokkos 3)
|
||||
if(NOT Kokkos_FOUND)
|
||||
message(FATAL_ERROR "KOKKOS library not found, help CMake to find it by setting KOKKOS_LIBRARY, or set DOWNLOAD_KOKKOS=ON to download it")
|
||||
endif()
|
||||
find_package(Kokkos 3.1.01 REQUIRED CONFIG)
|
||||
target_link_libraries(lammps PRIVATE Kokkos::kokkos)
|
||||
else()
|
||||
set(LAMMPS_LIB_KOKKOS_SRC_DIR ${LAMMPS_LIB_SOURCE_DIR}/kokkos)
|
||||
|
||||
@ -2,7 +2,7 @@ option(FFT_SINGLE "Use single precision FFTs instead of double precision FFTs" O
|
||||
set(FFTW "FFTW3")
|
||||
if(FFT_SINGLE)
|
||||
set(FFTW "FFTW3F")
|
||||
target_compile_definitions(lammps PUBLIC -DFFT_SINGLE)
|
||||
target_compile_definitions(lammps PRIVATE -DFFT_SINGLE)
|
||||
endif()
|
||||
find_package(${FFTW} QUIET)
|
||||
if(${FFTW}_FOUND)
|
||||
@ -17,8 +17,8 @@ string(TOUPPER ${FFT} FFT)
|
||||
|
||||
if(FFT STREQUAL "FFTW3")
|
||||
find_package(${FFTW} REQUIRED)
|
||||
target_compile_definitions(lammps PUBLIC -DFFT_FFTW3)
|
||||
target_link_libraries(lammps PUBLIC ${FFTW}::${FFTW})
|
||||
target_compile_definitions(lammps PRIVATE -DFFT_FFTW3)
|
||||
target_link_libraries(lammps PRIVATE ${FFTW}::${FFTW})
|
||||
if(FFTW3_OMP_LIBRARY OR FFTW3F_OMP_LIBRARY)
|
||||
option(FFT_FFTW_THREADS "Use threaded FFTW library" ON)
|
||||
else()
|
||||
|
||||
@ -1,5 +1,12 @@
|
||||
enable_language(Fortran)
|
||||
find_package(LATTE)
|
||||
|
||||
# using lammps in a super-build setting
|
||||
if(TARGET LATTE::latte)
|
||||
target_link_libraries(lammps PRIVATE LATTE::latte)
|
||||
return()
|
||||
endif()
|
||||
|
||||
find_package(LATTE 1.2.2 CONFIG)
|
||||
if(LATTE_FOUND)
|
||||
set(DOWNLOAD_LATTE_DEFAULT OFF)
|
||||
else()
|
||||
@ -10,8 +17,8 @@ if(DOWNLOAD_LATTE)
|
||||
message(STATUS "LATTE download requested - we will build our own")
|
||||
include(ExternalProject)
|
||||
ExternalProject_Add(latte_build
|
||||
URL https://github.com/lanl/LATTE/archive/v1.2.1.tar.gz
|
||||
URL_MD5 85ac414fdada2d04619c8f936344df14
|
||||
URL https://github.com/lanl/LATTE/archive/v1.2.2.tar.gz
|
||||
URL_MD5 820e73a457ced178c08c71389a385de7
|
||||
SOURCE_SUBDIR cmake
|
||||
CMAKE_ARGS -DCMAKE_INSTALL_PREFIX=<INSTALL_DIR> ${CMAKE_REQUEST_PIC} -DCMAKE_INSTALL_LIBDIR=lib
|
||||
-DBLAS_LIBRARIES=${BLAS_LIBRARIES} -DLAPACK_LIBRARIES=${LAPACK_LIBRARIES}
|
||||
@ -27,13 +34,7 @@ if(DOWNLOAD_LATTE)
|
||||
INTERFACE_LINK_LIBRARIES "${LAPACK_LIBRARIES}")
|
||||
target_link_libraries(lammps PRIVATE LAMMPS::LATTE)
|
||||
add_dependencies(LAMMPS::LATTE latte_build)
|
||||
if(NOT BUILD_SHARED_LIBS)
|
||||
install(CODE "MESSAGE(FATAL_ERROR \"Installing liblammps with downloaded libraries is currently not supported.\")")
|
||||
endif()
|
||||
else()
|
||||
find_package(LATTE)
|
||||
if(NOT LATTE_FOUND)
|
||||
message(FATAL_ERROR "LATTE library not found, help CMake to find it by setting LATTE_LIBRARY, or set DOWNLOAD_LATTE=ON to download it")
|
||||
endif()
|
||||
find_package(LATTE 1.2.2 REQUIRED CONFIG)
|
||||
target_link_libraries(lammps PRIVATE LATTE::latte)
|
||||
endif()
|
||||
|
||||
@ -7,9 +7,6 @@ file(GLOB_RECURSE cslib_SOURCES ${LAMMPS_LIB_SOURCE_DIR}/message/cslib/[^.]*.F
|
||||
${LAMMPS_LIB_SOURCE_DIR}/message/cslib/[^.]*.cpp)
|
||||
|
||||
add_library(cslib STATIC ${cslib_SOURCES})
|
||||
if(NOT BUILD_SHARED_LIBS)
|
||||
install(TARGETS cslib EXPORT LAMMPS_Targets LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR} ARCHIVE DESTINATION ${CMAKE_INSTALL_LIBDIR})
|
||||
endif()
|
||||
target_compile_definitions(cslib PRIVATE -DLAMMPS_${LAMMPS_SIZES})
|
||||
set_target_properties(cslib PROPERTIES OUTPUT_NAME lammps_cslib${LAMMPS_MACHINE})
|
||||
if(BUILD_MPI)
|
||||
|
||||
@ -35,9 +35,6 @@ if(DOWNLOAD_MSCG)
|
||||
INTERFACE_LINK_LIBRARIES "${LAPACK_LIBRARIES}")
|
||||
target_link_libraries(lammps PRIVATE LAMMPS::MSCG)
|
||||
add_dependencies(LAMMPS::MSCG mscg_build)
|
||||
if(NOT BUILD_SHARED_LIBS)
|
||||
install(CODE "MESSAGE(FATAL_ERROR \"Installing liblammps with downloaded libraries is currently not supported.\")")
|
||||
endif()
|
||||
else()
|
||||
find_package(MSCG)
|
||||
if(NOT MSCG_FOUND)
|
||||
|
||||
@ -9,9 +9,6 @@ if(COLVARS_LEPTON)
|
||||
set(LEPTON_DIR ${LAMMPS_LIB_SOURCE_DIR}/colvars/lepton)
|
||||
file(GLOB LEPTON_SOURCES ${LEPTON_DIR}/src/[^.]*.cpp)
|
||||
add_library(lepton STATIC ${LEPTON_SOURCES})
|
||||
if(NOT BUILD_SHARED_LIBS)
|
||||
install(TARGETS lepton EXPORT LAMMPS_Targets LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR} ARCHIVE DESTINATION ${CMAKE_INSTALL_LIBDIR})
|
||||
endif()
|
||||
# Change the define below to LEPTON_BUILDING_SHARED_LIBRARY when linking Lepton as a DLL with MSVC
|
||||
target_compile_definitions(lepton PRIVATE -DLEPTON_BUILDING_STATIC_LIBRARY)
|
||||
set_target_properties(lepton PROPERTIES OUTPUT_NAME lammps_lepton${LAMMPS_MACHINE})
|
||||
@ -19,9 +16,6 @@ if(COLVARS_LEPTON)
|
||||
endif()
|
||||
|
||||
add_library(colvars STATIC ${COLVARS_SOURCES})
|
||||
if(NOT BUILD_SHARED_LIBS)
|
||||
install(TARGETS colvars EXPORT LAMMPS_Targets LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR} ARCHIVE DESTINATION ${CMAKE_INSTALL_LIBDIR})
|
||||
endif()
|
||||
target_compile_definitions(colvars PRIVATE -DLAMMPS_${LAMMPS_SIZES})
|
||||
set_target_properties(colvars PROPERTIES OUTPUT_NAME lammps_colvars${LAMMPS_MACHINE})
|
||||
target_include_directories(colvars PUBLIC ${LAMMPS_LIB_SOURCE_DIR}/colvars)
|
||||
|
||||
@ -77,7 +77,7 @@ else()
|
||||
foreach(_FLAG -O2 -fp-model fast=2 -no-prec-div -qoverride-limits -qopt-zmm-usage=high -qno-offload -fno-alias -ansi-alias -restrict)
|
||||
check_cxx_compiler_flag("${_FLAG}" COMPILER_SUPPORTS${_FLAG})
|
||||
if(COMPILER_SUPPORTS${_FLAG})
|
||||
target_compile_options(lammps PRIVATE ${_FLAG})
|
||||
target_compile_options(lammps PRIVATE ${_FLAG})
|
||||
endif()
|
||||
endforeach()
|
||||
endif()
|
||||
|
||||
@ -1,8 +1,5 @@
|
||||
set(MOLFILE_INCLUDE_DIRS "${LAMMPS_LIB_SOURCE_DIR}/molfile" CACHE STRING "Path to VMD molfile plugin headers")
|
||||
add_library(molfile INTERFACE)
|
||||
if(NOT BUILD_SHARED_LIBS)
|
||||
install(TARGETS molfile EXPORT LAMMPS_Targets LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR} ARCHIVE DESTINATION ${CMAKE_INSTALL_LIBDIR})
|
||||
endif()
|
||||
target_include_directories(molfile INTERFACE ${MOLFILE_INCLUDE_DIRS})
|
||||
# no need to link with -ldl on windows
|
||||
if(NOT ${CMAKE_SYSTEM_NAME} STREQUAL "Windows")
|
||||
|
||||
@ -1,11 +1,17 @@
|
||||
# USER-NETCDF can use NetCDF, Parallel NetCDF (PNetCDF), or both. At least one necessary.
|
||||
# NetCDF library enables dump style "netcdf", while PNetCDF enables dump style "netcdf/mpiio"
|
||||
find_package(NetCDF)
|
||||
if(NETCDF_FOUND)
|
||||
find_package(PNetCDF)
|
||||
else(NETCDF_FOUND)
|
||||
find_package(PNetCDF REQUIRED)
|
||||
endif(NETCDF_FOUND)
|
||||
|
||||
# may use NetCDF or PNetCDF with MPI, but must have NetCDF without
|
||||
if(NOT BUILD_MPI)
|
||||
find_package(NetCDF REQUIRED)
|
||||
else()
|
||||
find_package(NetCDF)
|
||||
if(NETCDF_FOUND)
|
||||
find_package(PNetCDF)
|
||||
else()
|
||||
find_package(PNetCDF REQUIRED)
|
||||
endif()
|
||||
endif()
|
||||
|
||||
if(NETCDF_FOUND)
|
||||
target_link_libraries(lammps PRIVATE NetCDF::NetCDF)
|
||||
|
||||
@ -70,16 +70,12 @@ if(DOWNLOAD_PLUMED)
|
||||
ExternalProject_get_property(plumed_build INSTALL_DIR)
|
||||
add_library(LAMMPS::PLUMED UNKNOWN IMPORTED)
|
||||
add_dependencies(LAMMPS::PLUMED plumed_build)
|
||||
if(NOT BUILD_SHARED_LIBS)
|
||||
install(CODE "MESSAGE(FATAL_ERROR \"Installing liblammps with downloaded libraries is currently not supported.\")")
|
||||
endif()
|
||||
if(PLUMED_MODE STREQUAL "STATIC")
|
||||
set_target_properties(LAMMPS::PLUMED PROPERTIES INTERFACE_COMPILE_DEFINITIONS "__PLUMED_WRAPPER_CXX=1")
|
||||
set_target_properties(LAMMPS::PLUMED PROPERTIES IMPORTED_LOCATION ${INSTALL_DIR}/lib/libplumed.a INTERFACE_LINK_LIBRARIES "${PLUMED_LINK_LIBS};${CMAKE_DL_LIBS}")
|
||||
elseif(PLUMED_MODE STREQUAL "SHARED")
|
||||
set_target_properties(LAMMPS::PLUMED PROPERTIES IMPORTED_LOCATION ${INSTALL_DIR}/lib/libplumed${CMAKE_SHARED_LIBRARY_SUFFIX} INTERFACE_LINK_LIBRARIES "${INSTALL_DIR}/lib/libplumedKernel${CMAKE_SHARED_LIBRARY_SUFFIX};${CMAKE_DL_LIBS}")
|
||||
elseif(PLUMED_MODE STREQUAL "RUNTIME")
|
||||
set_target_properties(LAMMPS::PLUMED PROPERTIES INTERFACE_COMPILE_DEFINITIONS "__PLUMED_HAS_DLOPEN=1;__PLUMED_DEFAULT_KERNEL=${INSTALL_DIR}/lib/libplumedKernel${CMAKE_SHARED_LIBRARY_SUFFIX}")
|
||||
set_target_properties(LAMMPS::PLUMED PROPERTIES INTERFACE_COMPILE_DEFINITIONS "__PLUMED_DEFAULT_KERNEL=${INSTALL_DIR}/lib/libplumedKernel${CMAKE_SHARED_LIBRARY_SUFFIX}")
|
||||
set_target_properties(LAMMPS::PLUMED PROPERTIES IMPORTED_LOCATION ${INSTALL_DIR}/lib/libplumedWrapper.a INTERFACE_LINK_LIBRARIES "${CMAKE_DL_LIBS}")
|
||||
endif()
|
||||
set_target_properties(LAMMPS::PLUMED PROPERTIES INTERFACE_INCLUDE_DIRECTORIES ${INSTALL_DIR}/include)
|
||||
@ -89,12 +85,11 @@ else()
|
||||
pkg_check_modules(PLUMED REQUIRED plumed)
|
||||
add_library(LAMMPS::PLUMED INTERFACE IMPORTED)
|
||||
if(PLUMED_MODE STREQUAL "STATIC")
|
||||
set_target_properties(LAMMPS::PLUMED PROPERTIES INTERFACE_COMPILE_DEFINITIONS "__PLUMED_WRAPPER_CXX=1")
|
||||
include(${PLUMED_LIBDIR}/plumed/src/lib/Plumed.cmake.static)
|
||||
elseif(PLUMED_MODE STREQUAL "SHARED")
|
||||
include(${PLUMED_LIBDIR}/plumed/src/lib/Plumed.cmake.shared)
|
||||
elseif(PLUMED_MODE STREQUAL "RUNTIME")
|
||||
set_target_properties(LAMMPS::PLUMED PROPERTIES INTERFACE_COMPILE_DEFINITIONS "__PLUMED_HAS_DLOPEN=1;__PLUMED_DEFAULT_KERNEL=${PLUMED_LIBDIR}/libplumedKernel${CMAKE_SHARED_LIBRARY_SUFFIX}")
|
||||
set_target_properties(LAMMPS::PLUMED PROPERTIES INTERFACE_COMPILE_DEFINITIONS "__PLUMED_DEFAULT_KERNEL=${PLUMED_LIBDIR}/libplumedKernel${CMAKE_SHARED_LIBRARY_SUFFIX}")
|
||||
include(${PLUMED_LIBDIR}/plumed/src/lib/Plumed.cmake.runtime)
|
||||
endif()
|
||||
set_target_properties(LAMMPS::PLUMED PROPERTIES INTERFACE_LINK_LIBRARIES "${PLUMED_LOAD}")
|
||||
|
||||
@ -1,12 +1,6 @@
|
||||
enable_language(C)
|
||||
|
||||
if(NOT BUILD_SHARED_LIBS)
|
||||
message(WARNING "It is recommended to use BUILD_SHARED_LIBS=yes with USER-QMMM")
|
||||
endif()
|
||||
add_library(qmmm STATIC ${LAMMPS_LIB_SOURCE_DIR}/qmmm/libqmmm.c)
|
||||
if(NOT BUILD_SHARED_LIBS)
|
||||
install(TARGETS qmmm EXPORT LAMMPS_Targets LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR} ARCHIVE DESTINATION ${CMAKE_INSTALL_LIBDIR})
|
||||
endif()
|
||||
set_target_properties(qmmm PROPERTIES OUTPUT_NAME lammps_qmmm${LAMMPS_MACHINE})
|
||||
target_link_libraries(lammps PRIVATE qmmm)
|
||||
target_include_directories(qmmm PUBLIC ${LAMMPS_LIB_SOURCE_DIR}/qmmm)
|
||||
|
||||
@ -14,10 +14,16 @@ endif()
|
||||
option(DOWNLOAD_SCAFACOS "Download ScaFaCoS library instead of using an already installed one" ${DOWNLOAD_SCAFACOS_DEFAULT})
|
||||
if(DOWNLOAD_SCAFACOS)
|
||||
message(STATUS "ScaFaCoS download requested - we will build our own")
|
||||
|
||||
# version 1.0.1 needs a patch to compile and linke cleanly with GCC 10 and later.
|
||||
file(DOWNLOAD https://download.lammps.org/thirdparty/scafacos-1.0.1-fix.diff ${CMAKE_CURRENT_BINARY_DIR}/scafacos-1.0.1.fix.diff
|
||||
EXPECTED_HASH MD5=4baa1333bb28fcce102d505e1992d032)
|
||||
|
||||
include(ExternalProject)
|
||||
ExternalProject_Add(scafacos_build
|
||||
URL https://github.com/scafacos/scafacos/releases/download/v1.0.1/scafacos-1.0.1.tar.gz
|
||||
URL_MD5 bd46d74e3296bd8a444d731bb10c1738
|
||||
PATCH_COMMAND patch -p1 < ${CMAKE_CURRENT_BINARY_DIR}/scafacos-1.0.1.fix.diff
|
||||
CONFIGURE_COMMAND <SOURCE_DIR>/configure --prefix=<INSTALL_DIR> --disable-doc
|
||||
--enable-fcs-solvers=fmm,p2nfft,direct,ewald,p3m
|
||||
--with-internal-fftw --with-internal-pfft
|
||||
@ -52,9 +58,6 @@ if(DOWNLOAD_SCAFACOS)
|
||||
INTERFACE_LINK_LIBRARIES "${INSTALL_DIR}/lib/libfcs.a;${INSTALL_DIR}/lib/libfcs_direct.a;${INSTALL_DIR}/lib/libfcs_ewald.a;${INSTALL_DIR}/lib/libfcs_fmm.a;${INSTALL_DIR}/lib/libfcs_p2nfft.a;${INSTALL_DIR}/lib/libfcs_p3m.a;GSL::gsl;${INSTALL_DIR}/lib/libfcs_near.a;${INSTALL_DIR}/lib/libfcs_gridsort.a;${INSTALL_DIR}/lib/libfcs_resort.a;${INSTALL_DIR}/lib/libfcs_redist.a;${INSTALL_DIR}/lib/libfcs_common.a;${INSTALL_DIR}/lib/libfcs_pnfft.a;${INSTALL_DIR}/lib/libfcs_pfft.a;${INSTALL_DIR}/lib/libfcs_fftw3_mpi.a;${INSTALL_DIR}/lib/libfcs_fftw3.a;MPI::MPI_Fortran;MPI::MPI_C")
|
||||
target_link_libraries(lammps PRIVATE LAMMPS::SCAFACOS)
|
||||
add_dependencies(LAMMPS::SCAFACOS scafacos_build)
|
||||
if(NOT BUILD_SHARED_LIBS)
|
||||
install(CODE "MESSAGE(FATAL_ERROR \"Installing liblammps with downloaded libraries is currently not supported.\")")
|
||||
endif()
|
||||
else()
|
||||
find_package(PkgConfig REQUIRED)
|
||||
pkg_check_modules(SCAFACOS REQUIRED IMPORTED_TARGET scafacos)
|
||||
|
||||
@ -9,7 +9,7 @@ if(DOWNLOAD_EIGEN3)
|
||||
message(STATUS "Eigen3 download requested - we will build our own")
|
||||
include(ExternalProject)
|
||||
ExternalProject_Add(Eigen3_build
|
||||
URL http://bitbucket.org/eigen/eigen/get/3.3.7.tar.gz
|
||||
URL https://bitbucket.org/eigen/eigen/get/3.3.7.tar.gz
|
||||
URL_MD5 f2a417d083fe8ca4b8ed2bc613d20f07
|
||||
CONFIGURE_COMMAND "" BUILD_COMMAND "" INSTALL_COMMAND ""
|
||||
)
|
||||
@ -18,9 +18,6 @@ if(DOWNLOAD_EIGEN3)
|
||||
set_target_properties(LAMMPS::EIGEN3 PROPERTIES INTERFACE_INCLUDE_DIRECTORIES "${SOURCE_DIR}")
|
||||
target_link_libraries(lammps PRIVATE LAMMPS::EIGEN3)
|
||||
add_dependencies(LAMMPS::EIGEN3 Eigen3_build)
|
||||
if(NOT BUILD_SHARED_LIBS)
|
||||
install(CODE "MESSAGE(FATAL_ERROR \"Installing liblammps with downloaded libraries is currently not supported.\")")
|
||||
endif()
|
||||
else()
|
||||
find_package(Eigen3 NO_MODULE)
|
||||
mark_as_advanced(Eigen3_DIR)
|
||||
|
||||
@ -24,7 +24,11 @@ if(DOWNLOAD_VORO)
|
||||
ExternalProject_Add(voro_build
|
||||
URL https://download.lammps.org/thirdparty/voro++-0.4.6.tar.gz
|
||||
URL_MD5 2338b824c3b7b25590e18e8df5d68af9
|
||||
CONFIGURE_COMMAND "" BUILD_COMMAND make ${VORO_BUILD_OPTIONS} BUILD_IN_SOURCE 1 INSTALL_COMMAND ""
|
||||
PATCH_COMMAND patch -b -p0 < ${LAMMPS_LIB_SOURCE_DIR}/voronoi/voro-make.patch
|
||||
CONFIGURE_COMMAND ""
|
||||
BUILD_COMMAND make ${VORO_BUILD_OPTIONS}
|
||||
BUILD_IN_SOURCE 1
|
||||
INSTALL_COMMAND ""
|
||||
BUILD_BYPRODUCTS <SOURCE_DIR>/src/libvoro++.a
|
||||
)
|
||||
ExternalProject_get_property(voro_build SOURCE_DIR)
|
||||
@ -35,9 +39,6 @@ if(DOWNLOAD_VORO)
|
||||
INTERFACE_INCLUDE_DIRECTORIES "${SOURCE_DIR}/src")
|
||||
target_link_libraries(lammps PRIVATE LAMMPS::VORO)
|
||||
add_dependencies(LAMMPS::VORO voro_build)
|
||||
if(NOT BUILD_SHARED_LIBS)
|
||||
install(CODE "MESSAGE(FATAL_ERROR \"Installing liblammps with downloaded libraries is currently not supported.\")")
|
||||
endif()
|
||||
else()
|
||||
find_package(VORO)
|
||||
if(NOT VORO_FOUND)
|
||||
|
||||
@ -3,49 +3,23 @@
|
||||
###############################################################################
|
||||
option(ENABLE_TESTING "Enable testing" OFF)
|
||||
if(ENABLE_TESTING)
|
||||
find_program(VALGRIND_BINARY NAMES valgrind)
|
||||
# generate custom suppression file
|
||||
file(WRITE ${CMAKE_CURRENT_BINARY_DIR}/lammps.supp "\n")
|
||||
file(GLOB VALGRIND_SUPPRESSION_FILES ${LAMMPS_TOOLS_DIR}/valgrind/[^.]*.supp)
|
||||
foreach(SUPP ${VALGRIND_SUPPRESSION_FILES})
|
||||
file(READ ${SUPP} SUPPRESSIONS)
|
||||
file(APPEND ${CMAKE_CURRENT_BINARY_DIR}/lammps.supp "${SUPPRESSIONS}")
|
||||
endforeach()
|
||||
set(VALGRIND_DEFAULT_OPTIONS "--leak-check=full --show-leak-kinds=all --track-origins=yes --suppressions=${CMAKE_BINARY_DIR}/lammps.supp")
|
||||
|
||||
set(MEMORYCHECK_COMMAND "${VALGRIND_BINARY}" CACHE FILEPATH "Memory Check Command")
|
||||
set(MEMORYCHECK_COMMAND_OPTIONS "${VALGRIND_DEFAULT_OPTIONS}" CACHE STRING "Memory Check Command Options")
|
||||
|
||||
include(CTest)
|
||||
|
||||
enable_testing()
|
||||
option(LAMMPS_TESTING_SOURCE_DIR "Location of lammps-testing source directory" "")
|
||||
option(LAMMPS_TESTING_GIT_TAG "Git tag of lammps-testing" "master")
|
||||
mark_as_advanced(LAMMPS_TESTING_SOURCE_DIR LAMMPS_TESTING_GIT_TAG)
|
||||
|
||||
if (CMAKE_VERSION VERSION_GREATER "3.10.3" AND NOT LAMMPS_TESTING_SOURCE_DIR)
|
||||
include(FetchContent)
|
||||
|
||||
FetchContent_Declare(lammps-testing
|
||||
GIT_REPOSITORY https://github.com/lammps/lammps-testing.git
|
||||
GIT_TAG ${LAMMPS_TESTING_GIT_TAG}
|
||||
)
|
||||
|
||||
FetchContent_GetProperties(lammps-testing)
|
||||
if(NOT lammps-testing_POPULATED)
|
||||
message(STATUS "Downloading tests...")
|
||||
FetchContent_Populate(lammps-testing)
|
||||
endif()
|
||||
|
||||
set(LAMMPS_TESTING_SOURCE_DIR ${lammps-testing_SOURCE_DIR})
|
||||
elseif(NOT LAMMPS_TESTING_SOURCE_DIR)
|
||||
message(WARNING "Full test-suite requires CMake >= 3.11 or copy of\n"
|
||||
"https://github.com/lammps/lammps-testing in LAMMPS_TESTING_SOURCE_DIR")
|
||||
endif()
|
||||
|
||||
add_test(NAME ShowHelp COMMAND $<TARGET_FILE:lmp> -help)
|
||||
|
||||
if(EXISTS ${LAMMPS_TESTING_SOURCE_DIR})
|
||||
message(STATUS "Running test discovery...")
|
||||
|
||||
file(GLOB_RECURSE TEST_SCRIPTS ${LAMMPS_TESTING_SOURCE_DIR}/tests/core/*/in.*)
|
||||
foreach(script_path ${TEST_SCRIPTS})
|
||||
get_filename_component(TEST_NAME ${script_path} EXT)
|
||||
get_filename_component(SCRIPT_NAME ${script_path} NAME)
|
||||
get_filename_component(PARENT_DIR ${script_path} DIRECTORY)
|
||||
string(SUBSTRING ${TEST_NAME} 1 -1 TEST_NAME)
|
||||
string(REPLACE "-" "_" TEST_NAME ${TEST_NAME})
|
||||
string(REPLACE "+" "_" TEST_NAME ${TEST_NAME})
|
||||
set(TEST_NAME "test_core_${TEST_NAME}_serial")
|
||||
add_test(NAME ${TEST_NAME} COMMAND $<TARGET_FILE:lmp> -in ${SCRIPT_NAME} WORKING_DIRECTORY ${PARENT_DIR})
|
||||
endforeach()
|
||||
list(LENGTH TEST_SCRIPTS NUM_TESTS)
|
||||
|
||||
message(STATUS "Found ${NUM_TESTS} tests.")
|
||||
endif()
|
||||
get_filename_component(LAMMPS_UNITTEST_DIR ${LAMMPS_SOURCE_DIR}/../unittest ABSOLUTE)
|
||||
get_filename_component(LAMMPS_UNITTEST_BIN ${CMAKE_BINARY_DIR}/unittest ABSOLUTE)
|
||||
add_subdirectory(${LAMMPS_UNITTEST_DIR} ${LAMMPS_UNITTEST_BIN})
|
||||
endif()
|
||||
|
||||
@ -3,17 +3,19 @@ set(temp_git_commit "(unknown)")
|
||||
set(temp_git_branch "(unknown)")
|
||||
set(temp_git_describe "(unknown)")
|
||||
set(temp_git_info "false")
|
||||
if(GIT_FOUND AND EXISTS ${CMAKE_CURRENT_SOURCE_DIR}/../.git)
|
||||
|
||||
message(STATUS "Git Directory: ${LAMMPS_DIR}/.git")
|
||||
if(GIT_FOUND AND EXISTS ${LAMMPS_DIR}/.git)
|
||||
set(temp_git_info "true")
|
||||
execute_process(COMMAND ${GIT_EXECUTABLE} -C ${CMAKE_CURRENT_SOURCE_DIR}/.. rev-parse HEAD
|
||||
execute_process(COMMAND ${GIT_EXECUTABLE} -C ${LAMMPS_DIR} rev-parse HEAD
|
||||
OUTPUT_VARIABLE temp_git_commit
|
||||
ERROR_QUIET
|
||||
OUTPUT_STRIP_TRAILING_WHITESPACE)
|
||||
execute_process(COMMAND ${GIT_EXECUTABLE} -C ${CMAKE_CURRENT_SOURCE_DIR}/.. rev-parse --abbrev-ref HEAD
|
||||
execute_process(COMMAND ${GIT_EXECUTABLE} -C ${LAMMPS_DIR} rev-parse --abbrev-ref HEAD
|
||||
OUTPUT_VARIABLE temp_git_branch
|
||||
ERROR_QUIET
|
||||
OUTPUT_STRIP_TRAILING_WHITESPACE)
|
||||
execute_process(COMMAND ${GIT_EXECUTABLE} -C ${CMAKE_CURRENT_SOURCE_DIR}/.. describe --dirty=-modified
|
||||
execute_process(COMMAND ${GIT_EXECUTABLE} -C ${LAMMPS_DIR} describe --dirty=-modified
|
||||
OUTPUT_VARIABLE temp_git_describe
|
||||
ERROR_QUIET
|
||||
OUTPUT_STRIP_TRAILING_WHITESPACE)
|
||||
|
||||
@ -8,7 +8,7 @@ set(ALL_PACKAGES ASPHERE BODY CLASS2 COLLOID COMPRESS CORESHELL DIPOLE GPU
|
||||
USER-ADIOS USER-ATC USER-AWPMD USER-BOCS USER-CGDNA USER-CGSDK
|
||||
USER-COLVARS USER-DIFFRACTION USER-DPD USER-DRUDE USER-EFF USER-FEP
|
||||
USER-H5MD USER-INTEL USER-LB USER-MANIFOLD USER-MEAMC USER-MESODPD
|
||||
USER-MGPT USER-MISC USER-MOFFF USER-MOLFILE USER-NETCDF USER-OMP
|
||||
USER-MESONT USER-MGPT USER-MISC USER-MOFFF USER-MOLFILE USER-NETCDF USER-OMP
|
||||
USER-PHONON USER-PLUMED USER-PTM USER-QMMM USER-QTB USER-QUIP
|
||||
USER-REACTION USER-REAXC USER-SCAFACOS USER-SDPD USER-SMD USER-SMTBQ
|
||||
USER-SPH USER-TALLY USER-UEF USER-VTK USER-YAFF)
|
||||
|
||||
@ -10,7 +10,7 @@ set(ALL_PACKAGES ASPHERE BODY CLASS2 COLLOID COMPRESS CORESHELL DIPOLE GPU
|
||||
USER-ADIOS USER-ATC USER-AWPMD USER-BOCS USER-CGDNA USER-CGSDK
|
||||
USER-COLVARS USER-DIFFRACTION USER-DPD USER-DRUDE USER-EFF USER-FEP
|
||||
USER-H5MD USER-INTEL USER-LB USER-MANIFOLD USER-MEAMC USER-MESODPD
|
||||
USER-MGPT USER-MISC USER-MOFFF USER-MOLFILE USER-NETCDF USER-OMP
|
||||
USER-MESONT USER-MGPT USER-MISC USER-MOFFF USER-MOLFILE USER-NETCDF USER-OMP
|
||||
USER-PHONON USER-PLUMED USER-PTM USER-QMMM USER-QTB USER-QUIP
|
||||
USER-REACTION USER-REAXC USER-SCAFACOS USER-SDPD USER-SMD USER-SMTBQ
|
||||
USER-SPH USER-TALLY USER-UEF USER-VTK USER-YAFF)
|
||||
|
||||
@ -2,7 +2,7 @@
|
||||
|
||||
set(CMAKE_CXX_COMPILER "clang++" CACHE STRING "" FORCE)
|
||||
set(CMAKE_C_COMPILER "clang" CACHE STRING "" FORCE)
|
||||
set(CMAKE_CXX_FLAGS "-Wall -Wextra -g -O2 -DNDEBG" CACHE STRING "" FORCE)
|
||||
set(CMAKE_CXX_FLAGS "-Wall -Wextra -g -O2 -DNDEBUG" CACHE STRING "" FORCE)
|
||||
set(MPI_CXX "clang++" CACHE STRING "" FORCE)
|
||||
set(MPI_CXX_COMPILER "mpicxx" CACHE STRING "" FORCE)
|
||||
unset(HAVE_OMP_H_INCLUDE CACHE)
|
||||
|
||||
17
cmake/presets/download.cmake
Normal file
17
cmake/presets/download.cmake
Normal file
@ -0,0 +1,17 @@
|
||||
# preset that turns on packages with automatic downloads of sources of potentials
|
||||
# compilation of libraries like Plumed or ScaFaCoS can take a considerable amount of time.
|
||||
|
||||
set(ALL_PACKAGES KIM LATTE MSCG VORONOI USER-PLUMED USER-SCAFACOS USER-SMD USER-MESONT)
|
||||
|
||||
foreach(PKG ${ALL_PACKAGES})
|
||||
set(PKG_${PKG} ON CACHE BOOL "" FORCE)
|
||||
endforeach()
|
||||
|
||||
set(DOWNLOAD_KIM ON CACHE BOOL "" FORCE)
|
||||
set(DOWNLOAD_LATTE ON CACHE BOOL "" FORCE)
|
||||
set(DOWNLOAD_MSCG ON CACHE BOOL "" FORCE)
|
||||
set(DOWNLOAD_VORO ON CACHE BOOL "" FORCE)
|
||||
set(DOWNLOAD_EIGEN3 ON CACHE BOOL "" FORCE)
|
||||
set(DOWNLOAD_PLUMED ON CACHE BOOL "" FORCE)
|
||||
set(DOWNLOAD_SCAFACOS ON CACHE BOOL "" FORCE)
|
||||
|
||||
12
cmake/presets/hip.cmake
Normal file
12
cmake/presets/hip.cmake
Normal file
@ -0,0 +1,12 @@
|
||||
# preset that will enable hipcc plus gcc 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_CXX_FLAGS "-Wall -Wextra -g -O2 -DNDEBUG" CACHE STRING "" FORCE)
|
||||
unset(HAVE_OMP_H_INCLUDE CACHE)
|
||||
|
||||
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)
|
||||
|
||||
@ -1,10 +1,10 @@
|
||||
set(WIN_PACKAGES ASPHERE BODY CLASS2 COLLOID COMPRESS CORESHELL DIPOLE GPU
|
||||
GRANULAR KSPACE LATTE MANYBODY MC MISC MOLECULE OPT PERI
|
||||
POEMS QEQ REPLICA RIGID SHOCK SNAP SPIN SRD VORONOI
|
||||
GRANULAR KSPACE LATTE MANYBODY MC MISC MLIAP MOLECULE OPT
|
||||
PERI POEMS QEQ REPLICA RIGID SHOCK SNAP SPIN SRD VORONOI
|
||||
USER-ATC USER-AWPMD USER-BOCS USER-CGDNA USER-CGSDK
|
||||
USER-COLVARS USER-DIFFRACTION USER-DPD USER-DRUDE USER-EFF
|
||||
USER-FEP USER-INTEL USER-MANIFOLD USER-MEAMC USER-MESODPD
|
||||
USER-MISC USER-MGPT USER-MOFFF USER-MOLFILE USER-OMP
|
||||
USER-MESONT USER-MISC USER-MGPT USER-MOFFF USER-MOLFILE USER-OMP
|
||||
USER-PHONON USER-PTM USER-QTB USER-REACTION USER-REAXC
|
||||
USER-SDPD USER-SMD USER-SMTBQ USER-SPH USER-TALLY USER-UEF
|
||||
USER-YAFF)
|
||||
|
||||
@ -2,13 +2,13 @@
|
||||
# external libraries. Compared to all_on.cmake some more unusual packages
|
||||
# are removed. The resulting binary should be able to run most inputs.
|
||||
|
||||
set(ALL_PACKAGES ASPHERE BODY CLASS2 COLLOID COMPRESS CORESHELL
|
||||
DIPOLE GRANULAR KSPACE MANYBODY MC MISC MOLECULE OPT PERI
|
||||
set(ALL_PACKAGES ASPHERE BODY CLASS2 COLLOID COMPRESS CORESHELL DIPOLE
|
||||
GRANULAR KSPACE MANYBODY MC MISC MLIAP MOLECULE OPT PERI
|
||||
POEMS PYTHON QEQ REPLICA RIGID SHOCK SNAP SPIN SRD VORONOI
|
||||
USER-CGDNA USER-CGSDK USER-COLVARS USER-DIFFRACTION
|
||||
USER-DPD USER-DRUDE USER-FEP USER-MEAMC USER-MESODPD
|
||||
USER-BOCS USER-CGDNA USER-CGSDK USER-COLVARS USER-DIFFRACTION
|
||||
USER-DPD USER-DRUDE USER-EFF USER-FEP USER-MEAMC USER-MESODPD
|
||||
USER-MISC USER-MOFFF USER-OMP USER-PHONON USER-REACTION
|
||||
USER-REAXC USER-SPH USER-SMD USER-UEF USER-YAFF)
|
||||
USER-REAXC USER-SDPD USER-SPH USER-SMD USER-UEF USER-YAFF)
|
||||
|
||||
foreach(PKG ${ALL_PACKAGES})
|
||||
set(PKG_${PKG} ON CACHE BOOL "" FORCE)
|
||||
|
||||
@ -3,7 +3,7 @@
|
||||
|
||||
set(PACKAGES_WITH_LIB COMPRESS GPU KIM KOKKOS LATTE MPIIO MSCG PYTHON
|
||||
VORONOI USER-ADIOS USER-ATC USER-AWPMD USER-H5MD USER-LB
|
||||
USER-MOLFILE USER-NETCDF USER-PLUMED USER-QMMM USER-QUIP
|
||||
USER-MOLFILE USER-MESONT USER-NETCDF USER-PLUMED USER-QMMM USER-QUIP
|
||||
USER-SCAFACOS USER-SMD USER-VTK)
|
||||
|
||||
foreach(PKG ${PACKAGES_WITH_LIB})
|
||||
|
||||
@ -25,10 +25,10 @@ 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,
|
||||
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.
|
||||
when necessary.
|
||||
|
||||
## Pull Requests
|
||||
|
||||
|
||||
@ -49,22 +49,15 @@ include files provided with LAMMPS are included with double quotes
|
||||
|
||||
For headers declaring functions of the C-library, the corresponding
|
||||
C++ versions should be included (examples: `#include <cstdlib>` or
|
||||
`#include <cctypes>`). However, these includes are limited to those defined
|
||||
in the C++98 standard. Some files thus must use the older style until
|
||||
the minimum C++ standard requirement of LAMMPS is lifted to C++11 or
|
||||
even beyond (examples: `#include <stdint.h>` versus `#include <cstdint>`
|
||||
or `#include <inttypes.h>` versus `#include <cinttypes>`).
|
||||
`#include <cctypes>` instead of `#include <stdlib.h>` or
|
||||
`#include<ctypes.h>` ).
|
||||
|
||||
### C++ Standard Compliance
|
||||
|
||||
LAMMPS core files currently correspond to the C++98 standard. Files
|
||||
requiring C++11 or later are only permitted in (optional) packages
|
||||
and particularly packages that are not part of the list of commonly
|
||||
used packages such as MOLECULE, KSPACE, MANYBODY, or RIGID.
|
||||
|
||||
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.
|
||||
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
|
||||
|
||||
@ -72,7 +65,7 @@ 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
|
||||
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
|
||||
|
||||
@ -1,4 +1,4 @@
|
||||
.TH LAMMPS "15 April 2020" "2020-04-15"
|
||||
.TH LAMMPS "15 June 2020" "2020-06-15"
|
||||
.SH NAME
|
||||
.B LAMMPS
|
||||
\- Molecular Dynamics Simulator.
|
||||
|
||||
0
doc/src/99/crib.html
Executable file → Normal file
0
doc/src/99/crib.html
Executable file → Normal file
@ -225,7 +225,7 @@ A few example command lines are:
|
||||
|
||||
For compiling with the Clang/LLVM compilers a CMake preset is provided that
|
||||
can be loaded with `-C ../cmake/presets/clang.cmake`. Similarly,
|
||||
`-C ../cmake/presets/intel.cmake` should switch the
|
||||
`-C ../cmake/presets/intel.cmake` should switch the
|
||||
|
||||
In addition you can set ``CMAKE_TUNE_FLAGS`` to specifically add
|
||||
compiler flags to tune for optimal performance on given hosts. By
|
||||
@ -372,7 +372,8 @@ it. The build step will also create generic soft links, named
|
||||
``liblammps.a`` and ``liblammps.so``\ , which point to the specific
|
||||
``liblammps_machine.a/so`` files.
|
||||
|
||||
**CMake and make info**\ :
|
||||
CMake and make info
|
||||
^^^^^^^^^^^^^^^^^^^
|
||||
|
||||
Note that for creating a shared library, all the libraries it depends on
|
||||
must be compiled to be compatible with shared libraries. This should be
|
||||
@ -462,7 +463,8 @@ tool. The actual translation is then done via make commands.
|
||||
.. _rst: https://docutils.readthedocs.io/en/sphinx-docs/user/rst/quickstart.html
|
||||
.. _sphinx: https://sphinx-doc.org
|
||||
|
||||
**Documentation make option**\ :
|
||||
Documentation make option
|
||||
^^^^^^^^^^^^^^^^^^^^^^^^^
|
||||
|
||||
The following make commands can be issued in the doc folder of the
|
||||
LAMMPS source distribution.
|
||||
@ -489,7 +491,8 @@ your system.
|
||||
current LAMMPS version (HTML and PDF files), from the website
|
||||
`download page <https://lammps.sandia.gov/download.html>`_.
|
||||
|
||||
**CMake build option**\ :
|
||||
CMake build option
|
||||
^^^^^^^^^^^^^^^^^^
|
||||
|
||||
It is also possible to create the HTML version of the manual within
|
||||
the :doc:`CMake build directory <Build_cmake>`. The reason for this
|
||||
@ -512,7 +515,8 @@ Build LAMMPS tools
|
||||
Some tools described in :doc:`Auxiliary tools <Tools>` can be built directly
|
||||
using CMake or Make.
|
||||
|
||||
**CMake build3**\ :
|
||||
CMake build
|
||||
^^^^^^^^^^^
|
||||
|
||||
.. code-block:: bash
|
||||
|
||||
@ -521,7 +525,8 @@ using CMake or Make.
|
||||
The generated binaries will also become part of the LAMMPS installation
|
||||
(see below).
|
||||
|
||||
**Traditional make**\ :
|
||||
Traditional make
|
||||
^^^^^^^^^^^^^^^^
|
||||
|
||||
.. code-block:: bash
|
||||
|
||||
@ -545,7 +550,8 @@ a globally visible place on your system, for others to access. Note
|
||||
that you may need super-user privileges (e.g. sudo) if the directory
|
||||
you want to copy files to is protected.
|
||||
|
||||
**CMake build**\ :
|
||||
CMake build
|
||||
^^^^^^^^^^^
|
||||
|
||||
.. code-block:: bash
|
||||
|
||||
@ -553,7 +559,8 @@ you want to copy files to is protected.
|
||||
make # perform make after CMake command
|
||||
make install # perform the installation into prefix
|
||||
|
||||
**Traditional make**\ :
|
||||
Traditional make
|
||||
^^^^^^^^^^^^^^^^
|
||||
|
||||
There is no "install" option in the ``src/Makefile`` for LAMMPS. If
|
||||
you wish to do this you will need to first build LAMMPS, then manually
|
||||
|
||||
@ -107,7 +107,7 @@ re-compile and relink the LAMMPS executable with ``cmake --build .`` (or
|
||||
``cmake .`` and then compile again. The included dependency tracking
|
||||
should make certain that only the necessary subset of files are
|
||||
re-compiled. You can also delete compiled objects, libraries and
|
||||
executables with ``cmake --build . clean`` (or ``make clean``).
|
||||
executables with ``cmake --build . --target clean`` (or ``make clean``).
|
||||
|
||||
After compilation, you may optionally install the LAMMPS executable into
|
||||
your system with:
|
||||
|
||||
@ -8,8 +8,8 @@ useful during development, testing or debugging.
|
||||
|
||||
.. _compilation:
|
||||
|
||||
Verify compilation flags
|
||||
------------------------
|
||||
Monitor compilation flags
|
||||
-------------------------
|
||||
|
||||
Sometimes it is necessary to verify the complete sequence of compilation flags
|
||||
generated by the CMake build. To enable a more verbose output during
|
||||
@ -19,7 +19,8 @@ compilation you can use the following option.
|
||||
|
||||
-D CMAKE_VERBOSE_MAKEFILE=value # value = no (default) or yes
|
||||
|
||||
Another way of doing this without reconfiguration is calling make with variable VERBOSE set to 1:
|
||||
Another way of doing this without reconfiguration is calling make with
|
||||
variable VERBOSE set to 1:
|
||||
|
||||
.. code-block:: bash
|
||||
|
||||
@ -33,77 +34,320 @@ Address, Undefined Behavior, and Thread Sanitizer Support
|
||||
---------------------------------------------------------
|
||||
|
||||
Compilers such as GCC and Clang support generating instrumented binaries
|
||||
which use different sanitizer libraries to detect problems in code
|
||||
which use different sanitizer libraries to detect problems in the code
|
||||
during run-time. They can detect issues like:
|
||||
|
||||
- `memory leaks <https://clang.llvm.org/docs/AddressSanitizer.html>`_
|
||||
- `undefined behavior <https://clang.llvm.org/docs/UndefinedBehaviorSanitizer.html>`_
|
||||
- `data races <https://clang.llvm.org/docs/ThreadSanitizer.html>`_
|
||||
|
||||
Please note that this kind of instrumentation usually comes with a small
|
||||
performance hit (much less than using tools like `Valgrind
|
||||
<https://valgrind.org>`_). The to enable these features additional
|
||||
compiler flags need to be added to the compilation and linking stages.
|
||||
This is most easily done through setting the ``CMAKE_TUNE_FLAGS``
|
||||
variable during configuration. Examples:
|
||||
Please note that this kind of instrumentation usually comes with a
|
||||
performance hit (but much less than using tools like `Valgrind
|
||||
<https://valgrind.org>`_ with a more low level approach). The to enable
|
||||
these features additional compiler flags need to be added to the
|
||||
compilation and linking stages. This is done through setting the
|
||||
``ENABLE_SANITIZER`` variable during configuration. Examples:
|
||||
|
||||
.. code-block:: bash
|
||||
|
||||
-D CMAKE_TUNE_FLAGS=-fsanitize=address # enable address sanitizer / memory leak checker
|
||||
-D CMAKE_TUNE_FLAGS=-fsanitize=undefined # enable undefined behavior sanitizer
|
||||
-D CMAKE_TUNE_FLAGS=-fsanitize=thread # enable thread sanitizer
|
||||
-D ENABLE_SANITIZER=none # no sanitizer active (default)
|
||||
-D ENABLE_SANITIZER=address # enable address sanitizer / memory leak checker
|
||||
-D ENABLE_SANITIZER=leak # enable memory leak checker (only)
|
||||
-D ENABLE_SANITIZER=undefined # enable undefined behavior sanitizer
|
||||
-D ENABLE_SANITIZER=thread # enable thread sanitizer
|
||||
|
||||
----------
|
||||
|
||||
.. _testing:
|
||||
|
||||
Code Coverage and Testing
|
||||
---------------------------------------
|
||||
Code Coverage and Unit Testing
|
||||
------------------------------
|
||||
|
||||
We do extensive regression testing of the LAMMPS code base on a continuous
|
||||
basis. Some of the logic to do this has been added to the CMake build so
|
||||
developers can run the tests directly on their workstation.
|
||||
The LAMMPS code is subject to multiple levels of automated testing
|
||||
during development: integration testing (i.e. whether the code compiles
|
||||
on various platforms and with a variety of settings), unit testing
|
||||
(i.e. whether certain individual parts of the code produce the expected
|
||||
results for given inputs), run testing (whether selected complete input
|
||||
decks run without crashing for multiple configurations), and regression
|
||||
testing (i.e. whether selected input examples reproduce the same
|
||||
results over a given number of steps and operations within a given
|
||||
error margin). The status of this automated testing can be viewed on
|
||||
`https://ci.lammps.org <https://ci.lammps.org>`_.
|
||||
|
||||
The unit testing facility is integrated into the CMake build process
|
||||
of the LAMMPS source code distribution itself. It can be enabled by
|
||||
setting ``-D ENABLE_TESTING=on`` during the CMake configuration step.
|
||||
It requires the `YAML <http://pyyaml.org/>`_ library and development
|
||||
headers to compile and will download and compile a recent version of the
|
||||
`Googletest <https://github.com/google/googletest/>`_ C++ test framework
|
||||
for implementing the tests.
|
||||
|
||||
After compilation is complete, the unit testing is started in the build
|
||||
folder using the ``ctest`` command, which is part of the CMake software.
|
||||
The output of this command will be looking something like this::
|
||||
|
||||
[...]$ ctest
|
||||
Test project /home/akohlmey/compile/lammps/build-testing
|
||||
Start 1: MolPairStyle:hybrid-overlay
|
||||
1/109 Test #1: MolPairStyle:hybrid-overlay ......... Passed 0.02 sec
|
||||
Start 2: MolPairStyle:hybrid
|
||||
2/109 Test #2: MolPairStyle:hybrid ................. Passed 0.01 sec
|
||||
Start 3: MolPairStyle:lj_class2
|
||||
[...]
|
||||
Start 107: PotentialFileReader
|
||||
107/109 Test #107: PotentialFileReader ................ Passed 0.04 sec
|
||||
Start 108: EIMPotentialFileReader
|
||||
108/109 Test #108: EIMPotentialFileReader ............. Passed 0.03 sec
|
||||
Start 109: TestSimpleCommands
|
||||
109/109 Test #109: TestSimpleCommands ................. Passed 0.02 sec
|
||||
|
||||
100% tests passed, 0 tests failed out of 26
|
||||
|
||||
Total Test time (real) = 25.57 sec
|
||||
|
||||
|
||||
The ``ctest`` command has many options, the most important ones are:
|
||||
|
||||
.. list-table::
|
||||
|
||||
* - Option
|
||||
- Function
|
||||
* - -V
|
||||
- verbose output: display output of individual test runs
|
||||
* - -j <num>
|
||||
- parallel run: run <num> tests in parallel
|
||||
* - -R <regex>
|
||||
- run subset of tests matching the regular expression <regex>
|
||||
* - -E <regex>
|
||||
- exclude subset of tests matching the regular expression <regex>
|
||||
* - -N
|
||||
- dry-run: display list of tests without running them
|
||||
* - -T memcheck
|
||||
- run tests with valgrind memory checker (if available)
|
||||
|
||||
In its full implementation, the unit test framework will consist of multiple
|
||||
kinds of tests implemented in different programming languages (C++, C, Python,
|
||||
Fortran) and testing different aspects of the LAMMPS software and its features.
|
||||
At the moment only tests for "force styles" are implemented. More on those
|
||||
in the next section.
|
||||
|
||||
.. note::
|
||||
|
||||
this is incomplete and only represents a small subset of tests that we run
|
||||
The unit test framework is new and still under development.
|
||||
The coverage is only minimal and will be expanded over time.
|
||||
Tests styles of the same kind of style (e.g. pair styles or
|
||||
bond styles) are performed with the same executable using
|
||||
different input files in YAML format. So to add a test for
|
||||
another pair style can be done by copying the YAML file and
|
||||
editing the style settings and then running the individual test
|
||||
program with a flag to update the computed reference data.
|
||||
Detailed documentation about how to add new test program and
|
||||
the contents of the YAML files for existing test programs
|
||||
will be provided in time as well.
|
||||
|
||||
Unit tests for force styles
|
||||
^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
||||
|
||||
A large part of LAMMPS are different "styles" for computing non-bonded
|
||||
and bonded interactions selected through the :doc:`pair_style`,
|
||||
:doc:`bond_style`, :doc:`angle_style`, :doc:`dihedral_style`,
|
||||
:doc:`improper_style`, and :doc:`kspace_style`. Since these all share
|
||||
common interfaces, it is possible to write generic test programs that
|
||||
will call those common interfaces for small test systems with less than
|
||||
100 atoms and compare the results with pre-recorded reference results.
|
||||
A test run is then a a collection multiple individual test runs each
|
||||
with many comparisons to reference results based on template input
|
||||
files, individual command settings, relative error margins, and
|
||||
reference data stored in a YAML format file with ``.yaml``
|
||||
suffix. Currently the programs ``pair_style``, ``bond_style``, and
|
||||
``angle_style`` are implemented. They will compare forces, energies and
|
||||
(global) stress for all atoms after a ``run 0`` calculation and after a
|
||||
few steps of MD with :doc:`fix nve <fix_nve>`, each in multiple variants
|
||||
with different settings and also for multiple accelerated styles. If a
|
||||
prerequisite style or package is missing, the individual tests are
|
||||
skipped. All tests will be executed on a single MPI process, so using
|
||||
the CMake option ``-D BUILD_MPI=off`` can significantly speed up testing,
|
||||
since this will skip the MPI initialization for each test run.
|
||||
Below is an example command and output:
|
||||
|
||||
.. parsed-literal::
|
||||
|
||||
[tests]$ pair_style mol-pair-lj_cut.yaml
|
||||
[==========] Running 6 tests from 1 test suite.
|
||||
[----------] Global test environment set-up.
|
||||
[----------] 6 tests from PairStyle
|
||||
[ RUN ] PairStyle.plain
|
||||
[ OK ] PairStyle.plain (24 ms)
|
||||
[ RUN ] PairStyle.omp
|
||||
[ OK ] PairStyle.omp (18 ms)
|
||||
[ RUN ] PairStyle.intel
|
||||
[ OK ] PairStyle.intel (6 ms)
|
||||
[ RUN ] PairStyle.opt
|
||||
[ SKIPPED ] PairStyle.opt (0 ms)
|
||||
[ RUN ] PairStyle.single
|
||||
[ OK ] PairStyle.single (7 ms)
|
||||
[ RUN ] PairStyle.extract
|
||||
[ OK ] PairStyle.extract (6 ms)
|
||||
[----------] 6 tests from PairStyle (62 ms total)
|
||||
|
||||
[----------] Global test environment tear-down
|
||||
[==========] 6 tests from 1 test suite ran. (63 ms total)
|
||||
[ PASSED ] 5 tests.
|
||||
[ SKIPPED ] 1 test, listed below:
|
||||
[ SKIPPED ] PairStyle.opt
|
||||
|
||||
In this particular case, 5 out of 6 sets of tests were conducted, the
|
||||
tests for the ``lj/cut/opt`` pair style was skipped, since the tests
|
||||
executable did not include it. To learn what individual tests are performed,
|
||||
you (currently) need to read the source code. You can use code coverage
|
||||
recording (see next section) to confirm how well the tests cover the code
|
||||
paths in the individual source files.
|
||||
|
||||
The force style test programs have a common set of options:
|
||||
|
||||
.. list-table::
|
||||
|
||||
* - Option
|
||||
- Function
|
||||
* - -g <newfile>
|
||||
- regenerate reference data in new YAML file
|
||||
* - -u
|
||||
- update reference data in the original YAML file
|
||||
* - -s
|
||||
- print error statistics for each group of comparisons
|
||||
* - -v
|
||||
- verbose output: also print the executed LAMMPS commands
|
||||
|
||||
The ``ctest`` tool has no mechanism to directly pass flags to the individual
|
||||
test programs, but a workaround has been implemented where these flags can be
|
||||
set in an environment variable ``TEST_ARGS``. Example:
|
||||
|
||||
.. code-block:: bash
|
||||
|
||||
-D ENABLE_TESTING=value # enable simple run tests of LAMMPS, value = no (default) or yes
|
||||
-D LAMMPS_TESTING_SOURCE_DIR=path # path to lammps-testing repository (option if in custom location)
|
||||
-D LAMMPS_TESTING_GIT_TAG=value # version of lammps-testing repository that should be used, value = master (default) or custom git commit or tag
|
||||
env TEST_ARGS=-s ctest -V -R BondStyle
|
||||
|
||||
If you enable testing in the CMake build it will create an additional
|
||||
target called "test". You can run them with:
|
||||
To add a test for a style that is not yet covered, it is usually best
|
||||
to copy a YAML file for a similar style to a new file, edit the details
|
||||
of the style (how to call it, how to set its coefficients) and then
|
||||
run test command with either the *-g* and the replace the initial
|
||||
test file with the regenerated one or the *-u* option. The *-u* option
|
||||
will destroy the original file, if the generation run does not complete,
|
||||
so using *-g* is recommended unless the YAML file is fully tested
|
||||
and working.
|
||||
|
||||
.. admonition:: Recommendations and notes for YAML files
|
||||
:class: note
|
||||
|
||||
- The reference results should be recorded without any code
|
||||
optimization or related compiler flags enabled.
|
||||
- The ``epsilon`` parameter defines the relative precision with which
|
||||
the reference results must be met. The test geometries often have
|
||||
high and low energy parts and thus a significant impact from
|
||||
floating-point math truncation errors is to be expected. Some
|
||||
functional forms and potentials are more noisy than others, so this
|
||||
parameter needs to be adjusted. Typically a value around 1.0e-13
|
||||
can be used, but it may need to be as large as 1.0e-8 in some
|
||||
cases.
|
||||
- The tests for pair styles from OPT, USER-OMP and USER-INTEL are
|
||||
performed with automatically rescaled epsilon to account for
|
||||
additional loss of precision from code optimizations and different
|
||||
summation orders.
|
||||
- When compiling with (aggressive) compiler optimization, some tests
|
||||
are likely to fail. It is recommended to inspect the individual
|
||||
tests in detail to decide, whether the specific error for a specific
|
||||
property is acceptable (it often is), or this may be an indication
|
||||
of mis-compiled code (or an undesired large loss of precision due
|
||||
to significant reordering of operations and thus less error cancellation).
|
||||
|
||||
Tests for other components and utility functions
|
||||
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
||||
|
||||
Additional tests that validate utility functions or specific components
|
||||
of LAMMPS are implemented as standalone executable which may, or may not
|
||||
require creating a suitable LAMMPS instance. These tests are more specific
|
||||
and do not require YAML format input files. To add a test, either an
|
||||
existing source file needs to be extended or a new file added, which in turn
|
||||
requires additions to the ``CMakeLists.txt`` file in the source folder.
|
||||
|
||||
Collect and visualize code coverage metrics
|
||||
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
||||
|
||||
You can also collect code coverage metrics while running LAMMPS or the
|
||||
tests by enabling code coverage support during the CMake configuration:
|
||||
|
||||
.. code-block:: bash
|
||||
|
||||
cmake --build . test
|
||||
-D ENABLE_COVERAGE=on # enable coverage measurements (off by default)
|
||||
|
||||
The test cases used come from the lammps-testing repository. They are
|
||||
derivatives of the examples folder with some modifications to make the
|
||||
run faster.
|
||||
This will instrument all object files to write information about which
|
||||
lines of code were accessed during execution in files next to the
|
||||
corresponding object files. These can be post-processed to visually
|
||||
show the degree of coverage and which code paths are accessed and which
|
||||
are not taken. When working on unit tests (see above), this can be
|
||||
extremely helpful to determine which parts of the code are not executed
|
||||
and thus what kind of tests are still missing. The coverage data is
|
||||
cumulative, i.e. new data is added with each new run.
|
||||
|
||||
You can also collect code coverage metrics while running the tests by
|
||||
enabling coverage support during building.
|
||||
Enabling code coverage will also add the following build targets to
|
||||
generate coverage reports after running the LAMMPS executable or the
|
||||
unit tests:
|
||||
|
||||
.. code-block:: bash
|
||||
|
||||
-D ENABLE_COVERAGE=value # enable coverage measurements, value = no (default) or yes
|
||||
make gen_coverage_html # generate coverage report in HTML format
|
||||
make gen_coverage_xml # generate coverage report in XML format
|
||||
make clean_coverage_html # delete folder with HTML format coverage report
|
||||
make reset_coverage # delete all collected coverage data and HTML output
|
||||
|
||||
This will also add the following targets to generate coverage reports
|
||||
after running the LAMMPS executable:
|
||||
|
||||
.. code-block:: bash
|
||||
|
||||
make test # run tests first!
|
||||
make gen_coverage_html # generate coverage report in HTML format
|
||||
make gen_coverage_xml # generate coverage report in XML format
|
||||
|
||||
These reports require GCOVR to be installed. The easiest way to do this
|
||||
to install it via pip:
|
||||
These reports require `GCOVR <https://gcovr.com/>`_ to be installed. The easiest way
|
||||
to do this to install it via pip:
|
||||
|
||||
.. code-block:: bash
|
||||
|
||||
pip install git+https://github.com/gcovr/gcovr.git
|
||||
|
||||
After post-processing with ``gen_coverage_html`` the results are in
|
||||
a folder ``coverage_html`` and can be viewed with a web browser.
|
||||
The images below illustrate how the data is presented.
|
||||
|
||||
.. list-table::
|
||||
|
||||
* - .. figure:: JPG/coverage-overview-top.png
|
||||
:target: JPG/coverage-overview-top.png
|
||||
|
||||
Top of the overview page
|
||||
|
||||
- .. figure:: JPG/coverage-overview-manybody.png
|
||||
:target: JPG/coverage-overview-manybody.png
|
||||
|
||||
Styles with good coverage
|
||||
|
||||
- .. figure:: JPG/coverage-file-top.png
|
||||
:target: JPG/coverage-file-top.png
|
||||
|
||||
Top of individual source page
|
||||
|
||||
- .. figure:: JPG/coverage-file-branches.png
|
||||
:target: JPG/coverage-file-branches.png
|
||||
|
||||
Source page with branches
|
||||
|
||||
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.
|
||||
The following options are available.
|
||||
|
||||
.. code-block:: bash
|
||||
|
||||
make check-whitespace # generate coverage report in HTML format
|
||||
make fix-whitespace # generate coverage report in XML format
|
||||
make check-permissions # delete folder with HTML format coverage report
|
||||
make fix-permissions # delete all collected coverage data and HTML output
|
||||
|
||||
For the code in the ``unittest`` tree we are using the `clang-format`
|
||||
tool (Clang version 8.0 or later is required). If available, the source
|
||||
code files in the ``unittest`` tree can be updated to conform to the
|
||||
formatting settings using ``make format-tests``.
|
||||
|
||||
File diff suppressed because it is too large
Load Diff
@ -1,12 +1,12 @@
|
||||
Link LAMMPS as a library to another code
|
||||
========================================
|
||||
|
||||
LAMMPS is designed as a library of C++ objects and can thus be
|
||||
LAMMPS is designed as a library of C++ objects that can be
|
||||
integrated into other applications including Python scripts.
|
||||
The files ``src/library.cpp`` and ``src/library.h`` define a
|
||||
C-style API for using LAMMPS as a library. See the :doc:`Howto
|
||||
library <Howto_library>` doc page for a description of the interface
|
||||
and how to extend it for your needs.
|
||||
library <Howto_library>` page for a description of the interface
|
||||
and how to use it for your needs.
|
||||
|
||||
The :doc:`Build basics <Build_basics>` doc page explains how to build
|
||||
LAMMPS as either a shared or static library. This results in a file
|
||||
@ -31,18 +31,18 @@ the suffix ``.so.0`` (or some other number).
|
||||
communicator with a subset of MPI ranks to the function creating the
|
||||
LAMMPS instance.
|
||||
|
||||
----------
|
||||
|
||||
**Link with LAMMPS as a static library**\ :
|
||||
Link with LAMMPS as a static library
|
||||
------------------------------------
|
||||
|
||||
The calling application can link to LAMMPS as a static library with
|
||||
compilation and link commands as in the examples shown below. These
|
||||
are examples for a code written in C in the file *caller.c*.
|
||||
are examples for a code written in C in the file ``caller.c``.
|
||||
The benefit of linking to a static library is, that the resulting
|
||||
executable is independent of that library since all required
|
||||
executable code from the library is copied into the calling executable.
|
||||
|
||||
*CMake build*\ :
|
||||
CMake build
|
||||
^^^^^^^^^^^
|
||||
|
||||
This assumes that LAMMPS has been configured without setting a
|
||||
``LAMMPS_MACHINE`` name, installed with "make install", and the
|
||||
@ -55,7 +55,8 @@ The commands to compile and link a coupled executable are then:
|
||||
mpicc -c -O $(pkgconf liblammps --cflags) caller.c
|
||||
mpicxx -o caller caller.o -$(pkgconf liblammps --libs)
|
||||
|
||||
*Traditional make*\ :
|
||||
Traditional make
|
||||
^^^^^^^^^^^^^^^^
|
||||
|
||||
This assumes that LAMMPS has been compiled in the folder
|
||||
``${HOME}/lammps/src`` with "make mpi". The commands to compile and link
|
||||
@ -83,20 +84,20 @@ LAMMPS library without any optional packages that depend on libraries
|
||||
need to include all flags, libraries, and paths for the coupled
|
||||
executable, that are also required to link the LAMMPS executable.
|
||||
|
||||
*CMake build*\ :
|
||||
CMake build
|
||||
^^^^^^^^^^^
|
||||
|
||||
When using CMake, additional libraries with sources in the lib folder
|
||||
are built, but not included in ``liblammps.a`` and (currently) not
|
||||
installed with "make install" and not included in the *pkgconfig*
|
||||
installed with ``make install`` and not included in the ``pkgconfig``
|
||||
configuration file. They can be found in the top level build folder,
|
||||
but you have to determine the necessary link flags manually. It is
|
||||
therefore recommended to either use the traditional make procedure to
|
||||
build and link with a static library or build and link with a shared
|
||||
library instead.
|
||||
|
||||
.. TODO: this needs to be updated to reflect that latest CMake changes after they are complete.
|
||||
|
||||
*Traditional make*\ :
|
||||
Traditional make
|
||||
^^^^^^^^^^^^^^^^
|
||||
|
||||
After you have compiled a static LAMMPS library using the conventional
|
||||
build system for example with "make mode=static serial". And you also
|
||||
@ -110,10 +111,10 @@ change to:
|
||||
g++ -o caller caller.o -L${HOME}/lammps/lib/poems \
|
||||
-L${HOME}/lammps/src/STUBS -L${HOME}/lammps/src -llammps_serial -lpoems -lmpi_stubs
|
||||
|
||||
Note, that you need to link with "g++" instead of "gcc", since the
|
||||
LAMMPS library is C++ code. You can display the currently applied
|
||||
settings for building LAMMPS for the "serial" machine target by using
|
||||
the command:
|
||||
Note, that you need to link with ``g++`` instead of ``gcc`` even if you have
|
||||
written your code in C, since LAMMPS itself is C++ code. You can display the
|
||||
currently applied settings for building LAMMPS for the "serial" machine target
|
||||
by using the command:
|
||||
|
||||
.. code-block:: bash
|
||||
|
||||
@ -123,25 +124,24 @@ Which should output something like:
|
||||
|
||||
.. code-block:: bash
|
||||
|
||||
# Compiler:
|
||||
# Compiler:
|
||||
CXX=g++
|
||||
# Linker:
|
||||
# Linker:
|
||||
LD=g++
|
||||
# Compilation:
|
||||
# Compilation:
|
||||
CXXFLAGS=-g -O3 -DLAMMPS_GZIP -DLAMMPS_MEMALIGN=64 -I${HOME}/compile/lammps/lib/poems -I${HOME}/compile/lammps/src/STUBS
|
||||
# Linking:
|
||||
# Linking:
|
||||
LDFLAGS=-g -O
|
||||
# Libraries:
|
||||
# Libraries:
|
||||
LDLIBS=-L${HOME}/compile/lammps/src -llammps_serial -L${HOME}/compile/lammps/lib/poems -L${HOME}/compile/lammps/src/STUBS -lpoems -lmpi_stubs
|
||||
|
||||
From this you can gather the necessary paths and flags. With
|
||||
makefiles for other *machine* configurations you need to do the
|
||||
equivalent and replace "serial" with the corresponding *machine* name
|
||||
equivalent and replace "serial" with the corresponding "machine" name
|
||||
of the makefile.
|
||||
|
||||
----------
|
||||
|
||||
**Link with LAMMPS as a shared library**\ :
|
||||
Link with LAMMPS as a shared library
|
||||
------------------------------------
|
||||
|
||||
When linking to LAMMPS built as a shared library, the situation becomes
|
||||
much simpler, as all dependent libraries and objects are either included
|
||||
@ -151,7 +151,8 @@ linking the calling executable. Only the *-I* flags are needed. So the
|
||||
example case from above of the serial version static LAMMPS library with
|
||||
the POEMS package installed becomes:
|
||||
|
||||
*CMake build*\ :
|
||||
CMake build
|
||||
^^^^^^^^^^^
|
||||
|
||||
The commands with a shared LAMMPS library compiled with the CMake
|
||||
build process are the same as for the static library.
|
||||
@ -161,10 +162,11 @@ build process are the same as for the static library.
|
||||
mpicc -c -O $(pkgconf liblammps --cflags) caller.c
|
||||
mpicxx -o caller caller.o -$(pkgconf --libs)
|
||||
|
||||
*Traditional make*\ :
|
||||
Traditional make
|
||||
^^^^^^^^^^^^^^^^
|
||||
|
||||
The commands with a shared LAMMPS library compiled with the
|
||||
traditional make build using "make mode=shared serial" becomes:
|
||||
traditional make build using ``make mode=shared serial`` becomes:
|
||||
|
||||
.. code-block:: bash
|
||||
|
||||
@ -231,29 +233,3 @@ If a required library is missing, you would get a 'not found' entry:
|
||||
libc.so.6 => /usr/lib64/libc.so.6 (0x00007fb7c7b5d000)
|
||||
/lib64/ld-linux-x86-64.so.2 (0x00007fb7c80a2000)
|
||||
|
||||
----------
|
||||
|
||||
**Calling the LAMMPS library**\ :
|
||||
|
||||
Either flavor of library (static or shared) allows one or more LAMMPS
|
||||
objects to be instantiated from the calling program. When used from a
|
||||
C++ program, most of the symbols and functions in LAMMPS are wrapped
|
||||
in a ``LAMMPS_NS`` namespace; you can safely use any of its classes and
|
||||
methods from within the calling code, as needed, and you will not incur
|
||||
conflicts with functions and variables in your code that share the name.
|
||||
This, however, does not extend to all additional libraries bundled with
|
||||
LAMMPS in the lib folder and some of the low-level code of some packages.
|
||||
|
||||
To be compatible with C, Fortran, Python programs, the library has a simple
|
||||
C-style interface, provided in ``src/library.cpp`` and ``src/library.h``.
|
||||
|
||||
See the :doc:`Python library <Python_library>` doc page for a
|
||||
description of the Python interface to LAMMPS, which wraps the C-style
|
||||
interface from a shared library through the `ctypes python module <ctypes_>`_.
|
||||
|
||||
See the sample codes in ``examples/COUPLE/simple`` for examples of C++ and
|
||||
C and Fortran codes that invoke LAMMPS through its library interface.
|
||||
Other examples in the COUPLE directory use coupling ideas discussed on
|
||||
the :doc:`Howto couple <Howto_couple>` doc page.
|
||||
|
||||
.. _ctypes: https://docs.python.org/3/library/ctypes.html
|
||||
|
||||
@ -45,7 +45,8 @@ packages:
|
||||
The mechanism for including packages is simple but different for CMake
|
||||
versus make.
|
||||
|
||||
**CMake build**\ :
|
||||
CMake build
|
||||
^^^^^^^^^^^
|
||||
|
||||
.. code-block:: csh
|
||||
|
||||
@ -72,7 +73,8 @@ once with CMake.
|
||||
invoke cmake. CMake will give an error if that is not the case,
|
||||
indicating how you can un-install all packages in the src dir.
|
||||
|
||||
**Traditional make**\ :
|
||||
Traditional make
|
||||
^^^^^^^^^^^^^^^^
|
||||
|
||||
.. code-block:: bash
|
||||
|
||||
@ -108,7 +110,8 @@ once with make.
|
||||
within the same command. You can include or exclude multiple packages
|
||||
in a single make command, e.g. make yes-colloid no-manybody.
|
||||
|
||||
**CMake and make info**\ :
|
||||
CMake and make info
|
||||
^^^^^^^^^^^^^^^^^^^
|
||||
|
||||
Any package can be included or excluded in a LAMMPS build, independent
|
||||
of all other packages. However, some packages include files derived
|
||||
@ -132,7 +135,7 @@ src directory.
|
||||
|
||||
.. _cmake_presets:
|
||||
|
||||
**CMake shortcuts for installing many packages**\ :
|
||||
CMake presets for installing many packages
|
||||
|
||||
Instead of specifying all the CMake options via the command-line,
|
||||
CMake allows initializing its settings cache using script files.
|
||||
@ -148,13 +151,14 @@ one of them as a starting point and customize it to your needs.
|
||||
|
||||
.. code-block:: bash
|
||||
|
||||
cmake -C ../cmake/presets/minimal.cmake [OPTIONS] ../cmake # enable just a few core packages
|
||||
cmake -C ../cmake/presets/most.cmake [OPTIONS] ../cmake # enable most packages
|
||||
cmake -C ../cmake/presets/nolib.cmake [OPTIONS] ../cmake # disable packages that do require extra libraries or tools
|
||||
cmake -C ../cmake/presets/clang.cmake [OPTIONS] ../cmake # change settings to use the Clang compilers by default
|
||||
cmake -C ../cmake/presets/intel.cmake [OPTIONS] ../cmake # change settings to use the Intel compilers by default
|
||||
cmake -C ../cmake/presets/all_on.cmake [OPTIONS] ../cmake # enable all packages
|
||||
cmake -C ../cmake/presets/all_off.cmake [OPTIONS] ../cmake # disable all packages
|
||||
cmake -C ../cmake/presets/minimal.cmake [OPTIONS] ../cmake # enable just a few core packages
|
||||
cmake -C ../cmake/presets/most.cmake [OPTIONS] ../cmake # enable most packages
|
||||
cmake -C ../cmake/presets/download.cmake [OPTIONS] ../cmake # enable packages which download sources or potential files
|
||||
cmake -C ../cmake/presets/nolib.cmake [OPTIONS] ../cmake # disable packages that do require extra libraries or tools
|
||||
cmake -C ../cmake/presets/clang.cmake [OPTIONS] ../cmake # change settings to use the Clang compilers by default
|
||||
cmake -C ../cmake/presets/intel.cmake [OPTIONS] ../cmake # change settings to use the Intel compilers by default
|
||||
cmake -C ../cmake/presets/all_on.cmake [OPTIONS] ../cmake # enable all packages
|
||||
cmake -C ../cmake/presets/all_off.cmake [OPTIONS] ../cmake # disable all packages
|
||||
mingw64-cmake -C ../cmake/presets/mingw-cross.cmake [OPTIONS] ../cmake # compile with MinGW cross compilers
|
||||
|
||||
.. note::
|
||||
@ -184,7 +188,8 @@ one of them as a starting point and customize it to your needs.
|
||||
|
||||
----------
|
||||
|
||||
**Make shortcuts for installing many packages**\ :
|
||||
Make shortcuts for installing many packages
|
||||
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
||||
|
||||
The following commands are useful for managing package source files
|
||||
and their installation when building LAMMPS via traditional make.
|
||||
|
||||
@ -44,7 +44,8 @@ require use of an FFT library to compute 1d FFTs. The KISS FFT
|
||||
library is included with LAMMPS but other libraries can be faster.
|
||||
LAMMPS can use them if they are available on your system.
|
||||
|
||||
**CMake variables**\ :
|
||||
CMake build
|
||||
^^^^^^^^^^^
|
||||
|
||||
.. code-block:: bash
|
||||
|
||||
@ -74,7 +75,12 @@ to assist:
|
||||
-D FFT_MKL_THREADS=on # enable using threaded FFTs with MKL libraries
|
||||
-D MKL_LIBRARIES=path
|
||||
|
||||
**Makefile.machine settings**\ :
|
||||
Traditional make
|
||||
^^^^^^^^^^^^^^^^
|
||||
|
||||
To change the FFT library to be used and its options, you have to edit
|
||||
your machine Makefile. Below are examples how the makefile variables
|
||||
could be changed.
|
||||
|
||||
.. code-block:: make
|
||||
|
||||
@ -104,7 +110,8 @@ As with CMake, you do not need to set paths in ``FFT_INC`` or ``FFT_PATH``, if
|
||||
the compiler can find the FFT header and library files in its default search path.
|
||||
You must specify ``FFT_LIB`` with the appropriate FFT libraries to include in the link.
|
||||
|
||||
**CMake and make info**\ :
|
||||
CMake build
|
||||
^^^^^^^^^^^
|
||||
|
||||
The `KISS FFT library <http://kissfft.sf.net>`_ is included in the LAMMPS
|
||||
distribution. It is portable across all platforms. Depending on the size
|
||||
@ -127,7 +134,7 @@ download it from `www.fftw.org <http://www.fftw.org>`_. LAMMPS requires
|
||||
version 3.X; the legacy version 2.1.X is no longer supported.
|
||||
|
||||
Building FFTW for your box should be as simple as ``./configure; make;
|
||||
make install``\ . The install command typically requires root privileges
|
||||
make install``. The install command typically requires root privileges
|
||||
(e.g. invoke it via sudo), unless you specify a local directory with
|
||||
the "--prefix" option of configure. Type ``./configure --help`` to see
|
||||
various options.
|
||||
@ -169,20 +176,25 @@ ARRAY mode.
|
||||
|
||||
.. _size:
|
||||
|
||||
Size of LAMMPS data types
|
||||
Size of LAMMPS integer types
|
||||
------------------------------------
|
||||
|
||||
LAMMPS has a few integer data types which can be defined as 4-byte or
|
||||
8-byte integers. The default setting of "smallbig" is almost always
|
||||
adequate.
|
||||
LAMMPS has a few integer data types which can be defined as either
|
||||
4-byte (= 32-bit) or 8-byte (= 64-bit) integers at compile time.
|
||||
The default setting of "smallbig" is almost always adequate.
|
||||
|
||||
**CMake variable**\ :
|
||||
CMake build
|
||||
^^^^^^^^^^^
|
||||
|
||||
.. code-block:: bash
|
||||
|
||||
-D LAMMPS_SIZES=value # smallbig (default) or bigbig or smallsmall
|
||||
|
||||
**Makefile.machine setting**\ :
|
||||
Traditional build
|
||||
^^^^^^^^^^^^^^^^^
|
||||
|
||||
If you want a setting different from the default, you need to edit your
|
||||
machine Makefile.
|
||||
|
||||
.. code-block:: make
|
||||
|
||||
@ -190,7 +202,8 @@ adequate.
|
||||
|
||||
The default setting is ``-DLAMMPS_SMALLBIG`` if nothing is specified
|
||||
|
||||
**CMake and make info**\ :
|
||||
CMake and make info
|
||||
^^^^^^^^^^^^^^^^^^^
|
||||
|
||||
The default "smallbig" setting allows for simulations with:
|
||||
|
||||
@ -251,7 +264,8 @@ PNG image files. Likewise the :doc:`dump movie <dump_image>` command
|
||||
outputs movie files in MPEG format. Using these options requires the
|
||||
following settings:
|
||||
|
||||
**CMake variables**\ :
|
||||
CMake build
|
||||
^^^^^^^^^^^
|
||||
|
||||
.. code-block:: bash
|
||||
|
||||
@ -276,7 +290,8 @@ variables:
|
||||
-D ZLIB_LIBRARIES=path # path to libz.a (.so) file
|
||||
-D FFMPEG_EXECUTABLE=path # path to ffmpeg executable
|
||||
|
||||
**Makefile.machine settings**\ :
|
||||
Traditional make
|
||||
^^^^^^^^^^^^^^^^
|
||||
|
||||
.. code-block:: make
|
||||
|
||||
@ -295,7 +310,8 @@ with a list of graphics libraries to include in the link. You must
|
||||
insure ffmpeg is in a directory where LAMMPS can find it at runtime,
|
||||
that is a directory in your PATH environment variable.
|
||||
|
||||
**CMake and make info**\ :
|
||||
CMake and make info
|
||||
^^^^^^^^^^^^^^^^^^^
|
||||
|
||||
Using ``ffmpeg`` to output movie files requires that your machine
|
||||
supports the "popen" function in the standard runtime library.
|
||||
@ -318,7 +334,8 @@ If this option is enabled, large files can be read or written with
|
||||
gzip compression by several LAMMPS commands, including
|
||||
:doc:`read_data <read_data>`, :doc:`rerun <rerun>`, and :doc:`dump <dump>`.
|
||||
|
||||
**CMake variables**\ :
|
||||
CMake build
|
||||
^^^^^^^^^^^
|
||||
|
||||
.. code-block:: bash
|
||||
|
||||
@ -326,13 +343,15 @@ gzip compression by several LAMMPS commands, including
|
||||
# default is yes if CMake can find gzip, else no
|
||||
-D GZIP_EXECUTABLE=path # path to gzip executable if CMake cannot find it
|
||||
|
||||
**Makefile.machine setting**\ :
|
||||
Traditional make
|
||||
^^^^^^^^^^^^^^^^
|
||||
|
||||
.. code-block:: make
|
||||
|
||||
LMP_INC = -DLAMMPS_GZIP
|
||||
|
||||
**CMake and make info**\ :
|
||||
CMake and make info
|
||||
^^^^^^^^^^^^^^^^^^^
|
||||
|
||||
This option requires that your machine supports the "popen()" function
|
||||
in the standard runtime library and that a gzip executable can be
|
||||
@ -363,7 +382,8 @@ pointers that are aligned to 16-byte boundaries. Using SSE vector
|
||||
instructions efficiently, however, requires memory blocks being
|
||||
aligned on 64-byte boundaries.
|
||||
|
||||
**CMake variable**\ :
|
||||
CMake build
|
||||
^^^^^^^^^^^
|
||||
|
||||
.. code-block:: bash
|
||||
|
||||
@ -374,7 +394,8 @@ and revert to using the malloc() C-library function instead. When
|
||||
compiling LAMMPS for Windows systems, malloc() will always be used
|
||||
and this setting ignored.
|
||||
|
||||
**Makefile.machine setting**\ :
|
||||
Traditional make
|
||||
^^^^^^^^^^^^^^^^
|
||||
|
||||
.. code-block:: make
|
||||
|
||||
@ -398,13 +419,15 @@ types, the following setting will be needed. It converts "long long"
|
||||
to a "long" data type, which should be the desired 8-byte integer on
|
||||
those systems:
|
||||
|
||||
**CMake variable**\ :
|
||||
CMake build
|
||||
^^^^^^^^^^^
|
||||
|
||||
.. code-block:: bash
|
||||
|
||||
-D LAMMPS_LONGLONG_TO_LONG=value # yes or no (default)
|
||||
|
||||
**Makefile.machine setting**\ :
|
||||
Traditional make
|
||||
^^^^^^^^^^^^^^^^
|
||||
|
||||
.. code-block:: make
|
||||
|
||||
@ -420,17 +443,26 @@ Exception handling when using LAMMPS as a library
|
||||
This setting is useful when external codes drive LAMMPS as a library.
|
||||
With this option enabled, LAMMPS errors do not kill the calling code.
|
||||
Instead, the call stack is unwound and control returns to the caller,
|
||||
e.g. to Python. Of course the calling code has to be set up to
|
||||
*catch* exceptions from within LAMMPS.
|
||||
e.g. to Python. Of course, the calling code has to be set up to
|
||||
*catch* exceptions thrown from within LAMMPS.
|
||||
|
||||
**CMake variable**\ :
|
||||
CMake build
|
||||
^^^^^^^^^^^
|
||||
|
||||
.. code-block:: bash
|
||||
|
||||
-D LAMMPS_EXCEPTIONS=value # yes or no (default)
|
||||
|
||||
**Makefile.machine setting**\ :
|
||||
Traditional make
|
||||
^^^^^^^^^^^^^^^^
|
||||
|
||||
.. code-block:: make
|
||||
|
||||
LMP_INC = -DLAMMPS_EXCEPTIONS
|
||||
|
||||
.. note::
|
||||
|
||||
When LAMMPS is running in parallel, it is not always possible to
|
||||
cleanly recover from an exception since not all parallel ranks may
|
||||
throw an exception and thus other MPI ranks may get stuck waiting for
|
||||
messages from the ones with errors.
|
||||
|
||||
@ -94,6 +94,7 @@ An alphabetic list of all general LAMMPS commands.
|
||||
* :doc:`package <package>`
|
||||
* :doc:`pair_coeff <pair_coeff>`
|
||||
* :doc:`pair_modify <pair_modify>`
|
||||
* :doc:`pair_style <pair_style>`
|
||||
* :doc:`pair_write <pair_write>`
|
||||
* :doc:`partition <partition>`
|
||||
* :doc:`prd <prd>`
|
||||
|
||||
@ -42,7 +42,7 @@ KOKKOS, o = USER-OMP, t = OPT.
|
||||
* :doc:`com <compute_com>`
|
||||
* :doc:`com/chunk <compute_com_chunk>`
|
||||
* :doc:`contact/atom <compute_contact_atom>`
|
||||
* :doc:`coord/atom <compute_coord_atom>`
|
||||
* :doc:`coord/atom (k) <compute_coord_atom>`
|
||||
* :doc:`damage/atom <compute_damage_atom>`
|
||||
* :doc:`dihedral <compute_dihedral>`
|
||||
* :doc:`dihedral/local <compute_dihedral_local>`
|
||||
@ -79,15 +79,13 @@ KOKKOS, o = USER-OMP, t = OPT.
|
||||
* :doc:`ke/atom/eff <compute_ke_atom_eff>`
|
||||
* :doc:`ke/eff <compute_ke_eff>`
|
||||
* :doc:`ke/rigid <compute_ke_rigid>`
|
||||
* :doc:`meso/e/atom <compute_meso_e_atom>`
|
||||
* :doc:`meso/rho/atom <compute_meso_rho_atom>`
|
||||
* :doc:`meso/t/atom <compute_meso_t_atom>`
|
||||
* :doc:`mesont <compute_mesont>`
|
||||
* :doc:`momentum <compute_momentum>`
|
||||
* :doc:`msd <compute_msd>`
|
||||
* :doc:`msd/chunk <compute_msd_chunk>`
|
||||
* :doc:`msd/nongauss <compute_msd_nongauss>`
|
||||
* :doc:`omega/chunk <compute_omega_chunk>`
|
||||
* :doc:`orientorder/atom <compute_orientorder_atom>`
|
||||
* :doc:`orientorder/atom (k) <compute_orientorder_atom>`
|
||||
* :doc:`pair <compute_pair>`
|
||||
* :doc:`pair/local <compute_pair_local>`
|
||||
* :doc:`pe <compute_pe>`
|
||||
@ -133,6 +131,9 @@ KOKKOS, o = USER-OMP, t = OPT.
|
||||
* :doc:`sna/atom <compute_sna_atom>`
|
||||
* :doc:`snad/atom <compute_sna_atom>`
|
||||
* :doc:`snav/atom <compute_sna_atom>`
|
||||
* :doc:`sph/e/atom <compute_sph_e_atom>`
|
||||
* :doc:`sph/rho/atom <compute_sph_rho_atom>`
|
||||
* :doc:`sph/t/atom <compute_sph_t_atom>`
|
||||
* :doc:`spin <compute_spin>`
|
||||
* :doc:`stress/atom <compute_stress_atom>`
|
||||
* :doc:`stress/mop <compute_stress_mop>`
|
||||
@ -161,5 +162,6 @@ KOKKOS, o = USER-OMP, t = OPT.
|
||||
* :doc:`torque/chunk <compute_torque_chunk>`
|
||||
* :doc:`vacf <compute_vacf>`
|
||||
* :doc:`vcm/chunk <compute_vcm_chunk>`
|
||||
* :doc:`viscosity/cos <compute_viscosity_cos>`
|
||||
* :doc:`voronoi/atom <compute_voronoi_atom>`
|
||||
* :doc:`xrd <compute_xrd>`
|
||||
|
||||
@ -22,6 +22,7 @@ OPT.
|
||||
.. table_from_list::
|
||||
:columns: 5
|
||||
|
||||
* :doc:`accelerate/cos <fix_accelerate_cos>`
|
||||
* :doc:`adapt <fix_adapt>`
|
||||
* :doc:`adapt/fep <fix_adapt_fep>`
|
||||
* :doc:`addforce <fix_addforce>`
|
||||
@ -94,9 +95,7 @@ OPT.
|
||||
* :doc:`lb/viscous <fix_lb_viscous>`
|
||||
* :doc:`lineforce <fix_lineforce>`
|
||||
* :doc:`manifoldforce <fix_manifoldforce>`
|
||||
* :doc:`meso <fix_meso>`
|
||||
* :doc:`meso/move <fix_meso_move>`
|
||||
* :doc:`meso/stationary <fix_meso_stationary>`
|
||||
* :doc:`momentum (k) <fix_momentum>`
|
||||
* :doc:`move <fix_move>`
|
||||
* :doc:`mscg <fix_mscg>`
|
||||
@ -148,6 +147,7 @@ OPT.
|
||||
* :doc:`oneway <fix_oneway>`
|
||||
* :doc:`orient/bcc <fix_orient>`
|
||||
* :doc:`orient/fcc <fix_orient>`
|
||||
* :doc:`orient/eco <fix_orient_eco>`
|
||||
* :doc:`phonon <fix_phonon>`
|
||||
* :doc:`pimd <fix_pimd>`
|
||||
* :doc:`planeforce <fix_planeforce>`
|
||||
@ -201,6 +201,8 @@ OPT.
|
||||
* :doc:`smd/move_tri_surf <fix_smd_move_triangulated_surface>`
|
||||
* :doc:`smd/setvel <fix_smd_setvel>`
|
||||
* :doc:`smd/wall_surface <fix_smd_wall_surface>`
|
||||
* :doc:`sph <fix_sph>`
|
||||
* :doc:`sph/stationary <fix_sph_stationary>`
|
||||
* :doc:`spring <fix_spring>`
|
||||
* :doc:`spring/chunk <fix_spring_chunk>`
|
||||
* :doc:`spring/rg <fix_spring_rg>`
|
||||
|
||||
@ -31,9 +31,9 @@ does something different than this sequence:
|
||||
run 100
|
||||
|
||||
In the first case, the specified timestep (0.5 fs) is used for two
|
||||
simulations of 100 timesteps each. In the 2nd case, the default
|
||||
timestep (1.0 fs) is used for the 1st 100 step simulation and a 0.5 fs
|
||||
timestep is used for the 2nd one.
|
||||
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
|
||||
|
||||
@ -78,7 +78,7 @@ OPT.
|
||||
* :doc:`coul/long/soft (o) <pair_fep_soft>`
|
||||
* :doc:`coul/msm (o) <pair_coul>`
|
||||
* :doc:`coul/slater/cut <pair_coul_slater>`
|
||||
* :doc:`coul/slater/long <pair_coul_slater>`
|
||||
* :doc:`coul/slater/long <pair_coul_slater>`
|
||||
* :doc:`coul/shield <pair_coul_shield>`
|
||||
* :doc:`coul/streitz <pair_coul>`
|
||||
* :doc:`coul/wolf (ko) <pair_coul>`
|
||||
@ -92,8 +92,8 @@ OPT.
|
||||
* :doc:`drip <pair_drip>`
|
||||
* :doc:`eam (gikot) <pair_eam>`
|
||||
* :doc:`eam/alloy (gikot) <pair_eam>`
|
||||
* :doc:`eam/cd (o) <pair_eam>`
|
||||
* :doc:`eam/cd/old (o) <pair_eam>`
|
||||
* :doc:`eam/cd <pair_eam>`
|
||||
* :doc:`eam/cd/old <pair_eam>`
|
||||
* :doc:`eam/fs (gikot) <pair_eam>`
|
||||
* :doc:`edip (o) <pair_edip>`
|
||||
* :doc:`edip/multi <pair_edip>`
|
||||
@ -180,8 +180,10 @@ OPT.
|
||||
* :doc:`meam/spline (o) <pair_meam_spline>`
|
||||
* :doc:`meam/sw/spline <pair_meam_sw_spline>`
|
||||
* :doc:`mesocnt <pair_mesocnt>`
|
||||
* :doc:`mesont/tpm <pair_mesont_tpm>`
|
||||
* :doc:`mgpt <pair_mgpt>`
|
||||
* :doc:`mie/cut (g) <pair_mie>`
|
||||
* :doc:`mliap <pair_mliap>`
|
||||
* :doc:`mm3/switch3/coulgauss/long <pair_mm3_switch3_coulgauss_long>`
|
||||
* :doc:`momb <pair_momb>`
|
||||
* :doc:`morse (gkot) <pair_morse>`
|
||||
@ -227,7 +229,6 @@ OPT.
|
||||
* :doc:`smd/ulsph <pair_smd_ulsph>`
|
||||
* :doc:`smtbq <pair_smtbq>`
|
||||
* :doc:`snap (k) <pair_snap>`
|
||||
* :doc:`snap (k) <pair_snap>`
|
||||
* :doc:`soft (go) <pair_soft>`
|
||||
* :doc:`sph/heatconduction <pair_sph_heatconduction>`
|
||||
* :doc:`sph/idealgas <pair_sph_idealgas>`
|
||||
|
||||
@ -142,7 +142,7 @@ follows:
|
||||
minimize.
|
||||
|
||||
\item The Special class walks the bond topology of a molecular system
|
||||
to find 1st, 2nd, 3rd neighbors of each atom. It is invoked by
|
||||
to find first, second, third neighbors of each atom. It is invoked by
|
||||
several commands, like read\_data, read\_restart, and replicate.
|
||||
|
||||
\item The Atom class stores all per-atom arrays. More precisely, they
|
||||
|
||||
@ -23,7 +23,7 @@ We use it to show how to identify the origin of a segmentation fault.
|
||||
double *special_lj = force->special_lj;
|
||||
int newton_pair = force->newton_pair;
|
||||
+ double comx = 0.0;
|
||||
|
||||
|
||||
inum = list->inum;
|
||||
ilist = list->ilist;
|
||||
@@ -134,8 +135,10 @@ void PairLJCut::compute(int eflag, int vflag)
|
||||
@ -31,7 +31,7 @@ We use it to show how to identify the origin of a segmentation fault.
|
||||
}
|
||||
}
|
||||
- }
|
||||
|
||||
|
||||
+ comx += atom->rmass[i]*x[i][0]; /* BUG */
|
||||
+ }
|
||||
+ printf("comx = %g\n",comx);
|
||||
@ -42,7 +42,7 @@ After recompiling LAMMPS and running the input you should get something like thi
|
||||
|
||||
.. code-block:
|
||||
|
||||
$ ./lmp -in in.melt
|
||||
$ ./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
|
||||
@ -98,11 +98,11 @@ drop back to the GDB prompt.
|
||||
Unit style : lj
|
||||
Current step : 0
|
||||
Time step : 0.005
|
||||
|
||||
|
||||
Program received signal SIGSEGV, Segmentation fault.
|
||||
0x00000000006653ab in LAMMPS_NS::PairLJCut::compute (this=0x829740, eflag=1, vflag=<optimized out>) at /home/akohlmey/compile/lammps/src/pair_lj_cut.cpp:139
|
||||
139 comx += atom->rmass[i]*x[i][0]; /* BUG */
|
||||
(gdb)
|
||||
(gdb)
|
||||
|
||||
Now typing the command "where" will show the stack of functions starting from
|
||||
the current function back to "main()".
|
||||
@ -119,7 +119,7 @@ the current function back to "main()".
|
||||
#4 0x0000000000410ad3 in LAMMPS_NS::Input::execute_command (this=0x7d1410) at /home/akohlmey/compile/lammps/src/input.cpp:864
|
||||
#5 0x00000000004111fb in LAMMPS_NS::Input::file (this=0x7d1410) at /home/akohlmey/compile/lammps/src/input.cpp:229
|
||||
#6 0x000000000040933a in main (argc=<optimized out>, argv=<optimized out>) at /home/akohlmey/compile/lammps/src/main.cpp:65
|
||||
(gdb)
|
||||
(gdb)
|
||||
|
||||
You can also print the value of variables and see if there is anything
|
||||
unexpected. Segmentation faults, for example, commonly happen when a
|
||||
@ -189,12 +189,12 @@ the console are not mixed.
|
||||
|
||||
.. code-block::
|
||||
|
||||
$ valgrind ./lmp -in in.melt
|
||||
$ valgrind ./lmp -in in.melt
|
||||
==1933642== Memcheck, a memory error detector
|
||||
==1933642== Copyright (C) 2002-2017, and GNU GPL'd, by Julian Seward et al.
|
||||
==1933642== Using Valgrind-3.15.0 and LibVEX; rerun with -h for copyright info
|
||||
==1933642== Command: ./lmp -in in.melt
|
||||
==1933642==
|
||||
==1933642==
|
||||
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
|
||||
@ -228,7 +228,7 @@ the console are not mixed.
|
||||
==1933642== by 0x4111FA: LAMMPS_NS::Input::file() (input.cpp:229)
|
||||
==1933642== by 0x409339: main (main.cpp:65)
|
||||
==1933642== Address 0x0 is not stack'd, malloc'd or (recently) free'd
|
||||
==1933642==
|
||||
==1933642==
|
||||
|
||||
As you can see, the stack trace information is similar to that obtained
|
||||
from GDB. In addition you get a more specific hint about what cause the
|
||||
|
||||
@ -381,7 +381,7 @@ Doc page with :doc:`WARNING messages <Errors_warnings>`
|
||||
are defined.
|
||||
|
||||
*Bond atom missing in box size check*
|
||||
The 2nd atoms needed to compute a particular bond is missing on this
|
||||
The second atom needed to compute a particular bond is missing on this
|
||||
processor. Typically this is because the pairwise cutoff is set too
|
||||
short or the bond has blown apart and an atom is too far away.
|
||||
|
||||
@ -391,7 +391,7 @@ Doc page with :doc:`WARNING messages <Errors_warnings>`
|
||||
the atoms are too far apart to make a valid bond.
|
||||
|
||||
*Bond atom missing in image check*
|
||||
The 2nd atom in a particular bond is missing on this processor.
|
||||
The second atom in a particular bond is missing on this processor.
|
||||
Typically this is because the pairwise cutoff is set too short or the
|
||||
bond has blown apart and an atom is too far away.
|
||||
|
||||
@ -401,12 +401,12 @@ Doc page with :doc:`WARNING messages <Errors_warnings>`
|
||||
are too far apart to make a valid bond.
|
||||
|
||||
*Bond atoms %d %d missing on proc %d at step %ld*
|
||||
The 2nd atom needed to compute a particular bond is missing on this
|
||||
The second atom needed to compute a particular bond is missing on this
|
||||
processor. Typically this is because the pairwise cutoff is set too
|
||||
short or the bond has blown apart and an atom is too far away.
|
||||
|
||||
*Bond atoms missing on proc %d at step %ld*
|
||||
The 2nd atom needed to compute a particular bond is missing on this
|
||||
The second atom needed to compute a particular bond is missing on this
|
||||
processor. Typically this is because the pairwise cutoff is set too
|
||||
short or the bond has blown apart and an atom is too far away.
|
||||
|
||||
@ -1374,7 +1374,7 @@ Doc page with :doc:`WARNING messages <Errors_warnings>`
|
||||
template does not qualify.
|
||||
|
||||
*Cannot use fix box/relax on a 2nd non-periodic dimension*
|
||||
When specifying an off-diagonal pressure component, the 2nd of the two
|
||||
When specifying an off-diagonal pressure component, the second of the two
|
||||
dimensions must be periodic. E.g. if the xy component is specified,
|
||||
then the y dimension must be periodic.
|
||||
|
||||
@ -1388,7 +1388,7 @@ Doc page with :doc:`WARNING messages <Errors_warnings>`
|
||||
also keyword tri or xy, this is wrong.
|
||||
|
||||
*Cannot use fix box/relax with tilt factor scaling on a 2nd non-periodic dimension*
|
||||
When specifying scaling on a tilt factor component, the 2nd of the two
|
||||
When specifying scaling on a tilt factor component, the second of the two
|
||||
dimensions must be periodic. E.g. if the xy component is specified,
|
||||
then the y dimension must be periodic.
|
||||
|
||||
@ -1429,7 +1429,7 @@ Doc page with :doc:`WARNING messages <Errors_warnings>`
|
||||
This would be changing the same box dimension twice.
|
||||
|
||||
*Cannot use fix nvt/npt/nph on a 2nd non-periodic dimension*
|
||||
When specifying an off-diagonal pressure component, the 2nd of the two
|
||||
When specifying an off-diagonal pressure component, the second of the two
|
||||
dimensions must be periodic. E.g. if the xy component is specified,
|
||||
then the y dimension must be periodic.
|
||||
|
||||
@ -1447,13 +1447,13 @@ Doc page with :doc:`WARNING messages <Errors_warnings>`
|
||||
Self-explanatory.
|
||||
|
||||
*Cannot use fix nvt/npt/nph with xy scaling when y is non-periodic dimension*
|
||||
The 2nd dimension in the barostatted tilt factor must be periodic.
|
||||
The second dimension in the barostatted tilt factor must be periodic.
|
||||
|
||||
*Cannot use fix nvt/npt/nph with xz scaling when z is non-periodic dimension*
|
||||
The 2nd dimension in the barostatted tilt factor must be periodic.
|
||||
The second dimension in the barostatted tilt factor must be periodic.
|
||||
|
||||
*Cannot use fix nvt/npt/nph with yz scaling when z is non-periodic dimension*
|
||||
The 2nd dimension in the barostatted tilt factor must be periodic.
|
||||
The second dimension in the barostatted tilt factor must be periodic.
|
||||
|
||||
*Cannot use fix pour rigid and not molecule*
|
||||
Self-explanatory.
|
||||
@ -7192,7 +7192,7 @@ keyword to allow for additional bonds to be formed
|
||||
does not exist.
|
||||
|
||||
*Replacing a fix, but new style != old style*
|
||||
A fix ID can be used a 2nd time, but only if the style matches the
|
||||
A fix ID can be used a second time, but only if the style matches the
|
||||
previous fix. In this case it is assumed you with to reset a fix's
|
||||
parameters. This error may mean you are mistakenly re-using a fix ID
|
||||
when you do not intend to.
|
||||
|
||||
@ -43,17 +43,17 @@ Doc page with :doc:`ERROR messages <Errors_messages>`
|
||||
Self-explanatory.
|
||||
|
||||
*Bond atom missing in box size check*
|
||||
The 2nd atoms needed to compute a particular bond is missing on this
|
||||
The second atom needed to compute a particular bond is missing on this
|
||||
processor. Typically this is because the pairwise cutoff is set too
|
||||
short or the bond has blown apart and an atom is too far away.
|
||||
|
||||
*Bond atom missing in image check*
|
||||
The 2nd atom in a particular bond is missing on this processor.
|
||||
The second atom in a particular bond is missing on this processor.
|
||||
Typically this is because the pairwise cutoff is set too short or the
|
||||
bond has blown apart and an atom is too far away.
|
||||
|
||||
*Bond atoms missing at step %ld*
|
||||
The 2nd atom needed to compute a particular bond is missing on this
|
||||
The second atom needed to compute a particular bond is missing on this
|
||||
processor. Typically this is because the pairwise cutoff is set too
|
||||
short or the bond has blown apart and an atom is too far away.
|
||||
|
||||
@ -486,7 +486,7 @@ This will most likely cause errors in kinetic fluctuations.
|
||||
a new style.
|
||||
|
||||
*No Kspace calculation with verlet/split*
|
||||
The 2nd partition performs a kspace calculation so the kspace_style
|
||||
The second partition performs a kspace calculation so the kspace_style
|
||||
command must be used.
|
||||
|
||||
*No automatic unit conversion to XTC file format conventions possible for units lj*
|
||||
|
||||
@ -163,7 +163,7 @@ Here is how you can run and visualize one of the sample problems:
|
||||
|
||||
Running the simulation produces the files *dump.indent* and
|
||||
*log.lammps*\ . You can visualize the dump file of snapshots with a
|
||||
variety of 3rd-party tools highlighted on the
|
||||
variety of third-party tools highlighted on the
|
||||
`Visualization <https://lammps.sandia.gov/viz.html>`_ page of the LAMMPS
|
||||
web site.
|
||||
|
||||
|
||||
@ -197,7 +197,7 @@ compress individual polymer chains (molecules) in a mixture, is
|
||||
explained on the :doc:`compute chunk/spread/atom <compute_chunk_spread_atom>` command doc page.
|
||||
|
||||
(7) An example for using one set of per-chunk values for molecule
|
||||
chunks, to create a 2nd set of micelle-scale chunks (clustered
|
||||
chunks, to create a second set of micelle-scale chunks (clustered
|
||||
molecules, due to hydrophobicity), is explained on the :doc:`compute chunk/reduce <compute_reduce_chunk>` command doc page.
|
||||
|
||||
(8) An example for using one set of per-chunk values (dipole moment
|
||||
|
||||
@ -114,19 +114,19 @@ summary screen will look like this:
|
||||
-- Detecting CXX compiler ABI info - done
|
||||
-- Detecting CXX compile features
|
||||
-- Detecting CXX compile features - done
|
||||
-- Found Git: /usr/bin/git (found version "2.25.2")
|
||||
-- Found Git: /usr/bin/git (found version "2.25.2")
|
||||
-- Running check for auto-generated files from make-based build system
|
||||
-- Found MPI_CXX: /usr/lib64/mpich/lib/libmpicxx.so (found version "3.1")
|
||||
-- Found MPI: TRUE (found version "3.1")
|
||||
-- Found MPI_CXX: /usr/lib64/mpich/lib/libmpicxx.so (found version "3.1")
|
||||
-- Found MPI: TRUE (found version "3.1")
|
||||
-- Looking for C++ include omp.h
|
||||
-- Looking for C++ include omp.h - found
|
||||
-- Found OpenMP_CXX: -fopenmp (found version "4.5")
|
||||
-- Found OpenMP: TRUE (found version "4.5")
|
||||
-- Found JPEG: /usr/lib64/libjpeg.so (found version "62")
|
||||
-- Found PNG: /usr/lib64/libpng.so (found version "1.6.37")
|
||||
-- Found ZLIB: /usr/lib64/libz.so (found version "1.2.11")
|
||||
-- Found GZIP: /usr/bin/gzip
|
||||
-- Found FFMPEG: /usr/bin/ffmpeg
|
||||
-- Found OpenMP_CXX: -fopenmp (found version "4.5")
|
||||
-- Found OpenMP: TRUE (found version "4.5")
|
||||
-- Found JPEG: /usr/lib64/libjpeg.so (found version "62")
|
||||
-- Found PNG: /usr/lib64/libpng.so (found version "1.6.37")
|
||||
-- Found ZLIB: /usr/lib64/libz.so (found version "1.2.11")
|
||||
-- Found GZIP: /usr/bin/gzip
|
||||
-- Found FFMPEG: /usr/bin/ffmpeg
|
||||
-- Performing Test COMPILER_SUPPORTS-ffast-math
|
||||
-- Performing Test COMPILER_SUPPORTS-ffast-math - Success
|
||||
-- Performing Test COMPILER_SUPPORTS-march=native
|
||||
@ -143,7 +143,7 @@ summary screen will look like this:
|
||||
* JPEG
|
||||
* PNG
|
||||
* ZLIB
|
||||
|
||||
|
||||
-- <<< Build configuration >>>
|
||||
Build type: RelWithDebInfo
|
||||
Install path: /home/akohlmey/.local
|
||||
@ -157,7 +157,7 @@ summary screen will look like this:
|
||||
Options: -ffast-math;-march=native
|
||||
-- <<< Linker flags: >>>
|
||||
-- Executable name: lmp
|
||||
-- Static library flags:
|
||||
-- Static library flags:
|
||||
-- <<< MPI flags >>>
|
||||
-- MPI includes: /usr/include/mpich-x86_64
|
||||
-- MPI libraries: /usr/lib64/mpich/lib/libmpicxx.so;/usr/lib64/mpich/lib/libmpi.so;
|
||||
@ -291,7 +291,7 @@ Some common CMake variables
|
||||
|
||||
.. list-table::
|
||||
:header-rows: 1
|
||||
|
||||
|
||||
* - Variable
|
||||
- Description
|
||||
* - ``CMAKE_INSTALL_PREFIX``
|
||||
@ -313,13 +313,13 @@ Some common CMake variables
|
||||
- Fortran compiler to be used for compilation (default: system specific, ``gfortran`` on Linux)
|
||||
* - ``CXX_COMPILER_LAUNCHER``
|
||||
- tool to launch the C++ compiler, e.g. ``ccache`` or ``distcc`` for faster compilation (default: empty)
|
||||
|
||||
|
||||
Some common LAMMPS specific variables
|
||||
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
||||
|
||||
.. list-table::
|
||||
:header-rows: 1
|
||||
|
||||
|
||||
* - Variable
|
||||
- Description
|
||||
* - ``BUILD_MPI``
|
||||
@ -378,9 +378,9 @@ change some variables later with additional *-D* flags. A few examples:
|
||||
|
||||
.. code-block:: bash
|
||||
|
||||
cmake -C ../cmake/preset/minimal.cmake -D PKG_MISC=on ../cmake
|
||||
cmake -C ../cmake/preset/clang.cmake -C ../cmake/preset/most.cmake ../cmake
|
||||
cmake -C ../cmake/preset/minimal.cmake -D BUILD_MPI=off ../cmake
|
||||
cmake -C ../cmake/presets/minimal.cmake -D PKG_MISC=on ../cmake
|
||||
cmake -C ../cmake/presets/clang.cmake -C ../cmake/presets/most.cmake ../cmake
|
||||
cmake -C ../cmake/presets/minimal.cmake -D BUILD_MPI=off ../cmake
|
||||
|
||||
The first command will install the packages ``KSPACE``, ``MANYBODY``,
|
||||
``MOLECULE``, ``RIGID`` and ``MISC``; the first four from the preset
|
||||
@ -396,7 +396,7 @@ It is also possible to do this incrementally.
|
||||
|
||||
.. code-block:: bash
|
||||
|
||||
cmake -C ../cmake/preset/minimal.cmake ../cmake
|
||||
cmake -C ../cmake/presets/minimal.cmake ../cmake
|
||||
cmake -D PKG_MISC=on .
|
||||
|
||||
will achieve the same configuration like in the first example above. In
|
||||
@ -415,8 +415,10 @@ This is particularly convenient, if you have set a custom build command
|
||||
via the ``CMAKE_MAKE_PROGRAM`` variable.
|
||||
|
||||
When calling the build program, you can also select which "target" is to
|
||||
be build through appending the name of the target to the build command.
|
||||
Example: ``cmake --build . all``. The following abstract targets are available:
|
||||
be build through appending the ``--target`` flag and the name of the target
|
||||
to the build command. When using ``make`` as build tool, you can just append
|
||||
the target name to the command. Example: ``cmake --build . --target all`` or
|
||||
``make all``. The following abstract targets are available:
|
||||
|
||||
.. list-table::
|
||||
:header-rows: 1
|
||||
@ -432,11 +434,11 @@ Example: ``cmake --build . all``. The following abstract targets are available:
|
||||
* - ``install``
|
||||
- install all target files into folders in ``CMAKE_INSTALL_PREFIX``
|
||||
* - ``test``
|
||||
- run some simple tests (if configured with ``-D ENABLE_TESTING=on``)
|
||||
- run some tests (if configured with ``-D ENABLE_TESTING=on``)
|
||||
* - ``clean``
|
||||
- remove all generated files
|
||||
|
||||
|
||||
|
||||
Choosing generators
|
||||
-------------------
|
||||
|
||||
|
||||
@ -119,7 +119,7 @@ non-polarized ions (ions without an attached satellite particle). The
|
||||
groups, one for the core atoms, another for the shell atoms.
|
||||
Non-polarized ions which might also be included in the treated system
|
||||
should not be included into either of these groups, they are taken
|
||||
into account by the *group-ID* (2nd argument) of the compute. The
|
||||
into account by the *group-ID* (second argument) of the compute. The
|
||||
groups can be defined using the :doc:`group *type*\ <group>` command.
|
||||
Note that to perform thermostatting using this definition of
|
||||
temperature, the :doc:`fix modify temp <fix_modify>` command should be
|
||||
|
||||
@ -91,4 +91,4 @@ With these modifications, the 8 simulations of each script would run
|
||||
on the 3 partitions one after the other until all were finished.
|
||||
Initially, 3 simulations would be started simultaneously, one on each
|
||||
partition. When one finished, that partition would then start
|
||||
the 4th simulation, and so forth, until all 8 were completed.
|
||||
the fourth simulation, and so forth, until all 8 were completed.
|
||||
|
||||
@ -28,7 +28,7 @@ scripts are based on. If that script had the line
|
||||
added to it, it would produce 2 binary restart files (tmp.restart.50
|
||||
and tmp.restart.100) as it ran.
|
||||
|
||||
This script could be used to read the 1st restart file and re-run the
|
||||
This script could be used to read the first restart file and re-run the
|
||||
last 50 timesteps:
|
||||
|
||||
.. code-block:: LAMMPS
|
||||
|
||||
@ -85,7 +85,7 @@ where *V* is the volume of the box, **X** is the original vector quantity and
|
||||
**x** is the vector in the LAMMPS basis.
|
||||
|
||||
There is no requirement that a triclinic box be periodic in any
|
||||
dimension, though it typically should be in at least the 2nd dimension
|
||||
dimension, though it typically should be in at least the second dimension
|
||||
of the tilt (y in xy) if you want to enforce a shift in periodic
|
||||
boundary conditions across that boundary. Some commands that work
|
||||
with triclinic boxes, e.g. the :doc:`fix deform <fix_deform>` and :doc:`fix npt <fix_nh>` commands, require periodicity or non-shrink-wrap
|
||||
@ -120,7 +120,7 @@ The 9 parameters, as well as lx,ly,lz, can be output via the
|
||||
To avoid extremely tilted boxes (which would be computationally
|
||||
inefficient), LAMMPS normally requires that no tilt factor can skew
|
||||
the box more than half the distance of the parallel box length, which
|
||||
is the 1st dimension in the tilt factor (x for xz). This is required
|
||||
is the first dimension in the tilt factor (x for xz). This is required
|
||||
both when the simulation box is created, e.g. via the
|
||||
:doc:`create_box <create_box>` or :doc:`read_data <read_data>` commands,
|
||||
as well as when the box shape changes dynamically during a simulation,
|
||||
@ -137,7 +137,7 @@ limit during a dynamics run (e.g. via the :doc:`fix deform <fix_deform>`
|
||||
command), then the box is "flipped" to an equivalent shape with a tilt
|
||||
factor within the bounds, so the run can continue. See the :doc:`fix deform <fix_deform>` doc page for further details.
|
||||
|
||||
One exception to this rule is if the 1st dimension in the tilt
|
||||
One exception to this rule is if the first dimension in the tilt
|
||||
factor (x for xy) is non-periodic. In that case, the limits on the
|
||||
tilt factor are not enforced, since flipping the box in that dimension
|
||||
does not change the atom positions due to non-periodicity. In this
|
||||
|
||||
@ -1,10 +1,11 @@
|
||||
Calculate viscosity
|
||||
===================
|
||||
|
||||
The shear viscosity eta of a fluid can be measured in at least 5 ways
|
||||
The shear viscosity eta of a fluid can be measured in at least 6 ways
|
||||
using various options in LAMMPS. See the examples/VISCOSITY directory
|
||||
for scripts that implement the 5 methods discussed here for a simple
|
||||
Lennard-Jones fluid model. Also, see the :doc:`Howto kappa <Howto_kappa>` doc page for an analogous discussion for
|
||||
Lennard-Jones fluid model and 1 method for SPC/E water model.
|
||||
Also, see the :doc:`Howto kappa <Howto_kappa>` doc page for an analogous discussion for
|
||||
thermal conductivity.
|
||||
|
||||
Eta is a measure of the propensity of a fluid to transmit momentum in
|
||||
@ -130,9 +131,25 @@ time-integrated momentum fluxes play the role of Cartesian
|
||||
coordinates, whose mean-square displacement increases linearly
|
||||
with time at sufficiently long times.
|
||||
|
||||
The sixth is periodic perturbation method. It is also a non-equilibrium MD method.
|
||||
However, instead of measure the momentum flux in response of applied velocity gradient,
|
||||
it measures the velocity profile in response of applied stress.
|
||||
A cosine-shaped periodic acceleration is added to the system via the
|
||||
:doc:`fix accelerate/cos <fix_accelerate_cos>` command,
|
||||
and the :doc:`compute viscosity/cos<compute_viscosity_cos>` command is used to monitor the
|
||||
generated velocity profile and remove the velocity bias before thermostatting.
|
||||
|
||||
.. note::
|
||||
|
||||
An article by :ref:`(Hess) <Hess3>` discussed the accuracy and efficiency of these methods.
|
||||
|
||||
----------
|
||||
|
||||
.. _Daivis-viscosity:
|
||||
|
||||
**(Daivis and Todd)** Daivis and Todd, Nonequilibrium Molecular Dynamics (book),
|
||||
Cambridge University Press, https://doi.org/10.1017/9781139017848, (2017).
|
||||
|
||||
.. _Hess3:
|
||||
|
||||
**(Hess)** Hess, B. The Journal of Chemical Physics 2002, 116 (1), 209-217.
|
||||
|
||||
@ -24,12 +24,13 @@ allows you to install LAMMPS with a single command, and stay
|
||||
up-to-date with the current version of LAMMPS by simply updating your
|
||||
operating system.
|
||||
|
||||
To install the appropriate personal-package archive (PPA), do the
|
||||
To install the appropriate personal-package archives (PPAs), do the
|
||||
following once:
|
||||
|
||||
.. code-block:: bash
|
||||
|
||||
$ sudo add-apt-repository ppa:gladky-anton/lammps
|
||||
$ sudo add-apt-repository ppa:openkim/latest
|
||||
$ sudo apt-get update
|
||||
|
||||
To install LAMMPS do the following once:
|
||||
@ -38,7 +39,7 @@ To install LAMMPS do the following once:
|
||||
|
||||
$ sudo apt-get install lammps-daily
|
||||
|
||||
This downloads an executable named "lmp_daily" to your box, which
|
||||
This downloads an executable named ``lmp_daily`` to your box, which
|
||||
can then be used in the usual way to run input scripts:
|
||||
|
||||
.. code-block:: bash
|
||||
@ -60,11 +61,29 @@ To get a copy of the current documentation and examples:
|
||||
$ sudo apt-get install lammps-daily-doc
|
||||
|
||||
which will download the doc files in
|
||||
/usr/share/doc/lammps-daily-doc/doc and example problems in
|
||||
/usr/share/doc/lammps-doc/examples.
|
||||
``/usr/share/doc/lammps-daily-doc/doc`` and example problems in
|
||||
``/usr/share/doc/lammps-doc/examples``.
|
||||
|
||||
Note that you may still wish to download the tarball to get potential
|
||||
files and auxiliary tools.
|
||||
To get a copy of the current potentials files:
|
||||
|
||||
.. code-block:: bash
|
||||
|
||||
$ sudo apt-get install lammps-daily-data
|
||||
|
||||
which will download the potentials files to
|
||||
``/usr/share/lammps-daily/potentials``. The ``lmp_daily`` binary is
|
||||
hard-coded to look for potential files in this directory (it does not
|
||||
use the `LAMMPS_POTENTIALS` environment variable, as described
|
||||
in :doc:`pair_coeff <pair_coeff>` command).
|
||||
|
||||
The ``lmp_daily`` binary is built with the :ref:`KIM package <kim>` which
|
||||
results in the above command also installing the `kim-api` binaries when LAMMPS
|
||||
is installed. In order to use potentials from `openkim.org <openkim_>`_, you
|
||||
can install the `openkim-models` package
|
||||
|
||||
.. code-block:: bash
|
||||
|
||||
$ sudo apt-get install openkim-models
|
||||
|
||||
To un-install LAMMPS, do the following:
|
||||
|
||||
@ -72,17 +91,8 @@ To un-install LAMMPS, do the following:
|
||||
|
||||
$ sudo apt-get remove lammps-daily
|
||||
|
||||
Note that the lammps-daily executable is built with the following
|
||||
sequence of make commands, as if you had done the same with the
|
||||
unpacked tarball files in the src directory:
|
||||
|
||||
.. code-block:: bash
|
||||
|
||||
$ make yes-all
|
||||
$ make no-lib
|
||||
$ make mpi
|
||||
|
||||
Thus it builds with FFTW3 and OpenMPI.
|
||||
Please use ``lmp_daily -help`` to see which compilation options, packages,
|
||||
and styles are included in the binary.
|
||||
|
||||
Thanks to Anton Gladky (gladky.anton at gmail.com) for setting up this
|
||||
Ubuntu package capability.
|
||||
@ -103,14 +113,14 @@ linking to the C library interface (lammps-devel, lammps-mpich-devel,
|
||||
lammps-openmpi-devel), the header for compiling programs using
|
||||
the C library interface (lammps-headers), and the LAMMPS python
|
||||
module for Python 3. All packages can be installed at the same
|
||||
time and the name of the LAMMPS executable is *lmp* and *lmp_openmpi*
|
||||
or *lmp_mpich* respectively. By default, *lmp* will refer to the
|
||||
time and the name of the LAMMPS executable is ``lmp`` and ``lmp_openmpi``
|
||||
or ``lmp_mpich`` respectively. By default, ``lmp`` will refer to the
|
||||
serial executable, unless one of the MPI environment modules is loaded
|
||||
("module load mpi/mpich-x86_64" or "module load mpi/openmpi-x86_64").
|
||||
(``module load mpi/mpich-x86_64`` or ``module load mpi/openmpi-x86_64``).
|
||||
Then the corresponding parallel LAMMPS executable can be used.
|
||||
The same mechanism applies when loading the LAMMPS python module.
|
||||
|
||||
To install LAMMPS with OpenMPI and run an input in.lj with 2 CPUs do:
|
||||
To install LAMMPS with OpenMPI and run an input ``in.lj`` with 2 CPUs do:
|
||||
|
||||
.. code-block:: bash
|
||||
|
||||
@ -118,10 +128,10 @@ To install LAMMPS with OpenMPI and run an input in.lj with 2 CPUs do:
|
||||
$ module load mpi/openmpi-x86_64
|
||||
$ mpirun -np 2 lmp -in in.lj
|
||||
|
||||
The "dnf install" command is needed only once. In case of a new LAMMPS
|
||||
stable release, "dnf update" will automatically update to the newer
|
||||
The ``dnf install`` command is needed only once. In case of a new LAMMPS
|
||||
stable release, ``dnf update`` will automatically update to the newer
|
||||
version as soon at the RPM files are built and uploaded to the download
|
||||
mirrors. The "module load" command is needed once per (shell) session
|
||||
mirrors. The ``module load`` command is needed once per (shell) session
|
||||
or shell terminal instance, unless it is automatically loaded from the
|
||||
shell profile.
|
||||
|
||||
@ -134,7 +144,7 @@ can install the `openkim-models` package
|
||||
|
||||
$ 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.
|
||||
|
||||
Thanks to Christoph Junghans (LANL) for making LAMMPS available in Fedora.
|
||||
@ -153,10 +163,10 @@ in the `Extra Packages for Enterprise Linux (EPEL) repository <https://fedorapro
|
||||
for use with Red Hat Enterprise Linux (RHEL) or CentOS version 7.x
|
||||
and compatible Linux distributions. Names of packages, executable,
|
||||
and content are the same as described above for Fedora Linux.
|
||||
But RHEL/CentOS 7.x uses the "yum" package manager instead of "dnf"
|
||||
But RHEL/CentOS 7.x uses the ``yum`` package manager instead of ``dnf``
|
||||
in Fedora 28.
|
||||
|
||||
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.
|
||||
|
||||
Thanks to Christoph Junghans (LANL) for making LAMMPS available in EPEL.
|
||||
@ -176,13 +186,13 @@ in OpenSuse as of Leap 15.0. You can install the package with:
|
||||
$ zypper install lammps
|
||||
|
||||
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
|
||||
|
||||
$ 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.
|
||||
|
||||
The LAMMPS binary is built with the :ref:`KIM package <kim>` which
|
||||
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user