diff --git a/examples/USER/misc/orient_eco/log.2Jun2020.orent_eco.g++.1 b/examples/USER/misc/orient_eco/log.2Jun2020.orent_eco.g++.1 index 836948d92d..02d8a1bdd5 100644 --- a/examples/USER/misc/orient_eco/log.2Jun2020.orent_eco.g++.1 +++ b/examples/USER/misc/orient_eco/log.2Jun2020.orent_eco.g++.1 @@ -1,19 +1,18 @@ -LAMMPS (5 May 2020) +LAMMPS (2 Jun 2020) using 1 OpenMP thread(s) per MPI task units metal atom_style atomic read_data data.sigma5 - orthogonal box = (-90.272 -4.42719e-07 0) to (90.272 88.5438 17.5) + orthogonal box = (-90.27200752837744 -4.427188724235731e-07 0.0) to (90.27200752837744 88.54377448471462 17.5) 1 by 1 by 1 MPI processor grid reading atoms ... 25600 atoms - read_data CPU = 0.0209658 secs + read_data CPU = 0.028 secs pair_style eam pair_coeff * * Ni_u3.eam -Reading potential file Ni_u3.eam with DATE: 2007-06-11 -timestep 0.001 +Reading potential file Ni_u3.eam with DATE: 2007-06-11timestep 0.001 fix integrator all npt temp 750 750 0.1 iso 0 0 0.1 fix eco all orient/eco 0.08 0.25 3.6 sigma5.ori @@ -26,7 +25,7 @@ velocity all create 750 18527782 #dump_modify save sort id run 1000 - fix orient/eco: cutoff=3.600000 norm_fac=30.012844 neighbors=18 + fix orient/eco: cutoff=3.6 norm_fac=30.012843706295556 neighbors=18 Neighbor list info ... update every 1 steps, delay 10 steps, check yes max neighbors/atom: 2000, page size: 100000 @@ -57,20 +56,20 @@ Step Temp TotEng Press Volume f_eco 800 664.91881 -109021.02 -62.347415 289323.84 -6.1930838 900 704.83039 -108741.73 365.8898 289827.26 -9.8340949 1000 734.71441 -108502.96 1119.6572 290190 -12.049805 -Loop time of 114.325 on 1 procs for 1000 steps with 25600 atoms +Loop time of 116.807 on 1 procs for 1000 steps with 25600 atoms -Performance: 0.756 ns/day, 31.757 hours/ns, 8.747 timesteps/s -99.8% CPU use with 1 MPI tasks x 1 OpenMP threads +Performance: 0.740 ns/day, 32.446 hours/ns, 8.561 timesteps/s +99.7% CPU use with 1 MPI tasks x 1 OpenMP threads MPI task timing breakdown: Section | min time | avg time | max time |%varavg| %total --------------------------------------------------------------- -Pair | 27.174 | 27.174 | 27.174 | 0.0 | 23.77 -Neigh | 0.82192 | 0.82192 | 0.82192 | 0.0 | 0.72 -Comm | 0.12876 | 0.12876 | 0.12876 | 0.0 | 0.11 -Output | 0.00077987 | 0.00077987 | 0.00077987 | 0.0 | 0.00 -Modify | 86.114 | 86.114 | 86.114 | 0.0 | 75.32 -Other | | 0.0853 | | | 0.07 +Pair | 27.131 | 27.131 | 27.131 | 0.0 | 23.23 +Neigh | 0.83119 | 0.83119 | 0.83119 | 0.0 | 0.71 +Comm | 0.13038 | 0.13038 | 0.13038 | 0.0 | 0.11 +Output | 0.00079226 | 0.00079226 | 0.00079226 | 0.0 | 0.00 +Modify | 88.626 | 88.626 | 88.626 | 0.0 | 75.87 +Other | | 0.08717 | | | 0.07 Nlocal: 25600 ave 25600 max 25600 min Histogram: 1 0 0 0 0 0 0 0 0 0 @@ -88,4 +87,4 @@ Dangerous builds = 0 Please see the log.cite file for references relevant to this simulation -Total wall time: 0:01:54 +Total wall time: 0:01:57 diff --git a/examples/USER/misc/orient_eco/log.2Jun2020.orent_eco.g++.4 b/examples/USER/misc/orient_eco/log.2Jun2020.orent_eco.g++.4 index d05dded505..07af9a5f25 100644 --- a/examples/USER/misc/orient_eco/log.2Jun2020.orent_eco.g++.4 +++ b/examples/USER/misc/orient_eco/log.2Jun2020.orent_eco.g++.4 @@ -1,19 +1,18 @@ -LAMMPS (5 May 2020) +LAMMPS (2 Jun 2020) using 1 OpenMP thread(s) per MPI task units metal atom_style atomic read_data data.sigma5 - orthogonal box = (-90.272 -4.42719e-07 0) to (90.272 88.5438 17.5) + orthogonal box = (-90.27200752837744 -4.427188724235731e-07 0.0) to (90.27200752837744 88.54377448471462 17.5) 4 by 1 by 1 MPI processor grid reading atoms ... 25600 atoms - read_data CPU = 0.0275698 secs + read_data CPU = 0.329 secs pair_style eam pair_coeff * * Ni_u3.eam -Reading potential file Ni_u3.eam with DATE: 2007-06-11 -timestep 0.001 +Reading potential file Ni_u3.eam with DATE: 2007-06-11timestep 0.001 fix integrator all npt temp 750 750 0.1 iso 0 0 0.1 fix eco all orient/eco 0.08 0.25 3.6 sigma5.ori @@ -26,7 +25,7 @@ velocity all create 750 18527782 #dump_modify save sort id run 1000 - fix orient/eco: cutoff=3.600000 norm_fac=30.012844 neighbors=18 + fix orient/eco: cutoff=3.6 norm_fac=30.012843706295556 neighbors=18 Neighbor list info ... update every 1 steps, delay 10 steps, check yes max neighbors/atom: 2000, page size: 100000 @@ -57,20 +56,20 @@ Step Temp TotEng Press Volume f_eco 800 664.86797 -109021.92 -52.316387 289313.22 -4.603192 900 703.88411 -108742.88 329.87308 289838.93 -8.1835743 1000 734.57012 -108504.44 1032.3825 290208.8 -9.5778417 -Loop time of 34.6285 on 4 procs for 1000 steps with 25600 atoms +Loop time of 42.9059 on 4 procs for 1000 steps with 25600 atoms -Performance: 2.495 ns/day, 9.619 hours/ns, 28.878 timesteps/s -98.5% CPU use with 4 MPI tasks x 1 OpenMP threads +Performance: 2.014 ns/day, 11.918 hours/ns, 23.307 timesteps/s +92.9% CPU use with 4 MPI tasks x 1 OpenMP threads MPI task timing breakdown: Section | min time | avg time | max time |%varavg| %total --------------------------------------------------------------- -Pair | 7.109 | 7.1216 | 7.136 | 0.4 | 20.57 -Neigh | 0.21069 | 0.21649 | 0.22302 | 1.1 | 0.63 -Comm | 0.15651 | 0.1704 | 0.17919 | 2.1 | 0.49 -Output | 0.0003221 | 0.00059247 | 0.0013802 | 0.0 | 0.00 -Modify | 27.057 | 27.074 | 27.084 | 0.2 | 78.18 -Other | | 0.04514 | | | 0.13 +Pair | 7.702 | 7.8512 | 8.0322 | 4.3 | 18.30 +Neigh | 0.21251 | 0.22612 | 0.24124 | 2.3 | 0.53 +Comm | 0.58286 | 0.84708 | 1.0824 | 19.5 | 1.97 +Output | 0.040286 | 0.048071 | 0.060272 | 3.8 | 0.11 +Modify | 33.411 | 33.509 | 33.606 | 1.3 | 78.10 +Other | | 0.4242 | | | 0.99 Nlocal: 6400 ave 6429 max 6369 min Histogram: 1 1 0 0 0 0 0 0 0 2 @@ -88,4 +87,4 @@ Dangerous builds = 0 Please see the log.cite file for references relevant to this simulation -Total wall time: 0:00:34 +Total wall time: 0:00:43 diff --git a/src/USER-MISC/fix_orient_eco.cpp b/src/USER-MISC/fix_orient_eco.cpp index 09d8bded46..e046cfe7ae 100644 --- a/src/USER-MISC/fix_orient_eco.cpp +++ b/src/USER-MISC/fix_orient_eco.cpp @@ -51,9 +51,9 @@ static const char cite_fix_orient_eco[] = " doi = {j.commatsci.2020.109774},\n" " url = {https://doi.org/10.1016/j.commatsci.2020.109774}\n" "}\n\n"; - + #define FIX_ORIENT_ECO_MAX_NEIGH 24 - + struct FixOrientECO::Nbr { public: int n; // # of neighbors @@ -173,17 +173,12 @@ void FixOrientECO::init() { MPI_Comm_rank(world, &me); // compute normalization factor + int neigh = get_norm(); if (me == 0) { - int neigh; - get_norm(neigh); - if (screen) { - fprintf(screen, " fix orient/eco: cutoff=%f norm_fac=%f neighbors=%i\n", r_cut, norm_fac, neigh); - } - if (logfile) { - fprintf(logfile, " fix orient/eco: cutoff=%f norm_fac=%f neighbors=%i\n", r_cut, norm_fac, neigh); - } + utils::logmesg(lmp,fmt::format(" fix orient/eco: cutoff={} norm_fac={} " + "neighbors={}\n", r_cut, norm_fac, neigh)); } - + inv_norm_fac = 1.0 / norm_fac; // check parameters @@ -384,7 +379,7 @@ void FixOrientECO::post_force(int /* vflag */) { double sin_scalar_product; // sine of scalar product double gcos_scalar_product; // gradient weight function * cosine of scalar product double gsin_scalar_product; // gradient weight function * sine of scalar product - + // compute force only if synthetic // potential is not zero if (u_0 != 0.0) { @@ -417,7 +412,7 @@ void FixOrientECO::post_force(int /* vflag */) { // loop over all neighbors of atom i for (j = 0; j < n; ++j) { idj = nbr[i].id[j]; - + // compute force on atom i if it is close to boundary if ((nbr[idj].duchi != 0.0) || boundary_atom) { delta = &nbr[i].delta[j][0]; @@ -606,7 +601,7 @@ void FixOrientECO::get_reciprocal() { normalization factor ------------------------------------------------------------------------- */ -void FixOrientECO::get_norm(int &neigh) { +int FixOrientECO::get_norm() { // set up local variables double delta[3]; // relative position double squared_distance; // squared distance of atoms i and j @@ -618,7 +613,7 @@ void FixOrientECO::get_norm(int &neigh) { int max_co = 4; // will produce wrong results for rcut > 3 * lattice constant - neigh = 0; // count number of neighbors used + int neigh = 0; // count number of neighbors used // loop over ideal lattice positions int i, k, idx[3]; @@ -656,6 +651,7 @@ void FixOrientECO::get_norm(int &neigh) { for (k = 0; k < 3; ++k) { norm_fac -= reesum[k] * reesum[k] + imesum[k] * imesum[k]; } + return neigh; } diff --git a/src/USER-MISC/fix_orient_eco.h b/src/USER-MISC/fix_orient_eco.h index a9478f87d0..15eef4f78b 100644 --- a/src/USER-MISC/fix_orient_eco.h +++ b/src/USER-MISC/fix_orient_eco.h @@ -41,7 +41,7 @@ class FixOrientECO : public Fix { private: struct Nbr; // private struct for managing precomputed terms - + int me; // this processors rank int nmax; // maximal # of owned + ghost atoms on this processor int ilevel_respa; // used for RESPA integrator only @@ -70,7 +70,7 @@ class FixOrientECO : public Fix { class NeighList *list; // LAMMPS' neighbor list void get_reciprocal(); // calculate reciprocal lattice vectors - void get_norm(int &); // compute normalization factor + int get_norm(); // compute normalization factor }; }