Merge pull request #4530 from akohlmey/collected-small-fixes

Collected small fixes and changes.
This commit is contained in:
Axel Kohlmeyer
2025-04-04 12:04:46 -04:00
committed by GitHub
30 changed files with 520 additions and 186 deletions

View File

@ -1,10 +1,18 @@
# the geturl command needs libcurl
find_package(CURL QUIET COMPONENTS HTTP HTTPS)
find_package(CURL QUIET)
option(WITH_CURL "Enable libcurl support" ${CURL_FOUND})
if(WITH_CURL)
find_package(CURL REQUIRED COMPONENTS HTTP HTTPS)
target_compile_definitions(lammps PRIVATE -DLAMMPS_CURL)
# need to use pkgconfig for fully static bins to find custom static libs
if (CMAKE_SYSTEM_NAME STREQUAL "LinuxMUSL")
include(FindPkgConfig)
pkg_check_modules(CURL IMPORTED_TARGET libcurl libssl libcrypto)
target_link_libraries(lammps PUBLIC PkgConfig::CURL)
else()
find_package(CURL REQUIRED)
target_link_libraries(lammps PRIVATE CURL::libcurl)
endif()
endif()

View File

@ -21,10 +21,11 @@ to the online LAMMPS documentation for known LAMMPS commands and styles.
Sur or later), and Windows (version 10 or later) :ref:`are available
<lammps_gui_install>` for download. Non-MPI LAMMPS executables (as
``lmp``) for running LAMMPS from the command-line and :doc:`some
LAMMPS tools <Tools>` compiled executables are also included.
Also, the pre-compiled LAMMPS-GUI packages include the WHAM executables
LAMMPS tools <Tools>` compiled executables are also included. Also,
the pre-compiled LAMMPS-GUI packages include the WHAM executables
from http://membrane.urmc.rochester.edu/content/wham/ for use with
LAMMPS tutorials.
LAMMPS tutorials documented in this paper (:ref:`Gravelle1
<Gravelle1>`).
The source code for LAMMPS-GUI is included in the LAMMPS source code
distribution and can be found in the ``tools/lammps-gui`` folder. It
@ -720,6 +721,19 @@ output, charts, slide show, variables, or snapshot images. The
default settings for their visibility can be changed in the
*Preferences* dialog.
Tutorials
^^^^^^^^^
The *Tutorials* menu is to support the set of LAMMPS tutorials for
beginners and intermediate LAMMPS users documented in (:ref:`Gravelle1
<Gravelle1>`). From the drop down menu you can select which of the eight
currently available tutorial sessions you want to start and then will be
taken to a 'wizard' dialog where you can choose in which folder you want
to work, whether you want that folder to be cleared, and also whether
you want to download the solutions files (can be large). The dialog
will then start downloading the files requested and load the first input
file for the selected session into LAMMPS-GUI.
About
^^^^^
@ -848,6 +862,11 @@ General Settings:
the plots in the *Charts* window in milliseconds. The default is to
redraw the plots every 500 milliseconds. This is just for the drawing,
data collection is managed with the previous setting.
- *HTTPS proxy setting:* Allows to enter a URL for an HTTPS proxy. This
may be needed when the LAMMPS input contains :doc:`geturl commands <geturl>`
or for downloading tutorial files from the *Tutorials* menu. If the
``https_proxy`` environment variable was set externally, its value is
displayed but cannot be changed.
Accelerators:
^^^^^^^^^^^^^
@ -976,10 +995,21 @@ available (On macOS use the Command key instead of Ctrl/Control).
- Ctrl+Shift+T
- LAMMPS Tutorial
Further editing keybindings `are documented with the Qt documentation
Further keybindings of the editor window `are documented with the Qt
documentation
<https://doc.qt.io/qt-5/qplaintextedit.html#editing-key-bindings>`_. In
case of conflicts the list above takes precedence.
All other windows only support a subset of keyboard shortcuts listed
above. Typically, the shortcuts `Ctrl-/` (Stop Run), `Ctrl-W` (Close
Window), and `Ctrl-Q` (Quit Application) are supported.
-------------
.. _Gravelle1:
**(Gravelle1)** Gravelle, Gissinger, Kohlmeyer, `arXiv:2503.14020 \[physics.comp-ph\] <https://doi.org/10.48550/arXiv.2503.14020>`_ (2025)
.. _Gravelle2:
**(Gravelle2)** Gravelle https://lammpstutorials.github.io/

View File

@ -1,19 +1,21 @@
Compute styles
==============
Classes that compute scalar and vector quantities like temperature
and the pressure tensor, as well as classes that compute per-atom
quantities like kinetic energy and the centro-symmetry parameter
are derived from the Compute class. New styles can be created
to add new calculations to LAMMPS.
Classes that compute scalar and vector quantities like temperature and
the pressure tensor, as well as classes that compute per-atom quantities
like kinetic energy and the centro-symmetry parameter are derived from
the Compute class. New styles can be created to add new calculations to
LAMMPS.
Compute_temp.cpp is a simple example of computing a scalar
temperature. Compute_ke_atom.cpp is a simple example of computing
per-atom kinetic energy.
The ``src/compute_temp.cpp`` file is a simple example of computing a
scalar temperature. The ``src/compute_ke_atom.cpp`` file is a simple
example of computing per-atom kinetic energy.
Here is a brief description of methods you define in your new derived
class. See compute.h for details.
class. See ``src/compute.h`` for additional details.
+-----------------------+------------------------------------------------------------------+
| post_constructor | perform tasks that cannot be run in the constructor (optional) |
+-----------------------+------------------------------------------------------------------+
| init | perform one time setup (required) |
+-----------------------+------------------------------------------------------------------+
@ -50,10 +52,11 @@ class. See compute.h for details.
| memory_usage | tally memory usage (optional) |
+-----------------------+------------------------------------------------------------------+
Tally-style computes are a special case, as their computation is done
in two stages: the callback function is registered with the pair style
and then called from the Pair::ev_tally() function, which is called for
each pair after force and energy has been computed for this pair. Then
the tallied values are retrieved with the standard compute_scalar or
compute_vector or compute_peratom methods. The :doc:`compute styles in the TALLY package <compute_tally>`
provide *examples* for utilizing this mechanism.
Tally-style computes are a special case, as their computation is done in
two stages: the callback function is registered with the pair style and
then called from the Pair::ev_tally() function, which is called for each
pair after force and energy has been computed for this pair. Then the
tallied values are retrieved with the standard compute_scalar or
compute_vector or compute_peratom methods. The :doc:`compute styles in
the TALLY package <compute_tally>` provide *examples* for utilizing this
mechanism.

View File

@ -1,23 +1,25 @@
Fix styles
==========
In LAMMPS, a "fix" is any operation that is computed during
timestepping that alters some property of the system. Essentially
everything that happens during a simulation besides force computation,
neighbor list construction, and output, is a "fix". This includes
time integration (update of coordinates and velocities), force
constraints or boundary conditions (SHAKE or walls), and diagnostics
(compute a diffusion coefficient). New styles can be created to add
new options to LAMMPS.
In LAMMPS, a "fix" is any operation that is computed during timestepping
that alters some property of the system. Essentially everything that
happens during a simulation besides force computation, neighbor list
construction, and output, is a "fix". This includes time integration
(update of coordinates and velocities), force constraints or boundary
conditions (SHAKE or walls), and diagnostics (compute a diffusion
coefficient). New styles can be created to add new options to LAMMPS.
Fix_setforce.cpp is a simple example of setting forces on atoms to
prescribed values. There are dozens of fix options already in LAMMPS;
choose one as a template that is similar to what you want to
implement.
The file ``src/fix_setforce.cpp`` is a simple example of setting forces
on atoms to prescribed values. There are dozens of fix options already
in LAMMPS; choose one as a template that is similar to what you want to
implement. There also is a detailed discussion of :doc:`how to write
new fix styles <Developer_write_fix>` in LAMMPS.
Here is a brief description of methods you can define in your new
derived class. See fix.h for details.
derived class. See ``src/fix.h`` for additional details.
+---------------------------+--------------------------------------------------------------------------------------------+
| post_constructor | perform tasks that cannot be run in the constructor (optional) |
+---------------------------+--------------------------------------------------------------------------------------------+
| setmask | determines when the fix is called during the timestep (required) |
+---------------------------+--------------------------------------------------------------------------------------------+
@ -130,10 +132,11 @@ derived class. See fix.h for details.
Typically, only a small fraction of these methods are defined for a
particular fix. Setmask is mandatory, as it determines when the fix
will be invoked during the timestep. Fixes that perform time
integration (\ *nve*, *nvt*, *npt*\ ) implement initial_integrate() and
final_integrate() to perform velocity Verlet updates. Fixes that
constrain forces implement post_force().
will be invoked during :doc:`the evolution of a timestep
<Developer_flow>`. Fixes that perform time integration (\ *nve*, *nvt*,
*npt*\ ) implement initial_integrate() and final_integrate() to perform
velocity Verlet updates. Fixes that constrain forces implement
post_force().
Fixes that perform diagnostics typically implement end_of_step(). For
an end_of_step fix, one of your fix arguments must be the variable
@ -143,13 +146,13 @@ is the first argument the fix defines (after the ID, group-ID, style).
If the fix needs to store information for each atom that persists from
timestep to timestep, it can manage that memory and migrate the info
with the atoms as they move from processors to processor by
implementing the grow_arrays, copy_arrays, pack_exchange, and
unpack_exchange methods. Similarly, the pack_restart and
unpack_restart methods can be implemented to store information about
the fix in restart files. If you wish an integrator or force
constraint fix to work with rRESPA (see the :doc:`run_style <run_style>`
command), the initial_integrate, post_force_integrate, and
final_integrate_respa methods can be implemented. The thermo method
enables a fix to contribute values to thermodynamic output, as printed
quantities and/or to be summed to the potential energy of the system.
with the atoms as they move from processors to processor by implementing
the grow_arrays, copy_arrays, pack_exchange, and unpack_exchange
methods. Similarly, the pack_restart and unpack_restart methods can be
implemented to store information about the fix in restart files. If you
wish an integrator or force constraint fix to work with rRESPA (see the
:doc:`run_style <run_style>` command), the initial_integrate,
post_force_integrate, and final_integrate_respa methods can be
implemented. The thermo method enables a fix to contribute values to
thermodynamic output, as printed quantities and/or to be summed to the
potential energy of the system.

View File

@ -3,17 +3,16 @@ Scatter/gather operations
.. code-block:: python
data = lmp.gather_atoms(name,type,count) # return per-atom property of all atoms gathered into data, ordered by atom ID
# name = "x", "charge", "type", etc
data = lmp.gather_atoms_concat(name,type,count) # ditto, but concatenated atom values from each proc (unordered)
data = lmp.gather_atoms_subset(name,type,count,ndata,ids) # ditto, but for subset of Ndata atoms with IDs
data = lmp.gather_atoms(name,dtype,count) # return per-atom property of all atoms gathered into data, ordered by atom ID
# name = "x", "q", "type", etc
data = lmp.gather_atoms_concat(name,dtype,count) # ditto, but concatenated atom values from each proc (unordered)
data = lmp.gather_atoms_subset(name,dtype,count,ndata,ids) # ditto, but for subset of Ndata atoms with IDs
lmp.scatter_atoms(name,type,count,data) # scatter per-atom property to all atoms from data, ordered by atom ID
# name = "x", "charge", "type", etc
lmp.scatter_atoms(name,dtype,count,data) # scatter per-atom property to all atoms from data, ordered by atom ID
# name = "x", "q", "type", etc
# count = # of per-atom values, 1 or 3, etc
lmp.scatter_atoms_subset(name,type,count,ndata,ids,data) # ditto, but for subset of Ndata atoms with IDs
lmp.scatter_atoms_subset(name,dtype,count,ndata,ids,data) # ditto, but for subset of Ndata atoms with IDs
The gather methods collect peratom info of the requested type (atom
coords, atom types, forces, etc) from all processors, and returns the
@ -22,6 +21,12 @@ functions do the inverse. They distribute a vector of peratom values,
passed by all calling processors, to individual atoms, which may be
owned by different processors.
The *dtype* parameter is 0 for ``int`` values and 1 for ``double``
values. The *count* parameter is 1 for per-atom vectors like "type"
or "q" and 3 for per-atom arrays like "x", "v", "f". Use *count* = 3
with name = "image" if you want the single integer storing the image
flags unpacked into 3 components ("x", "y", and "z").
Note that the data returned by the gather methods,
e.g. :py:meth:`gather_atoms("x") <lammps.lammps.gather_atoms()>`, is
different from the data structure returned by

View File

@ -1276,11 +1276,13 @@ Those scripts were written by Steve Plimpton sjplimp at gmail.com
valgrind tool
-------------
The ``valgrind`` folder contains additional suppressions fur LAMMPS when using
valgrind's memcheck tool to search for memory access violation and memory
leaks. These suppressions are automatically invoked when running tests through
CMake "ctest -T memcheck". See the provided README file to add these
suppressions when running LAMMPS.
The ``valgrind`` folder contains additional suppressions fur LAMMPS when
using `valgrind's <https://valgrind.org/>`_ ` `memcheck tool
<https://valgrind.org/info/tools.html#memcheck>`_ to search for memory
access violation and memory leaks. These suppressions are automatically
invoked when running tests through CMake "ctest -T memcheck". See the
instruction in the ``README`` file to add these suppressions when using
valgrind with LAMMPS or other programs.
----------

View File

@ -1,4 +1,5 @@
.. index:: dihedral_style multi/harmonic
.. index:: dihedral_style multi/harmonic/kk
.. index:: dihedral_style multi/harmonic/omp
dihedral_style multi/harmonic command

View File

@ -58,6 +58,32 @@ behave as expected. If the argument is *no*, geturl will operate silently
and only report the error status number provided by libcurl, in case of a
failure.
.. _geturl_proxy:
.. admonition:: Using *geturl* with proxies for http or https
:class: note
The `libcurl library <https:://curl.se/libcurl/>`_ supports `routing
traffic through proxies
<https://everything.curl.dev/usingcurl/proxies/env.html>`_ by setting
suitable environment variables (e.g. ``http_proxy`` or
``https_proxy``) as required by some institutional or corporate
security protocols. In that case you probably also want to use the
*verify* *no* setting.
Using a proxy may also be needed if you are running on an HPC cluster
where only the login or head nodes have access to the internet, but
not the compute nodes. In this case the following input can be adapted
and used for your local HPC environment:
.. code-block:: LAMMPS
variable headnode getenv PBS_O_HOST # use SLURM_SUBMIT_HOST when using SLURM instead of Torque/PBS
shell ssh -N -f -D 8001 ${headnode} # start SOCKS5 proxy with backgrounded ssh connection to cluster head node
shell putenv http_proxy=socks5://localhost:8001 https_proxy=socks5://localhost:8001
geturl https://download.lammps.org/tars/SHA256SUMS # download a file using proxy
shell head SHA256SUMS # check if the download was successful
----------
Restrictions

View File

@ -63,6 +63,13 @@ DumpExtXYZ::DumpExtXYZ(LAMMPS *lmp, int narg, char **arg) :
/* ---------------------------------------------------------------------- */
DumpExtXYZ::~DumpExtXYZ()
{
delete[] properties_string;
}
/* ---------------------------------------------------------------------- */
void DumpExtXYZ::update_properties()
{
// How many per-atom elements we buffer

View File

@ -26,6 +26,7 @@ namespace LAMMPS_NS {
class DumpExtXYZ : public DumpXYZ {
public:
DumpExtXYZ(class LAMMPS *, int, char **);
~DumpExtXYZ() override;
protected:
int with_vel;

View File

@ -29,6 +29,7 @@ template <class DeviceType> class MLIAPModelKokkos : protected Pointers {
MLIAPModelKokkos(LAMMPS *lmp, MLIAPModel *model_in) : Pointers(lmp), model(model_in) {}
virtual ~MLIAPModelKokkos()
{
memoryKK->destroy_kokkos(k_coeffelem,model->coeffelem);
model->coeffelem = nullptr;
}
@ -39,7 +40,7 @@ template <class DeviceType> class MLIAPModelKokkos : protected Pointers {
"MLIAPModelKokkos::coeffelem");
for (int i = 0; i < model->nelements; ++i)
for (int j = 0; j < model->nparams; ++j) tmp[i][j] = model->coeffelem[i][j];
delete model->coeffelem;
memory->destroy(model->coeffelem);
model->coeffelem = tmp;
k_coeffelem.modify<LMPHostType>();
k_coeffelem.sync<LMPDeviceType>();

View File

@ -42,16 +42,16 @@ public:
typedef ArrayTypes<DeviceType> AT;
PairMLIAPKokkos(class LAMMPS*);
~PairMLIAPKokkos();
void settings(int narg, char ** arg);
void init_style();
~PairMLIAPKokkos() override;
void settings(int narg, char ** arg) override;
void init_style() override;
void compute(int, int);
void compute(int, int) override;
void e_tally(MLIAPData* data);
void allocate();
void allocate() override;
void coeff(int narg, char **arg);
void coeff(int narg, char **arg) override;
//Outward facing functions to be invoked by the ML layer via MLIAPDataKokkosDevice
template <typename CommType>

View File

@ -47,7 +47,7 @@ using namespace LAMMPS_NS;
/* ---------------------------------------------------------------------- */
PairMLIAP::PairMLIAP(LAMMPS *lmp) :
Pair(lmp), map(nullptr), model(nullptr), descriptor(nullptr), data(nullptr)
Pair(lmp), model(nullptr), descriptor(nullptr), data(nullptr)
{
single_enable = 0;
restartinfo = 0;
@ -55,8 +55,6 @@ PairMLIAP::PairMLIAP(LAMMPS *lmp) :
manybody_flag = 1;
is_child = false;
centroidstressflag = CENTROID_NOTAVAIL;
model=nullptr;
descriptor=nullptr;
}
/* ---------------------------------------------------------------------- */

View File

@ -36,7 +36,6 @@ class PairMLIAP : public Pair {
void init_style() override;
double init_one(int, int) override;
double memory_usage() override;
int *map; // mapping from atom types to elements
protected:
virtual void allocate();

View File

@ -101,7 +101,10 @@ void FixQEqRelReaxFF::calc_chi_eff()
sum_d += overlap;
}
}
if (sum_d != 0.0)
chi_eff[i] = chia + scale * (phia - sum_n / sum_d);
else
chi_eff[i] = chia;
}
} else {
for (i = 0; i < nn; i++) { chi_eff[i] = chi[type[i]]; }

View File

@ -3309,9 +3309,9 @@ x[0][2], x[1][0], x[1][1], x[1][2], x[2][0], :math:`\dots`);
\endverbatim
*
* \param handle pointer to a previously created LAMMPS instance
* \param name desired quantity (e.g., *x* or *charge*)
* \param type 0 for ``int`` values, 1 for ``double`` values
* \param count number of per-atom values (e.g., 1 for *type* or *charge*,
* \param name desired quantity (e.g., *x* or *q*)
* \param dtype 0 for ``int`` values, 1 for ``double`` values
* \param count number of per-atom values (e.g., 1 for *type* or *q*,
* 3 for *x* or *f*); use *count* = 3 with *image* if you want
* a single image flag unpacked into (*x*,*y*,*z*) components.
* \param data per-atom values packed in a 1-dimensional array of length
@ -3325,7 +3325,7 @@ x[0][2], x[1][0], x[1][1], x[1][2], x[2][0], :math:`\dots`);
Allreduce to sum vector into data across all procs
------------------------------------------------------------------------- */
void lammps_gather_atoms(void *handle, const char *name, int type, int count, void *data)
void lammps_gather_atoms(void *handle, const char *name, int dtype, int count, void *data)
{
auto *lmp = (LAMMPS *) handle;
if (!lmp || !lmp->error || !lmp->atom || !lmp->memory) {
@ -3360,7 +3360,7 @@ void lammps_gather_atoms(void *handle, const char *name, int type, int count, vo
// use atom ID to insert each atom's values into copy
// MPI_Allreduce with MPI_SUM to merge into data, ordered by atom ID
if (type == 0) {
if (dtype == 0) {
int *vector = nullptr;
int **array = nullptr;
const int imgunpack = (count == 3) && (strcmp(name,"image") == 0);
@ -3399,7 +3399,7 @@ void lammps_gather_atoms(void *handle, const char *name, int type, int count, vo
MPI_Allreduce(copy, data, count * natoms, MPI_INT, MPI_SUM, lmp->world);
lmp->memory->destroy(copy);
} else if (type == 1) {
} else if (dtype == 1) {
double *vector = nullptr;
double **array = nullptr;
if (count == 1) vector = (double *) vptr;
@ -3427,7 +3427,7 @@ void lammps_gather_atoms(void *handle, const char *name, int type, int count, vo
MPI_Allreduce(copy, data, count*natoms, MPI_DOUBLE, MPI_SUM, lmp->world);
lmp->memory->destroy(copy);
} else {
lmp->error->all(FLERR, Error::NOLASTLINE, "{}(): unsupported data type: {}", FNERR, type);
lmp->error->all(FLERR, Error::NOLASTLINE, "{}(): unsupported data type: {}", FNERR, dtype);
return;
}
#endif
@ -3469,13 +3469,13 @@ or :cpp:func:`lammps_extract_setting`.
\endverbatim
*
* \param handle: pointer to a previously created LAMMPS instance
* \param name: desired quantity (e.g., *x* or *charge*\ )
* \param type: 0 for ``int`` values, 1 for ``double`` values
* \param count: number of per-atom values (e.g., 1 for *type* or *charge*,
* \param handle pointer to a previously created LAMMPS instance
* \param name desired quantity (e.g., *x* or *q*\ )
* \param dtype 0 for ``int`` values, 1 for ``double`` values
* \param count number of per-atom values (e.g., 1 for *type* or *q*,
* 3 for *x* or *f*); use *count* = 3 with "image" if you want
* single image flags unpacked into (*x*,*y*,*z*)
* \param data: per-atom values packed in a 1-dimensional array of length
* \param data per-atom values packed in a 1-dimensional array of length
* *natoms* \* *count*.
*
*/
@ -3485,7 +3485,7 @@ or :cpp:func:`lammps_extract_setting`.
Allgather Nlocal atoms from each proc into data
------------------------------------------------------------------------- */
void lammps_gather_atoms_concat(void *handle, const char *name, int type,
void lammps_gather_atoms_concat(void *handle, const char *name, int dtype,
int count, void *data)
{
auto *lmp = (LAMMPS *) handle;
@ -3523,7 +3523,7 @@ void lammps_gather_atoms_concat(void *handle, const char *name, int type,
lmp->memory->create(recvcounts,nprocs,"lib/gather:recvcounts");
lmp->memory->create(displs,nprocs,"lib/gather:displs");
if (type == 0) {
if (dtype == 0) {
int *vector = nullptr;
int **array = nullptr;
const int imgunpack = (count == 3) && (strcmp(name,"image") == 0);
@ -3631,15 +3631,15 @@ x[100][2], x[57][0], x[57][1], x[57][2], x[210][0], :math:`\dots`);
\endverbatim
*
* \param handle: pointer to a previously created LAMMPS instance
* \param name: desired quantity (e.g., *x* or *charge*)
* \param type: 0 for ``int`` values, 1 for ``double`` values
* \param count: number of per-atom values (e.g., 1 for *type* or *charge*,
* \param handle pointer to a previously created LAMMPS instance
* \param name desired quantity (e.g., *x* or *q*)
* \param dtype 0 for ``int`` values, 1 for ``double`` values
* \param count number of per-atom values (e.g., 1 for *type* or *q*,
* 3 for *x* or *f*); use *count* = 3 with "image" if you want
* single image flags unpacked into (*x*,*y*,*z*)
* \param ndata: number of atoms for which to return data (can be all of them)
* \param ids: list of *ndata* atom IDs for which to return data
* \param data: per-atom values packed in a 1-dimensional array of length
* \param ndata number of atoms for which to return data (can be all of them)
* \param ids list of *ndata* atom IDs for which to return data
* \param data per-atom values packed in a 1-dimensional array of length
* *ndata* \* *count*.
*
*/
@ -3651,7 +3651,7 @@ x[100][2], x[57][0], x[57][1], x[57][2], x[210][0], :math:`\dots`);
Allreduce to sum vector into data across all procs
------------------------------------------------------------------------- */
void lammps_gather_atoms_subset(void *handle, const char *name, int type,
void lammps_gather_atoms_subset(void *handle, const char *name, int dtype,
int count, int ndata, int *ids, void *data)
{
auto *lmp = (LAMMPS *) handle;
@ -3686,7 +3686,7 @@ void lammps_gather_atoms_subset(void *handle, const char *name, int type,
// use atom ID to insert each atom's values into copy
// MPI_Allreduce with MPI_SUM to merge into data
if (type == 0) {
if (dtype == 0) {
int *vector = nullptr;
int **array = nullptr;
const int imgunpack = (count == 3) && (strcmp(name,"image") == 0);
@ -3799,9 +3799,9 @@ atom ID (e.g., if *name* is *x* and *count* = 3, then
\endverbatim
*
* \param handle pointer to a previously created LAMMPS instance
* \param name desired quantity (e.g., *x* or *charge*)
* \param type 0 for ``int`` values, 1 for ``double`` values
* \param count number of per-atom values (e.g., 1 for *type* or *charge*,
* \param name desired quantity (e.g., *x* or *q*)
* \param dtype 0 for ``int`` values, 1 for ``double`` values
* \param count number of per-atom values (e.g., 1 for *type* or *q*,
* 3 for *x* or *f*); use *count* = 3 with *image* if you have
* a single image flag packed into (*x*,*y*,*z*) components.
* \param data per-atom values packed in a one-dimensional array of length
@ -3814,7 +3814,7 @@ atom ID (e.g., if *name* is *x* and *count* = 3, then
loop over Natoms, if I own atom ID, set its values from data
------------------------------------------------------------------------- */
void lammps_scatter_atoms(void *handle, const char *name, int type, int count, void *data)
void lammps_scatter_atoms(void *handle, const char *name, int dtype, int count, void *data)
{
auto *lmp = (LAMMPS *) handle;
if (!lmp || !lmp->error || !lmp->atom || !lmp->memory) {
@ -3847,7 +3847,7 @@ void lammps_scatter_atoms(void *handle, const char *name, int type, int count, v
void *vptr = lmp->atom->extract(name);
if (!vptr) lmp->error->all(FLERR, Error::NOLASTLINE, "{}(): unknown property {}", FNERR, name);
if (type == 0) {
if (dtype == 0) {
int *vector = nullptr;
int **array = nullptr;
const int imgpack = (count == 3) && (strcmp(name,"image") == 0);
@ -3935,14 +3935,14 @@ be {1, 100, 57}.
\endverbatim
*
* \param handle: pointer to a previously created LAMMPS instance
* \param name: desired quantity (e.g., *x* or *charge*)
* \param type: 0 for ``int`` values, 1 for ``double`` values
* \param count: number of per-atom values (e.g., 1 for *type* or *charge*,
* \param handle pointer to a previously created LAMMPS instance
* \param name desired quantity (e.g., *x* or *q*)
* \param dtype 0 for ``int`` values, 1 for ``double`` values
* \param count number of per-atom values (e.g., 1 for *dtype* or *q*,
* 3 for *x* or *f*); use *count* = 3 with "image" if you have
* all the image flags packed into (*xyz*)
* \param ndata: number of atoms listed in *ids* and *data* arrays
* \param ids: list of *ndata* atom IDs to scatter data to
* \param ndata number of atoms listed in *ids* and *data* arrays
* \param ids list of *ndata* atom IDs to scatter data to
* \param data per-atom values packed in a 1-dimensional array of length
* *ndata* \* *count*.
*
@ -3953,9 +3953,9 @@ be {1, 100, 57}.
data is ordered by provided atom IDs
no requirement for consecutive atom IDs (1 to N)
see scatter_atoms() to scatter data for all atoms, ordered by consecutive IDs
name = desired quantity (e.g., x or charge)
type = 0 for integer values, 1 for double values
count = # of per-atom values (e.g., 1 for type or charge, 3 for x or f)
name = desired quantity (e.g., x or q)
dtype = 0 for integer values, 1 for double values
count = # of per-atom values (e.g., 1 for type or q, 3 for x or f)
use count = 3 with "image" for xyz to be packed into single image flag
ndata = # of atoms in ids and data (could be all atoms)
ids = list of Ndata atom IDs to scatter data to
@ -3966,7 +3966,7 @@ be {1, 100, 57}.
loop over Ndata, if I own atom ID, set its values from data
------------------------------------------------------------------------- */
void lammps_scatter_atoms_subset(void *handle, const char *name, int type,
void lammps_scatter_atoms_subset(void *handle, const char *name, int dtype,
int count, int ndata, int *ids, void *data)
{
auto *lmp = (LAMMPS *) handle;
@ -3997,7 +3997,7 @@ void lammps_scatter_atoms_subset(void *handle, const char *name, int type,
void *vptr = lmp->atom->extract(name);
if (!vptr) lmp->error->all(FLERR, Error::NOLASTLINE, "{}(): Unknown property {}", FNERR, name);
if (type == 0) {
if (dtype == 0) {
int *vector = nullptr;
int **array = nullptr;
const int imgpack = (count == 3) && (strcmp(name,"image") == 0);
@ -4572,8 +4572,8 @@ given does not have per-atom data.
* data, "c_id" for per-atom compute data, "d_name" or "i_name" for fix
* property/atom vectors with *count* = 1, "d2_name" or "i2_name" for fix
* property/atom vectors with *count* > 1)
* \param type 0 for ``int`` values, 1 for ``double`` values
* \param count number of per-atom values (e.g., 1 for *type* or *charge*, 3 for *x* or *f*);
* \param dtype 0 for ``int`` values, 1 for ``double`` values
* \param count number of per-atom values (e.g., 1 for *type* or *q*, 3 for *x* or *f*);
* use *count* = 3 with *image* if you want the image flags unpacked into
* (*x*,*y*,*z*) components.
* \param data per-atom values packed into a one-dimensional array of length
@ -4593,8 +4593,8 @@ given does not have per-atom data.
"d_name" or "i_name" for fix property/atom vectors with count = 1
"d2_name" or "i2_name" for fix property/atom arrays with count > 1
will return error if fix/compute isn't atom-based
type = 0 for integer values, 1 for double values
count = # of per-atom values (e.g., 1 for type or charge, 3 for x or f)
dtype = 0 for integer values, 1 for double values
count = # of per-atom values (e.g., 1 for type or q, 3 for x or f)
use count = 3 with "image" if want single image flag unpacked into xyz
return atom-based values in 1d data, ordered by count, then by atom ID
(e.g., x[0][0],x[0][1],x[0][2],x[1][0],x[1][1],x[1][2],x[2][0],...)
@ -4606,7 +4606,7 @@ given does not have per-atom data.
Allreduce to sum vector into data across all procs
------------------------------------------------------------------------- */
void lammps_gather(void *handle, const char *name, int type, int count, void *data)
void lammps_gather(void *handle, const char *name, int dtype, int count, void *data)
{
auto *lmp = (LAMMPS *) handle;
if (!lmp || !lmp->error || !lmp->atom || !lmp->memory || !lmp->modify) {
@ -4696,7 +4696,7 @@ void lammps_gather(void *handle, const char *name, int type, int count, void *da
if (idx < 0)
lmp->error->all(FLERR, Error::NOLASTLINE,
"{}(): Could not find custom per-atom property ID {}", FNERR, propid);
if (ltype != type)
if (ltype != dtype)
lmp->error->all(FLERR, Error::NOLASTLINE,
"{}(): Custom per-atom property {} type mismatch", FNERR, propid);
if ((count == 1) && (icol != 0))
@ -4723,7 +4723,7 @@ void lammps_gather(void *handle, const char *name, int type, int count, void *da
// use atom ID to insert each atom's values into copy
// MPI_Allreduce with MPI_SUM to merge into data, ordered by atom ID
if (type==0) {
if (dtype==0) {
int *vector = nullptr;
int **array = nullptr;
@ -4826,16 +4826,16 @@ pre-allocated by the caller to length (*count* :math:`\times` *natoms*), as quer
\endverbatim
*
* \param handle: pointer to a previously created LAMMPS instance
* \param name: desired quantity (e.g., "x" or "f" for atom properties, "f_id" for per-atom fix
* \param handle pointer to a previously created LAMMPS instance
* \param name desired quantity (e.g., "x" or "f" for atom properties, "f_id" for per-atom fix
* data, "c_id" for per-atom compute data, "d_name" or "i_name" for fix
* property/atom vectors with count = 1, "d2_name" or "i2_name" for fix
* property/atom vectors with count > 1)
* \param type: 0 for ``int`` values, 1 for ``double`` values
* \param count: number of per-atom values (e.g., 1 for *type* or *charge*, 3 for *x* or *f*);
* \param dtype 0 for ``int`` values, 1 for ``double`` values
* \param count number of per-atom values (e.g., 1 for *type* or *q*, 3 for *x* or *f*);
* use *count* = 3 with *image* if you want the image flags unpacked into
* (*x*,*y*,*z*) components.
* \param data: per-atom values packed into a one-dimensional array of length
* \param data per-atom values packed into a one-dimensional array of length
* *natoms* \* *count*.
*
*/
@ -4852,8 +4852,8 @@ pre-allocated by the caller to length (*count* :math:`\times` *natoms*), as quer
"d_name" or "i_name" for fix property/atom vectors with count = 1
"d2_name" or "i2_name" for fix property/atom arrays with count > 1
will return error if fix/compute isn't atom-based
type = 0 for integer values, 1 for double values
count = # of per-atom values (e.g., 1 for type or charge, 3 for x or f)
dtype = 0 for integer values, 1 for double values
count = # of per-atom values (e.g., 1 for type or q, 3 for x or f)
use count = 3 with "image" if want single image flag unpacked into xyz
return atom-based values in 1d data, ordered by count, then by atom ID
(e.g., x[0][0],x[0][1],x[0][2],x[1][0],x[1][1],x[1][2],x[2][0],...)
@ -4865,7 +4865,7 @@ pre-allocated by the caller to length (*count* :math:`\times` *natoms*), as quer
Allreduce to sum vector into data across all procs
------------------------------------------------------------------------- */
void lammps_gather_concat(void *handle, const char *name, int type, int count, void *data)
void lammps_gather_concat(void *handle, const char *name, int dtype, int count, void *data)
{
auto *lmp = (LAMMPS *) handle;
if (!lmp || !lmp->error || !lmp->atom || !lmp->memory || !lmp->modify || !lmp->comm) {
@ -4953,7 +4953,7 @@ void lammps_gather_concat(void *handle, const char *name, int type, int count, v
if (idx < 0)
lmp->error->all(FLERR, Error::NOLASTLINE,
"{}(): Could not find custom per-atom property ID {}", FNERR, propid);
if (ltype != type)
if (ltype != dtype)
lmp->error->all(FLERR, Error::NOLASTLINE,
"{}(): Custom per-atom property {} type mismatch", FNERR, propid);
if ((count == 1) && (icol != 0))
@ -4985,7 +4985,7 @@ void lammps_gather_concat(void *handle, const char *name, int type, int count, v
lmp->memory->create(recvcounts,nprocs,"lib/gather:recvcounts");
lmp->memory->create(displs,nprocs,"lib/gather:displs");
if (type == 0) {
if (dtype == 0) {
int *vector = nullptr;
int **array = nullptr;
@ -5093,20 +5093,19 @@ pre-allocated by the caller to length (*count*\ :math:`{}\times{}`\ *ndata*).
\endverbatim
*
* \param handle: pointer to a previously created LAMMPS instance
* \param handle pointer to a previously created LAMMPS instance
* \param name desired quantity (e.g., "x" or "f" for atom properties, "f_id" for per-atom fix
* data, "c_id" for per-atom compute data, "d_name" or "i_name" for fix
* property/atom vectors with *count* = 1, "d2_name" or "i2_name" for fix
* property/atom vectors with *count* > 1)
* \param type 0 for ``int`` values, 1 for ``double`` values
* \param count number of per-atom values (e.g., 1 for *type* or *charge*, 3 for *x* or *f*);
* \param dtype 0 for ``int`` values, 1 for ``double`` values
* \param count number of per-atom values (e.g., 1 for *type* or *q*, 3 for *x* or *f*);
* use *count* = 3 with *image* if you want the image flags unpacked into
* (*x*,*y*,*z*) components.
* \param ndata: number of atoms for which to return data (can be all of them)
* \param ids: list of *ndata* atom IDs for which to return data
* \param ndata number of atoms for which to return data (can be all of them)
* \param ids list of *ndata* atom IDs for which to return data
* \param data per-atom values packed into a one-dimensional array of length
* *ndata* \* *count*.
*
*/
/* ----------------------------------------------------------------------
Contributing author: Thomas Swinburne (CNRS & CINaM, Marseille, France)
@ -5121,8 +5120,8 @@ pre-allocated by the caller to length (*count*\ :math:`{}\times{}`\ *ndata*).
"d_name" or "i_name" for fix property/atom vectors with count = 1
"d2_name" or "i2_name" for fix property/atom arrays with count > 1
will return error if fix/compute isn't atom-based
type = 0 for integer values, 1 for double values
count = # of per-atom values (e.g., 1 for type or charge, 3 for x or f)
dtype = 0 for integer values, 1 for double values
count = # of per-atom values (e.g., 1 for type or q, 3 for x or f)
use count = 3 with "image" if want single image flag unpacked into xyz
return atom-based values in 1d data, ordered by count, then by atom ID
(e.g., x[0][0],x[0][1],x[0][2],x[1][0],x[1][1],x[1][2],x[2][0],...)
@ -5134,7 +5133,7 @@ pre-allocated by the caller to length (*count*\ :math:`{}\times{}`\ *ndata*).
Allreduce to sum vector into data across all procs
------------------------------------------------------------------------- */
void lammps_gather_subset(void *handle, const char *name, int type, int count, int ndata, int *ids,
void lammps_gather_subset(void *handle, const char *name, int dtype, int count, int ndata, int *ids,
void *data)
{
auto *lmp = (LAMMPS *) handle;
@ -5225,7 +5224,7 @@ void lammps_gather_subset(void *handle, const char *name, int type, int count, i
if (idx < 0)
lmp->error->all(FLERR, Error::NOLASTLINE,
"{}(): Could not find custom per-atom property ID {}", FNERR, propid);
if (ltype != type)
if (ltype != dtype)
lmp->error->all(FLERR, Error::NOLASTLINE,
"{}(): Custom per-atom property {} type mismatch", FNERR, propid);
if ((count == 1) && (icol != 0))
@ -5253,7 +5252,7 @@ void lammps_gather_subset(void *handle, const char *name, int type, int count, i
// use atom ID to insert each atom's values into copy
// MPI_Allreduce with MPI_SUM to merge into data
if (type == 0) {
if (dtype == 0) {
int *vector = nullptr;
int **array = nullptr;
const int imgunpack = (count == 3) && (strcmp(name,"image") == 0);
@ -5370,8 +5369,8 @@ x[1][2], x[2][0], :math:`\dots`}); *data* must be of length (*count* :math:`\tim
* data, "c_id" for per-atom compute data, "d_name" or "i_name" for fix
* property/atom vectors with *count* = 1, "d2_name" or "i2_name" for fix
* property/atom vectors with *count* > 1)
* \param type 0 for ``int`` values, 1 for ``double`` values
* \param count number of per-atom values (e.g., 1 for *type* or *charge*,
* \param dtype 0 for ``int`` values, 1 for ``double`` values
* \param count number of per-atom values (e.g., 1 for *type* or *q*,
* 3 for *x* or *f*); use *count* = 3 with *image* if you have
* a single image flag packed into (*x*,*y*,*z*) components.
* \param data per-atom values packed in a one-dimensional array of length
@ -5389,8 +5388,8 @@ x[1][2], x[2][0], :math:`\dots`}); *data* must be of length (*count* :math:`\tim
"d_name" or "i_name" for fix property/atom vectors with count = 1
"d2_name" or "i2_name" for fix property/atom arrays with count > 1
will return error if fix/compute isn't atom-based
type = 0 for integer values, 1 for double values
count = # of per-atom values (e.g., 1 for type or charge, 3 for x or f)
dtype = 0 for integer values, 1 for double values
count = # of per-atom values (e.g., 1 for type or q, 3 for x or f)
use count = 3 with "image" if want single image flag unpacked into xyz
return atom-based values in 1d data, ordered by count, then by atom ID
(e.g., x[0][0],x[0][1],x[0][2],x[1][0],x[1][1],x[1][2],x[2][0],...)
@ -5402,7 +5401,7 @@ x[1][2], x[2][0], :math:`\dots`}); *data* must be of length (*count* :math:`\tim
Allreduce to sum vector into data across all procs
------------------------------------------------------------------------- */
void lammps_scatter(void *handle, const char *name, int type, int count, void *data)
void lammps_scatter(void *handle, const char *name, int dtype, int count, void *data)
{
auto *lmp = (LAMMPS *) handle;
if (!lmp || !lmp->error || !lmp->atom || !lmp->memory || !lmp->modify || !lmp->comm) {
@ -5495,7 +5494,7 @@ void lammps_scatter(void *handle, const char *name, int type, int count, void *d
if (idx < 0)
lmp->error->all(FLERR, Error::NOLASTLINE,
"{}(): Could not find custom per-atom property ID {}", FNERR, propid);
if (ltype != type)
if (ltype != dtype)
lmp->error->all(FLERR, Error::NOLASTLINE,
"{}(): Custom per-atom property {} type mismatch", FNERR, propid);
if ((count == 1) && (icol != 0))
@ -5518,7 +5517,7 @@ void lammps_scatter(void *handle, const char *name, int type, int count, void *d
if (!vptr) lmp->error->all(FLERR, Error::NOLASTLINE, "{}(): Unknown property {}", name);
if (type == 0) {
if (dtype == 0) {
int *vector = nullptr;
int **array = nullptr;
const int imgpack = (count == 3) && (strcmp(name,"image") == 0);
@ -5606,17 +5605,17 @@ be {1, 100, 57}.
\endverbatim
*
* \param handle: pointer to a previously created LAMMPS instance
* \param handle pointer to a previously created LAMMPS instance
* \param name desired quantity (e.g., "x" or "f" for atom properties, "f_id" for per-atom fix
* data, "c_id" for per-atom compute data, "d_name" or "i_name" for fix
* property/atom vectors with *count* = 1, "d2_name" or "i2_name" for fix
* property/atom vectors with *count* > 1)
* \param type: 0 for ``int`` values, 1 for ``double`` values
* \param count: number of per-atom values (e.g., 1 for *type* or *charge*,
* \param dtype 0 for ``int`` values, 1 for ``double`` values
* \param count number of per-atom values (e.g., 1 for *type* or *q*,
* 3 for *x* or *f*); use *count* = 3 with "image" if you want
* single image flags unpacked into (*x*,*y*,*z*)
* \param ndata: number of atoms listed in *ids* and *data* arrays
* \param ids: list of *ndata* atom IDs to scatter data to
* \param ndata number of atoms listed in *ids* and *data* arrays
* \param ids list of *ndata* atom IDs to scatter data to
* \param data per-atom values packed in a 1-dimensional array of length
* *ndata* \* *count*.
*
@ -5631,8 +5630,8 @@ be {1, 100, 57}.
"d_name" or "i_name" for fix property/atom quantities
"f_fix", "c_compute" for fixes / computes
will return error if fix/compute doesn't isn't atom-based
type = 0 for integer values, 1 for double values
count = # of per-atom values (e.g., 1 for type or charge, 3 for x or f)
dtype = 0 for integer values, 1 for double values
count = # of per-atom values (e.g., 1 for type or q, 3 for x or f)
use count = 3 with "image" for xyz to be packed into single image flag
ndata = # of atoms in ids and data (could be all atoms)
ids = list of Ndata atom IDs to scatter data to
@ -5643,7 +5642,7 @@ be {1, 100, 57}.
loop over Ndata, if I own atom ID, set its values from data
------------------------------------------------------------------------- */
void lammps_scatter_subset(void *handle, const char *name, int type, int count, int ndata,
void lammps_scatter_subset(void *handle, const char *name, int dtype, int count, int ndata,
int *ids, void *data)
{
auto *lmp = (LAMMPS *) handle;
@ -5733,7 +5732,7 @@ void lammps_scatter_subset(void *handle, const char *name, int type, int count,
if (idx < 0)
lmp->error->all(FLERR, Error::NOLASTLINE,
"{}(): Could not find custom per-atom property ID {}", FNERR, propid);
if (ltype != type)
if (ltype != dtype)
lmp->error->all(FLERR, Error::NOLASTLINE,
"{}(): Custom per-atom property {} type mismatch", FNERR, propid);
if ((count == 1) && (icol != 0))
@ -5756,7 +5755,7 @@ void lammps_scatter_subset(void *handle, const char *name, int type, int count,
if (!vptr) lmp->error->all(FLERR, Error::NOLASTLINE, "{}(): Unknown property {}", name);
if (type == 0) {
if (dtype == 0) {
int *vector = nullptr;
int **array = nullptr;
const int imgpack = (count == 3) && (strcmp(name,"image") == 0);

View File

@ -1 +1,2 @@
#define LAMMPS_VERSION "2 Apr 2025"
#define LAMMPS_UPDATE "Development"

View File

@ -1,6 +1,6 @@
cmake_minimum_required(VERSION 3.16)
project(lammps-gui VERSION 1.6.12 LANGUAGES CXX)
project(lammps-gui VERSION 1.6.13 LANGUAGES CXX)
set(CMAKE_AUTOUIC ON)
set(CMAKE_AUTOMOC ON)

View File

@ -15,6 +15,8 @@ LAMMPS-GUI TODO list:
colors to individual atom types.
- Support color by property (e.g. scan computes or fixes with per-atom data), define colormaps etc.
- Add a "Diameters" dialog where diamaters can by specified by atom type
- figure out how widgets can be resized to fraction of available screen size.
- figure out stacking order of frames and whether it can be more flexible
- implement indenting regions for (nested) loops?
- implement data file manager GUI with the following features:

View File

@ -55,6 +55,12 @@
</provides>
<releases>
<release version="1.6.13" timestamp="1743734509">
<description>
Change working directory to user's home dir if initial directory is "/" or the Application folder
Add preferences option to set https proxy, if not already set via environment variable
</description>
</release>
<release version="1.6.12" timestamp="1734890080">
<description>
Update Tutorial menu entries to cover all 8 tutorials

View File

@ -389,6 +389,11 @@ LammpsGui::LammpsGui(QWidget *parent, const QString &filename) :
ui->textEdit->setReformatOnReturn(settings.value("return", false).toBool());
ui->textEdit->setAutoComplete(settings.value("automatic", true).toBool());
settings.endGroup();
// apply https proxy setting: prefer environment variable or fall back to preferences value
auto https_proxy = QString::fromLocal8Bit(qgetenv("https_proxy"));
if (https_proxy.isEmpty()) https_proxy = settings.value("https_proxy", "").toString();
if (!https_proxy.isEmpty()) lammps.command(QString("shell putenv https_proxy=") + https_proxy);
}
LammpsGui::~LammpsGui()
@ -1238,6 +1243,11 @@ void LammpsGui::do_run(bool use_buffer)
runner->setup_run(&lammps, nullptr, fname);
}
// apply https proxy setting: prefer environment variable or fall back to preferences value
auto https_proxy = QString::fromLocal8Bit(qgetenv("https_proxy"));
if (https_proxy.isEmpty()) https_proxy = settings.value("https_proxy", "").toString();
if (!https_proxy.isEmpty()) lammps.command(QString("shell putenv https_proxy=") + https_proxy);
connect(runner, &LammpsRunner::resultReady, this, &LammpsGui::run_done);
connect(runner, &LammpsRunner::finished, runner, &QObject::deleteLater);
runner->start();
@ -2020,9 +2030,13 @@ void LammpsGui::setup_tutorial(int tutno, const QString &dir, bool purgedir, boo
lammps.command("clear");
lammps.command(QString("shell cd " + dir));
// apply https proxy setting: prefer environment variable or fall back to preferences value
auto https_proxy = QString::fromLocal8Bit(qgetenv("https_proxy"));
if (https_proxy.isEmpty()) https_proxy = QSettings().value("https_proxy", "").toString();
if (!https_proxy.isEmpty()) lammps.command(QString("shell putenv https_proxy=") + https_proxy);
// download and process manifest for selected tutorial
// must check for error after download, e.g. when there is no network.
lammps.command(geturl.arg(tutno).arg(".manifest"));
if (lammps.has_error()) {
lammps.get_last_error_message(errorbuf, BUFLEN);

View File

@ -174,6 +174,9 @@ void Preferences::accept()
spin = tabWidget->findChild<QSpinBox *>("updchart");
if (spin) settings->setValue("updchart", spin->value());
field = tabWidget->findChild<QLineEdit *>("proxyval");
if (field) settings->setValue("https_proxy", field->text());
if (need_relaunch) {
QMessageBox msg(QMessageBox::Information, QString("Relaunching LAMMPS-GUI"),
QString("LAMMPS library plugin path was changed.\n"
@ -262,7 +265,7 @@ GeneralTab::GeneralTab(QSettings *_settings, LammpsWrapper *_lammps, QWidget *pa
connect(getallfont, &QPushButton::released, this, &GeneralTab::newallfont);
connect(gettextfont, &QPushButton::released, this, &GeneralTab::newtextfont);
auto *freqlabel = new QLabel("Data update interval (ms)");
auto *freqlabel = new QLabel("Data update interval (ms):");
auto *freqval = new QSpinBox;
freqval->setRange(1, 1000);
freqval->setStepType(QAbstractSpinBox::AdaptiveDecimalStepType);
@ -271,7 +274,7 @@ GeneralTab::GeneralTab(QSettings *_settings, LammpsWrapper *_lammps, QWidget *pa
gridlayout->addWidget(freqlabel, 1, 0);
gridlayout->addWidget(freqval, 1, 1);
auto *chartlabel = new QLabel("Charts update interval (ms)");
auto *chartlabel = new QLabel("Charts update interval (ms):");
auto *chartval = new QSpinBox;
chartval->setRange(1, 5000);
chartval->setStepType(QAbstractSpinBox::AdaptiveDecimalStepType);
@ -280,6 +283,19 @@ GeneralTab::GeneralTab(QSettings *_settings, LammpsWrapper *_lammps, QWidget *pa
gridlayout->addWidget(chartlabel, 2, 0);
gridlayout->addWidget(chartval, 2, 1);
auto *proxylabel = new QLabel("HTTPS proxy setting (empty for no proxy):");
gridlayout->addWidget(proxylabel, 3, 0);
auto https_proxy = QString::fromLocal8Bit(qgetenv("https_proxy"));
if (https_proxy.isEmpty()) {
https_proxy = settings->value("https_proxy", "").toString();
auto *proxyedit = new QLineEdit(https_proxy);
proxyedit->setObjectName("proxyval");
gridlayout->addWidget(proxyedit, 3, 1);
} else {
gridlayout->addWidget(new QLabel(https_proxy), 3, 1);
}
layout->addWidget(echo);
layout->addWidget(cite);
layout->addWidget(logv);

View File

@ -5,7 +5,6 @@
fun:malloc
fun:strdup
...
fun:_ZN7testing8UnitTest3RunEv
}
{
Run_register_state_1
@ -14,7 +13,6 @@
fun:malloc
fun:register_state
...
fun:_ZN7testing8TestSuite3RunEv.part.0
}
{
Run_register_state_2
@ -23,5 +21,4 @@
fun:malloc
fun:register_state
...
fun:_ZN7testing8TestSuite3RunEv
}

View File

@ -0,0 +1,17 @@
{
Kokkos_OpenMP_init1
Memcheck:Leak
match-leak-kinds: reachable
fun:*
fun:_ZNK6Kokkos9HostSpace13impl_allocateEPKcmm28Kokkos_Profiling_SpaceHandle
fun:_ZNK6Kokkos9HostSpace8allocateEPKcmm
fun:_ZN6Kokkos4Impl14OpenMPInternal18resize_thread_dataEmmmm
fun:_ZN6Kokkos4Impl14OpenMPInternal10initializeEi
fun:_ZN6Kokkos4Impl16ExecSpaceManager17initialize_spacesERKNS_22InitializationSettingsE
fun:initialize_backends
fun:initialize_internal
fun:_ZN6Kokkos10initializeERKNS_22InitializationSettingsE
fun:_ZN9LAMMPS_NS9KokkosLMPC1EPNS_6LAMMPSEiPPc
...
}

140
tools/valgrind/LLVM.supp Normal file
View File

@ -0,0 +1,140 @@
{
LLVM_addOption1
Memcheck:Leak
match-leak-kinds: reachable
fun:*
fun:*
fun:Allocate
...
fun:insert
...
fun:forEachSubCommand
fun:addOption
...
fun:call_init
fun:call_init
fun:_dl_init
obj:*
obj:*
obj:*
obj:*
}
{
LLVM_addOption2
Memcheck:Leak
match-leak-kinds: reachable
fun:*
fun:*
fun:Allocate
...
fun:insert
...
fun:call_init
fun:call_init
fun:_dl_init
fun:forEachSubCommand
fun:addOption
...
fun:call_init
fun:call_init
fun:_dl_init
obj:*
obj:*
obj:*
obj:*
obj:*
}
{
LLVM_addOption3
Memcheck:Leak
match-leak-kinds: reachable
fun:calloc
fun:safe_calloc
fun:insert
...
fun:forEachSubCommand
fun:addOption
...
fun:call_init
fun:call_init
fun:_dl_init
obj:*
obj:*
obj:*
}
{
LLVM_addOption4
Memcheck:Leak
match-leak-kinds: reachable
fun:calloc
fun:safe_calloc
...
fun:insert
...
fun:forEachSubCommand
fun:addOption
...
fun:call_init
fun:call_init
fun:_dl_init
obj:*
obj:*
obj:*
}
{
LLVM_insert1
Memcheck:Leak
match-leak-kinds: reachable
fun:*
fun:*
fun:Allocate
...
fun:insert
...
fun:call_init
fun:call_init
fun:_dl_init
obj:*
obj:*
obj:*
obj:*
obj:*
}
{
LLVM_init1
Memcheck:Leak
match-leak-kinds: reachable
fun:*
fun:call
...
fun:call_init
fun:call_init
fun:_dl_init
obj:*
obj:*
obj:*
obj:*
obj:*
}
{
LLVM_register1
Memcheck:Leak
match-leak-kinds: reachable
fun:*
fun:*
fun:*
fun:*
fun:*
fun:registerCategory
...
fun:Option
...
fun:call_init
fun:call_init
fun:_dl_init
obj:*
obj:*
obj:*
obj:*
obj:*
}

View File

@ -10,7 +10,7 @@
fun:MPIDI_OFI_init_local
...
fun:PMPI_Init
fun:main
...
}
{
MPICH_MPI_init2
@ -25,7 +25,7 @@
fun:MPIDI_OFI_init_local
...
fun:PMPI_Init
fun:main
...
}
{
MPICH_MPI_init3
@ -37,7 +37,7 @@
fun:MPIDI_OFI_init_local
...
fun:PMPI_Init
fun:main
...
}
{
MPICH_MPI_init4
@ -51,7 +51,7 @@
fun:MPIDI_Init.constprop.0
...
fun:PMPI_Init
fun:main
...
}
{
MPICH_MPI_init5
@ -65,7 +65,7 @@
fun:MPID_Init.constprop.0
...
fun:PMPI_Init
fun:main
...
}
{
MPICH_MPI_init6
@ -79,5 +79,45 @@
...
obj:*
fun:PMPI_Init
fun:main
...
}
{
MPICH_MPI_init7
Memcheck:Param
socketcall.sendto(msg)
fun:__libc_send
fun:send
...
fun:psmx3_sep_open
...
fun:PMPI_Init
...
}
{
MPICH_MPI_init8
Memcheck:Param
socketcall.sendto(msg)
fun:__libc_send
fun:send
...
fun:psmx3_sep_close
...
fun:MPID_Finalize
fun:MPII_Finalize
fun:*
fun:*
fun:PMPI_Finalize
...
}
{
MPICH_MPI_init9
Memcheck:Leak
match-leak-kinds: definite
fun:calloc
fun:psmx3_recv_generic
...
fun:MPIDI_OFI_init_local
...
fun:PMPI_Init
...
}

View File

@ -31,7 +31,6 @@
obj:/usr/lib*/libgomp.so.1*
fun:GOMP_parallel
...
fun:main
}
{
OpenMP_init_part3
@ -42,7 +41,6 @@
obj:/usr/lib*/libgomp.so.1*
fun:omp_set_num_threads
...
fun:main
}
{
OpenMP_init_part4
@ -54,7 +52,6 @@
obj:/usr/lib64/libomp.so
fun:omp_set_num_threads
...
fun:_ZN9LAMMPS_NS6LAMMPSC1EiPPci
}
{
OpenMP_init_part5
@ -66,7 +63,6 @@
obj:/usr/lib64/libomp.so
fun:omp_set_num_threads
...
fun:main
}
{
OpenMP_init_part6

View File

@ -7,7 +7,7 @@
...
fun:ompi_mpi_init
fun:PMPI_Init
fun:main
...
}
{
OpenMPI_MPI_init2
@ -33,7 +33,7 @@
...
fun:ompi_mpi_init
fun:PMPI_Init
fun:main
...
}
{
OpenMPI_MPI_init4
@ -43,7 +43,7 @@
...
fun:ompi_mpi_init
fun:PMPI_Init
fun:main
...
}
{
OpenMPI_MPI_init5
@ -68,7 +68,7 @@
fun:opal_progress
fun:ompi_mpi_init
fun:PMPI_Init
fun:main
...
}
{
OpenMPI_MPI_init7

View File

@ -5,15 +5,34 @@ and fixing real issues. When using CMake, these are automatically included
when running "ctest -T memcheck". To manually add them to do a memory check
on running LAMMPS, use a command line like following:
valgrind --show-leak-kinds=all --track-origins=yes \
valgrind --leak-check=full --show-leak-kinds=all --track-origins=yes \
--suppressions=/path/to/lammps/tools/valgrind/OpenMP.supp \
--suppressions=/path/to/lammps/tools/valgrind/OpenMPI.supp \
--suppressions=/path/to/lammps/tools/valgrind/MPICH.supp \
--suppressions=/path/to/lammps/tools/valgrind/LLVM.supp \
--suppressions=/path/to/lammps/tools/valgrind/Python3.supp \
--suppressions=/path/to/lammps/tools/valgrind/GTest.supp \
--suppressions=/path/to/lammps/tools/valgrind/Kokkos.supp \
--suppressions=/path/to/lammps/tools/valgrind/FlexiBLAS.supp \
--suppressions=/path/to/lammps/tools/valgrind/readline.supp \
lmp -in in.melt
Last update: 2022-08-11
Or you can create a file $HOME/.valgrindrc with one option per line:
--leak-check=full
--show-leak-kinds=all
--track-origins=yes
--suppressions=/path/to/lammps/tools/valgrind/OpenMP.supp
--suppressions=/path/to/lammps/tools/valgrind/OpenMPI.supp
--suppressions=/path/to/lammps/tools/valgrind/MPICH.supp
--suppressions=/path/to/lammps/tools/valgrind/LLVM.supp
--suppressions=/path/to/lammps/tools/valgrind/GTest.supp
--suppressions=/path/to/lammps/tools/valgrind/Kokkos.supp
--suppressions=/path/to/lammps/tools/valgrind/FlexiBLAS.supp
--suppressions=/path/to/lammps/tools/valgrind/readline.supp
--suppressions=/path/to/lammps/tools/valgrind/Python3.supp
These options will be automatically added to the valgrind
command line, so it becomes: valgrind lmp -in in.melt
Last update: 2025-04-04