From ed253fcc7470687e36aafdfb98c2b7fe5f5b2969 Mon Sep 17 00:00:00 2001 From: Paul Saxe Date: Wed, 31 Jul 2024 12:45:48 -0400 Subject: [PATCH 1/3] Bugfix and improvements for parallel runs * There was an issue saving the pressure and volume as properties due to a mismatch in the names used. This has been corrected. * Improved how the code determines the number of processors to use for parallel runs, giving salience to the numer of atoms in the system, but limiting to the LAMMPS and global limits on numbers of cores as well as the hardware available. --- HISTORY.rst | 7 +++++++ lammps_step/data/properties.csv | 8 ++++---- lammps_step/lammps.py | 13 +++++-------- lammps_step/metadata.py | 6 +++--- 4 files changed, 19 insertions(+), 15 deletions(-) diff --git a/HISTORY.rst b/HISTORY.rst index f20e647..8264234 100644 --- a/HISTORY.rst +++ b/HISTORY.rst @@ -1,6 +1,13 @@ ======= History ======= +2024.7.31 -- Bugfix and improvements for parallel runs + * There was an issue saving the pressure and volume as properties due to a mismatch + in the names used. This has been corrected. + * Improved how the code determines the number of processors to use for parallel runs, + giving salience to the numer of atoms in the system, but limiting to the LAMMPS and + global limits on numbers of cores as well as the harware available. + 2024.7.25 -- Bugfix and improvements * Bugfix: Fixed issue with the initial seamm.ini file, created if it is missing from the installation. diff --git a/lammps_step/data/properties.csv b/lammps_step/data/properties.csv index ee5e923..0cb4a95 100644 --- a/lammps_step/data/properties.csv +++ b/lammps_step/data/properties.csv @@ -15,10 +15,10 @@ Property,Type,Units,Description,URL "density, stderr#LAMMPS#{model}",float,g/mL,"The standard error of the density.",https://en.wikipedia.org/wiki/Standard_error "density, tau#LAMMPS#{model}",float,fs,"The autocorrelation time of the density.",https://en.wikipedia.org/wiki/Autocorrelation "density, inefficiency#LAMMPS#{model}",float,,"The statistical inefficiency of the density sampling.",https://en.wikipedia.org/wiki/Efficiency_(statistics) -"V#LAMMPS#{model}",float,g/mL,"The volume.",https://en.wikipedia.org/wiki/volume -"V, stderr#LAMMPS#{model}",float,g/mL,"The standard error of the volume.",https://en.wikipedia.org/wiki/Standard_error -"V, tau#LAMMPS#{model}",float,fs,"The autocorrelation time of the volume.",https://en.wikipedia.org/wiki/Autocorrelation -"V, inefficiency#LAMMPS#{model}",float,,"The statistical inefficiency of the volume sampling.",https://en.wikipedia.org/wiki/Efficiency_(statistics) +"volume#LAMMPS#{model}",float,g/mL,"The volume.",https://en.wikipedia.org/wiki/volume +"volume, stderr#LAMMPS#{model}",float,g/mL,"The standard error of the volume.",https://en.wikipedia.org/wiki/Standard_error +"volume, tau#LAMMPS#{model}",float,fs,"The autocorrelation time of the volume.",https://en.wikipedia.org/wiki/Autocorrelation +"volume, inefficiency#LAMMPS#{model}",float,,"The statistical inefficiency of the volume sampling.",https://en.wikipedia.org/wiki/Efficiency_(statistics) "pressure#LAMMPS#{model}",float,atm,"The pressure.",https://en.wikipedia.org/wiki/Pressure "pressure, stderr#LAMMPS#{model}",float,atm,"The standard error of the pressure.",https://en.wikipedia.org/wiki/Standard_error "pressure, tau#LAMMPS#{model}",float,fs,"The autocorrelation time of the pressure.",https://en.wikipedia.org/wiki/Autocorrelation diff --git a/lammps_step/lammps.py b/lammps_step/lammps.py index 0b4a717..b240a4a 100644 --- a/lammps_step/lammps.py +++ b/lammps_step/lammps.py @@ -403,14 +403,11 @@ def run(self): # Whether to run parallel and if so, how many mpi processes if global_options["parallelism"] in ("any", "mpi"): - np = o["ncores"] - if np == "available": - np = global_options["ncores"] - - if np == "available": - np = n_atoms // o["atoms_per_core"] + 1 - else: - np = int(np) + np = n_atoms // o["atoms_per_core"] + 1 + if o["ncores"] != "available": + np = min(np, o["ncores"]) + if global_options["ncores"] != "available": + np = min(np, global_options["ncores"]) else: np = 1 diff --git a/lammps_step/metadata.py b/lammps_step/metadata.py index 8c2c74f..2e182fe 100644 --- a/lammps_step/metadata.py +++ b/lammps_step/metadata.py @@ -162,7 +162,7 @@ ], "description": "V", "dimensionality": "scalar", - "property": "V#LAMMPS#{model}", + "property": "volume#LAMMPS#{model}", "type": "float", "units": "g/ml", }, @@ -170,7 +170,7 @@ "calculation": ["npt"], "description": "stderr of V", "dimensionality": "scalar", - "property": "V, stderr#LAMMPS#{model}", + "property": "volume, stderr#LAMMPS#{model}", "type": "float", "units": "g/ml", }, @@ -178,7 +178,7 @@ "calculation": ["npt"], "description": "autocorrelation time of V", "dimensionality": "scalar", - "property": "V, tau#LAMMPS#{model}", + "property": "volume, tau#LAMMPS#{model}", "type": "float", "units": "fs", }, From 61b893ef5a63a2e252c752e180b1d4aac4566410 Mon Sep 17 00:00:00 2001 From: Paul Saxe Date: Wed, 31 Jul 2024 12:46:14 -0400 Subject: [PATCH 2/3] Bugfix and improvements for parallel runs * There was an issue saving the pressure and volume as properties due to a mismatch in the names used. This has been corrected. * Improved how the code determines the number of processors to use for parallel runs, giving salience to the numer of atoms in the system, but limiting to the LAMMPS and global limits on numbers of cores as well as the hardware available. --- HISTORY.rst | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/HISTORY.rst b/HISTORY.rst index 8264234..f232d64 100644 --- a/HISTORY.rst +++ b/HISTORY.rst @@ -6,7 +6,7 @@ History in the names used. This has been corrected. * Improved how the code determines the number of processors to use for parallel runs, giving salience to the numer of atoms in the system, but limiting to the LAMMPS and - global limits on numbers of cores as well as the harware available. + global limits on numbers of cores as well as the hardware available. 2024.7.25 -- Bugfix and improvements * Bugfix: Fixed issue with the initial seamm.ini file, created if it is missing from From ddaae324e595b80621a790298a57e181ff0e5809 Mon Sep 17 00:00:00 2001 From: Paul Saxe Date: Wed, 31 Jul 2024 12:55:11 -0400 Subject: [PATCH 3/3] Fixed typo --- HISTORY.rst | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/HISTORY.rst b/HISTORY.rst index f232d64..dfa5a1e 100644 --- a/HISTORY.rst +++ b/HISTORY.rst @@ -5,7 +5,7 @@ History * There was an issue saving the pressure and volume as properties due to a mismatch in the names used. This has been corrected. * Improved how the code determines the number of processors to use for parallel runs, - giving salience to the numer of atoms in the system, but limiting to the LAMMPS and + giving salience to the number of atoms in the system, but limiting to the LAMMPS and global limits on numbers of cores as well as the hardware available. 2024.7.25 -- Bugfix and improvements