profile
viewpoint
Axel Kohlmeyer akohlmey Temple University Philadelphia PA http://goo.gl/1wk0

akohlmey/topotools 15

VMD plugin for manipulating topology information

akohlmey/fastermath 9

A library of optimized math functions targeted at 32-bit and 64-bit x86 Linux systems

advinstai/hpc-school2019 7

Repository for the 2nd Latin American School on Parallel Programming for High Performance Computing

akohlmey/tclmpi 6

TclMPI - MPI Bindings for Tcl

akohlmey/lammps 5

Axel Kohlmeyer's development repository of the LAMMPS MD software package

akohlmey/ljmd-c 2

Lennard-Jones MD code in C for teaching purposes

akohlmey/pbctools 2

The VMD PBC tools are Tcl scripts to be used with the VMD software, that allow to handle periodic boundary conditions.

rbberger/lammps-doc-utils 2

Utilities for converting LAMMPS txt docs to Sphinx ReStructuredText

akohlmey/kokkos 0

Kokkos C++ Performance Portability Programming EcoSystem: The Programming Model - Parallel Execution and Memory Abstraction

akohlmey/LATTE 0

Developer repository for the LATTE code

Pull request review commentlammps/lammps

Fix memory leaks and invalid memory access in USER-BOCS

 void FixBocs::init() // NJD MRD 2 functions int FixBocs::read_F_table( char *filename, int p_basis_type ) {-  FILE *fpi;-  int N_columns = 2, n_entries = 0, i;-  float f1, f2;-  int test_sscanf;-  double **data = (double **) calloc(N_columns,sizeof(double *));-  char * line = (char *) calloc(200,sizeof(char));+  DblVector volumeVec;+  DblVector pressureVec;+  std::vector<DblVector> data;    bool badInput = false;-  char badDataMsg[MAX_MESSAGE_LENGTH];-  fpi = fopen(filename,"r");-  if (fpi)-  {-    while (fgets(line,199,fpi)) { ++n_entries; }--    for (i = 0; i < N_columns; ++i)-    {-      data[i] = (double *) calloc(n_entries,sizeof(double));+  int numEntries = 0;+  FILE *fpi = fopen(filename,"r");+  if (fpi) {+    // Old code read the input file twice. Now we simply+    // read all the lines from the input file into a string vector,+    // then work with the data in-memory rather than do a second pass+    // through the file.+    // NB: LAMMPS coding guidelines prefer cstdio so we are intentionally+    // foregoing  reading with getline+    std::string message = fmt::format("INFO: About to read data file: {}", filename);+    error->message(FLERR, message.c_str());++    // Data file lines hold two floating point numbers.+    // Line length we allocate should be long enough without being too long.+    // 128 seems safe for a line we expect to be < 30 chars.+    const int MAX_F_TABLE_LINE_LENGTH = 128;+    char line[MAX_F_TABLE_LINE_LENGTH];+    std::vector<std::string> inputLines;+    while (fgets(line, MAX_F_TABLE_LINE_LENGTH, fpi)) {+      inputLines.push_back(std::string(line));     }+    fclose(fpi);++    numEntries = inputLines.size();+    message = fmt::format("INFO: Read {} lines from file", numEntries);+    error->message(FLERR, message.c_str()); -    // Don't need to re-open the file to make a second pass through it-    // simply rewind to beginning-    rewind(fpi);++    // Initializing the size of vectors is not required.+    // The structures will resize as you push values into them.+    // But for largish data sets where you do know the value,+    // it is more efficient to do one upfront allocation.+    volumeVec.resize(numEntries);+    pressureVec.resize(numEntries);+    data.resize(NUM_INPUT_DATA_COLUMNS);+    data[VOLUME] = volumeVec;+    data[PRESSURE_CORRECTION] = pressureVec;      double stdVolumeInterval = 0.0;     double currVolumeInterval = 0.0;     // When comparing doubles/floats, we need an Epsilon.     // The literature indicates getting this value right in the     // general case can be pretty complicated. I don't think it     // needs to be complicated here, though. At least based on the-    // sample data I've seen where the volume values are fairly-    // large.+    // sample data I've seen where the volume values are fairly large.     const double volumeIntervalTolerance = 0.001;-    n_entries = 0;-    while( fgets(line,199,fpi)) {-      ++n_entries;-      test_sscanf = sscanf(line," %f , %f ",&f1, &f2);+    int lineNum = 0;  // this value is only for  message+    int numBadVolumeIntervals = 0; // count these for message+    float f1, f2;+    int test_sscanf;+    for (int i = 0; i < inputLines.size(); ++i) {+      lineNum++;  // count each line processed now so lineNum messages can be 1-based+      test_sscanf = sscanf(inputLines.at(i).c_str()," %f , %f ",&f1, &f2);

Yes, the refactoring of the file reading can wait.

eagunn

comment created time in 5 hours

Pull request review commentlammps/lammps

Fix memory leaks and invalid memory access in USER-BOCS

 void FixBocs::init() // NJD MRD 2 functions int FixBocs::read_F_table( char *filename, int p_basis_type ) {-  FILE *fpi;-  int N_columns = 2, n_entries = 0, i;-  float f1, f2;-  int test_sscanf;-  double **data = (double **) calloc(N_columns,sizeof(double *));-  char * line = (char *) calloc(200,sizeof(char));+  DblVector volumeVec;+  DblVector pressureVec;+  std::vector<DblVector> data;    bool badInput = false;-  char badDataMsg[MAX_MESSAGE_LENGTH];-  fpi = fopen(filename,"r");-  if (fpi)-  {-    while (fgets(line,199,fpi)) { ++n_entries; }--    for (i = 0; i < N_columns; ++i)-    {-      data[i] = (double *) calloc(n_entries,sizeof(double));+  int numEntries = 0;+  FILE *fpi = fopen(filename,"r");+  if (fpi) {+    // Old code read the input file twice. Now we simply+    // read all the lines from the input file into a string vector,+    // then work with the data in-memory rather than do a second pass+    // through the file.+    // NB: LAMMPS coding guidelines prefer cstdio so we are intentionally+    // foregoing  reading with getline+    std::string message = fmt::format("INFO: About to read data file: {}", filename);+    error->message(FLERR, message.c_str());++    // Data file lines hold two floating point numbers.+    // Line length we allocate should be long enough without being too long.+    // 128 seems safe for a line we expect to be < 30 chars.+    const int MAX_F_TABLE_LINE_LENGTH = 128;+    char line[MAX_F_TABLE_LINE_LENGTH];+    std::vector<std::string> inputLines;+    while (fgets(line, MAX_F_TABLE_LINE_LENGTH, fpi)) {+      inputLines.push_back(std::string(line));     }+    fclose(fpi);++    numEntries = inputLines.size();+    message = fmt::format("INFO: Read {} lines from file", numEntries);+    error->message(FLERR, message.c_str()); -    // Don't need to re-open the file to make a second pass through it-    // simply rewind to beginning-    rewind(fpi);++    // Initializing the size of vectors is not required.+    // The structures will resize as you push values into them.+    // But for largish data sets where you do know the value,+    // it is more efficient to do one upfront allocation.+    volumeVec.resize(numEntries);+    pressureVec.resize(numEntries);+    data.resize(NUM_INPUT_DATA_COLUMNS);+    data[VOLUME] = volumeVec;+    data[PRESSURE_CORRECTION] = pressureVec;      double stdVolumeInterval = 0.0;     double currVolumeInterval = 0.0;     // When comparing doubles/floats, we need an Epsilon.     // The literature indicates getting this value right in the     // general case can be pretty complicated. I don't think it     // needs to be complicated here, though. At least based on the-    // sample data I've seen where the volume values are fairly-    // large.+    // sample data I've seen where the volume values are fairly large.     const double volumeIntervalTolerance = 0.001;-    n_entries = 0;-    while( fgets(line,199,fpi)) {-      ++n_entries;-      test_sscanf = sscanf(line," %f , %f ",&f1, &f2);+    int lineNum = 0;  // this value is only for  message+    int numBadVolumeIntervals = 0; // count these for message+    float f1, f2;+    int test_sscanf;+    for (int i = 0; i < inputLines.size(); ++i) {+      lineNum++;  // count each line processed now so lineNum messages can be 1-based+      test_sscanf = sscanf(inputLines.at(i).c_str()," %f , %f ",&f1, &f2);       if (test_sscanf == 2)       {-        data[0][n_entries-1] = (double) f1;-        data[1][n_entries-1] = (double) f2;-        if (n_entries == 2) {-          stdVolumeInterval = data[0][n_entries-1] - data[0][n_entries-2];+        //message = fmt::format("INFO: f1 = {}, f2 = {}", f1, f2);+        //error->message(FLERR,message.c_str());+        data[VOLUME][i] = (double)f1;+        data[PRESSURE_CORRECTION][i] = (double)f2;+        if (i == 1)+        {+          // second entry is used to compute the validation interval used below+          stdVolumeInterval = data[VOLUME][i] - data[VOLUME][i-1];+          //message = fmt::format("INFO: standard volume interval computed: {}", stdVolumeInterval);+          //error->message(FLERR,message.c_str());         }-        else if (n_entries > 2) {-          currVolumeInterval = data[0][n_entries-1] - data[0][n_entries-2];+        else if (i > 1)+        {+          // after second entry, all intervals are validated+          currVolumeInterval = data[VOLUME][i] - data[VOLUME][i-1];+          //message = fmt::format("INFO: current volume interval: {}", currVolumeInterval);+          //error->message(FLERR,message.c_str());           if (fabs(currVolumeInterval - stdVolumeInterval) > volumeIntervalTolerance) {-            snprintf(badDataMsg,MAX_MESSAGE_LENGTH,-                     "BAD VOLUME INTERVAL: spline analysis requires uniform"-                     " volume distribution, found inconsistent volume"-                     " differential, line %d of file %s\n\tline: %s",-                     n_entries,filename,line);-            error->message(FLERR,badDataMsg);+            message = fmt::format("ERROR: Bad volume interval. Spline analysis requires uniform"+                    " volume distribution, found inconsistent volume"+                    " differential, line {} of file {}\n\tline: {}",+                    lineNum,filename,inputLines.at(i).c_str());+            error->message(FLERR,message.c_str());             badInput = true;+            numBadVolumeIntervals++;           }+          // no concluding else is intentional: i = 0, first line, no interval to validate         }-        // no else -- first entry is simply ignored       }       else       {-        snprintf(badDataMsg,MAX_MESSAGE_LENGTH,-                 "BAD INPUT FORMAT: did not find 2 comma separated numeric"-                 " values in line %d of file %s\n\tline: %s",-                 n_entries,filename,line);-        error->message(FLERR,badDataMsg);+        message = fmt::format("ERROR: Bad input format: did not find 2 comma separated numeric"+                 " values in line {} of file {}\n\tline: {}",+                 lineNum, filename, inputLines.at(i).c_str());+        error->message(FLERR,message.c_str());         badInput = true;       }+      if (badInput)+      {+        numBadVolumeIntervals++;+      }+    }++    if (numBadVolumeIntervals) {+      message = fmt::format("INFO: total number bad volume intervals = {}", numBadVolumeIntervals);+      error->message(FLERR,message.c_str());     }-    fclose(fpi);   }   else {-    char errmsg[MAX_MESSAGE_LENGTH];-    snprintf(errmsg,MAX_MESSAGE_LENGTH,"Unable to open file: %s\n",filename);-    error->all(FLERR,errmsg);+    std::string errmsg = fmt::format("ERROR: Unable to open file: {}", filename);+    error->all(FLERR,errmsg.c_str());   }    if (badInput) {-    char errmsg[MAX_MESSAGE_LENGTH];-    snprintf(errmsg,MAX_MESSAGE_LENGTH,-             "Bad volume / pressure-correction data: %s\nSee details above",filename);-    error->all(FLERR,errmsg);+    std::string errmsg = fmt::format("Bad volume / pressure-correction data: {}\nSee details above", filename);+    error->message(FLERR,errmsg.c_str());   } -  if (p_basis_type == 1)+  if (p_basis_type == BASIS_LINEAR_SPLINE)

Had another look and found some more stuff that is not quite the way it is commonly done in LAMMPS.

eagunn

comment created time in 5 hours

Pull request review commentlammps/lammps

Fix memory leaks and invalid memory access in USER-BOCS

 void FixBocs::init() // NJD MRD 2 functions int FixBocs::read_F_table( char *filename, int p_basis_type ) {-  FILE *fpi;-  int N_columns = 2, n_entries = 0, i;-  float f1, f2;-  int test_sscanf;-  double **data = (double **) calloc(N_columns,sizeof(double *));-  char * line = (char *) calloc(200,sizeof(char));-+  double **data;   bool badInput = false;-  char badDataMsg[MAX_MESSAGE_LENGTH];-  fpi = fopen(filename,"r");-  if (fpi)-  {-    while (fgets(line,199,fpi)) { ++n_entries; }--    for (i = 0; i < N_columns; ++i)-    {-      data[i] = (double *) calloc(n_entries,sizeof(double));+  int numEntries = 0;+  FILE *fpi = fopen(filename,"r");+  if (fpi) {+    // Old code read the input file twice. Now we simply+    // read all the lines from the input file into a string vector,+    // then work with the data in-memory rather than do a second pass+    // through the file.+    // NB: LAMMPS coding guidelines prefer cstdio so we are intentionally+    // foregoing  reading with getline+    std::string message = fmt::format("INFO: About to read data file: {}", filename);+    error->message(FLERR, message);++    // Data file lines hold two floating point numbers.+    // Line length we allocate should be long enough without being too long.+    // 128 seems safe for a line we expect to be < 30 chars.+    const int MAX_F_TABLE_LINE_LENGTH = 128;+    char line[MAX_F_TABLE_LINE_LENGTH];+    std::vector<std::string> inputLines;+    while (fgets(line, MAX_F_TABLE_LINE_LENGTH, fpi)) {+      inputLines.push_back(std::string(line));     }+    fclose(fpi); -    // Don't need to re-open the file to make a second pass through it-    // simply rewind to beginning-    rewind(fpi);+    numEntries = inputLines.size();+    message = fmt::format("INFO: Read {} lines from file", numEntries);+    error->message(FLERR, message);++    // Allocate memory for the two dimensional matrix+    // that holds data from the input file.+    memory->create(data, NUM_INPUT_DATA_COLUMNS, numEntries, "data");      double stdVolumeInterval = 0.0;     double currVolumeInterval = 0.0;     // When comparing doubles/floats, we need an Epsilon.     // The literature indicates getting this value right in the     // general case can be pretty complicated. I don't think it     // needs to be complicated here, though. At least based on the-    // sample data I've seen where the volume values are fairly-    // large.+    // sample data I've seen where the volume values are fairly large.     const double volumeIntervalTolerance = 0.001;-    n_entries = 0;-    while( fgets(line,199,fpi)) {-      ++n_entries;-      test_sscanf = sscanf(line," %f , %f ",&f1, &f2);+    int lineNum = 0;  // this value is only for  message+    int numBadVolumeIntervals = 0; // count these for message+    float f1, f2;+    int test_sscanf;+    for (int i = 0; i < inputLines.size(); ++i) {+      lineNum++;  // count each line processed now so lineNum messages can be 1-based+      test_sscanf = sscanf(inputLines.at(i).c_str()," %f , %f ",&f1, &f2);       if (test_sscanf == 2)       {-        data[0][n_entries-1] = (double) f1;-        data[1][n_entries-1] = (double) f2;-        if (n_entries == 2) {-          stdVolumeInterval = data[0][n_entries-1] - data[0][n_entries-2];+        //message = fmt::format("INFO: f1 = {}, f2 = {}", f1, f2);+        //error->message(FLERR,message);+        data[VOLUME][i] = (double)f1;+        data[PRESSURE_CORRECTION][i] = (double)f2;+        if (i == 1)+        {+          // second entry is used to compute the validation interval used below+          stdVolumeInterval = data[VOLUME][i] - data[VOLUME][i-1];+          //message = fmt::format("INFO: standard volume interval computed: {}", stdVolumeInterval);+          //error->message(FLERR,message);         }-        else if (n_entries > 2) {-          currVolumeInterval = data[0][n_entries-1] - data[0][n_entries-2];+        else if (i > 1)+        {+          // after second entry, all intervals are validated+          currVolumeInterval = data[VOLUME][i] - data[VOLUME][i-1];+          //message = fmt::format("INFO: current volume interval: {}", currVolumeInterval);+          //error->message(FLERR,message);           if (fabs(currVolumeInterval - stdVolumeInterval) > volumeIntervalTolerance) {-            snprintf(badDataMsg,MAX_MESSAGE_LENGTH,-                     "BAD VOLUME INTERVAL: spline analysis requires uniform"-                     " volume distribution, found inconsistent volume"-                     " differential, line %d of file %s\n\tline: %s",-                     n_entries,filename,line);-            error->message(FLERR,badDataMsg);+            message = fmt::format("ERROR: Bad volume interval. Spline analysis requires uniform"+                    " volume distribution, found inconsistent volume"+                    " differential, line {} of file {}\n\tline: {}",+                    lineNum,filename,inputLines.at(i));+            error->message(FLERR,message);             badInput = true;+            numBadVolumeIntervals++;           }+          // no concluding else is intentional: i = 0, first line, no interval to validate         }-        // no else -- first entry is simply ignored       }       else       {-        snprintf(badDataMsg,MAX_MESSAGE_LENGTH,-                 "BAD INPUT FORMAT: did not find 2 comma separated numeric"-                 " values in line %d of file %s\n\tline: %s",-                 n_entries,filename,line);-        error->message(FLERR,badDataMsg);+        message = fmt::format("ERROR: Bad input format: did not find 2 comma separated numeric"+                 " values in line {} of file {}\n\tline: {}",+                 lineNum, filename, inputLines.at(i));+        error->message(FLERR,message);         badInput = true;       }+      if (badInput)+      {+        numBadVolumeIntervals++;+      }+    }++    if (numBadVolumeIntervals) {+      message = fmt::format("INFO: total number bad volume intervals = {}", numBadVolumeIntervals);+      error->message(FLERR,message);

please see my other comments about messages printed to the screen. In this case, actually removing the "INFO" tag and using message->warning() would be more appropriate.

eagunn

comment created time in 5 hours

Pull request review commentlammps/lammps

Fix memory leaks and invalid memory access in USER-BOCS

 void FixBocs::init() // NJD MRD 2 functions int FixBocs::read_F_table( char *filename, int p_basis_type ) {-  FILE *fpi;-  int N_columns = 2, n_entries = 0, i;-  float f1, f2;-  int test_sscanf;-  double **data = (double **) calloc(N_columns,sizeof(double *));-  char * line = (char *) calloc(200,sizeof(char));-+  double **data;   bool badInput = false;-  char badDataMsg[MAX_MESSAGE_LENGTH];-  fpi = fopen(filename,"r");-  if (fpi)-  {-    while (fgets(line,199,fpi)) { ++n_entries; }--    for (i = 0; i < N_columns; ++i)-    {-      data[i] = (double *) calloc(n_entries,sizeof(double));+  int numEntries = 0;+  FILE *fpi = fopen(filename,"r");+  if (fpi) {+    // Old code read the input file twice. Now we simply+    // read all the lines from the input file into a string vector,+    // then work with the data in-memory rather than do a second pass+    // through the file.+    // NB: LAMMPS coding guidelines prefer cstdio so we are intentionally+    // foregoing  reading with getline+    std::string message = fmt::format("INFO: About to read data file: {}", filename);+    error->message(FLERR, message);++    // Data file lines hold two floating point numbers.+    // Line length we allocate should be long enough without being too long.+    // 128 seems safe for a line we expect to be < 30 chars.+    const int MAX_F_TABLE_LINE_LENGTH = 128;+    char line[MAX_F_TABLE_LINE_LENGTH];+    std::vector<std::string> inputLines;+    while (fgets(line, MAX_F_TABLE_LINE_LENGTH, fpi)) {+      inputLines.push_back(std::string(line));     }+    fclose(fpi); -    // Don't need to re-open the file to make a second pass through it-    // simply rewind to beginning-    rewind(fpi);+    numEntries = inputLines.size();+    message = fmt::format("INFO: Read {} lines from file", numEntries);+    error->message(FLERR, message);++    // Allocate memory for the two dimensional matrix+    // that holds data from the input file.+    memory->create(data, NUM_INPUT_DATA_COLUMNS, numEntries, "data");      double stdVolumeInterval = 0.0;     double currVolumeInterval = 0.0;     // When comparing doubles/floats, we need an Epsilon.     // The literature indicates getting this value right in the     // general case can be pretty complicated. I don't think it     // needs to be complicated here, though. At least based on the-    // sample data I've seen where the volume values are fairly-    // large.+    // sample data I've seen where the volume values are fairly large.     const double volumeIntervalTolerance = 0.001;-    n_entries = 0;-    while( fgets(line,199,fpi)) {-      ++n_entries;-      test_sscanf = sscanf(line," %f , %f ",&f1, &f2);+    int lineNum = 0;  // this value is only for  message+    int numBadVolumeIntervals = 0; // count these for message+    float f1, f2;+    int test_sscanf;+    for (int i = 0; i < inputLines.size(); ++i) {+      lineNum++;  // count each line processed now so lineNum messages can be 1-based+      test_sscanf = sscanf(inputLines.at(i).c_str()," %f , %f ",&f1, &f2);       if (test_sscanf == 2)       {-        data[0][n_entries-1] = (double) f1;-        data[1][n_entries-1] = (double) f2;-        if (n_entries == 2) {-          stdVolumeInterval = data[0][n_entries-1] - data[0][n_entries-2];+        //message = fmt::format("INFO: f1 = {}, f2 = {}", f1, f2);+        //error->message(FLERR,message);+        data[VOLUME][i] = (double)f1;+        data[PRESSURE_CORRECTION][i] = (double)f2;+        if (i == 1)+        {+          // second entry is used to compute the validation interval used below+          stdVolumeInterval = data[VOLUME][i] - data[VOLUME][i-1];+          //message = fmt::format("INFO: standard volume interval computed: {}", stdVolumeInterval);+          //error->message(FLERR,message);         }-        else if (n_entries > 2) {-          currVolumeInterval = data[0][n_entries-1] - data[0][n_entries-2];+        else if (i > 1)+        {+          // after second entry, all intervals are validated+          currVolumeInterval = data[VOLUME][i] - data[VOLUME][i-1];+          //message = fmt::format("INFO: current volume interval: {}", currVolumeInterval);+          //error->message(FLERR,message);           if (fabs(currVolumeInterval - stdVolumeInterval) > volumeIntervalTolerance) {-            snprintf(badDataMsg,MAX_MESSAGE_LENGTH,-                     "BAD VOLUME INTERVAL: spline analysis requires uniform"-                     " volume distribution, found inconsistent volume"-                     " differential, line %d of file %s\n\tline: %s",-                     n_entries,filename,line);-            error->message(FLERR,badDataMsg);+            message = fmt::format("ERROR: Bad volume interval. Spline analysis requires uniform"

Since all MPI ranks seem to be reading the file, this message should only be printed on rank 0. Or the reader should be only run on MPI rank 0 and then the data needs to be sent to the other MPI ranks with MPI_Bcast().

eagunn

comment created time in 5 hours

Pull request review commentlammps/lammps

Fix memory leaks and invalid memory access in USER-BOCS

 void FixBocs::build_cubic_splines( double **data )      d[j] = (c[j+1]-c[j])/(3.0 * h[j]);   }-  splines = (double **) calloc(5,sizeof(double *)); -  for ( idx = 0; idx < 5; ++idx)-  {-    splines[idx] = (double *) calloc(n-1,sizeof(double));-  }-  idx = 0;-  for ( idx = 0; idx < n - 1; ++idx)+  memory->create(splines, NUM_CUBIC_SPLINE_COLUMNS, n-1, "splines");+  int numSplines = 0;+  for (int idx = 0; idx < n - 1; ++idx)   {+    splines[0][idx] = data[0][idx];     splines[1][idx] = a[idx];     splines[2][idx] = b[idx];     splines[3][idx] = c[idx];     splines[4][idx] = d[idx];-    splines[0][idx] = data[0][idx];+    numSplines++;

why count here? numSplines would be n-1.

eagunn

comment created time in 5 hours

Pull request review commentlammps/lammps

Fix memory leaks and invalid memory access in USER-BOCS

 void FixBocs::build_cubic_splines( double **data )      d[j] = (c[j+1]-c[j])/(3.0 * h[j]);   }-  splines = (double **) calloc(5,sizeof(double *)); -  for ( idx = 0; idx < 5; ++idx)-  {-    splines[idx] = (double *) calloc(n-1,sizeof(double));-  }-  idx = 0;-  for ( idx = 0; idx < n - 1; ++idx)+  memory->create(splines, NUM_CUBIC_SPLINE_COLUMNS, n-1, "splines");+  int numSplines = 0;+  for (int idx = 0; idx < n - 1; ++idx)   {+    splines[0][idx] = data[0][idx];     splines[1][idx] = a[idx];     splines[2][idx] = b[idx];     splines[3][idx] = c[idx];     splines[4][idx] = d[idx];-    splines[0][idx] = data[0][idx];+    numSplines++;   }++  memory->destroy(a);+  memory->destroy(b);+  memory->destroy(c);+  memory->destroy(d);++  memory->destroy(h);+  memory->destroy(alpha);+  memory->destroy(l);+  memory->destroy(mu);+  memory->destroy(z);++  message = fmt::format("INFO: leaving build_cubic_splines, numSplines = {}", numSplines);+  error->message(FLERR, message);

informational messages should only be printed on MPI ranks where comm->me == 0. Otherwise there are N lines of output when running in parallel with N MPI processes.

eagunn

comment created time in 5 hours

Pull request review commentlammps/lammps

Fix memory leaks and invalid memory access in USER-BOCS

 ComputePressureBocs::~ComputePressureBocs()   delete [] vector;   delete [] vptr;   if (phi_coeff) free(phi_coeff);++  // Any splines data that was sent in from fix_bocs must be+  // freed here, after it has been used.+  memory->destroy(splines);

Since the fix creates the compute, it can delete the splines data after the compute is deleted in the fix destructor.

eagunn

comment created time in 5 hours

Pull request review commentlammps/lammps

Fix memory leaks and invalid memory access in USER-BOCS

 ComputePressureBocs::~ComputePressureBocs()   delete [] vector;   delete [] vptr;   if (phi_coeff) free(phi_coeff);++  // Any splines data that was sent in from fix_bocs must be+  // freed here, after it has been used.+  memory->destroy(splines);

This is very unusual and not a good idea. We need to correct this eventually. If the fix allocates the storage, it should free it. We have an established mechanism to share access with the "extract" function. The compute can use "extract" to retrieve pointers from the fix.

eagunn

comment created time in 5 hours

Pull request review commentlammps/lammps

Fix memory leaks and invalid memory access in USER-BOCS

 double ComputePressureBocs::find_index(double * grid, double value)    if (value >= grid[i] && value <= (grid[i] + spacing)) { return i; } +  char errmsg[256];+  snprintf(errmsg,256,"find_index could not find value in grid for value: %f",value);+  error->all(FLERR,errmsg);

This could use fmt::format() just as the fix does.

eagunn

comment created time in 5 hours

Pull request review commentlammps/lammps

Fix memory leaks and invalid memory access in USER-BOCS

 FixBocs::FixBocs(LAMMPS *lmp, int narg, char **arg) :       } else if (strcmp(arg[iarg], "linear_spline") == 0  ) {         if (iarg+2 > narg) error->all(FLERR,"Illegal fix bocs command. "                               "Supply a file name after linear_spline.");-        p_basis_type = 1;+        p_basis_type = BASIS_LINEAR_SPLINE;         spline_length = read_F_table( arg[iarg+1], p_basis_type );         iarg += 2;       } else if (strcmp(arg[iarg], "cubic_spline") == 0 ) {         if (iarg+2 > narg) error->all(FLERR,"Illegal fix bocs command. "                                "Supply a file name after cubic_spline.");-        p_basis_type = 2;+        p_basis_type = BASIS_CUBIC_SPLINE;         spline_length = read_F_table( arg[iarg+1], p_basis_type );         iarg += 2;       }  else {-        char errmsg[256];-        snprintf(errmsg,256,"CG basis type %s is not recognized\nSupported "-                 "basis types: analytic linear_spline cubic_spline",arg[iarg]);+        std::string errmsg = fmt::format("CG basis type {} is not recognized\nSupported "

This kind of statement doesn't really need a temporary std::string type instance. you can put the call to fmt::format() right as an argument to error->all().

eagunn

comment created time in 5 hours

Pull request review commentlammps/lammps

Fix memory leaks and invalid memory access in USER-BOCS

+# preset that turns on just a few, frequently used packages

Please remove this file, too.

eagunn

comment created time in 5 hours

push eventakohlmey/lammps

Axel Kohlmeyer

commit sha b92eda8ab884669f440be4ebb23484dd98b496c4

enable testing with r-RESPA for real

view details

Axel Kohlmeyer

commit sha 67af8c000e2a4f78a3a688049b5c91f982518293

fix r-RESPA bug in storing global total force data

view details

Axel Kohlmeyer

commit sha 3993f53946ea89ac11844f90a8d94037994d8136

must skip DeathTests if no data file loaded

view details

Axel Kohlmeyer

commit sha 70f37d661371069e76bef97ccd86df687a4b8291

update for handling r-RESPA properly

view details

Axel Kohlmeyer

commit sha b9ce53e096bcc36ac95eb7ee2ad2c33aa4876e6a

update tests for r-RESPA testing of fixes

view details

push time in 8 hours

Pull request review commentlammps/lammps

unit tests for /soft pair styles

 void PairLJCharmmCoulLongSoft::init_style()     error->all(FLERR,                "Pair style lj/charmm/coul/long/soft requires atom attribute q"); -  // request regular or rRESPA neighbor lists+  // request regular or rRESPA neighbor list    int irequest;+  int respa = 0;    if (update->whichflag == 1 && strstr(update->integrate_style,"respa")) {

while you are modifying these files, instead of using strstr() this test should be using utils::strmatch(update->integrate_style,"^respa")

abhiShandy

comment created time in 9 hours

Pull request review commentlammps/lammps

unit tests for /soft pair styles

 void PairLJCharmmCoulLongSoft::init_style()     error->all(FLERR,                "Pair style lj/charmm/coul/long/soft requires atom attribute q"); -  // request regular or rRESPA neighbor lists+  // request regular or rRESPA neighbor list

using "lists" here is correct.

abhiShandy

comment created time in 9 hours

push eventlammps/lammps

jtclemm

commit sha 187117587187c159df3adb7ff231002b73515d29

Patched fix/store

view details

jtclemm

commit sha 27fe315db7ce7dcb45d37677745691e845e159f2

Matching style of other fixes

view details

jtclemm

commit sha 6b1191b1c024c1b9534c218402460034c6631bdc

Forgot to update saving buffer size

view details

jtclemm

commit sha 41904f7946994e7ebeea729883919fc918042297

Added cautionary comments

view details

jtclemm

commit sha d0720794a68a3510c21a3025d1654ef593d548ad

Replaced mistakenly dropped line

view details

Axel Kohlmeyer

commit sha e3beec8b958ebaf61b2b1080b6fd31ee770aa6ca

revert permission change and replace 'b/c' with 'because'

view details

Axel Kohlmeyer

commit sha 6f1055a9b11d47e2a332fad5aefa70aaa4516d25

Merge pull request #2281 from jtclemm/patch_fix_store Patch fix store to encode the size of per-atom data consistently with other related fixes for restarting.

view details

push time in 13 hours

PR merged lammps/lammps

Patch fix store bugfix

Summary

Fix store uses a different method to pack the size of peratom data in restart files than other fixes (such as property/atom, spring/self, neighbor/history, etc). From my understanding, this can cause one fix to read data associated with another fix, as seen in the example input scripts below. Replacing the method of casting integers in fix store resolves the problem.

Typically when a restart file is written, the size of peratom data is written directly to a buffer as an integer (e.g. buf[0] = nvalue+1). When the restart is read, the size of the peratom data (followed by the actual data) is temporarily stored in an array, atom->extra. Each fix with a registered restart callback will then locate the position of its data in atom->extra by incrementing a counter m using: for (int i = 0; i < nth; i++) m += static_cast<int> (extra[nlocal][m]). where nth is the number of fixes which wrote data prior this fix.

However, fix/store is an exception and saves a value of ubuf(nvalue+1).d to the buffer and casts the size of peratom data chunks back to an integer using (int) ubuf(extra[nlocal][m]).i. I don't fully understand how ubuf casts data (maybe I am incorrect), but testing seems to indicate the two methods are incompatible. If a simulation uses fix/store with another fix that stores peratom data, the fixes will fail to locate the correct position of their data in the extra array and will read incorrect data.

Related Issues

None

Author(s)

Joel Clemmer - Sandia National Labs

Licensing

By submitting this pull request, I agree, that my contribution will be included in LAMMPS and redistributed under either the GNU General Public License version 2 (GPL v2) or the GNU Lesser General Public License version 2.1 (LGPL v2.1).

Backward Compatibility

Old restart files that saved data from 2 or more instances of fix store will no longer be read correctly.

Implementation Notes

Updated syntax in fix store to match property/atom, spring/self, neigh/history, etc. Packing the size of data in restart files is now uniform.

Post Submission Checklist

  • [ ] The feature or features in this pull request is complete
  • [ ] Licensing information is complete
  • [ ] Corresponding author information is complete
  • [ ] The source code follows the LAMMPS formatting guidelines
  • [ ] Suitable new documentation files and/or updates to the existing docs are included
  • [ ] 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

Attached are two minimal input files which reproduce the bug on my system.

An LJ melt simulation is initialized in input_1.txt. A dump file is written with two columns corresponding to the initial y position (stored in a store/state fix) and the initial x position (calculated from a displace/atom compute). Note that compute displace/atom uses fix/store.

The simulation is restarted in input_2.txt. After restarting, fix store and fix store/state fail to read the correct peratom data (both read the first data written) and the two columns in the dump correspond to the reference y position.

input_1.txt input_2.txt

+60 -21

18 comments

19 changed files

jtclemm

pr closed time in 13 hours

pull request commentlammps/lammps

Implement force history in Mindlin granular pair styles

by something similar to

if (fabs(rsht) == 0) rsht = 0;

This statement has no effect. What you should be looking for is a (relevant) parameter p that has the same unit as 'rsht' and then you can use p*EPSILON as threshold - adjusting EPSILON if p is usually large - so that this becomes a relative threshold instead of an absolute one.

Thank you for your guidance

jibril-b-coulibaly

comment created time in 13 hours

pull request commentlammps/lammps

Patch fix store

@jtclemm reverted the permission change and replaced 'b/c' with 'because'. @sjplimp will merge this as soon as it passes the integration tests. any further tweaks or related changes can be in a new PR.

jtclemm

comment created time in 13 hours

push eventjtclemm/lammps

Axel Kohlmeyer

commit sha e3beec8b958ebaf61b2b1080b6fd31ee770aa6ca

revert permission change and replace 'b/c' with 'because'

view details

push time in 13 hours

push eventakohlmey/lammps

Axel Kohlmeyer

commit sha 4b7356f5afabc7006a84fcf1f70d175044a8cd42

add support for testing virial contributions from fixes (as an option)

view details

Axel Kohlmeyer

commit sha c3903efb467591021773faf338d0e3037f1804cd

add test for berendsen barostat

view details

push time in a day

push eventakohlmey/lammps

Axel Kohlmeyer

commit sha f1da1ed180e4f445600e3db4c3394b7733e1bf7c

document restart capability of fix temp/csld and fix temp/csvr

view details

push time in a day

push eventakohlmey/lammps

Axel Kohlmeyer

commit sha d8cd12b28597154b83cabef0a2300f868657c02a

print warning only on MPI rank 0

view details

Axel Kohlmeyer

commit sha 6e9bf8709e26845a8bf323fd1c06f5dfe7bdc6f9

add tests for fix rattle

view details

Axel Kohlmeyer

commit sha 548e108695334df96024c66c583d2d14db14d8b5

simplify

view details

Axel Kohlmeyer

commit sha 897ae681d352410226ffc2f1f7c2f0ea18b03c61

remove dead code

view details

Axel Kohlmeyer

commit sha 383bb7f9056a28b6762362c841e5ba3b643bfc75

added restart capability to RanMars

view details

Axel Kohlmeyer

commit sha bbcae3b20cd8f0052533e30724147315ff932c78

added restart capability to fix temp/csld and fix temp/csvr

view details

Axel Kohlmeyer

commit sha f1da2b2f5fce110eb6c8965272b728e6db2df009

add tests for fix/csvr and fix/csld

view details

Axel Kohlmeyer

commit sha 2fcd7b79ab21be00527cfee3928866a39f41c679

make certain that internal data in RanMars is initialized to avoid false positive with valgrind

view details

Axel Kohlmeyer

commit sha b223ca14367870f1d327941244cc2ef795de04b9

cleanup and bugfix

view details

Axel Kohlmeyer

commit sha 4708cd7e1f9279bf868246d3d85cafb37126837d

always call MPI_Finalize() before exiting tester program

view details

Axel Kohlmeyer

commit sha e51bec10a864e019ff6d0c6fab6822a8472977f8

one more test variant for fix setforce

view details

push time in a day

push eventakohlmey/lammps

Axel Kohlmeyer

commit sha 3ebd1940901258a26ad5ae1dbfa74ce2e7564b43

update documentation for unit testing to include timestepping fix tests

view details

push time in 2 days

pull request commentlammps/lammps

fix typo in the math of pair style dpd doc

Thank you for merging! Out of curiosity, at what frequency is the online doc rebuilt?

Every time a new patch version is released.

With the next stable release, we plan that https://docs.lammps.org/ is automatically updated by the integration testing system whenever a pull request is merged to the master branch. Currently, this website is following a feature branch with an ongoing refactoring of the library interface and the programming documentation, which is planned to be merged for the stable release. This feature branch is more frequently updated, but not automatically.

pdebuyl

comment created time in 2 days

push eventakohlmey/lammps

Axel Kohlmeyer

commit sha 198927944215d8d1a371e5b31998af188c1cb200

no need to list all dependencies. if atom style full is available, the rest is, too.

view details

Axel Kohlmeyer

commit sha a6cc775241200927dba83b6bc56233c09f76077d

add example for wall fix

view details

Axel Kohlmeyer

commit sha a4eea29d90026631891ff67acb00e46a14c8115b

add fix setforce test with variables

view details

Axel Kohlmeyer

commit sha cabb1660411cb433ef63c8dd32227db1fe1542ea

add tests for fix shake

view details

push time in 2 days

push eventakohlmey/lammps

Axel Kohlmeyer

commit sha d7c1162e9d441ce807424f50c86fc7d8762900e1

make plain and omp test consistent

view details

Axel Kohlmeyer

commit sha 20537761185cfd74a50ab9a8984304166a8db7e7

increase code coverage

view details

push time in 2 days

push eventakohlmey/lammps

Axel Kohlmeyer

commit sha 2edad432ce1aac08af075f89bd75e08b6a77f7a2

add support for storing a global scalar and global vector

view details

Axel Kohlmeyer

commit sha e94d1c5537bb868f49d6d9f33eb51d754788c737

add function to query whether ErrorStats class has data

view details

Axel Kohlmeyer

commit sha 62a501ebda59547bb3483fb2511df6266190e4e0

store cumulative energy change in restart file

view details

Axel Kohlmeyer

commit sha 88f89c8f14a416619cabe0461bc622ea9ae485c1

correctly read entire vector

view details

Axel Kohlmeyer

commit sha b1e9b6d3fccd438eeb19b517da10b0f23229276c

set variable for checking thermostat target temperature

view details

Axel Kohlmeyer

commit sha a27a03bc1af04c08e6efe51eace76eeaa8567b68

now also test for global scalars and vectors and t_target for thermostats

view details

push time in 2 days

PR opened lammps/lammps

Add unit test tool for fixes that do time integration, thermostatting, force manipulations and similar unittest_feature work_in_progress

Summary

This adds a new tester tool (and a few test input decks), to test fix styles that manipulate coordinates, velocities, or forces.

Related Issues

#2099

Author(s)

Axel Kohlmeyer, Temple U

Licensing

By submitting this pull request, I agree, that my contribution will be included in LAMMPS and redistributed under either the GNU General Public License version 2 (GPL v2) or the GNU Lesser General Public License version 2.1 (LGPL v2.1).

Backward Compatibility

N/A

Implementation Notes

This builds on existing test templates and tests with verlet/respa run style, with per-type and per-atom masses and either two run commands or one read_restart and one run command. Also, if available, USER-OMP styles are tested against plain styles.

Post Submission Checklist

  • [ ] The feature or features in this pull request is complete
  • [x] Licensing information is complete
  • [x] Corresponding author information is complete
  • [x] The source code follows the LAMMPS formatting guidelines
  • [ ] Suitable new documentation files and/or updates to the existing docs are included
  • [ ] 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
  • [x] The feature has been verified to work with the CMake based build system
  • [x] Suitable tests have been added to the unittest tree.
+1532 -5

0 comment

19 changed files

pr created time in 2 days

create barnchakohlmey/lammps

branch : fix-tester

created branch time in 2 days

MemberEvent

issue commentlammps/lammps

[Feature Request] Add more unit test inputs

There are still the /soft pair styles open.

-- Dr. Axel Kohlmeyer akohlmey@gmail.com http://goo.gl/1wk0 College of Science & Technology, Temple University, Philadelphia PA, USA International Centre for Theoretical Physics, Trieste, Italy

On Fri, Aug 7, 2020, 20:51 Abhishek Shandilya notifications@github.com wrote:

Awesome! I had mental barrier for writing tests for pair styles which I haven't used or don't understand well. I am planning to attempt writing tester programs for dihedral and improper styles in the next burst.

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub https://github.com/lammps/lammps/issues/2099#issuecomment-670798946, or unsubscribe https://github.com/notifications/unsubscribe-auth/AACGTY4H6PB4TEPVB5AV7UTR7SOR5ANCNFSM4NFQ7QDQ .

akohlmey

comment created time in 3 days

push eventlammps/lammps

Axel Kohlmeyer

commit sha f9539f9ca670ffaf2752d305e9584390b8af2479

remove unused code

view details

Axel Kohlmeyer

commit sha 357716ec4c4ffff64fcacbcd49c3912fffcfcad9

correctly check of mu and torque flags as those data structures are always accessed.

view details

Axel Kohlmeyer

commit sha e860779fa0d87a91ac25adc9b7a388e133d0c59b

formatting update

view details

Pierre de Buyl

commit sha 1a642d36ae25447b68ab0e0f50ec3c7eeaf2fe53

fix typo in the math of pair style dpd doc - missing closing backticks for math - V fixed to v for relative velocity

view details

Axel Kohlmeyer

commit sha 67a9856e0c6e3ce56431d50458d179d9cd70123e

silence compiler warning when converting MAXBIGINT to a double

view details

Axel Kohlmeyer

commit sha 8558e9bd45b38618b42a8d02fae1a8af3f8f2608

fix bug when applying floating point output formatting to integers

view details

Axel Kohlmeyer

commit sha 8f84b6cbe6ffe179f6ec27ed445a0934643bdcd6

Merge branch 'fix_typo_doc_dpd' of github.com:pdebuyl/lammps into collected-small-changes

view details

Axel Kohlmeyer

commit sha ac08bcadf705b2e5f06e8891be80515ac7b2a343

use bbox keyword on some replicate commands to increase code coverage

view details

Axel Kohlmeyer

commit sha 458243604bf5981ea5553dc31f3d9e48cc27021b

change atom style tests expand covered code paths: tiled vs. brick comm, orthogonal vs. triclinic. relax floating point check precision

view details

Axel Kohlmeyer

commit sha 15db052c80916a319e743a439f2bd660f3e0ed8e

Merge branch 'master' into collected-small-changes

view details

Axel Kohlmeyer

commit sha 89694d3f8ee7d0d6efecad57e437955cc6853d98

small tweak

view details

Axel Kohlmeyer

commit sha e7774548885314ec6d5ec62b07b3c26c7e3dc040

add unittest for pppm/tip4p with kspace_modify diff ad and fix related bug in pppm/tip4p/omp

view details

Axel Kohlmeyer

commit sha e93e49a7773d144d0468025751853d5ea80e4fc6

restore printing alphabetically sorted lists of missing styles

view details

Axel Kohlmeyer

commit sha ad9483343cd49cb46fd9e2b536fcf725893ef61a

reformat pair_coeff section

view details

Axel Kohlmeyer

commit sha 0d677321d87b1ff241e06e0d26790bc6d44ee35c

more tests for coreshell

view details

Axel Kohlmeyer

commit sha 8826ea91e28de3016b856732c614bb0de5113a3d

inherited single function doesn't match, we need to set single_enable to 0

view details

Axel Kohlmeyer

commit sha dae97e1151c04f26c4bb950a6ccb6d1599b897fa

add tabulation for long-range coulomb

view details

Axel Kohlmeyer

commit sha ad71475e911e74c853ad65b7d3b4a784dbe19d90

more tests

view details

Axel Kohlmeyer

commit sha fefed73cb90c6c9e38b915a3760104c0180cceb0

fix bug in single function of buck/long/coul/long

view details

Axel Kohlmeyer

commit sha e1219399b4d0c793efed38f906ab82875b377582

add tests for buck/long/coul/long

view details

push time in 3 days

delete branch akohlmey/lammps

delete branch : more-unit-tests

delete time in 3 days

push eventlammps/lammps

Axel Kohlmeyer

commit sha c6d5715ea192dc91ea44fddfe64dbd87a3b2236a

add tests for meam/c

view details

Axel Kohlmeyer

commit sha 1d539ea7874408652f9bc4503fc08e91aa7d7392

make single function consistent with compute

view details

Axel Kohlmeyer

commit sha a42365bf9028f27f8e4668508fd0e215c8f23b15

add support enforce writing a data file with pair ij as required by sdk styles

view details

Axel Kohlmeyer

commit sha 7d9f6b0dc51dd3358e9ab100b54f86b47a2d4a01

add tests for pair styles from USER-SDK

view details

Axel Kohlmeyer

commit sha 094f52c378efcc8fbe688901dce8fca62cfe83e1

make space style msm an explicit dependency

view details

Axel Kohlmeyer

commit sha 15e969ca5b018ef1301d8efe97a205d5fffb401f

add triclinic support to ewald/omp

view details

Axel Kohlmeyer

commit sha efa8b3486fc74317b2b09ed449452a5096a2a3ec

update colloid test template so it can handle different atom styles

view details

Axel Kohlmeyer

commit sha 1c33bff55709e3629b44642335cfb9fa7f17fe60

add test for pair style yukawa/colloid

view details

Axel Kohlmeyer

commit sha 04cc5df27b03bc1fdd25671fde4ee868adc33fc5

atom type to element mapping is not done correctly. for now require exactly one atom type per element

view details

Axel Kohlmeyer

commit sha 51decfcf85171564cee8eb8fc82695cb74ce5e6e

add test for pair style meam/spline

view details

Axel Kohlmeyer

commit sha 8e0dccee2c8695509f759e8fd02f0b05933ba1d3

add test for pair style meam/sw/spline

view details

Axel Kohlmeyer

commit sha 4542a39f21641bf505b6a6e254c85ec17c249aad

fix indexing bug in pair style edip/omp

view details

Axel Kohlmeyer

commit sha ec0c3d60a8002c2bc8c6638a7bba0e00d9771f7a

add test for pair style edip

view details

Axel Kohlmeyer

commit sha 0537cc721e0ab20d35ef6dca7c43784c9331071a

add test for pair style edip/multi

view details

Axel Kohlmeyer

commit sha e217635e9ab168abc656436d8e7e7adb576b8ebe

fix bug in reading binary restarts for pair style coul/diel

view details

Axel Kohlmeyer

commit sha 7d26fbc6e2ce9c9823f94cfe0d72cddd14dd8957

add test for pair style coul/diel

view details

Axel Kohlmeyer

commit sha 2ffa7430ab49c55eb080b7c45ac3118e1b2eeebb

fix restart bug in pair style coul/shield

view details

Axel Kohlmeyer

commit sha c5cd10811341207d969d9e5d015ddef0e981f9cc

add tests for coul/shield, coul/slater/cut and coul/slater/long

view details

Axel Kohlmeyer

commit sha a17633bd20967411598b7c35d11a658a73af0f04

use open_potential in pair style coul/streitz

view details

Axel Kohlmeyer

commit sha e169a5c78531cd32f1ded4db36b929455bb12c00

add tests for pair style coul/streitz

view details

push time in 3 days

PR merged lammps/lammps

Reviewers
Add more unit tests for pair and kspace styles bugfix unittest_feature

Summary

This adds more unit tests for pair and kspace styles and fixes bugs detected by them.

Related Issues

#2099

Author(s)

Axel Kohlmeyer, Temple U

Licensing

By submitting this pull request, I agree, that my contribution will be included in LAMMPS and redistributed under either the GNU General Public License version 2 (GPL v2) or the GNU Lesser General Public License version 2.1 (LGPL v2.1).

Backward Compatibility

No known issues.

Post Submission Checklist

  • [x] The feature or features in this pull request is complete
  • [x] Licensing information is complete
  • [x] Corresponding author information is complete
  • [x] The source code follows the LAMMPS formatting guidelines
  • [x] The feature has been verified to work with the conventional build system
  • [x] The feature has been verified to work with the CMake based build system
  • [x] Suitable tests have been added to the unittest tree.
+2725 -426

1 comment

43 changed files

akohlmey

pr closed time in 3 days

pull request commentlammps/lammps

Add more unit tests for pair and kspace styles

The next stable LAMMPS release will be the "most tested ever(tm)". I am constantly surprised how many issues are uncovered by writing those test input decks that systematically test consistency and reproducibility.

akohlmey

comment created time in 3 days

issue commentlammps/lammps

[Feature Request] Add more unit test inputs

@abhiShandy Did a chunk more tests, mostly for cases, where building the input is tricky, where changes to the code were needed or where there were bugs in the pair styles.

$ make check-tests
Check completeness of force style tests
Parsing style names from C++ tree in:  /home/akohlmey/compile/lammps/src

Tests available for pair styles: 122 of 236
No tests for:  ['agni', 'awpmd/cut', 'body/nparticle', 'body/rounded/polygon', 'body/rounded/polyhedron', 'brownian', 'brownian/poly', 'buck6d/coul/gauss/dsf', 'buck6d/coul/gauss/long', 'coul/cut/soft', 'coul/long/soft', 'dpd', 'dpd/fdt', 'dpd/fdt/energy', 'dpd/tstat', 'drip', 'dsmc', 'e3b', 'edip/multi', 'edpd', 'eff/cut', 'exp6/rx', 'extep', 'gayberne', 'gran/hertz/history', 'gran/hooke', 'gran/hooke/history', 'granular', 'hbond/dreiding/lj', 'hbond/dreiding/morse', 'ilp/graphene/hbn', 'kolmogorov/crespi/full', 'kolmogorov/crespi/z', 'lebedeva/z', 'line/lj', 'list', 'lj/charmm/coul/long/soft', 'lj/class2/coul/cut/soft', 'lj/class2/coul/long/soft', 'lj/class2/soft', 'lj/cut/coul/cut/soft', 'lj/cut/coul/long/soft', 'lj/cut/dipole/cut', 'lj/cut/dipole/long', 'lj/cut/soft', 'lj/cut/thole/long', 'lj/cut/tip4p/long/soft', 'lj/long/dipole/long', 'lj/sf/dipole/sf', 'lj/switch3/coulgauss/long', 'local/density', 'lubricate', 'lubricate/poly', 'lubricateU', 'lubricateU/poly', 'mdpd', 'mdpd/rhosum', 'mesocnt', 'mesont/tpm', 'mgpt', 'mm3/switch3/coulgauss/long', 'momb', 'morse/smooth/linear', 'morse/soft', 'multi/lucy', 'multi/lucy/rx', 'oxdna/coaxstk', 'oxdna/excv', 'oxdna/hbond', 'oxdna/stk', 'oxdna/xstk', 'oxdna2/coaxstk', 'oxdna2/dh', 'oxdna2/excv', 'oxdna2/hbond', 'oxdna2/stk', 'oxdna2/xstk', 'oxrna2/coaxstk', 'oxrna2/dh', 'oxrna2/excv', 'oxrna2/hbond', 'oxrna2/stk', 'oxrna2/xstk', 'peri/eps', 'peri/lps', 'peri/pmb', 'peri/ves', 'quip', 'reax/c', 'resquared', 'sdpd/taitwater/isothermal', 'smd/hertz', 'smd/tlsph', 'smd/tri_surface', 'smd/ulsph', 'smtbq', 'sph/heatconduction', 'sph/idealgas', 'sph/lj', 'sph/rhosum', 'sph/taitwater', 'sph/taitwater/morris', 'spin/dipole/cut', 'spin/dipole/long', 'spin/dmi', 'spin/exchange', 'spin/magelec', 'spin/neel', 'srp', 'table/rx', 'tdpd', 'thole', 'tip4p/long/soft', 'tri/lj']

Tests available for bond styles: 13 of 17
No tests for:  ['oxdna/fene', 'oxdna2/fene', 'oxrna2/fene', 'quartic']

Tests available for angle styles: 18 of 21
No tests for:  ['cosine/buck6d', 'dipole', 'sdk']

Tests available for dihedral styles: 0 of 16
No tests for:  ['charmm', 'charmmfsw', 'class2', 'cosine/shift/exp', 'fourier', 'harmonic', 'helix', 'hybrid', 'multi/harmonic', 'nharmonic', 'opls', 'quadratic', 'spherical', 'table', 'table/cut', 'zero']

Tests available for improper styles: 0 of 13
No tests for:  ['class2', 'cossq', 'cvff', 'distance', 'distharm', 'fourier', 'harmonic', 'hybrid', 'inversion/harmonic', 'ring', 'sqdistharm', 'umbrella', 'zero']

Tests available for kspace styles: 10 of 15
No tests for:  ['ewald/dipole', 'ewald/dipole/spin', 'pppm/dipole', 'pppm/dipole/spin', 'scafacos']

Total tests missing: 155 of 318

akohlmey

comment created time in 3 days

push eventakohlmey/lammps

Axel Kohlmeyer

commit sha 17b7476217a7407a434274d668cc25f8dcc87cfd

avoid sqrt computation on cutoffs. make single functions consistent with compute

view details

Axel Kohlmeyer

commit sha 7aae5ba5d17cfac39f226d75f7814420a334be1f

set molecule ids for testing interlayer potentials

view details

Axel Kohlmeyer

commit sha 54b933164fc7ef8e145d23f8bc376dccb4209594

tweak epsilon

view details

push time in 3 days

push eventakohlmey/lammps

Axel Kohlmeyer

commit sha e217635e9ab168abc656436d8e7e7adb576b8ebe

fix bug in reading binary restarts for pair style coul/diel

view details

Axel Kohlmeyer

commit sha 7d26fbc6e2ce9c9823f94cfe0d72cddd14dd8957

add test for pair style coul/diel

view details

Axel Kohlmeyer

commit sha 2ffa7430ab49c55eb080b7c45ac3118e1b2eeebb

fix restart bug in pair style coul/shield

view details

Axel Kohlmeyer

commit sha c5cd10811341207d969d9e5d015ddef0e981f9cc

add tests for coul/shield, coul/slater/cut and coul/slater/long

view details

Axel Kohlmeyer

commit sha a17633bd20967411598b7c35d11a658a73af0f04

use open_potential in pair style coul/streitz

view details

Axel Kohlmeyer

commit sha e169a5c78531cd32f1ded4db36b929455bb12c00

add tests for pair style coul/streitz

view details

Axel Kohlmeyer

commit sha 9f469623c03ceac5a0831ce7bd88a1e54a177e84

add test for lj/smooth/linear and gaus/cut

view details

push time in 3 days

push eventakohlmey/lammps

Axel Kohlmeyer

commit sha 04cc5df27b03bc1fdd25671fde4ee868adc33fc5

atom type to element mapping is not done correctly. for now require exactly one atom type per element

view details

Axel Kohlmeyer

commit sha 51decfcf85171564cee8eb8fc82695cb74ce5e6e

add test for pair style meam/spline

view details

Axel Kohlmeyer

commit sha 8e0dccee2c8695509f759e8fd02f0b05933ba1d3

add test for pair style meam/sw/spline

view details

Axel Kohlmeyer

commit sha 4542a39f21641bf505b6a6e254c85ec17c249aad

fix indexing bug in pair style edip/omp

view details

Axel Kohlmeyer

commit sha ec0c3d60a8002c2bc8c6638a7bba0e00d9771f7a

add test for pair style edip

view details

Axel Kohlmeyer

commit sha 0537cc721e0ab20d35ef6dca7c43784c9331071a

add test for pair style edip/multi

view details

push time in 3 days

pull request commentlammps/lammps

Patch fix store

If that is what is in your patch, then I'm not sure what @akohlmey meant by his last comment about why the patch has an effect ?

because I was assuming that packing unpacking of data is local to the fix only. so the clean approach would be to also add a comment to all equivalent locations that the storing of the integer data must be done exactly this one way so that other fixes can read it.

If we want to make sure the ubuf() logic is used everywhere for everything (no static cast to ints out of bufs), that would also fix the issue, but that's a bigger job.

i don't think that ubuf() would be needed here because "m" would overflow and all the pack/unpack routines use 32-bit ints, too.

axel.

jtclemm

comment created time in 3 days

pull request commentlammps/lammps

Patch fix store

@sjplimp there are two issues here:

  1. why does the patch have an effect, even though it should not?
  2. what is the issue with the two inputs attached to the description at the top not producing consistent results and why does the patch "cure" it
jtclemm

comment created time in 3 days

pull request commentlammps/lammps

Patch fix store

@jtclemm it should be handled consistently. the main purpose of using the ubuf() packing is to support large systems where the number of atoms is > 2^31, but for that the corresponding "nvalues" variables also have to be defined as bigint. However, this is touching a very sensitive part of the core of LAMMPS, so I won't make any suggestion unless we also have the input from @sjplimp, who has the final word on such changes and should be consulted before doing any changes of this kind.

Bottom line, inconsistency is bad. But if we revise it, we should consider making it compatible and consistent with the rest of LAMMPS as much as possible.

As I hinted at in a previous comment, these kind of omissions can happen and sometimes can go unnoticed for a while. We are incrementally adding a more thorough and low-level checking of LAMMPS internal procedures in the unittest tree, which has been helping enormously to detect corner cases or rarely used combinations of steps.

jtclemm

comment created time in 3 days

pull request commentlammps/lammps

Patch fix store

I'm still internalizing the details of ubuf, but to make sure I'm on the same page, what changes were you referring to that shouldn't make a difference? The change I made in the pull request, the change I made in the snippet of test code you provided (int itwo = (int) ubuf(dval).i; -> int itwo = (int) dval;), or both changes?

the changes in your patch should not make a difference. Your change to my snippet is incorrect.

jtclemm

comment created time in 3 days

push eventakohlmey/lammps

Axel Kohlmeyer

commit sha efa8b3486fc74317b2b09ed449452a5096a2a3ec

update colloid test template so it can handle different atom styles

view details

Axel Kohlmeyer

commit sha 1c33bff55709e3629b44642335cfb9fa7f17fe60

add test for pair style yukawa/colloid

view details

push time in 4 days

push eventakohlmey/lammps

Axel Kohlmeyer

commit sha 15e969ca5b018ef1301d8efe97a205d5fffb401f

add triclinic support to ewald/omp

view details

push time in 4 days

Pull request review commentlammps/lammps

Fix memory leaks and invalid memory access in USER-BOCS

 class FixBocs : public Fix {   void nhc_press_integrate();    int read_F_table(char *, int);-  void build_cubic_splines(double **);+  int build_linear_splines(std::vector<std::vector<double>>);

@eagunn yes, that works. But I don't think that the clearing of the array is needed. Also the whole file reading code looks needlessly convoluted and complex. Like it was taken from some other application. On top of that you need to keep in mind, that many people that contribute to scientific software have no formal training in programming and sometimes get stuck in an "expert beginner" state, where their programming is full of quirks that are typical for beginners, but have become experienced enough in their ways to more-or-less achieve their objectives. When looking at the example folder, this looks like the clearing of the allocated storage is not needed, since the array is dimensioned for the data to be read. I would suggest to look at pair style table as a template for how to read such tables.

You should also need to keep in mind, that you are looking at a "user" package and particularly one that was added at a time, when the barrier for adding code was deliberately kept very low. This code would not be merged like this anymore. We now work with people to improve their code to meet higher minimum standards, as we have found out that this is more effective that to merge it first and then try to rectify style issues later. This also reflects that change that I am not handling the first contact with contributors, while in the past I would often only see new contributions after they were already added and could give my suggestions and comments only later on (which then frequently resulted in me doing the touching up of the code). So we have more conventional protocols now (even though I - as well - have no formal training, but had lots of guidance from people who had and also have now 25+ years of working on maintaining scientific software. so if there is a mistake to be made, I have made it myself and thus can more easily spot it when other untrained people do them.).

eagunn

comment created time in 4 days

PR opened lammps/lammps

Add more unit tests for pair and kspace styles bugfix unittest_feature work_in_progress

Summary

This adds more unit tests for pair and kspace styles and fixes bugs detected by them.

Related Issues

#2099

Author(s)

Axel Kohlmeyer, Temple U

Licensing

By submitting this pull request, I agree, that my contribution will be included in LAMMPS and redistributed under either the GNU General Public License version 2 (GPL v2) or the GNU Lesser General Public License version 2.1 (LGPL v2.1).

Backward Compatibility

No known issues.

Post Submission Checklist

  • [ ] The feature or features in this pull request is complete
  • [x] Licensing information is complete
  • [x] Corresponding author information is complete
  • [x] The source code follows the LAMMPS formatting guidelines
  • [ ] The feature has been verified to work with the conventional build system
  • [x] The feature has been verified to work with the CMake based build system
  • [x] Suitable tests have been added to the unittest tree.
+756 -21

0 comment

14 changed files

pr created time in 4 days

create barnchakohlmey/lammps

branch : more-unit-tests

created branch time in 4 days

pull request commentlammps/lammps

support for tiled decompositions in PPPM

What worries me a little bit is that changing from orthogonal to triclinic changes the forces even though all the tilt factors are 0. This is the same for pppm an pppm2 though.

Are you manually constraining the grid? I believe the logic for choosing the grid size is a little different for triclinic vs not.

nope. there are the test inputs and lists of reference forces/energies/stresses: https://github.com/lammps/lammps/blob/master/unittest/force-styles/tests/kspace-pppm.yaml and https://github.com/lammps/lammps/blob/master/unittest/force-styles/tests/kspace-pppm_tri.yaml

all kspace related commands are in the "post_commands" section. The tester feeds input fragments, files and settings from these files into a LAMMPS instance and then compares the forces, stresses and energies.

sjplimp

comment created time in 4 days

pull request commentlammps/lammps

Patch fix store

Hi Axel, thank you for the reply. So ubuf is used to avoid issues converting 32 and 64 bit datatypes?

My understanding is that the bug is equivalent to this case.

int ione = 1;
double dval = ubuf(ione).d;
int itwo = (int) dval;

there is a big difference between (int) dval and (int) ubuf(dval).i.

To explain. An IEEE754 double precision floating point number has:

  • 52 bits mantissa
  • 11 bits exponent
  • 1 bit sign Everything is base 2 and the bits in the mantissa represent 1/2 + 1/4 + 1/8 + 1/16 and so on. to that you always add 1, so the mantissa represents numbers between 1 and 2. this is multiplied by 2^exponent. that way if the mantissa would become larger than 2, all bits are shifted and the exponent incremented by 1. and so on. there is a special case, if all bits are 0: that gives you 0.0 (which is different from -0.0, BTW, since that has the sign bit set). Because of this setup you can represent all integers up to 2^52 exactly but, for example, something like 0.1 not. However, when using the union, we can also use the bits for the exponent and the sign to store integers. thus ubuf(1).d becomes -0.0 as now the sign bit is set but all other bits are still 0.

or put differently with ubuf(int i), the value of i is promoted to an int64_t and then stored in the same storage as a double. with .d we copy the bitpattern (without looking at its value) into the communication buffer, which only stores doubles. on the reverse step, you initialize the union with the double bitpattern but with the .i you access it as an int64_t, which recovers the original value. the (int) cast is not really needed and primarily used to silence compiler warnings about truncation.

You can find the definition of ubuf and some (inline) docs in the file lmptype.h

I don't quite follow the casting, but testing I find itwo = 0. I'll look up ubuf and see if I can figure out what it's doing to confirm.

what is your compiler?

What you are doing should not make a difference, but apparently it does. I don't see why. If this would not work, LAMMPS would not be able to run. In fact, we recently had some hard to find bugs, where the ubuf(val).i was missing and just val was used.

If only fix stores are used, data is restarted without errors. However, if fix store is used with another fix (say property/atom) data is then read incorrectly. I think this is because fix store saves/reads the data size using ubuf while all other fixes just use static_cast<int>. In my tests, this mismatch of ubuf returns zero.

jtclemm

comment created time in 4 days

push eventlammps/lammps

Axel Kohlmeyer

commit sha b91419397d7b0deab5ab9897f8d47cb5264b9a82

update (some) kspace tests to run faster

view details

Axel Kohlmeyer

commit sha 522a76694f4492f0f96d61fa3bec05c52258a0bf

test pppm with triclinic cell

view details

Axel Kohlmeyer

commit sha 3c21642bf1da222cb34d12c9a4e63620b21e54ae

Merge branch 'collected-small-changes' into gridcomm-tiled

view details

Axel Kohlmeyer

commit sha aa393f35db0c6217034202ee1153390da489860b

Merge pull request #2279 from akohlmey/collected-small-changes Collected small changes and fixes

view details

Axel Kohlmeyer

commit sha d2a66cc9ee1a9327650d05624d115dcd266a1e2d

Merge branch 'master' into gridcomm-tiled

view details

push time in 4 days

delete branch akohlmey/lammps

delete branch : collected-small-changes

delete time in 4 days

push eventlammps/lammps

Axel Kohlmeyer

commit sha f9539f9ca670ffaf2752d305e9584390b8af2479

remove unused code

view details

Axel Kohlmeyer

commit sha 357716ec4c4ffff64fcacbcd49c3912fffcfcad9

correctly check of mu and torque flags as those data structures are always accessed.

view details

Axel Kohlmeyer

commit sha e860779fa0d87a91ac25adc9b7a388e133d0c59b

formatting update

view details

Pierre de Buyl

commit sha 1a642d36ae25447b68ab0e0f50ec3c7eeaf2fe53

fix typo in the math of pair style dpd doc - missing closing backticks for math - V fixed to v for relative velocity

view details

Axel Kohlmeyer

commit sha 67a9856e0c6e3ce56431d50458d179d9cd70123e

silence compiler warning when converting MAXBIGINT to a double

view details

Axel Kohlmeyer

commit sha 8558e9bd45b38618b42a8d02fae1a8af3f8f2608

fix bug when applying floating point output formatting to integers

view details

Axel Kohlmeyer

commit sha 8f84b6cbe6ffe179f6ec27ed445a0934643bdcd6

Merge branch 'fix_typo_doc_dpd' of github.com:pdebuyl/lammps into collected-small-changes

view details

Axel Kohlmeyer

commit sha ac08bcadf705b2e5f06e8891be80515ac7b2a343

use bbox keyword on some replicate commands to increase code coverage

view details

Axel Kohlmeyer

commit sha 458243604bf5981ea5553dc31f3d9e48cc27021b

change atom style tests expand covered code paths: tiled vs. brick comm, orthogonal vs. triclinic. relax floating point check precision

view details

Axel Kohlmeyer

commit sha 15db052c80916a319e743a439f2bd660f3e0ed8e

Merge branch 'master' into collected-small-changes

view details

Axel Kohlmeyer

commit sha 89694d3f8ee7d0d6efecad57e437955cc6853d98

small tweak

view details

Axel Kohlmeyer

commit sha e7774548885314ec6d5ec62b07b3c26c7e3dc040

add unittest for pppm/tip4p with kspace_modify diff ad and fix related bug in pppm/tip4p/omp

view details

Axel Kohlmeyer

commit sha e93e49a7773d144d0468025751853d5ea80e4fc6

restore printing alphabetically sorted lists of missing styles

view details

Axel Kohlmeyer

commit sha ad9483343cd49cb46fd9e2b536fcf725893ef61a

reformat pair_coeff section

view details

Axel Kohlmeyer

commit sha 0d677321d87b1ff241e06e0d26790bc6d44ee35c

more tests for coreshell

view details

Axel Kohlmeyer

commit sha 8826ea91e28de3016b856732c614bb0de5113a3d

inherited single function doesn't match, we need to set single_enable to 0

view details

Axel Kohlmeyer

commit sha dae97e1151c04f26c4bb950a6ccb6d1599b897fa

add tabulation for long-range coulomb

view details

Axel Kohlmeyer

commit sha ad71475e911e74c853ad65b7d3b4a784dbe19d90

more tests

view details

Axel Kohlmeyer

commit sha fefed73cb90c6c9e38b915a3760104c0180cceb0

fix bug in single function of buck/long/coul/long

view details

Axel Kohlmeyer

commit sha e1219399b4d0c793efed38f906ab82875b377582

add tests for buck/long/coul/long

view details

push time in 4 days

PR merged lammps/lammps

Collected small changes and fixes bugfix documentation maintenance

Summary

This pull request combines multiple small tweaks, updates, and bug fixes

Related Issues

Includes and thus closes #2278

Author(s)

Axel Kohlmeyer, Temple U

Licensing

By submitting this pull request, I agree, that my contribution will be included in LAMMPS and redistributed under either the GNU General Public License version 2 (GPL v2) or the GNU Lesser General Public License version 2.1 (LGPL v2.1).

Backward Compatibility

No known issues.

Implementation Notes

The following individual changes are included:

  • a bugfix for replicate with bounding bbox option
  • silence compiler warnings when converting MAXBIGINT to a double
  • fix typos in pair style dpd docs
  • correctly check for atom style requirements in pair style lj/long/dipole/long
  • dead code removal
  • increase code coverage in atom style tests
  • more unit tests for pair styles
  • bugfixes for inconsistent single function and missing tabulated long-range coulomb

Post Submission Checklist

  • [x] The feature or features in this pull request is complete
  • [x] Licensing information is complete
  • [x] Corresponding author information is complete
  • [x] The source code follows the LAMMPS formatting guidelines
  • [x] Suitable new documentation files and/or updates to the existing docs are included
  • [x] The added/updated documentation is integrated and tested with the documentation build system
  • [x] The feature has been verified to work with the conventional build system
  • [x] The feature has been verified to work with the CMake based build system
  • [x] Suitable tests have been added to the unittest tree.
+2221 -1022

2 comments

31 changed files

akohlmey

pr closed time in 4 days

PR closed lammps/lammps

fix typo in the math of pair style dpd doc
  • missing closing backticks for math
  • V fixed to v for relative velocity

Summary

This is a typo fix for https://lammps.sandia.gov/doc/pair_dpd.html . The math was badly escaped in the description of the force terms.

Author(s)

Pierre de Buyl, KU Leuven, Belgium

Licensing

By submitting this pull request, I agree, that my contribution will be included in LAMMPS and redistributed under either the GNU General Public License version 2 (GPL v2) or the GNU Lesser General Public License version 2.1 (LGPL v2.1).

Backward Compatibility

No compatibility issue.

Post Submission Checklist

  • [x] The feature or features in this pull request is complete
  • [x] Licensing information is complete
  • [x] Corresponding author information is complete
  • [x] The source code follows the LAMMPS formatting guidelines
  • [x] Suitable new documentation files and/or updates to the existing docs are included
  • [ ] 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
+2 -2

1 comment

1 changed file

pdebuyl

pr closed time in 4 days

pull request commentlammps/lammps

support for tiled decompositions in PPPM

@sjplimp ran this with the unittest test programs and found no difference between when switching to comm_style tiled, but those are all serial tests, so I am not sure how relevant those are. What worries me a little bit is that changing from orthogonal to triclinic changes the forces even though all the tilt factors are 0. This is the same for pppm an pppm2 though.

sjplimp

comment created time in 4 days

push eventakohlmey/lammps

Axel Kohlmeyer

commit sha b91419397d7b0deab5ab9897f8d47cb5264b9a82

update (some) kspace tests to run faster

view details

Axel Kohlmeyer

commit sha 522a76694f4492f0f96d61fa3bec05c52258a0bf

test pppm with triclinic cell

view details

push time in 4 days

pull request commentlammps/lammps

Patch fix store

@jtclemm Please note that

int ione = 1;
double dval = ubuf(ione).d;
int itwo = (int) ubuf(dval).i;

and

int ion = 1;
double dval = ione;
int itwo = (int) dval;

should be producing the same result in itwo. The difference is that the first method also works for all 64-bit integers (int64_t or bigint), while the second only if the value is less than 2^52, due to the lower precision of double precision numbers since the remaining bits are used for the exponent.

@sjplimp any idea why this makes a difference?

jtclemm

comment created time in 4 days

pull request commentlammps/lammps

Collected small changes and fixes

Just using a floating point format on integers.

This is being checked with unit testing now.

-- Dr. Axel Kohlmeyer akohlmey@gmail.com http://goo.gl/1wk0 College of Science & Technology, Temple University, Philadelphia PA, USA International Centre for Theoretical Physics, Trieste, Italy

On Thu, Aug 6, 2020, 20:06 Steve Plimpton notifications@github.com wrote:

@akohlmey https://github.com/akohlmey Was the "bug" with replicate bbox just an output formatting issue or something more serious?

— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub https://github.com/lammps/lammps/pull/2279#issuecomment-670250224, or unsubscribe https://github.com/notifications/unsubscribe-auth/AACGTY767A64HJTPLGDIL4TR7NAR5ANCNFSM4PV7NJNQ .

akohlmey

comment created time in 4 days

push eventlammps/lammps

Diaz

commit sha 9a3f90294cc4bae9d2e29898df3d033a8efb2b6e

updated comm tiled to have multi

view details

Diaz

commit sha 0f88513f65db23a4834e2ed1859f13f278fb2172

updated comm tiled to have multi

view details

Richard Berger

commit sha 06964c58ded182a851d26f234685b509e712b128

Merge branch 'master' into multi-comm-tiled Conflicts resolved: src/comm_tiled.cpp

view details

Adrian-Diaz

commit sha c262d08e84e5430c067c8615e26d2e662305589a

remove comments

view details

Adrian-Diaz

commit sha e982f418d31c6d63dc29658945afeeaa69f52d53

remove whitespace issues

view details

Axel Kohlmeyer

commit sha 5452f72bd9f9c0d122154b761052fadc79ff111c

convert fix ttm and fix ttm/mod to use tokenizer class for parsing files

view details

Steve Plimpton

commit sha 9db34bc18e6509ce057930346cccaedbd7bc70be

cosmetic changes to CommTiled for comm multi style

view details

Axel Kohlmeyer

commit sha cc0cf3b94f21572d461debef8cab5d170ebcd341

consolidate USER-REAXC init error message handling. avoid snprintf and buffer

view details

Axel Kohlmeyer

commit sha d3b5e50da325d6c55cf8ee12c14fdde247705cae

fix bugs in lennard/mdf pair style

view details

Axel Kohlmeyer

commit sha 6707e64d14e7d21841a0209adb6243f0198d750a

change class name and add write_data support with pair style lennard/mdf

view details

Axel Kohlmeyer

commit sha 8c849c01042af124f6e9ced02b0c59e3084ddb6d

add test file for pair style lennard/mdf

view details

Axel Kohlmeyer

commit sha c355348ff971f24b9a6fe78646a8d48b2e02a31d

remove local copy of "me"

view details

Axel Kohlmeyer

commit sha 8c30b320fd9c7b165bd9de289f2b5bd6332f106e

Merge branch 'master' into collected-small-changes

view details

Axel Kohlmeyer

commit sha 2c3f9b111a4d3f78add249ec45f868edb99d8489

whitespace cleanup: replace tabs and remove trailing blanks

view details

Axel Kohlmeyer

commit sha 6a90a2affecedcf3daa1687f37ff5c9b5c11ed37

consistently check for presence of all input mesh data

view details

abhishandy

commit sha 36f4e6789ae54a92ee26e568a35ea0dd40b5048e

simple test for pair-born

view details

Axel Kohlmeyer

commit sha 4a28a708b9f2f5ca76e332d20df258ddbc8538ea

T_initial_set array is only required during reading of the mesh

view details

Axel Kohlmeyer

commit sha facb2f3c27ba3c1b185ffc60f88fe9807d65b46b

fix error in determining A/B parameters. outputs now match lj/mdf as expected.

view details

Axel Kohlmeyer

commit sha f0e66517805bf047414676d63cbc747355401cbf

Merge branch 'first-test' of github.com:abhiShandy/lammps into collected-small-changes

view details

Richard Berger

commit sha 1ae785132c976f8d80ea7b0241951cb863c693e7

Add codecov.yml

view details

push time in 4 days

push eventakohlmey/lammps

Axel Kohlmeyer

commit sha ec0b3ae8d2eee8ddc726d7da97cc77ffe917bd07

add test for pair style tip4p/cut

view details

Axel Kohlmeyer

commit sha cd31006006911b27d5e61d6e6bdd0a222a416730

add test for pair style python

view details

push time in 4 days

push eventakohlmey/lammps

Axel Kohlmeyer

commit sha e93e49a7773d144d0468025751853d5ea80e4fc6

restore printing alphabetically sorted lists of missing styles

view details

Axel Kohlmeyer

commit sha ad9483343cd49cb46fd9e2b536fcf725893ef61a

reformat pair_coeff section

view details

Axel Kohlmeyer

commit sha 0d677321d87b1ff241e06e0d26790bc6d44ee35c

more tests for coreshell

view details

Axel Kohlmeyer

commit sha 8826ea91e28de3016b856732c614bb0de5113a3d

inherited single function doesn't match, we need to set single_enable to 0

view details

Axel Kohlmeyer

commit sha dae97e1151c04f26c4bb950a6ccb6d1599b897fa

add tabulation for long-range coulomb

view details

Axel Kohlmeyer

commit sha ad71475e911e74c853ad65b7d3b4a784dbe19d90

more tests

view details

Axel Kohlmeyer

commit sha fefed73cb90c6c9e38b915a3760104c0180cceb0

fix bug in single function of buck/long/coul/long

view details

Axel Kohlmeyer

commit sha e1219399b4d0c793efed38f906ab82875b377582

add tests for buck/long/coul/long

view details

push time in 4 days

push eventakohlmey/lammps

Axel Kohlmeyer

commit sha 89694d3f8ee7d0d6efecad57e437955cc6853d98

small tweak

view details

Axel Kohlmeyer

commit sha e7774548885314ec6d5ec62b07b3c26c7e3dc040

add unittest for pppm/tip4p with kspace_modify diff ad and fix related bug in pppm/tip4p/omp

view details

push time in 4 days

push eventakohlmey/lammps

Diaz

commit sha 9a3f90294cc4bae9d2e29898df3d033a8efb2b6e

updated comm tiled to have multi

view details

Diaz

commit sha 0f88513f65db23a4834e2ed1859f13f278fb2172

updated comm tiled to have multi

view details

Richard Berger

commit sha 06964c58ded182a851d26f234685b509e712b128

Merge branch 'master' into multi-comm-tiled Conflicts resolved: src/comm_tiled.cpp

view details

Adrian-Diaz

commit sha c262d08e84e5430c067c8615e26d2e662305589a

remove comments

view details

Adrian-Diaz

commit sha e982f418d31c6d63dc29658945afeeaa69f52d53

remove whitespace issues

view details

Steve Plimpton

commit sha 9db34bc18e6509ce057930346cccaedbd7bc70be

cosmetic changes to CommTiled for comm multi style

view details

Axel Kohlmeyer

commit sha 9db3004d0c3ef1bf3f070a58a5c7c3230f9e5891

Merge branch 'master' into multi-comm-tiled

view details

Axel Kohlmeyer

commit sha 8d406403bba4473e4fb4efd6454bbf2f6695421b

fix typo in manual

view details

Axel Kohlmeyer

commit sha 7ed748118e90089dd9e815447f0449825fc3a365

add exception for single test for colloid pair style

view details

Axel Kohlmeyer

commit sha a6b3ee7a07155077bf1e6cdc2fd28239a0cf25d0

fix bugs in comm style tiled with multi-cutoff

view details

Axel Kohlmeyer

commit sha 6dcd96271881b04452a9f6230cbbe16fa01241b4

fix indentation and whitespace

view details

Axel Kohlmeyer

commit sha 851a22802ee2564401d7602e213a8316c9aade5e

add tests for pair style colloid in variants in several neighbor list and comm variants this does 3 tests: - regular neighborlist binning with single cutoff communication - comm style brick with multi-cutoff neighborlists and communication - comm style tiled with multi-cutoff neighborlists and communication

view details

abhishandy

commit sha 33aa96b1bf10536907a32df204236e64d7e0033b

test for buck/mdf, fixed bug in broadcasting inner cutoff, typos in doc

view details

Adrian-Diaz

commit sha 0db1c66b039c728b3d788880f81e800035d44fae

triclinic compatibility

view details

abhishandy

commit sha de828fceafa7aa23ce9b65e491023c05fe3b708d

test for cosine/squared

view details

abhishandy

commit sha a921c44a4f650021bf57656497d3b581642a8ff5

fix bug in writing data

view details

abhishandy

commit sha 6bc65dc14c55f02d43fc8ba54a9a3d2285606617

reference typos in doc

view details

Axel Kohlmeyer

commit sha d89a047461a6624d868f77b9d53444915870ab65

Simplify write data code

view details

Axel Kohlmeyer

commit sha ea900b3482602fab893675d4f8f0d16e9b0a987e

add test input template for tiled with triclinic and multi-cutoff

view details

Axel Kohlmeyer

commit sha f4aede49dc9b4a8fdcc76143dc933d89e24b224c

Merge branch 'master' into multi-comm-tiled

view details

push time in 5 days

push eventlammps/lammps

Diaz

commit sha 9a3f90294cc4bae9d2e29898df3d033a8efb2b6e

updated comm tiled to have multi

view details

Diaz

commit sha 0f88513f65db23a4834e2ed1859f13f278fb2172

updated comm tiled to have multi

view details

Richard Berger

commit sha 06964c58ded182a851d26f234685b509e712b128

Merge branch 'master' into multi-comm-tiled Conflicts resolved: src/comm_tiled.cpp

view details

Adrian-Diaz

commit sha c262d08e84e5430c067c8615e26d2e662305589a

remove comments

view details

Adrian-Diaz

commit sha e982f418d31c6d63dc29658945afeeaa69f52d53

remove whitespace issues

view details

Steve Plimpton

commit sha 9db34bc18e6509ce057930346cccaedbd7bc70be

cosmetic changes to CommTiled for comm multi style

view details

Axel Kohlmeyer

commit sha 9db3004d0c3ef1bf3f070a58a5c7c3230f9e5891

Merge branch 'master' into multi-comm-tiled

view details

Axel Kohlmeyer

commit sha 8d406403bba4473e4fb4efd6454bbf2f6695421b

fix typo in manual

view details

Axel Kohlmeyer

commit sha 7ed748118e90089dd9e815447f0449825fc3a365

add exception for single test for colloid pair style

view details

Axel Kohlmeyer

commit sha a6b3ee7a07155077bf1e6cdc2fd28239a0cf25d0

fix bugs in comm style tiled with multi-cutoff

view details

Axel Kohlmeyer

commit sha 6dcd96271881b04452a9f6230cbbe16fa01241b4

fix indentation and whitespace

view details

Axel Kohlmeyer

commit sha 851a22802ee2564401d7602e213a8316c9aade5e

add tests for pair style colloid in variants in several neighbor list and comm variants this does 3 tests: - regular neighborlist binning with single cutoff communication - comm style brick with multi-cutoff neighborlists and communication - comm style tiled with multi-cutoff neighborlists and communication

view details

abhishandy

commit sha 33aa96b1bf10536907a32df204236e64d7e0033b

test for buck/mdf, fixed bug in broadcasting inner cutoff, typos in doc

view details

Adrian-Diaz

commit sha 0db1c66b039c728b3d788880f81e800035d44fae

triclinic compatibility

view details

abhishandy

commit sha de828fceafa7aa23ce9b65e491023c05fe3b708d

test for cosine/squared

view details

abhishandy

commit sha a921c44a4f650021bf57656497d3b581642a8ff5

fix bug in writing data

view details

abhishandy

commit sha 6bc65dc14c55f02d43fc8ba54a9a3d2285606617

reference typos in doc

view details

Axel Kohlmeyer

commit sha d89a047461a6624d868f77b9d53444915870ab65

Simplify write data code

view details

Axel Kohlmeyer

commit sha ea900b3482602fab893675d4f8f0d16e9b0a987e

add test input template for tiled with triclinic and multi-cutoff

view details

Axel Kohlmeyer

commit sha f4aede49dc9b4a8fdcc76143dc933d89e24b224c

Merge branch 'master' into multi-comm-tiled

view details

push time in 5 days

push eventlammps/lammps

abhishandy

commit sha 33aa96b1bf10536907a32df204236e64d7e0033b

test for buck/mdf, fixed bug in broadcasting inner cutoff, typos in doc

view details

abhishandy

commit sha de828fceafa7aa23ce9b65e491023c05fe3b708d

test for cosine/squared

view details

abhishandy

commit sha a921c44a4f650021bf57656497d3b581642a8ff5

fix bug in writing data

view details

abhishandy

commit sha 6bc65dc14c55f02d43fc8ba54a9a3d2285606617

reference typos in doc

view details

Axel Kohlmeyer

commit sha d89a047461a6624d868f77b9d53444915870ab65

Simplify write data code

view details

Axel Kohlmeyer

commit sha 4e46c0aef4d704249344c71a231372df2c863f76

add missing born/coul/long variant using tabulation

view details

Axel Kohlmeyer

commit sha ef8b619840f75d114f441296992e3493a5e012b6

fix missing support for nozforce in ewald/omp

view details

Axel Kohlmeyer

commit sha 83519290e7e445c81958b3577dc804a3218e6874

add kspace tests with slab correction and pppm/stagger

view details

Axel Kohlmeyer

commit sha b21737574450e02b0432e3409f4a9a4e6a8e86c8

add tests with AD instead of IK

view details

Axel Kohlmeyer

commit sha f407db6198b2c6b7d7fb76e1c6961f42433194a3

add test for lj/cut/tip4p/cut

view details

abhishandy

commit sha eed71135066537305b98982301e4b97b02b406ab

tests for fene, fene/expand

view details

abhishandy

commit sha feadfaf9bec683f90263b85439261ee84202d555

unit tests for angle-class2/p6, angle-cross and angle-mm3

view details

abhishandy

commit sha 59c5a62a00a394b5fc939f247c28fab842fa35bd

Merge branch 'angle-tests-Aug4' into pair-tests-aug4

view details

abhishandy

commit sha 5592bac69c695344228e1a41e88966e05c1c45fa

Merge branch 'bond-styles-Aug4' into pair-tests-aug4

view details

abhishandy

commit sha f895904d2c4492aa516b2c18fe94b1900adb0743

Merge branch 'pair-tests-aug4' of github.com:abhiShandy/lammps into pair-tests-aug4

view details

Axel Kohlmeyer

commit sha c3075250eefb77b5f3fa78520ff978b5f367f281

Merge pull request #2273 from abhiShandy/pair-tests-aug4 Bunch of units tests for pair-style, angle-style, bond-style

view details

push time in 5 days

PR merged lammps/lammps

Reviewers
Bunch of units tests for pair-style, angle-style, bond-style bugfix ready_for_merge unittest_feature

Summary

Tests

  • pair: cosine/squared and buck/mdf
  • pair: Kspace styles (ewald, pppm, pppm/tip4p) with regular slab correction and 'nozforce', as well as kspace_modify diff ad
  • angle: class2/p6, cross and mm3
  • bond: fene, fene/expand

Bug fix

  • write data of cosine/squared had a bug with wca flag
  • inner cutoff of buck/mdf was missed while broadcasting settings
  • ewald/omp was missing support for the 'nozforce' variant of the slab correction

<!--Briefly describe the new feature(s), enhancement(s), or bugfix(es) included in this pull request.-->

Related Issues

#2099

<!--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)

Abhishek Shandilya, RPI

<!--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

By submitting this pull request, I agree, that my contribution will be included in LAMMPS and redistributed under either the GNU General Public License version 2 (GPL v2) or the GNU Lesser General Public License version 2.1 (LGPL v2.1).

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-->

Implementation Notes

  • shape of cosine/squared was matched with lj/cut
  • buck/mdf uses parameters for vanilla buck

<!--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-->

  • [ ] The feature or features in this pull request is complete
  • [ ] Licensing information is complete
  • [ ] Corresponding author information is complete
  • [ ] The source code follows the LAMMPS formatting guidelines
  • [ ] Suitable new documentation files and/or updates to the existing docs are included
  • [ ] 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)-->

+1773 -10

0 comment

27 changed files

abhiShandy

pr closed time in 5 days

push eventlammps/lammps

Diaz

commit sha 9a3f90294cc4bae9d2e29898df3d033a8efb2b6e

updated comm tiled to have multi

view details

Diaz

commit sha 0f88513f65db23a4834e2ed1859f13f278fb2172

updated comm tiled to have multi

view details

Richard Berger

commit sha 06964c58ded182a851d26f234685b509e712b128

Merge branch 'master' into multi-comm-tiled Conflicts resolved: src/comm_tiled.cpp

view details

Adrian-Diaz

commit sha c262d08e84e5430c067c8615e26d2e662305589a

remove comments

view details

Adrian-Diaz

commit sha e982f418d31c6d63dc29658945afeeaa69f52d53

remove whitespace issues

view details

Steve Plimpton

commit sha 9db34bc18e6509ce057930346cccaedbd7bc70be

cosmetic changes to CommTiled for comm multi style

view details

Axel Kohlmeyer

commit sha 9db3004d0c3ef1bf3f070a58a5c7c3230f9e5891

Merge branch 'master' into multi-comm-tiled

view details

Axel Kohlmeyer

commit sha 8d406403bba4473e4fb4efd6454bbf2f6695421b

fix typo in manual

view details

Axel Kohlmeyer

commit sha 7ed748118e90089dd9e815447f0449825fc3a365

add exception for single test for colloid pair style

view details

Axel Kohlmeyer

commit sha a6b3ee7a07155077bf1e6cdc2fd28239a0cf25d0

fix bugs in comm style tiled with multi-cutoff

view details

Axel Kohlmeyer

commit sha 6dcd96271881b04452a9f6230cbbe16fa01241b4

fix indentation and whitespace

view details

Axel Kohlmeyer

commit sha 851a22802ee2564401d7602e213a8316c9aade5e

add tests for pair style colloid in variants in several neighbor list and comm variants this does 3 tests: - regular neighborlist binning with single cutoff communication - comm style brick with multi-cutoff neighborlists and communication - comm style tiled with multi-cutoff neighborlists and communication

view details

Adrian-Diaz

commit sha 0db1c66b039c728b3d788880f81e800035d44fae

triclinic compatibility

view details

Axel Kohlmeyer

commit sha ea900b3482602fab893675d4f8f0d16e9b0a987e

add test input template for tiled with triclinic and multi-cutoff

view details

Axel Kohlmeyer

commit sha f4aede49dc9b4a8fdcc76143dc933d89e24b224c

Merge branch 'master' into multi-comm-tiled

view details

Axel Kohlmeyer

commit sha 89d85436f10ad40ee24d5d7f28d08389a55efb08

update reference data for triclinic case

view details

Axel Kohlmeyer

commit sha c2ed04052907fb8665e23a0dd0e9559405c44e24

simplify

view details

Steve Plimpton

commit sha 304d6876f4e4079ff9d31a201fe18b7c82e62779

a few bug fixes for support for multi and triclinic in CommTiled

view details

Axel Kohlmeyer

commit sha 65574be1783e05284d33a1aadc62a51932faeb36

whitespace fixes

view details

Steve Plimpton

commit sha 5f83edd127517f024c5a24a09c0cea58da5827ba

remove references to non-existent MPI_Statuses

view details

push time in 5 days

PR merged lammps/lammps

updated comm tiled to have multi style ghost communication communication_feature ready_for_merge unittest_feature

Purpose

Enables comm style tiled to use multiple cutoff lengths to communicate ghosts in the borders function.

Author(s)

Adrian Diaz (University of Florida)

Backward Compatibility

Clear of Conflict

Implementation Notes

Additional sendbox arrays are defined, allocated, and then defined using the multiple cutoffs available in cuttype from the Neighbor class. The changes were tested with a lead tellurium/ lead selenium interface model using both single and multi settings.

+820 -122

13 comments

12 changed files

Adrian-Diaz

pr closed time in 5 days

push eventlammps/lammps

Stan Moore

commit sha ed566bf6af0d9d8a489ec3a9df78659daedd4c74

First set of changes for Kokkos HIP

view details

Stan Moore

commit sha c6f5640d48ff443247a0ac7554c7a42b73d2e72d

Simplify #ifdef

view details

Stan Moore

commit sha 0b6c7ba502ae9c48787c5fd2fd32a621e58d89ba

Add missing KOKKOS_INLINE_FUNCTION

view details

Stan Moore

commit sha ae765f9d6e0b6764214a3689d91d924ae7ae86af

Add missing KOKKOS_INLINE_FUNCTION

view details

Axel Kohlmeyer

commit sha ae3df83ed8b09e779ad6196b84125d6463c15334

Merge pull request #2275 from stanmoore1/kk_hip First set of changes for Kokkos HIP

view details

push time in 5 days

PR merged lammps/lammps

Reviewers
First set of changes for Kokkos HIP enhancement kokkos_package ready_for_merge

Summary

This is the first set of changes needed to use the Kokkos HIP backend in LAMMPS. With these changes (and jumping through a few other hoops), I can run the Lennard-Jones benchmark on an AMD GPU using the Kokkos HIP backend.

Related Issues

None

Author(s)

Stan Moore (SNL)

Licensing

By submitting this pull request, I agree, that my contribution will be included in LAMMPS and redistributed under either the GNU General Public License version 2 (GPL v2) or the GNU Lesser General Public License version 2.1 (LGPL v2.1).

Backward Compatibility

Yes

+142 -112

0 comment

101 changed files

stanmoore1

pr closed time in 5 days

push eventakohlmey/topotools

Axel Kohlmeyer

commit sha aa806d98c1823cf3ef51c42b0307fceec1215628

sync with cvs repo

view details

push time in 5 days

push eventakohlmey/lammps

Axel Kohlmeyer

commit sha ac08bcadf705b2e5f06e8891be80515ac7b2a343

use bbox keyword on some replicate commands to increase code coverage

view details

Axel Kohlmeyer

commit sha 458243604bf5981ea5553dc31f3d9e48cc27021b

change atom style tests expand covered code paths: tiled vs. brick comm, orthogonal vs. triclinic. relax floating point check precision

view details

push time in 5 days

PR opened lammps/lammps

Collected small changes and fixes bugfix documentation maintenance

Summary

This pull request combines multiple small tweaks, updates, and bug fixes

Related Issues

Includes and thus closes #2278

Author(s)

Axel Kohlmeyer, Temple U

Licensing

By submitting this pull request, I agree, that my contribution will be included in LAMMPS and redistributed under either the GNU General Public License version 2 (GPL v2) or the GNU Lesser General Public License version 2.1 (LGPL v2.1).

Backward Compatibility

No known issues.

Implementation Notes

The following individual changes are included:

  • a bugfix for replicate with bounding bbox option
  • silence compiler warnings when converting MAXBIGINT to a double
  • fix typos in pair style dpd docs
  • correctly check for atom style requirements in pair style lj/long/dipole/long
  • dead code removal

Post Submission Checklist

  • [ ] The feature or features in this pull request is complete
  • [x] Licensing information is complete
  • [x] Corresponding author information is complete
  • [x] The source code follows the LAMMPS formatting guidelines
  • [x] Suitable new documentation files and/or updates to the existing docs are included
  • [x] The added/updated documentation is integrated and tested with the documentation build system
  • [x] The feature has been verified to work with the conventional build system
  • [x] The feature has been verified to work with the CMake based build system
  • [x] Suitable tests have been added to the unittest tree.
+26 -35

0 comment

6 changed files

pr created time in 5 days

push eventlammps/lammps

Richard Berger

commit sha 63cbbf96059e877ecd2de3f6446f33e14d5fdc6a

Upgrade embedded fmt library to v7.0.2

view details

Richard Berger

commit sha 2fe7be0d371ea0f4b35bff126fe1a8e34dbe16e9

Reapply fmt patches for Intel compiler issues - work around issue of the Intel compiler disguising as clang on MacOS - {fmt}: don't use [[gnu::fallthrough]] on intel compilers

view details

Richard Berger

commit sha 72949363225fba5d03f41e6f6b417f8980a7e43f

Add missing fmt license

view details

Axel Kohlmeyer

commit sha d53fc62fb0652f34ff2020dfe635bb8a4b4703d1

change fmtlib internal namespace from v7 to v7_lmp to avoid clashes when linking with other fmtlib variants

view details

Axel Kohlmeyer

commit sha 0e7c5a014d1e2725455f70d2200605b75405c111

Merge pull request #2276 from rbberger/fmtlib-upgrade Upgrades the fmt library to version 7.0.2

view details

push time in 5 days

PR merged lammps/lammps

Reviewers
Upgrades the fmt library to version 7.0.2 maintenance ready_for_merge update

Summary

  • Upgrades the fmt library to version 7.0.2 (from 6.2.1)
    • multiple performance improvements
    • fixes multiple compilation issues
    • for more details see https://github.com/fmtlib/fmt/releases/tag/7.0.0, https://github.com/fmtlib/fmt/releases/tag/7.0.1, and https://github.com/fmtlib/fmt/releases/tag/7.0.2
  • Reapplies patches for some special cases when using Intel compilers
  • Changes the library symbols to have v7_lmp instead of v7 so linking the LAMMPS library does not collide with other uses of fmtlib

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-->

Author(s)

@rbberger

Licensing

By submitting this pull request, I agree, that my contribution will be included in LAMMPS and redistributed under either the GNU General Public License version 2 (GPL v2) or the GNU Lesser General Public License version 2.1 (LGPL v2.1).

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-->

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-->

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-->

  • [ ] The feature or features in this pull request is complete
  • [ ] Licensing information is complete
  • [ ] Corresponding author information is complete
  • [ ] The source code follows the LAMMPS formatting guidelines
  • [ ] Suitable new documentation files and/or updates to the existing docs are included
  • [ ] 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)-->

+2342 -2052

0 comment

14 changed files

rbberger

pr closed time in 5 days

pull request commentlammps/lammps

updated comm tiled to have multi style ghost communication

@sjplimp had to remove some tabs (you probably should set the variable indent-tabs-mode in your emacs configuration to nil) and trailing whitespace. After compilation, the code passes the bundled (serial) unit tests without further adjustments.

Adrian-Diaz

comment created time in 5 days

push eventAdrian-Diaz/lammps

Axel Kohlmeyer

commit sha 65574be1783e05284d33a1aadc62a51932faeb36

whitespace fixes

view details

push time in 5 days

push eventakohlmey/topotools

Josh Vermaas

commit sha b37113416953cbd91bbade975fea8571bbeb95ad

Add cmaptypes to bogus parameters

view details

Josh Vermaas

commit sha 243ce99d4f498ffe58def5981251e67784a107fb

Correct formatting for fake cmaptypes

view details

Axel Kohlmeyer

commit sha 50fdb404d01a9f0360c14a5e52aa086aa83a7af3

Merge pull request #19 from jvermaas/master Add fake cmaptypes when needed

view details

push time in 5 days

PR merged akohlmey/topotools

Add fake cmaptypes when needed

Based on today's VMD-L topic, it looks like we had an oversight for when there are crossterms in the structure loaded into VMD. No crossterm parameters are written, so grompp chokes when it can't reconcile parameters with terms.

+1 -0

0 comment

1 changed file

jvermaas

pr closed time in 5 days

Pull request review commentlammps/lammps

Fix memory leaks and invalid memory access in USER-BOCS

 class FixBocs : public Fix {   void nhc_press_integrate();    int read_F_table(char *, int);-  void build_cubic_splines(double **);+  int build_linear_splines(std::vector<std::vector<double>>);

Checking for understanding here: Do you have a more general concern about the ability of vectors to handle reasonably large multidimensional arrays of doubles? The coder overhead is high to correctly manage the calloc/free code that was being used in this code before. A switch to vectors decreases that burden without having to change any of the code that accesses the actual array elements. Now that we have C++11 at our command, are there good reasons not to use vectors consistently for local data structures?

the problem of the previous code is that it didn't use the memory class, which can allocate and delete multi-dimensional arrays in one go and nullify the pointer after deleting. That made it look clumsy. Also, the memory class has provisions for allocating memory with a preferred alignment and is integrated into the error reporting when malloc fails. When using C++ features you would also have to wrap everything into try/catch blocks to cleanly handle memory allocation issues and shut down parallel runs cleanly. My take on using containers is: we use them only when we can take advantage of their additional features, e.g. use iterators, or the size() member function (in case the size is unknown) or want to add/remove elements incrementally. What to use also depends on the specific use case. You can see that in the use of the tokenizer class (for speed) or the utils::split_words() function (for consistency and convenience).

eagunn

comment created time in 5 days

Pull request review commentlammps/lammps

Fix memory leaks and invalid memory access in USER-BOCS

 void FixBocs::init() // NJD MRD 2 functions int FixBocs::read_F_table( char *filename, int p_basis_type ) {-  FILE *fpi;-  int N_columns = 2, n_entries = 0, i;-  float f1, f2;-  int test_sscanf;-  double **data = (double **) calloc(N_columns,sizeof(double *));-  char * line = (char *) calloc(200,sizeof(char));+  DblVector volumeVec;+  DblVector pressureVec;+  std::vector<DblVector> data;    bool badInput = false;-  char badDataMsg[MAX_MESSAGE_LENGTH];-  fpi = fopen(filename,"r");-  if (fpi)-  {-    while (fgets(line,199,fpi)) { ++n_entries; }--    for (i = 0; i < N_columns; ++i)-    {-      data[i] = (double *) calloc(n_entries,sizeof(double));+  int numEntries = 0;+  FILE *fpi = fopen(filename,"r");+  if (fpi) {+    // Old code read the input file twice. Now we simply+    // read all the lines from the input file into a string vector,+    // then work with the data in-memory rather than do a second pass+    // through the file.+    // NB: LAMMPS coding guidelines prefer cstdio so we are intentionally+    // foregoing  reading with getline+    std::string message = fmt::format("INFO: About to read data file: {}", filename);+    error->message(FLERR, message.c_str());++    // Data file lines hold two floating point numbers.+    // Line length we allocate should be long enough without being too long.+    // 128 seems safe for a line we expect to be < 30 chars.+    const int MAX_F_TABLE_LINE_LENGTH = 128;+    char line[MAX_F_TABLE_LINE_LENGTH];+    std::vector<std::string> inputLines;+    while (fgets(line, MAX_F_TABLE_LINE_LENGTH, fpi)) {+      inputLines.push_back(std::string(line));     }+    fclose(fpi);++    numEntries = inputLines.size();+    message = fmt::format("INFO: Read {} lines from file", numEntries);+    error->message(FLERR, message.c_str()); -    // Don't need to re-open the file to make a second pass through it-    // simply rewind to beginning-    rewind(fpi);++    // Initializing the size of vectors is not required.+    // The structures will resize as you push values into them.+    // But for largish data sets where you do know the value,+    // it is more efficient to do one upfront allocation.+    volumeVec.resize(numEntries);+    pressureVec.resize(numEntries);+    data.resize(NUM_INPUT_DATA_COLUMNS);+    data[VOLUME] = volumeVec;+    data[PRESSURE_CORRECTION] = pressureVec;      double stdVolumeInterval = 0.0;     double currVolumeInterval = 0.0;     // When comparing doubles/floats, we need an Epsilon.     // The literature indicates getting this value right in the     // general case can be pretty complicated. I don't think it     // needs to be complicated here, though. At least based on the-    // sample data I've seen where the volume values are fairly-    // large.+    // sample data I've seen where the volume values are fairly large.     const double volumeIntervalTolerance = 0.001;-    n_entries = 0;-    while( fgets(line,199,fpi)) {-      ++n_entries;-      test_sscanf = sscanf(line," %f , %f ",&f1, &f2);+    int lineNum = 0;  // this value is only for  message+    int numBadVolumeIntervals = 0; // count these for message+    float f1, f2;+    int test_sscanf;+    for (int i = 0; i < inputLines.size(); ++i) {+      lineNum++;  // count each line processed now so lineNum messages can be 1-based+      test_sscanf = sscanf(inputLines.at(i).c_str()," %f , %f ",&f1, &f2);       if (test_sscanf == 2)       {-        data[0][n_entries-1] = (double) f1;-        data[1][n_entries-1] = (double) f2;-        if (n_entries == 2) {-          stdVolumeInterval = data[0][n_entries-1] - data[0][n_entries-2];+        //message = fmt::format("INFO: f1 = {}, f2 = {}", f1, f2);+        //error->message(FLERR,message.c_str());+        data[VOLUME][i] = (double)f1;+        data[PRESSURE_CORRECTION][i] = (double)f2;+        if (i == 1)+        {+          // second entry is used to compute the validation interval used below+          stdVolumeInterval = data[VOLUME][i] - data[VOLUME][i-1];+          //message = fmt::format("INFO: standard volume interval computed: {}", stdVolumeInterval);+          //error->message(FLERR,message.c_str());         }-        else if (n_entries > 2) {-          currVolumeInterval = data[0][n_entries-1] - data[0][n_entries-2];+        else if (i > 1)+        {+          // after second entry, all intervals are validated+          currVolumeInterval = data[VOLUME][i] - data[VOLUME][i-1];+          //message = fmt::format("INFO: current volume interval: {}", currVolumeInterval);+          //error->message(FLERR,message.c_str());           if (fabs(currVolumeInterval - stdVolumeInterval) > volumeIntervalTolerance) {-            snprintf(badDataMsg,MAX_MESSAGE_LENGTH,-                     "BAD VOLUME INTERVAL: spline analysis requires uniform"-                     " volume distribution, found inconsistent volume"-                     " differential, line %d of file %s\n\tline: %s",-                     n_entries,filename,line);-            error->message(FLERR,badDataMsg);+            message = fmt::format("ERROR: Bad volume interval. Spline analysis requires uniform"+                    " volume distribution, found inconsistent volume"+                    " differential, line {} of file {}\n\tline: {}",+                    lineNum,filename,inputLines.at(i).c_str());+            error->message(FLERR,message.c_str());             badInput = true;+            numBadVolumeIntervals++;           }+          // no concluding else is intentional: i = 0, first line, no interval to validate         }-        // no else -- first entry is simply ignored       }       else       {-        snprintf(badDataMsg,MAX_MESSAGE_LENGTH,-                 "BAD INPUT FORMAT: did not find 2 comma separated numeric"-                 " values in line %d of file %s\n\tline: %s",-                 n_entries,filename,line);-        error->message(FLERR,badDataMsg);+        message = fmt::format("ERROR: Bad input format: did not find 2 comma separated numeric"+                 " values in line {} of file {}\n\tline: {}",+                 lineNum, filename, inputLines.at(i).c_str());+        error->message(FLERR,message.c_str());         badInput = true;       }+      if (badInput)+      {+        numBadVolumeIntervals++;+      }+    }++    if (numBadVolumeIntervals) {+      message = fmt::format("INFO: total number bad volume intervals = {}", numBadVolumeIntervals);+      error->message(FLERR,message.c_str());     }-    fclose(fpi);   }   else {-    char errmsg[MAX_MESSAGE_LENGTH];-    snprintf(errmsg,MAX_MESSAGE_LENGTH,"Unable to open file: %s\n",filename);-    error->all(FLERR,errmsg);+    std::string errmsg = fmt::format("ERROR: Unable to open file: {}", filename);+    error->all(FLERR,errmsg.c_str());   }    if (badInput) {-    char errmsg[MAX_MESSAGE_LENGTH];-    snprintf(errmsg,MAX_MESSAGE_LENGTH,-             "Bad volume / pressure-correction data: %s\nSee details above",filename);-    error->all(FLERR,errmsg);+    std::string errmsg = fmt::format("Bad volume / pressure-correction data: {}\nSee details above", filename);+    error->message(FLERR,errmsg.c_str());   } -  if (p_basis_type == 1)+  if (p_basis_type == BASIS_LINEAR_SPLINE)

When refactoring the code, you may also consider updating the source formatting. We prefer

if (condition) {
    ...
} else {
   ...
}

and equivalent for loops

eagunn

comment created time in 5 days

Pull request review commentlammps/lammps

Fix memory leaks and invalid memory access in USER-BOCS

 void FixBocs::init() // NJD MRD 2 functions int FixBocs::read_F_table( char *filename, int p_basis_type ) {-  FILE *fpi;-  int N_columns = 2, n_entries = 0, i;-  float f1, f2;-  int test_sscanf;-  double **data = (double **) calloc(N_columns,sizeof(double *));-  char * line = (char *) calloc(200,sizeof(char));+  DblVector volumeVec;+  DblVector pressureVec;+  std::vector<DblVector> data;    bool badInput = false;-  char badDataMsg[MAX_MESSAGE_LENGTH];-  fpi = fopen(filename,"r");-  if (fpi)-  {-    while (fgets(line,199,fpi)) { ++n_entries; }--    for (i = 0; i < N_columns; ++i)-    {-      data[i] = (double *) calloc(n_entries,sizeof(double));+  int numEntries = 0;+  FILE *fpi = fopen(filename,"r");+  if (fpi) {+    // Old code read the input file twice. Now we simply+    // read all the lines from the input file into a string vector,+    // then work with the data in-memory rather than do a second pass+    // through the file.+    // NB: LAMMPS coding guidelines prefer cstdio so we are intentionally+    // foregoing  reading with getline+    std::string message = fmt::format("INFO: About to read data file: {}", filename);+    error->message(FLERR, message.c_str());++    // Data file lines hold two floating point numbers.+    // Line length we allocate should be long enough without being too long.+    // 128 seems safe for a line we expect to be < 30 chars.+    const int MAX_F_TABLE_LINE_LENGTH = 128;+    char line[MAX_F_TABLE_LINE_LENGTH];+    std::vector<std::string> inputLines;+    while (fgets(line, MAX_F_TABLE_LINE_LENGTH, fpi)) {+      inputLines.push_back(std::string(line));     }+    fclose(fpi);++    numEntries = inputLines.size();+    message = fmt::format("INFO: Read {} lines from file", numEntries);+    error->message(FLERR, message.c_str()); -    // Don't need to re-open the file to make a second pass through it-    // simply rewind to beginning-    rewind(fpi);++    // Initializing the size of vectors is not required.+    // The structures will resize as you push values into them.+    // But for largish data sets where you do know the value,+    // it is more efficient to do one upfront allocation.+    volumeVec.resize(numEntries);+    pressureVec.resize(numEntries);+    data.resize(NUM_INPUT_DATA_COLUMNS);+    data[VOLUME] = volumeVec;+    data[PRESSURE_CORRECTION] = pressureVec;      double stdVolumeInterval = 0.0;     double currVolumeInterval = 0.0;     // When comparing doubles/floats, we need an Epsilon.     // The literature indicates getting this value right in the     // general case can be pretty complicated. I don't think it     // needs to be complicated here, though. At least based on the-    // sample data I've seen where the volume values are fairly-    // large.+    // sample data I've seen where the volume values are fairly large.     const double volumeIntervalTolerance = 0.001;-    n_entries = 0;-    while( fgets(line,199,fpi)) {-      ++n_entries;-      test_sscanf = sscanf(line," %f , %f ",&f1, &f2);+    int lineNum = 0;  // this value is only for  message+    int numBadVolumeIntervals = 0; // count these for message+    float f1, f2;+    int test_sscanf;+    for (int i = 0; i < inputLines.size(); ++i) {+      lineNum++;  // count each line processed now so lineNum messages can be 1-based+      test_sscanf = sscanf(inputLines.at(i).c_str()," %f , %f ",&f1, &f2);

This should be using the ValueTokenizer class.

eagunn

comment created time in 5 days

Pull request review commentlammps/lammps

Fix memory leaks and invalid memory access in USER-BOCS

 void FixBocs::init() // NJD MRD 2 functions int FixBocs::read_F_table( char *filename, int p_basis_type ) {-  FILE *fpi;-  int N_columns = 2, n_entries = 0, i;-  float f1, f2;-  int test_sscanf;-  double **data = (double **) calloc(N_columns,sizeof(double *));-  char * line = (char *) calloc(200,sizeof(char));+  DblVector volumeVec;+  DblVector pressureVec;+  std::vector<DblVector> data;    bool badInput = false;-  char badDataMsg[MAX_MESSAGE_LENGTH];-  fpi = fopen(filename,"r");-  if (fpi)-  {-    while (fgets(line,199,fpi)) { ++n_entries; }--    for (i = 0; i < N_columns; ++i)-    {-      data[i] = (double *) calloc(n_entries,sizeof(double));

With memory->create/destroy() this call to calloc/malloc is no longer needed.

eagunn

comment created time in 5 days

Pull request review commentlammps/lammps

Fix memory leaks and invalid memory access in USER-BOCS

 void FixBocs::init() // NJD MRD 2 functions int FixBocs::read_F_table( char *filename, int p_basis_type ) {-  FILE *fpi;-  int N_columns = 2, n_entries = 0, i;-  float f1, f2;-  int test_sscanf;-  double **data = (double **) calloc(N_columns,sizeof(double *));-  char * line = (char *) calloc(200,sizeof(char));+  DblVector volumeVec;+  DblVector pressureVec;+  std::vector<DblVector> data;

From the changes here, I don't see a benefit of using stl vectors over plain arrays, if you switch to using memory->create() and memory->destroy(). This will be more familiar to others reviewing and maintaining the code. So far we only switch to STL containers when there are significant benefits in syntax (example: for (auto i : container) { ... }) or readability (e.g. string compare with == instead of strcmp()).

eagunn

comment created time in 5 days

Pull request review commentlammps/lammps

Fix memory leaks and invalid memory access in USER-BOCS

 void FixBocs::init() // NJD MRD 2 functions int FixBocs::read_F_table( char *filename, int p_basis_type ) {-  FILE *fpi;-  int N_columns = 2, n_entries = 0, i;-  float f1, f2;-  int test_sscanf;-  double **data = (double **) calloc(N_columns,sizeof(double *));-  char * line = (char *) calloc(200,sizeof(char));+  DblVector volumeVec;+  DblVector pressureVec;+  std::vector<DblVector> data;    bool badInput = false;-  char badDataMsg[MAX_MESSAGE_LENGTH];-  fpi = fopen(filename,"r");-  if (fpi)-  {-    while (fgets(line,199,fpi)) { ++n_entries; }--    for (i = 0; i < N_columns; ++i)-    {-      data[i] = (double *) calloc(n_entries,sizeof(double));+  int numEntries = 0;+  FILE *fpi = fopen(filename,"r");+  if (fpi) {+    // Old code read the input file twice. Now we simply+    // read all the lines from the input file into a string vector,+    // then work with the data in-memory rather than do a second pass+    // through the file.+    // NB: LAMMPS coding guidelines prefer cstdio so we are intentionally+    // foregoing  reading with getline+    std::string message = fmt::format("INFO: About to read data file: {}", filename);+    error->message(FLERR, message.c_str());

in the current master error->message() accepts const std::string & as argument.

eagunn

comment created time in 5 days

pull request commentlammps/lammps

Fix memory leaks and invalid memory access in USER-BOCS

I'm trying to understand your objection here.

@eagunn all folders and custom scripts that are labeled as "test" should not be part of this feature branch and not included in the pull request.

Is this a problem with how I've named/organized my examples? Or more fundamentally with the example sets I'm trying to preserve?

I've checked through the examples tree a bit. It seems to me to be full of grouped sets of input(lammps)/data/output files with a large variety in the folder and file naming conventions used. And there are already a few custom scripts for running groups of examples, as well. So I'm not understanding what is different about these new bocs file sets unless it's that I used the folder name "test" to distinguish files that are primarily examples of how the code works and not examples of science one can do with the code.

custom scripts are the exception. they are usually only tolerated to run post-processing. some are there for historic reasons, as we are now more thorough in checking what gets added than in the past. the fact that inputs are meant to be used for testing functionality instead of demonstrating the use is the point. tests for checking the correct function of features in LAMMPS can be added to the lammps-testing repo or in the unittest tree, but then in a more low level testing using the googletest framework. in part those additions looks like they are only for your convenience (e.g. the cmake script in the package subdirectory) or they have paths that can only work for you. those should be removed entirely.

I'd be happy to reorganize / rename these if that would help. But I spent a reasonable amount of time creating a set of files to cover the code I was changing. I'd like to think that most/all of the inputs could become the basis for unit tests someday. I would prefer not to risk losing them by having them stranded in an off-branch of my private repo.

I appreciate your concern, and if this was a mainstream feature, I might share it. Under the current circumstances, avoiding additional clutter in the repo is of higher priority than losing some tests. The best is probably to you keep them locally and try to convert the core of it to either a unittest entry (we don't have a template for testing fixes yet, though) or integrate them into the regression testing tree in the lammps-testing repo.

eagunn

comment created time in 5 days

push eventakohlmey/lammps

Pierre de Buyl

commit sha 1a642d36ae25447b68ab0e0f50ec3c7eeaf2fe53

fix typo in the math of pair style dpd doc - missing closing backticks for math - V fixed to v for relative velocity

view details

Axel Kohlmeyer

commit sha 67a9856e0c6e3ce56431d50458d179d9cd70123e

silence compiler warning when converting MAXBIGINT to a double

view details

Axel Kohlmeyer

commit sha 8558e9bd45b38618b42a8d02fae1a8af3f8f2608

fix bug when applying floating point output formatting to integers

view details

Axel Kohlmeyer

commit sha 8f84b6cbe6ffe179f6ec27ed445a0934643bdcd6

Merge branch 'fix_typo_doc_dpd' of github.com:pdebuyl/lammps into collected-small-changes

view details

push time in 6 days

pull request commentlammps/lammps

cmake: add EXTERNAL_FMTLIB option

The library symbol conflict is much easier resolved by changing the ABI of the included copy. I just applied the corresponding change to #2276. d53fc62fb0652f34ff2020dfe635bb8a4b4703d1

junghans

comment created time in 6 days

pull request commentlammps/lammps

fix typo in the math of pair style dpd doc

Thanks for reporting this.

pdebuyl

comment created time in 6 days

push eventrbberger/lammps

Axel Kohlmeyer

commit sha d53fc62fb0652f34ff2020dfe635bb8a4b4703d1

change fmtlib internal namespace from v7 to v7_lmp to avoid clashes when linking with other fmtlib variants

view details

push time in 6 days

pull request commentlammps/lammps

Fix memory leaks and invalid memory access in USER-BOCS

@eagunn all folders and custom scripts that are labeled as "test" should not be part of this feature branch and not included in the pull request.

eagunn

comment created time in 7 days

pull request commentlammps/lammps

Fix memory leaks and invalid memory access in USER-BOCS

@akohlmey Please take a look at src/USER-BOCS/fix_bocs.cpp and give me feedback on the include list.

  • The recommended order is to have "LAMMPS local headers (preferably in alphabetical order)". But your recent practice puts fmt/format.h consistently at the end of that list. Is fmt/format.h a known exception to the order, as mpi.h is?

this is not a strict rule. fmt/format.h is special since its feature has been included in C++20 so it will at some point become a system header. also the include file policy may need to be reviewed. already certain includes are used in lmptype.h which is used almost everywhere. so I expect in the future, that certain includes, like <cstdio>, <string>, "fmt/format.h", "utils.h", can be safely assumed to be available because they will be included in a file that is a prerequisite for almost all LAMMPS code. Then the individual includes can be removed.

furthermore, i expect that at some point we will have a clang-format rule file that will describe the source code format we agree on.

  • Do you object to the white space line between the different types of includes?

no.

eagunn

comment created time in 7 days

Pull request review commentlammps/lammps

Fix memory leaks and invalid memory access in USER-BOCS

 class FixBocs : public Fix {   void nhc_press_integrate();    int read_F_table(char *, int);-  void build_cubic_splines(double **);+  int build_linear_splines(std::vector<std::vector<double>>);

This API change is not good. Unless is is a (small) temporary array, multi-dimensional data should be allocated with memory->create() and deleted with memory->destroy(). But this is even worse since C++ does call by value and thus you create a needless copy and cannot pass it back. If the data is not used elsewhere, it should not be passed as an argument, but allocated locally, if it is needed elsewhere, it cannot be passed by value.

eagunn

comment created time in 7 days

pull request commentlammps/lammps

updated comm tiled to have multi style ghost communication

@sjplimp yes, this branch should now have all changes. It passes (serial) tests with an input deck using the colloid pair style with comm_style tiled, using multi-cutoff communication in orthogonal and triclinic boxes. I also have successfully run a similar input script in parallel. You can compare the .yaml files with "colloid" in the folder unittest/force-styles/tests/ and the listed stresses and forces should all be the same modulo numerical noise.

Adrian-Diaz

comment created time in 7 days

create barnchakohlmey/lammps

branch : warning-no-mixing-data-file

created branch time in 7 days

create barnchakohlmey/lammps

branch : collected-small-changes

created branch time in 7 days

push eventabhiShandy/lammps

Axel Kohlmeyer

commit sha f407db6198b2c6b7d7fb76e1c6961f42433194a3

add test for lj/cut/tip4p/cut

view details

push time in 7 days

push eventabhiShandy/lammps

Axel Kohlmeyer

commit sha b21737574450e02b0432e3409f4a9a4e6a8e86c8

add tests with AD instead of IK

view details

push time in 7 days

more