From d2cdb318aba4058e0458bf5fe4973654217c9228 Mon Sep 17 00:00:00 2001 From: Axel Kohlmeyer Date: Wed, 21 Apr 2021 22:53:41 -0400 Subject: [PATCH] apply new logmesg() overload to a bunch of cases. --- src/KSPACE/ewald_disp.cpp | 7 +- src/KSPACE/fix_tune_kspace.cpp | 16 ++-- src/KSPACE/msm_cg.cpp | 9 +-- src/KSPACE/pppm_cg.cpp | 9 +-- src/KSPACE/pppm_disp.cpp | 6 +- src/MC/pair_dsmc.cpp | 3 +- src/MLIAP/mliap_descriptor_snap.cpp | 5 +- src/PLUGIN/plugin.cpp | 40 +++++----- src/POEMS/fix_poems.cpp | 4 +- src/RIGID/fix_rigid.cpp | 3 +- src/RIGID/fix_rigid_small.cpp | 11 ++- src/RIGID/fix_shake.cpp | 14 ++-- src/SHOCK/fix_msst.cpp | 13 ++-- src/SNAP/pair_snap.cpp | 6 +- src/USER-COLVARS/group_ndx.cpp | 4 +- src/USER-COLVARS/ndx_group.cpp | 8 +- src/USER-MISC/fix_orient_eco.cpp | 4 +- src/USER-MISC/fix_pafi.cpp | 2 +- src/USER-PACE/pair_pace.cpp | 12 +-- src/USER-QTB/fix_qbmsst.cpp | 12 +-- src/bond.cpp | 8 +- src/comm.cpp | 2 +- src/create_atoms.cpp | 7 +- src/create_bonds.cpp | 4 +- src/delete_bonds.cpp | 20 ++--- src/finish.cpp | 112 +++++++++++++--------------- src/group.cpp | 4 +- src/lattice.cpp | 5 +- src/modify.cpp | 20 ++--- src/molecule.cpp | 18 ++--- src/output.cpp | 5 +- src/pair.cpp | 8 +- src/potential_file_reader.cpp | 4 +- src/read_data.cpp | 27 ++++--- src/read_dump.cpp | 15 ++-- src/read_restart.cpp | 35 +++++---- src/replicate.cpp | 18 ++--- src/reset_mol_ids.cpp | 8 +- src/set.cpp | 8 +- src/special.cpp | 29 ++++--- src/timer.cpp | 5 +- src/utils.cpp | 6 +- 42 files changed, 259 insertions(+), 297 deletions(-) diff --git a/src/KSPACE/ewald_disp.cpp b/src/KSPACE/ewald_disp.cpp index 89eeb4b3eb..927485ef84 100644 --- a/src/KSPACE/ewald_disp.cpp +++ b/src/KSPACE/ewald_disp.cpp @@ -274,8 +274,8 @@ void EwaldDisp::init() } if (comm->me == 0) - utils::logmesg(lmp,fmt::format(" G vector = {:.8g}, accuracy = {:.8g}\n", - g_ewald,accuracy)); + utils::logmesg(lmp," G vector = {:.8g}, accuracy = {:.8g}\n", + g_ewald,accuracy); // apply coulomb g_ewald to dispersion unless it is explicitly set @@ -339,8 +339,7 @@ void EwaldDisp::setup() if (!(first_output||comm->me)) { first_output = 1; - utils::logmesg(lmp,fmt::format(" vectors: nbox = {}, nkvec = {}\n", - nbox, nkvec)); + utils::logmesg(lmp," vectors: nbox = {}, nkvec = {}\n", nbox, nkvec); } } diff --git a/src/KSPACE/fix_tune_kspace.cpp b/src/KSPACE/fix_tune_kspace.cpp index 5f53561e20..55960f1c33 100644 --- a/src/KSPACE/fix_tune_kspace.cpp +++ b/src/KSPACE/fix_tune_kspace.cpp @@ -151,10 +151,8 @@ void FixTuneKspace::pre_exchange() } else if (niter == 4) { store_old_kspace_settings(); if (comm->me == 0) - utils::logmesg(lmp,fmt::format("ewald_time = {}\n" - "pppm_time = {}\n" - "msm_time = {}\n", - ewald_time, pppm_time, msm_time)); + utils::logmesg(lmp,"ewald_time = {}\npppm_time = {}\nmsm_time = {}\n", + ewald_time, pppm_time, msm_time); // switch to fastest one if (msm_time == 0.0) msm_time = 1.0e300; kspace_style = "ewald"; @@ -243,7 +241,7 @@ void FixTuneKspace::update_pair_style(const std::string &new_pair_style, force->pair->write_restart(p_pair_settings_file); rewind(p_pair_settings_file); if (comm->me == 0) - utils::logmesg(lmp,fmt::format("Creating new pair style: {}\n",new_pair_style)); + utils::logmesg(lmp,"Creating new pair style: {}\n",new_pair_style); // delete old pair style and create new one force->create_pair(new_pair_style.c_str(),1); @@ -254,8 +252,7 @@ void FixTuneKspace::update_pair_style(const std::string &new_pair_style, double *pcutoff = (double *) force->pair->extract("cut_coul",itmp); double current_cutoff = *pcutoff; if (comm->me == 0) - utils::logmesg(lmp,fmt::format("Coulomb cutoff for real space: {}\n", - current_cutoff)); + utils::logmesg(lmp,"Coulomb cutoff for real space: {}\n",current_cutoff); // close temporary file fclose(p_pair_settings_file); @@ -310,8 +307,7 @@ void FixTuneKspace::adjust_rcut(double time) double *p_cutoff = (double *) force->pair->extract("cut_coul",itmp); double current_cutoff = *p_cutoff; if (comm->me == 0) - utils::logmesg(lmp,fmt::format("Old Coulomb cutoff for real space: {}\n", - current_cutoff)); + utils::logmesg(lmp,"Old Coulomb cutoff for real space: {}\n",current_cutoff); // use Brent's method from Numerical Recipes to find optimal real space cutoff @@ -382,7 +378,7 @@ void FixTuneKspace::adjust_rcut(double time) double *new_cutoff = (double *) force->pair->extract("cut_coul",itmp); current_cutoff = *new_cutoff; if (comm->me == 0) - utils::logmesg(lmp,fmt::format("Adjusted Coulomb cutoff for real space: {}\n", current_cutoff)); + utils::logmesg(lmp,"Adjusted Coulomb cutoff for real space: {}\n", current_cutoff); store_old_kspace_settings(); update_pair_style(pair_style,pair_cut_coul); diff --git a/src/KSPACE/msm_cg.cpp b/src/KSPACE/msm_cg.cpp index 4c9384f13e..9781dee2ea 100644 --- a/src/KSPACE/msm_cg.cpp +++ b/src/KSPACE/msm_cg.cpp @@ -132,11 +132,10 @@ void MSMCG::compute(int eflag, int vflag) / static_cast(atom->natoms); if (me == 0) - utils::logmesg(lmp,fmt::format(" MSM/cg optimization cutoff: {:.8}\n" - " Total charged atoms: {:.1f}%\n" - " Min/max charged atoms/proc: {:.1f}%" - " {:.1f}%\n",smallq, - charged_frac,charged_fmin,charged_fmax)); + utils::logmesg(lmp," MSM/cg optimization cutoff: {:.8}\n" + " Total charged atoms: {:.1f}%\n" + " Min/max charged atoms/proc: {:.1f}% {:.1f}%\n", + smallq,charged_frac,charged_fmin,charged_fmax); } // only need to rebuild this list after a neighbor list update diff --git a/src/KSPACE/pppm_cg.cpp b/src/KSPACE/pppm_cg.cpp index a96e112393..b31919f767 100644 --- a/src/KSPACE/pppm_cg.cpp +++ b/src/KSPACE/pppm_cg.cpp @@ -148,11 +148,10 @@ void PPPMCG::compute(int eflag, int vflag) / static_cast(atom->natoms); if (me == 0) - utils::logmesg(lmp,fmt::format(" PPPM/cg optimization cutoff: {:.8g}\n" - " Total charged atoms: {:.1f}%\n" - " Min/max charged atoms/proc: {:.1f}%" - " {:.1f}%\n",smallq, - charged_frac,charged_fmin,charged_fmax)); + utils::logmesg(lmp," PPPM/cg optimization cutoff: {:.8g}\n" + " Total charged atoms: {:.1f}%\n" + " Min/max charged atoms/proc: {:.1f}% {:.1f}%\n", + smallq,charged_frac,charged_fmin,charged_fmax); } // only need to rebuild this list after a neighbor list update diff --git a/src/KSPACE/pppm_disp.cpp b/src/KSPACE/pppm_disp.cpp index 58db6e51fc..1844301ac5 100644 --- a/src/KSPACE/pppm_disp.cpp +++ b/src/KSPACE/pppm_disp.cpp @@ -1392,8 +1392,7 @@ void PPPMDisp::init_coeffs() if (function[2] && nsplit <= 6) { if (me == 0) - utils::logmesg(lmp,fmt::format(" Using {} instead of 7 structure " - "factors\n",nsplit)); + utils::logmesg(lmp," Using {} instead of 7 structure factors\n",nsplit); //function[3] = 1; //function[2] = 0; if (B) delete [] B; // remove this when un-comment previous 2 lines @@ -1406,8 +1405,7 @@ void PPPMDisp::init_coeffs() if (function[3]) { if (me == 0) - utils::logmesg(lmp,fmt::format(" Using {} structure factors\n", - nsplit)); + utils::logmesg(lmp," Using {} structure factors\n",nsplit); if (nsplit > 9) error->warning(FLERR,"Simulations might be very slow " "because of large number of structure factors"); diff --git a/src/MC/pair_dsmc.cpp b/src/MC/pair_dsmc.cpp index 1bcb9f6493..7064a500d2 100644 --- a/src/MC/pair_dsmc.cpp +++ b/src/MC/pair_dsmc.cpp @@ -283,8 +283,7 @@ void PairDSMC::init_style() cellz = (domain->boxhi[2] - domain->boxlo[2])/ncellsz; if (comm->me == 0) - utils::logmesg(lmp,fmt::format("DSMC cell size = {} x {} x {}\n", - cellx,celly,cellz)); + utils::logmesg(lmp,"DSMC cell size = {} x {} x {}\n",cellx,celly,cellz); total_ncells = ncellsx*ncellsy*ncellsz; vol = cellx*celly*cellz; diff --git a/src/MLIAP/mliap_descriptor_snap.cpp b/src/MLIAP/mliap_descriptor_snap.cpp index 0fdc548fc1..5c73cb64df 100644 --- a/src/MLIAP/mliap_descriptor_snap.cpp +++ b/src/MLIAP/mliap_descriptor_snap.cpp @@ -412,9 +412,8 @@ void MLIAPDescriptorSNAP::read_paramfile(char *paramfilename) char* keywd = strtok(line,"' \t\n\r\f"); char* keyval = strtok(nullptr,"' \t\n\r\f"); - if (comm->me == 0) { - utils::logmesg(lmp, fmt::format("SNAP keyword {} {} \n", keywd, keyval)); - } + if (comm->me == 0) + utils::logmesg(lmp,"SNAP keyword {} {} \n", keywd, keyval); // check for keywords with one value per element diff --git a/src/PLUGIN/plugin.cpp b/src/PLUGIN/plugin.cpp index d311b64520..4434b28d16 100644 --- a/src/PLUGIN/plugin.cpp +++ b/src/PLUGIN/plugin.cpp @@ -69,8 +69,8 @@ namespace LAMMPS_NS utils::logmesg(lmp,"Currently loaded plugins\n"); for (int i=0; i < num; ++i) { auto entry = plugin_get_info(i); - utils::logmesg(lmp,fmt::format("{:4}: {} style plugin {}\n", - i+1,entry->style,entry->name)); + utils::logmesg(lmp,"{:4}: {} style plugin {}\n", + i+1,entry->style,entry->name); } } } else error->all(FLERR,"Illegal plugin command"); @@ -96,8 +96,7 @@ namespace LAMMPS_NS void *dso = dlopen(file,RTLD_NOW|RTLD_GLOBAL); if (dso == nullptr) { if (me == 0) - utils::logmesg(lmp,fmt::format("Open of file {} failed: {}\n", - file,dlerror())); + utils::logmesg(lmp,"Open of file {} failed: {}\n",file,dlerror()); return; } @@ -110,8 +109,8 @@ namespace LAMMPS_NS dlclose(dso); if (me == 0) - utils::logmesg(lmp,fmt::format("Plugin symbol lookup failure in " - "file {}: {}\n",file,dlerror())); + utils::logmesg(lmp,"Plugin symbol lookup failure in file {}: {}\n", + file,dlerror()); return; } @@ -144,20 +143,19 @@ namespace LAMMPS_NS int idx = plugin_find(plugin->style,plugin->name); if (idx >= 0) { if (me == 0) - utils::logmesg(lmp,fmt::format("Ignoring load of {} style {}: must " - "unload existing {} plugin first\n", - plugin->style,plugin->name,plugin->name)); + utils::logmesg(lmp,"Ignoring load of {} style {}: must " + "unload existing {} plugin first\n", + plugin->style,plugin->name,plugin->name); return; } if (me == 0) { - utils::logmesg(lmp,fmt::format("Loading plugin: {} by {}\n", - plugin->info,plugin->author)); + utils::logmesg(lmp,"Loading plugin: {} by {}\n", + plugin->info,plugin->author); // print version info only if the versions of host and plugin don't match if ((plugin->version) && (strcmp(plugin->version,lmp->version) != 0)) - utils::logmesg(lmp,fmt::format(" compiled for LAMMPS version {} " - "loaded into LAMMPS version {}\n", - plugin->version,lmp->version)); + utils::logmesg(lmp," compiled for LAMMPS version {}, loaded into " + "LAMMPS version {}\n",plugin->version,lmp->version); } pluginlist.push_back(*plugin); @@ -260,8 +258,8 @@ namespace LAMMPS_NS (*command_map)[plugin->name] = (Input::CommandCreator)plugin->creator.v1; } else { - utils::logmesg(lmp,fmt::format("Loading plugin for {} styles not " - "yet implemented\n",pstyle)); + utils::logmesg(lmp,"Loading plugins for {} styles not " + "yet implemented\n",pstyle); pluginlist.pop_back(); } #endif @@ -285,8 +283,8 @@ namespace LAMMPS_NS && (strcmp(style,"fix") != 0) && (strcmp(style,"region") != 0) && (strcmp(style,"command") != 0)) { if (me == 0) - utils::logmesg(lmp,fmt::format("Ignoring unload: {} is not a " - "supported plugin style\n",style)); + utils::logmesg(lmp,"Ignoring unload: {} is not a " + "supported plugin style\n",style); return; } @@ -294,8 +292,8 @@ namespace LAMMPS_NS int idx = plugin_find(style,name); if (idx < 0) { if (me == 0) - utils::logmesg(lmp,fmt::format("Ignoring unload of {} style {}: not " - "loaded from a plugin\n",style,name)); + utils::logmesg(lmp,"Ignoring unload of {} style {}: not " + "loaded from a plugin\n",style,name); return; } @@ -305,7 +303,7 @@ namespace LAMMPS_NS // remove selected plugin from list of plugins if (me == 0) - utils::logmesg(lmp,fmt::format("Unloading {} style {}\n",style,name)); + utils::logmesg(lmp,"Unloading {} style {}\n",style,name); plugin_erase(style,name); // remove style of given name from corresponding map diff --git a/src/POEMS/fix_poems.cpp b/src/POEMS/fix_poems.cpp index 3d5b3697f7..d185523537 100644 --- a/src/POEMS/fix_poems.cpp +++ b/src/POEMS/fix_poems.cpp @@ -277,8 +277,8 @@ FixPOEMS::FixPOEMS(LAMMPS *lmp, int narg, char **arg) : nsum -= njoint; if (me == 0) - utils::logmesg(lmp,fmt::format("{} clusters, {} bodies, {} joints, {} atoms\n", - ncluster,nbody,njoint,nsum)); + utils::logmesg(lmp,"{} clusters, {} bodies, {} joints, {} atoms\n", + ncluster,nbody,njoint,nsum); } /* ---------------------------------------------------------------------- diff --git a/src/RIGID/fix_rigid.cpp b/src/RIGID/fix_rigid.cpp index 3cd4f5dbc8..91cb0ce82c 100644 --- a/src/RIGID/fix_rigid.cpp +++ b/src/RIGID/fix_rigid.cpp @@ -602,8 +602,7 @@ FixRigid::FixRigid(LAMMPS *lmp, int narg, char **arg) : for (ibody = 0; ibody < nbody; ibody++) nsum += nrigid[ibody]; if (me == 0) - utils::logmesg(lmp,fmt::format(" {} rigid bodies with {} atoms\n", - nbody,nsum)); + utils::logmesg(lmp," {} rigid bodies with {} atoms\n",nbody,nsum); } /* ---------------------------------------------------------------------- */ diff --git a/src/RIGID/fix_rigid_small.cpp b/src/RIGID/fix_rigid_small.cpp index 14bd9f7a55..c1c956f08e 100644 --- a/src/RIGID/fix_rigid_small.cpp +++ b/src/RIGID/fix_rigid_small.cpp @@ -401,8 +401,8 @@ FixRigidSmall::FixRigidSmall(LAMMPS *lmp, int narg, char **arg) : if (customflag) delete [] bodyID; if (comm->me == 0) - utils::logmesg(lmp,fmt::format(" create bodies CPU = {:.3f} seconds\n", - MPI_Wtime()-time1)); + utils::logmesg(lmp," create bodies CPU = {:.3f} seconds\n", + MPI_Wtime()-time1); // set nlocal_body and allocate bodies I own @@ -460,10 +460,9 @@ FixRigidSmall::FixRigidSmall(LAMMPS *lmp, int narg, char **arg) : MPI_Allreduce(&atomone,&atomall,1,MPI_LMP_BIGINT,MPI_SUM,world); if (me == 0) { - auto msg = fmt::format(" {} rigid bodies with {} atoms\n",nbody,atomall); - msg += fmt::format(" {:.8} = max distance from body owner to body atom\n", - maxextent); - utils::logmesg(lmp,msg); + utils::logmesg(lmp," {} rigid bodies with {} atoms\n" + " {:.8} = max distance from body owner to body atom\n", + nbody,atomall,maxextent); } // initialize Marsaglia RNG with processor-unique seed diff --git a/src/RIGID/fix_shake.cpp b/src/RIGID/fix_shake.cpp index 5662e63c88..957898d361 100644 --- a/src/RIGID/fix_shake.cpp +++ b/src/RIGID/fix_shake.cpp @@ -226,8 +226,8 @@ FixShake::FixShake(LAMMPS *lmp, int narg, char **arg) : find_clusters(); if (comm->me == 0) - utils::logmesg(lmp,fmt::format(" find clusters CPU = {:.3f} seconds\n", - MPI_Wtime()-time1)); + utils::logmesg(lmp," find clusters CPU = {:.3f} seconds\n", + MPI_Wtime()-time1); // initialize list of SHAKE clusters to constrain @@ -1007,11 +1007,11 @@ void FixShake::find_clusters() MPI_Allreduce(&tmp,&count4,1,MPI_INT,MPI_SUM,world); if (me == 0) { - auto mesg = fmt::format("{:>8} = # of size 2 clusters\n",count2/2); - mesg += fmt::format("{:>8} = # of size 3 clusters\n",count3/3); - mesg += fmt::format("{:>8} = # of size 4 clusters\n",count4/4); - mesg += fmt::format("{:>8} = # of frozen angles\n",count1/3); - utils::logmesg(lmp,mesg); + utils::logmesg(lmp,"{:>8} = # of size 2 clusters\n" + "{:>8} = # of size 3 clusters\n" + "{:>8} = # of size 4 clusters\n" + "{:>8} = # of frozen angles\n", + count2/2,count3/3,count4/4,count1/3); } } diff --git a/src/SHOCK/fix_msst.cpp b/src/SHOCK/fix_msst.cpp index 7a1efa064f..9e6ef32f5a 100644 --- a/src/SHOCK/fix_msst.cpp +++ b/src/SHOCK/fix_msst.cpp @@ -327,7 +327,7 @@ void FixMSST::setup(int /*vflag*/) v0 = compute_vol(); v0_set = 1; if (comm->me == 0) - utils::logmesg(lmp,fmt::format("Fix MSST v0 = {:.8g}\n", v0)); + utils::logmesg(lmp,"Fix MSST v0 = {:.8g}\n", v0); } if (p0_set == 0) { @@ -335,7 +335,7 @@ void FixMSST::setup(int /*vflag*/) p0_set = 1; if (comm->me == 0) - utils::logmesg(lmp,fmt::format("Fix MSST p0 = {:.8g}\n", p0)); + utils::logmesg(lmp,"Fix MSST p0 = {:.8g}\n", p0); } if (e0_set == 0) { @@ -343,7 +343,7 @@ void FixMSST::setup(int /*vflag*/) e0_set = 1; if (comm->me == 0) - utils::logmesg(lmp,fmt::format("Fix MSST e0 = {:.8g}\n", e0)); + utils::logmesg(lmp,"Fix MSST e0 = {:.8g}\n", e0); } temperature->compute_vector(); @@ -364,10 +364,9 @@ void FixMSST::setup(int /*vflag*/) double fac2 = omega[direction]/v0; if ( comm->me == 0 && tscale != 1.0) - utils::logmesg(lmp,fmt::format("Fix MSST initial strain rate of " - "{:.8g} established by reducing " - "temperature by factor of {:.8g}\n", - fac2,tscale)); + utils::logmesg(lmp,"Fix MSST initial strain rate of {:.8g} " + "established by reducing temperature by factor " + "of {:.8g}\n",fac2,tscale); for (int i = 0; i < atom->nlocal; i++) { if (mask[i] & groupbit) { for (int k = 0; k < 3; k++) { diff --git a/src/SNAP/pair_snap.cpp b/src/SNAP/pair_snap.cpp index ae0023ddec..b4ee3c870a 100644 --- a/src/SNAP/pair_snap.cpp +++ b/src/SNAP/pair_snap.cpp @@ -565,8 +565,8 @@ void PairSNAP::read_files(char *coefffilename, char *paramfilename) wjelem[jelem] = utils::numeric(FLERR,words[2].c_str(),false,lmp); if (comm->me == 0) - utils::logmesg(lmp,fmt::format("SNAP Element = {}, Radius {}, Weight {}\n", - elements[jelem], radelem[jelem], wjelem[jelem])); + utils::logmesg(lmp,"SNAP Element = {}, Radius {}, Weight {}\n", + elements[jelem], radelem[jelem], wjelem[jelem]); for (int icoeff = 0; icoeff < ncoeffall; icoeff++) { if (comm->me == 0) { @@ -660,7 +660,7 @@ void PairSNAP::read_files(char *coefffilename, char *paramfilename) auto keyval = words[1]; if (comm->me == 0) - utils::logmesg(lmp,fmt::format("SNAP keyword {} {}\n",keywd,keyval)); + utils::logmesg(lmp,"SNAP keyword {} {}\n",keywd,keyval); if (keywd == "rcutfac") { rcutfac = utils::numeric(FLERR,keyval.c_str(),false,lmp); diff --git a/src/USER-COLVARS/group_ndx.cpp b/src/USER-COLVARS/group_ndx.cpp index 995f60ac85..26711026e8 100644 --- a/src/USER-COLVARS/group_ndx.cpp +++ b/src/USER-COLVARS/group_ndx.cpp @@ -58,7 +58,7 @@ void Group2Ndx::command(int narg, char **arg) if (fp == nullptr) error->one(FLERR,fmt::format("Cannot open index file for writing: {}", utils::getsyserror())); - utils::logmesg(lmp,fmt::format("Writing groups to index file {}:\n",arg[0])); + utils::logmesg(lmp,"Writing groups to index file {}:\n",arg[0]); } if (narg == 1) { // write out all groups @@ -86,7 +86,7 @@ void Group2Ndx::write_group(FILE *fp, int gid) int lnum, width, cols; if (comm->me == 0) { - utils::logmesg(lmp,fmt::format(" writing group {}...",group->names[gid])); + utils::logmesg(lmp," writing group {}...",group->names[gid]); // the "all" group in LAMMPS is called "System" in Gromacs if (gid == 0) { diff --git a/src/USER-COLVARS/ndx_group.cpp b/src/USER-COLVARS/ndx_group.cpp index d8d5632b06..6b9a69ccd3 100644 --- a/src/USER-COLVARS/ndx_group.cpp +++ b/src/USER-COLVARS/ndx_group.cpp @@ -88,7 +88,7 @@ void Ndx2Group::command(int narg, char **arg) if (fp == nullptr) error->one(FLERR,fmt::format("Cannot open index file for reading: {}", utils::getsyserror())); - utils::logmesg(lmp,fmt::format("Reading groups from index file {}:\n",arg[0])); + utils::logmesg(lmp,"Reading groups from index file {}:\n",arg[0]); } if (narg == 1) { // restore all groups @@ -103,7 +103,7 @@ void Ndx2Group::command(int narg, char **arg) continue; } - utils::logmesg(lmp,fmt::format(" Processing group '{}'\n",name)); + utils::logmesg(lmp," Processing group '{}'\n",name); len = name.size()+1; MPI_Bcast(&len,1,MPI_INT,0,world); if (len > 1) { @@ -147,8 +147,8 @@ void Ndx2Group::command(int narg, char **arg) // find named section, search from beginning of file rewind(fp); name = find_section(fp,arg[idx]); - utils::logmesg(lmp,fmt::format(" {} group '{}'\n", name.size() - ? "Processing" : "Skipping",arg[idx])); + utils::logmesg(lmp," {} group '{}'\n", name.size() + ? "Processing" : "Skipping",arg[idx]); len = name.size()+1; MPI_Bcast(&len,1,MPI_INT,0,world); if (len > 1) { diff --git a/src/USER-MISC/fix_orient_eco.cpp b/src/USER-MISC/fix_orient_eco.cpp index 56da3cd6a1..b8b3a00354 100644 --- a/src/USER-MISC/fix_orient_eco.cpp +++ b/src/USER-MISC/fix_orient_eco.cpp @@ -162,8 +162,8 @@ void FixOrientECO::init() { // compute normalization factor int neigh = get_norm(); if (me == 0) { - utils::logmesg(lmp,fmt::format(" fix orient/eco: cutoff={} norm_fac={} " - "neighbors={}\n", r_cut, norm_fac, neigh)); + utils::logmesg(lmp," fix orient/eco: cutoff={} norm_fac={} " + "neighbors={}\n", r_cut, norm_fac, neigh); } inv_norm_fac = 1.0 / norm_fac; diff --git a/src/USER-MISC/fix_pafi.cpp b/src/USER-MISC/fix_pafi.cpp index 7d5216f540..472bb8498f 100644 --- a/src/USER-MISC/fix_pafi.cpp +++ b/src/USER-MISC/fix_pafi.cpp @@ -86,7 +86,7 @@ FixPAFI::FixPAFI(LAMMPS *lmp, int narg, char **arg) : error->all(FLERR,"Compute for fix pafi must have 9 fields per atom"); if (comm->me==0) - utils::logmesg(lmp,fmt::format("fix pafi compute name,style: {},{}\n",computename,PathCompute->style)); + utils::logmesg(lmp,"fix pafi compute name,style: {},{}\n",computename,PathCompute->style); respa_level_support = 1; ilevel_respa = nlevels_respa = 0; diff --git a/src/USER-PACE/pair_pace.cpp b/src/USER-PACE/pair_pace.cpp index d6eda0f511..ae13859968 100644 --- a/src/USER-PACE/pair_pace.cpp +++ b/src/USER-PACE/pair_pace.cpp @@ -280,8 +280,8 @@ void PairPACE::settings(int narg, char **arg) { } if (comm->me == 0) { - utils::logmesg(lmp,fmt::format("ACE version: {}.{}.{}\n", - VERSION_YEAR, VERSION_MONTH, VERSION_DAY)); + utils::logmesg(lmp,"ACE version: {}.{}.{}\n", + VERSION_YEAR, VERSION_MONTH, VERSION_DAY); if (recursive) utils::logmesg(lmp,"Recursive evaluator is used\n"); else utils::logmesg(lmp,"Product evaluator is used\n"); } @@ -303,7 +303,7 @@ void PairPACE::coeff(int narg, char **arg) { //load potential file aceimpl->basis_set = new ACECTildeBasisSet(); if (comm->me == 0) - utils::logmesg(lmp,fmt::format("Loading {}\n", potential_file_name)); + utils::logmesg(lmp,"Loading {}\n", potential_file_name); aceimpl->basis_set->load(potential_file_name); if (comm->me == 0) { @@ -312,7 +312,7 @@ void PairPACE::coeff(int narg, char **arg) { for (SPECIES_TYPE mu = 0; mu < aceimpl->basis_set->nelements; mu++) { int n_r1 = aceimpl->basis_set->total_basis_size_rank1[mu]; int n = aceimpl->basis_set->total_basis_size[mu]; - utils::logmesg(lmp,fmt::format("\t{}: {} (r=1) {} (r>1)\n", aceimpl->basis_set->elements_name[mu], n_r1, n)); + utils::logmesg(lmp,"\t{}: {} (r=1) {} (r>1)\n", aceimpl->basis_set->elements_name[mu], n_r1, n); } } @@ -334,8 +334,8 @@ void PairPACE::coeff(int narg, char **arg) { SPECIES_TYPE mu = aceimpl->basis_set->get_species_index_by_name(elemname); if (mu != -1) { if (comm->me == 0) - utils::logmesg(lmp,fmt::format("Mapping LAMMPS atom type #{}({}) -> " - "ACE species type #{}\n", i, elemname, mu)); + utils::logmesg(lmp,"Mapping LAMMPS atom type #{}({}) -> " + "ACE species type #{}\n", i, elemname, mu); map[i] = mu; aceimpl->ace->element_type_mapping(i) = mu; // set up LAMMPS atom type to ACE species mapping for ace evaluator } else { diff --git a/src/USER-QTB/fix_qbmsst.cpp b/src/USER-QTB/fix_qbmsst.cpp index a9dfb83f06..a21f5a59f0 100644 --- a/src/USER-QTB/fix_qbmsst.cpp +++ b/src/USER-QTB/fix_qbmsst.cpp @@ -415,7 +415,7 @@ void FixQBMSST::setup(int /*vflag*/) v0 = compute_vol(); v0_set = 1; if (comm->me == 0) - utils::logmesg(lmp,fmt::format("Fix QBMSST v0 = {:12.5e}\n", v0)); + utils::logmesg(lmp,"Fix QBMSST v0 = {:12.5e}\n", v0); } if (p0_set == 0) { @@ -423,7 +423,7 @@ void FixQBMSST::setup(int /*vflag*/) p0_set = 1; if (comm->me == 0) - utils::logmesg(lmp,fmt::format("Fix QBMSST p0 = {:12.5e}\n", p0)); + utils::logmesg(lmp,"Fix QBMSST p0 = {:12.5e}\n", p0); } if (e0_set == 0) { @@ -432,7 +432,7 @@ void FixQBMSST::setup(int /*vflag*/) old_eavg = e0; if (comm->me == 0) - utils::logmesg(lmp,fmt::format("Fix QBMSST e0 = to be {:12.5e}\n",e0)); + utils::logmesg(lmp,"Fix QBMSST e0 = to be {:12.5e}\n",e0); } temperature->compute_vector(); @@ -452,9 +452,9 @@ void FixQBMSST::setup(int /*vflag*/) double fac2 = omega[direction]/v0; if ( comm->me == 0 && tscale != 1.0) - utils::logmesg(lmp,fmt::format("Fix QBMSST initial strain rate of {:12.5e} " - "established by reducing temperature by " - "factor of {:12.5e}\n",fac2,tscale)); + utils::logmesg(lmp,"Fix QBMSST initial strain rate of {:12.5e} " + "established by reducing temperature by " + "factor of {:12.5e}\n",fac2,tscale); for (int i = 0; i < atom->nlocal; i++) { if (mask[i] & groupbit) { for (int k = 0; k < 3; k++) { diff --git a/src/bond.cpp b/src/bond.cpp index 1db4681c71..570d921abb 100644 --- a/src/bond.cpp +++ b/src/bond.cpp @@ -279,15 +279,15 @@ void Bond::write_file(int narg, char **arg) units, update->unit_style)); } std::string date = utils::get_potential_date(table_file,"table"); - utils::logmesg(lmp,fmt::format("Appending to table file {} with " - "DATE: {}\n", table_file, date)); + utils::logmesg(lmp,"Appending to table file {} with " + "DATE: {}\n", table_file, date); fp = fopen(table_file.c_str(),"a"); } else { char datebuf[16]; time_t tv = time(nullptr); strftime(datebuf,15,"%Y-%m-%d",localtime(&tv)); - utils::logmesg(lmp,fmt::format("Creating table file {} with " - "DATE: {}\n", table_file, datebuf)); + utils::logmesg(lmp,"Creating table file {} with " + "DATE: {}\n", table_file, datebuf); fp = fopen(table_file.c_str(),"w"); if (fp) fmt::print(fp,"# DATE: {} UNITS: {} Created by bond_write\n", datebuf, update->unit_style); diff --git a/src/comm.cpp b/src/comm.cpp index 6d3f72d9c0..85b6669d86 100644 --- a/src/comm.cpp +++ b/src/comm.cpp @@ -103,7 +103,7 @@ Comm::Comm(LAMMPS *lmp) : Pointers(lmp) if (!lmp->kokkos) omp_set_num_threads(nthreads); if (me == 0) - utils::logmesg(lmp,fmt::format(" using {} OpenMP thread(s) per MPI task\n",nthreads)); + utils::logmesg(lmp," using {} OpenMP thread(s) per MPI task\n",nthreads); #endif } diff --git a/src/create_atoms.cpp b/src/create_atoms.cpp index 7591ae7587..0cec1eba33 100644 --- a/src/create_atoms.cpp +++ b/src/create_atoms.cpp @@ -596,10 +596,9 @@ void CreateAtoms::command(int narg, char **arg) MPI_Barrier(world); if (me == 0) - utils::logmesg(lmp, fmt::format("Created {} atoms\n" - " create_atoms CPU = {:.3f} seconds\n", - atom->natoms - natoms_previous, - MPI_Wtime() - time1)); + utils::logmesg(lmp,"Created {} atoms\n" + " create_atoms CPU = {:.3f} seconds\n", + atom->natoms - natoms_previous, MPI_Wtime() - time1); } /* ---------------------------------------------------------------------- diff --git a/src/create_bonds.cpp b/src/create_bonds.cpp index bedbe4b436..aba0178368 100644 --- a/src/create_bonds.cpp +++ b/src/create_bonds.cpp @@ -320,8 +320,8 @@ void CreateBonds::many() bigint nadd_bonds = atom->nbonds - nbonds_previous; if (comm->me == 0) - utils::logmesg(lmp,fmt::format("Added {} bonds, new total = {}\n", - nadd_bonds,atom->nbonds)); + utils::logmesg(lmp,"Added {} bonds, new total = {}\n", + nadd_bonds,atom->nbonds); } /* ---------------------------------------------------------------------- */ diff --git a/src/delete_bonds.cpp b/src/delete_bonds.cpp index 2bb46e7564..74029c8d5b 100644 --- a/src/delete_bonds.cpp +++ b/src/delete_bonds.cpp @@ -535,24 +535,20 @@ void DeleteBonds::command(int narg, char **arg) if (comm->me == 0) { if (atom->avec->bonds_allow) - utils::logmesg(lmp,fmt::format(" {} total bonds, " - "{} turned on, {} turned off\n", - atom->nbonds,bond_on,bond_off)); + utils::logmesg(lmp," {} total bonds, {} turned on, {} turned off\n", + atom->nbonds,bond_on,bond_off); if (atom->avec->angles_allow) - utils::logmesg(lmp,fmt::format(" {} total angles, " - "{} turned on, {} turned off\n", - atom->nangles,angle_on,angle_off)); + utils::logmesg(lmp," {} total angles, {} turned on, {} turned off\n", + atom->nangles,angle_on,angle_off); if (atom->avec->dihedrals_allow) - utils::logmesg(lmp,fmt::format(" {} total dihedrals, " - "{} turned on, {} turned off\n", - atom->ndihedrals,dihedral_on,dihedral_off)); + utils::logmesg(lmp," {} total dihedrals, {} turned on, {} turned off\n", + atom->ndihedrals,dihedral_on,dihedral_off); if (atom->avec->impropers_allow) - utils::logmesg(lmp,fmt::format(" {} total impropers, " - "{} turned on, {} turned off\n", - atom->nimpropers,improper_on,improper_off)); + utils::logmesg(lmp," {} total impropers, {} turned on, {} turned off\n", + atom->nimpropers,improper_on,improper_off); } // re-compute special list if requested diff --git a/src/finish.cpp b/src/finish.cpp index 28596e3a72..42dc163e13 100644 --- a/src/finish.cpp +++ b/src/finish.cpp @@ -121,9 +121,9 @@ void Finish::end(int flag) if (me == 0) { int ntasks = nprocs * nthreads; - utils::logmesg(lmp,fmt::format("Loop time of {:.6g} on {} procs for " - "{} steps with {} atoms\n\n",time_loop, - ntasks,update->nsteps,atom->natoms)); + utils::logmesg(lmp,"Loop time of {:.6g} on {} procs for " + "{} steps with {} atoms\n\n",time_loop, + ntasks,update->nsteps,atom->natoms); // Gromacs/NAMD-style performance metric for suitable unit settings @@ -141,20 +141,18 @@ void Finish::end(int flag) if (strcmp(update->unit_style,"lj") == 0) { double tau_day = 24.0*3600.0 / t_step * update->dt / one_fs; - utils::logmesg(lmp,fmt::format("Performance: {:.3f} tau/day, {:.3f} " - "timesteps/s\n",tau_day,step_t)); + utils::logmesg(lmp,"Performance: {:.3f} tau/day, {:.3f} " + "timesteps/s\n",tau_day,step_t); } else if (strcmp(update->unit_style,"electron") == 0) { double hrs_fs = t_step / update->dt * one_fs / 3600.0; double fs_day = 24.0*3600.0 / t_step * update->dt / one_fs; - utils::logmesg(lmp,fmt::format("Performance: {:.3f} fs/day, {:.3f} " - "hours/fs, {:.3f} timesteps/s\n", - fs_day,hrs_fs,step_t)); + utils::logmesg(lmp,"Performance: {:.3f} fs/day, {:.3f} hours/fs, " + "{:.3f} timesteps/s\n",fs_day,hrs_fs,step_t); } else { double hrs_ns = t_step / update->dt * 1000000.0 * one_fs / 3600.0; double ns_day = 24.0*3600.0 / t_step * update->dt / one_fs/1000000.0; - utils::logmesg(lmp,fmt::format("Performance: {:.3f} ns/day, {:.3f} " - "hours/ns, {:.3f} timesteps/s\n", - ns_day,hrs_ns,step_t)); + utils::logmesg(lmp,"Performance: {:.3f} ns/day, {:.3f} hours/ns, " + "{:.3f} timesteps/s\n",ns_day,hrs_ns,step_t); } } @@ -162,17 +160,15 @@ void Finish::end(int flag) if (timeflag) { if (lmp->kokkos) { - utils::logmesg(lmp,fmt::format("{:.1f}% CPU use with {} MPI tasks " - "x {} OpenMP threads\n",cpu_loop,nprocs, - lmp->kokkos->nthreads)); + utils::logmesg(lmp,"{:.1f}% CPU use with {} MPI tasks x {} OpenMP " + "threads\n",cpu_loop,nprocs,lmp->kokkos->nthreads); } else { #if defined(_OPENMP) - utils::logmesg(lmp,fmt::format("{:.1f}% CPU use with {} MPI tasks " - "x {} OpenMP threads\n", - cpu_loop,nprocs,nthreads)); + utils::logmesg(lmp,"{:.1f}% CPU use with {} MPI tasks x {} OpenMP " + "threads\n",cpu_loop,nprocs,nthreads); #else - utils::logmesg(lmp,fmt::format("{:.1f}% CPU use with {} MPI tasks " - "x no OpenMP threads\n",cpu_loop,nprocs)); + utils::logmesg(lmp,"{:.1f}% CPU use with {} MPI tasks " + "x no OpenMP threads\n",cpu_loop,nprocs); #endif } } @@ -225,33 +221,33 @@ void Finish::end(int flag) time = timer->get_wall(Timer::DEPHASE); MPI_Allreduce(&time,&tmp,1,MPI_DOUBLE,MPI_SUM,world); time = tmp/nprocs; - if (me == 0) utils::logmesg(lmp,fmt::format(" Dephase time (%) = {} ({})\n", - time,time/time_loop*100.0)); + if (me == 0) utils::logmesg(lmp," Dephase time (%) = {} ({})\n", + time,time/time_loop*100.0); time = timer->get_wall(Timer::DYNAMICS); MPI_Allreduce(&time,&tmp,1,MPI_DOUBLE,MPI_SUM,world); time = tmp/nprocs; - if (me == 0) utils::logmesg(lmp,fmt::format(" Dynamics time (%) = {} ({})\n", - time,time/time_loop*100.0)); + if (me == 0) utils::logmesg(lmp," Dynamics time (%) = {} ({})\n", + time,time/time_loop*100.0); time = timer->get_wall(Timer::QUENCH); MPI_Allreduce(&time,&tmp,1,MPI_DOUBLE,MPI_SUM,world); time = tmp/nprocs; - if (me == 0) utils::logmesg(lmp,fmt::format(" Quench time (%) = {} ({})\n", - time,time/time_loop*100.0)); + if (me == 0) utils::logmesg(lmp," Quench time (%) = {} ({})\n", + time,time/time_loop*100.0); time = timer->get_wall(Timer::REPCOMM); MPI_Allreduce(&time,&tmp,1,MPI_DOUBLE,MPI_SUM,world); time = tmp/nprocs; - if (me == 0) utils::logmesg(lmp,fmt::format(" Comm time (%) = {} ({})\n", - time,time/time_loop*100.0)); + if (me == 0) utils::logmesg(lmp," Comm time (%) = {} ({})\n", + time,time/time_loop*100.0); time = timer->get_wall(Timer::REPOUT); MPI_Allreduce(&time,&tmp,1,MPI_DOUBLE,MPI_SUM,world); time = tmp/nprocs; - if (me == 0) utils::logmesg(lmp,fmt::format(" Output time (%) = {} ({})\n", - time,time/time_loop*100.0)); + if (me == 0) utils::logmesg(lmp," Output time (%) = {} ({})\n", + time,time/time_loop*100.0); time = time_other; MPI_Allreduce(&time,&tmp,1,MPI_DOUBLE,MPI_SUM,world); time = tmp/nprocs; - if (me == 0) utils::logmesg(lmp,fmt::format(" Other time (%) = {} ({})\n", - time,time/time_loop*100.0)); + if (me == 0) utils::logmesg(lmp," Other time (%) = {} ({})\n", + time,time/time_loop*100.0); } // TAD stats @@ -262,33 +258,33 @@ void Finish::end(int flag) time = timer->get_wall(Timer::NEB); MPI_Allreduce(&time,&tmp,1,MPI_DOUBLE,MPI_SUM,world); time = tmp/nprocs; - if (me == 0) utils::logmesg(lmp,fmt::format(" NEB time (%) = {} ({})\n", - time,time/time_loop*100.0)); + if (me == 0) utils::logmesg(lmp," NEB time (%) = {} ({})\n", + time,time/time_loop*100.0); time = timer->get_wall(Timer::DYNAMICS); MPI_Allreduce(&time,&tmp,1,MPI_DOUBLE,MPI_SUM,world); time = tmp/nprocs; - if (me == 0) utils::logmesg(lmp,fmt::format(" Dynamics time (%) = {} ({})\n", - time,time/time_loop*100.0)); + if (me == 0) utils::logmesg(lmp," Dynamics time (%) = {} ({})\n", + time,time/time_loop*100.0); time = timer->get_wall(Timer::QUENCH); MPI_Allreduce(&time,&tmp,1,MPI_DOUBLE,MPI_SUM,world); time = tmp/nprocs; - if (me == 0) utils::logmesg(lmp,fmt::format(" Quench time (%) = {} ({})\n", - time,time/time_loop*100.0)); + if (me == 0) utils::logmesg(lmp," Quench time (%) = {} ({})\n", + time,time/time_loop*100.0); time = timer->get_wall(Timer::REPCOMM); MPI_Allreduce(&time,&tmp,1,MPI_DOUBLE,MPI_SUM,world); time = tmp/nprocs; - if (me == 0) utils::logmesg(lmp,fmt::format(" Comm time (%) = {} ({})\n", - time,time/time_loop*100.0)); + if (me == 0) utils::logmesg(lmp," Comm time (%) = {} ({})\n", + time,time/time_loop*100.0); time = timer->get_wall(Timer::REPOUT); MPI_Allreduce(&time,&tmp,1,MPI_DOUBLE,MPI_SUM,world); time = tmp/nprocs; - if (me == 0) utils::logmesg(lmp,fmt::format(" Output time (%) = {} ({})\n", - time,time/time_loop*100.0)); + if (me == 0) utils::logmesg(lmp," Output time (%) = {} ({})\n", + time,time/time_loop*100.0); time = time_other; MPI_Allreduce(&time,&tmp,1,MPI_DOUBLE,MPI_SUM,world); time = tmp/nprocs; - if (me == 0) utils::logmesg(lmp,fmt::format(" Other time (%) = {} ({})\n", - time,time/time_loop*100.0)); + if (me == 0) utils::logmesg(lmp," Other time (%) = {} ({})\n", + time,time/time_loop*100.0); } // HYPER stats @@ -299,18 +295,18 @@ void Finish::end(int flag) time = timer->get_wall(Timer::DYNAMICS); MPI_Allreduce(&time,&tmp,1,MPI_DOUBLE,MPI_SUM,world); time = tmp/nprocs; - if (me == 0) utils::logmesg(lmp,fmt::format(" Dynamics time (%) = {} ({})\n", - time,time/time_loop*100.0)); + if (me == 0) utils::logmesg(lmp," Dynamics time (%) = {} ({})\n", + time,time/time_loop*100.0); time = timer->get_wall(Timer::QUENCH); MPI_Allreduce(&time,&tmp,1,MPI_DOUBLE,MPI_SUM,world); time = tmp/nprocs; - if (me == 0) utils::logmesg(lmp,fmt::format(" Quench time (%) = {} ({})\n", - time,time/time_loop*100.0)); + if (me == 0) utils::logmesg(lmp," Quench time (%) = {} ({})\n", + time,time/time_loop*100.0); time = time_other; MPI_Allreduce(&time,&tmp,1,MPI_DOUBLE,MPI_SUM,world); time = tmp/nprocs; - if (me == 0) utils::logmesg(lmp,fmt::format(" Other time (%) = {} ({})\n", - time,time/time_loop*100.0)); + if (me == 0) utils::logmesg(lmp," Other time (%) = {} ({})\n", + time,time/time_loop*100.0); } // further timing breakdowns @@ -358,13 +354,11 @@ void Finish::end(int flag) if (me == 0) { if (timer->has_full()) - utils::logmesg(lmp,fmt::format("Other | | {:<10.4g} | " - " | | |{:6.2f}\n", - time,time/time_loop*100.0)); + utils::logmesg(lmp,"Other | | {:<10.4g} | | " + " | |{:6.2f}\n",time,time/time_loop*100.0); else - utils::logmesg(lmp,fmt::format("Other | | {:<10.4g} | " - " | |{:6.2f}\n", - time,time/time_loop*100.0)); + utils::logmesg(lmp,"Other | | {:<10.4g} | | " + " |{:6.2f}\n",time,time/time_loop*100.0); } } @@ -388,7 +382,7 @@ void Finish::end(int flag) "\nThread timing breakdown (MPI rank {}):\nTotal threaded time {:.4g} / {:.1f}%\n" "Section | min time | avg time | max time |%varavg| %total\n" "---------------------------------------------------------------\n"; - utils::logmesg(lmp,fmt::format(thr_fmt,me,thr_total,thr_total/time_loop*100.0)); + utils::logmesg(lmp,thr_fmt,me,thr_total,thr_total/time_loop*100.0); omp_times(fixomp,"Pair",Timer::PAIR,nthreads,screen,logfile); if (atom->molecular != Atom::ATOMIC) @@ -460,9 +454,9 @@ void Finish::end(int flag) } else fraction = flop3 = flop1 = 0.0; if (me == 0) - utils::logmesg(lmp,fmt::format("FFT time (% of Kspce) = {:.6} ({:.4})\n" - "FFT Gflps 3d (1d only) = {:.8} {:.8}\n", - time3d,fraction,flop3,flop1)); + utils::logmesg(lmp,"FFT time (% of Kspce) = {:.6} ({:.4})\n" + "FFT Gflps 3d (1d only) = {:.8} {:.8}\n", + time3d,fraction,flop3,flop1); } if (histoflag) { diff --git a/src/group.cpp b/src/group.cpp index 9e140779ef..997214cbc7 100644 --- a/src/group.cpp +++ b/src/group.cpp @@ -535,9 +535,9 @@ void Group::assign(int narg, char **arg) if (me == 0) { if (dynamic[igroup]) - utils::logmesg(lmp,fmt::format("dynamic group {} defined\n",names[igroup])); + utils::logmesg(lmp,"dynamic group {} defined\n",names[igroup]); else - utils::logmesg(lmp,fmt::format("{:.15g} atoms in group {}\n",all,names[igroup])); + utils::logmesg(lmp,"{:.15g} atoms in group {}\n",all,names[igroup]); } } diff --git a/src/lattice.cpp b/src/lattice.cpp index 3a0deb72db..bfc0b5b9ef 100644 --- a/src/lattice.cpp +++ b/src/lattice.cpp @@ -300,9 +300,8 @@ Lattice::Lattice(LAMMPS *lmp, int narg, char **arg) : Pointers(lmp) // print lattice spacings if (comm->me == 0) - utils::logmesg(lmp,fmt::format("Lattice spacing in x,y,z = " - "{:.8} {:.8} {:.8}\n", - xlattice,ylattice,zlattice)); + utils::logmesg(lmp,"Lattice spacing in x,y,z = {:.8} {:.8} {:.8}\n", + xlattice,ylattice,zlattice); } /* ---------------------------------------------------------------------- */ diff --git a/src/modify.cpp b/src/modify.cpp index 246b855913..f8a75ca908 100644 --- a/src/modify.cpp +++ b/src/modify.cpp @@ -925,9 +925,9 @@ void Modify::add_fix(int narg, char **arg, int trysuffix) used_restart_global[i] = 1; fix[ifix]->restart_reset = 1; if (comm->me == 0) - utils::logmesg(lmp,fmt::format("Resetting global fix info from restart file:\n" - " fix style: {}, fix ID: {}\n", - fix[ifix]->style,fix[ifix]->id)); + utils::logmesg(lmp,"Resetting global fix info from restart file:\n" + " fix style: {}, fix ID: {}\n", + fix[ifix]->style,fix[ifix]->id); } // check if Fix is in restart_peratom list @@ -941,9 +941,9 @@ void Modify::add_fix(int narg, char **arg, int trysuffix) fix[ifix]->unpack_restart(j,index_restart_peratom[i]); fix[ifix]->restart_reset = 1; if (comm->me == 0) - utils::logmesg(lmp,fmt::format("Resetting peratom fix info from restart file:\n" - " fix style: {}, fix ID: {}\n", - fix[ifix]->style,fix[ifix]->id)); + utils::logmesg(lmp,"Resetting peratom fix info from restart file:\n" + " fix style: {}, fix ID: {}\n", + fix[ifix]->style,fix[ifix]->id); } // increment nfix (if new) @@ -1574,8 +1574,8 @@ void Modify::restart_deallocate(int flag) utils::logmesg(lmp,"Unused restart file global fix info:\n"); for (i = 0; i < nfix_restart_global; i++) { if (used_restart_global[i]) continue; - utils::logmesg(lmp,fmt::format(" fix style: {}, fix ID: {}\n", - style_restart_global[i],id_restart_global[i])); + utils::logmesg(lmp," fix style: {}, fix ID: {}\n", + style_restart_global[i],id_restart_global[i]); } } } @@ -1602,8 +1602,8 @@ void Modify::restart_deallocate(int flag) utils::logmesg(lmp,"Unused restart file peratom fix info:\n"); for (i = 0; i < nfix_restart_peratom; i++) { if (used_restart_peratom[i]) continue; - utils::logmesg(lmp,fmt::format(" fix style: {}, fix ID: {}\n", - style_restart_peratom[i],id_restart_peratom[i])); + utils::logmesg(lmp," fix style: {}, fix ID: {}\n", + style_restart_peratom[i],id_restart_peratom[i]); } } } diff --git a/src/molecule.cpp b/src/molecule.cpp index 644e3ff79c..9aca15820d 100644 --- a/src/molecule.cpp +++ b/src/molecule.cpp @@ -146,16 +146,14 @@ Molecule::Molecule(LAMMPS *lmp, int narg, char **arg, int &index) : // stats if (me == 0) - utils::logmesg(lmp,fmt::format("Read molecule template {}:\n" - " {} molecules\n" - " {} atoms with max type {}\n" - " {} bonds with max type {}\n" - " {} angles with max type {}\n" - " {} dihedrals with max type {}\n" - " {} impropers with max type {}\n", - id,nmolecules,natoms,ntypes, - nbonds,nbondtypes,nangles,nangletypes, - ndihedrals,ndihedraltypes,nimpropers,nimpropertypes)); + utils::logmesg(lmp,"Read molecule template {}:\n {} molecules\n" + " {} atoms with max type {}\n" + " {} bonds with max type {}\n" + " {} angles with max type {}\n" + " {} dihedrals with max type {}\n" + " {} impropers with max type {}\n", id,nmolecules, + natoms,ntypes,nbonds,nbondtypes,nangles,nangletypes, + ndihedrals,ndihedraltypes,nimpropers,nimpropertypes); } /* ---------------------------------------------------------------------- */ diff --git a/src/output.cpp b/src/output.cpp index d7be9b8cd6..6f11079a75 100644 --- a/src/output.cpp +++ b/src/output.cpp @@ -817,7 +817,6 @@ void Output::memory_usage() mbavg /= comm->nprocs; if (comm->me == 0) - utils::logmesg(lmp,fmt::format("Per MPI rank memory allocation (min/avg/" - "max) = {:.4} | {:.4} | {:.4} Mbytes\n", - mbmin,mbavg,mbmax)); + utils::logmesg(lmp,"Per MPI rank memory allocation (min/avg/max) = " + "{:.4} | {:.4} | {:.4} Mbytes\n",mbmin,mbavg,mbmax); } diff --git a/src/pair.cpp b/src/pair.cpp index 0d90b0ce39..015129dc5d 100644 --- a/src/pair.cpp +++ b/src/pair.cpp @@ -1734,15 +1734,15 @@ void Pair::write_file(int narg, char **arg) units, update->unit_style)); } std::string date = utils::get_potential_date(table_file,"table"); - utils::logmesg(lmp,fmt::format("Appending to table file {} with " - "DATE: {}\n", table_file, date)); + utils::logmesg(lmp,"Appending to table file {} with DATE: {}\n", + table_file, date); fp = fopen(table_file.c_str(),"a"); } else { char datebuf[16]; time_t tv = time(nullptr); strftime(datebuf,15,"%Y-%m-%d",localtime(&tv)); - utils::logmesg(lmp,fmt::format("Creating table file {} with " - "DATE: {}\n", table_file, datebuf)); + utils::logmesg(lmp,"Creating table file {} with DATE: {}\n", + table_file, datebuf); fp = fopen(table_file.c_str(),"w"); if (fp) fmt::print(fp,"# DATE: {} UNITS: {} Created by pair_write\n", datebuf, update->unit_style); diff --git a/src/potential_file_reader.cpp b/src/potential_file_reader.cpp index bddfca9bce..ce369253cf 100644 --- a/src/potential_file_reader.cpp +++ b/src/potential_file_reader.cpp @@ -254,8 +254,8 @@ TextFileReader *PotentialFileReader::open_potential(const std::string &path) { std::string units = utils::get_potential_units(filepath, filetype); if (!date.empty()) - utils::logmesg(lmp, fmt::format("Reading {} file {} with DATE: {}\n", - filetype, filename, date)); + utils::logmesg(lmp,"Reading {} file {} with DATE: {}\n", + filetype, filename, date); if (units.empty()) { unit_convert = utils::NOCONVERT; diff --git a/src/read_data.cpp b/src/read_data.cpp index c0085f19d1..57d5d898a9 100644 --- a/src/read_data.cpp +++ b/src/read_data.cpp @@ -907,8 +907,7 @@ void ReadData::command(int narg, char **arg) MPI_Barrier(world); if (comm->me == 0) - utils::logmesg(lmp,fmt::format(" read_data CPU = {:.3f} seconds\n", - MPI_Wtime()-time1)); + utils::logmesg(lmp," read_data CPU = {:.3f} seconds\n",MPI_Wtime()-time1); } /* ---------------------------------------------------------------------- @@ -1239,7 +1238,7 @@ void ReadData::atoms() MPI_Allreduce(&n,&sum,1,MPI_LMP_BIGINT,MPI_SUM,world); bigint nassign = sum - (atom->natoms - natoms); - if (me == 0) utils::logmesg(lmp,fmt::format(" {} atoms\n",nassign)); + if (me == 0) utils::logmesg(lmp," {} atoms\n",nassign); if (sum != atom->natoms) error->all(FLERR,"Did not assign all atoms correctly"); @@ -1293,7 +1292,7 @@ void ReadData::velocities() atom->map_style = Atom::MAP_NONE; } - if (me == 0) utils::logmesg(lmp,fmt::format(" {} velocities\n",natoms)); + if (me == 0) utils::logmesg(lmp," {} velocities\n",natoms); } /* ---------------------------------------------------------------------- @@ -1342,7 +1341,7 @@ void ReadData::bonds(int firstpass) if (addflag == NONE) maxall += atom->extra_bond_per_atom; if (me == 0) - utils::logmesg(lmp,fmt::format(" {} = max bonds/atom\n",maxall)); + utils::logmesg(lmp," {} = max bonds/atom\n",maxall); if (addflag != NONE) { if (maxall > atom->bond_per_atom) @@ -1364,7 +1363,7 @@ void ReadData::bonds(int firstpass) if (!force->newton_bond) factor = 2; if (me == 0) - utils::logmesg(lmp,fmt::format(" {} bonds\n",sum/factor)); + utils::logmesg(lmp," {} bonds\n",sum/factor); if (sum != factor*nbonds) error->all(FLERR,"Bonds assigned incorrectly"); @@ -1416,7 +1415,7 @@ void ReadData::angles(int firstpass) if (addflag == NONE) maxall += atom->extra_angle_per_atom; if (me == 0) - utils::logmesg(lmp,fmt::format(" {} = max angles/atom\n",maxall)); + utils::logmesg(lmp," {} = max angles/atom\n",maxall); if (addflag != NONE) { if (maxall > atom->angle_per_atom) @@ -1438,7 +1437,7 @@ void ReadData::angles(int firstpass) if (!force->newton_bond) factor = 3; if (me == 0) - utils::logmesg(lmp,fmt::format(" {} angles\n",sum/factor)); + utils::logmesg(lmp," {} angles\n",sum/factor); if (sum != factor*nangles) error->all(FLERR,"Angles assigned incorrectly"); @@ -1490,7 +1489,7 @@ void ReadData::dihedrals(int firstpass) if (addflag == NONE) maxall += atom->extra_dihedral_per_atom; if (me == 0) - utils::logmesg(lmp,fmt::format(" {} = max dihedrals/atom\n",maxall)); + utils::logmesg(lmp," {} = max dihedrals/atom\n",maxall); if (addflag != NONE) { if (maxall > atom->dihedral_per_atom) @@ -1512,7 +1511,7 @@ void ReadData::dihedrals(int firstpass) if (!force->newton_bond) factor = 4; if (me == 0) - utils::logmesg(lmp,fmt::format(" {} dihedrals\n",sum/factor)); + utils::logmesg(lmp," {} dihedrals\n",sum/factor); if (sum != factor*ndihedrals) error->all(FLERR,"Dihedrals assigned incorrectly"); @@ -1564,7 +1563,7 @@ void ReadData::impropers(int firstpass) if (addflag == NONE) maxall += atom->extra_improper_per_atom; if (me == 0) - utils::logmesg(lmp,fmt::format(" {} = max impropers/atom\n",maxall)); + utils::logmesg(lmp," {} = max impropers/atom\n",maxall); if (addflag != NONE) { if (maxall > atom->improper_per_atom) @@ -1586,7 +1585,7 @@ void ReadData::impropers(int firstpass) if (!force->newton_bond) factor = 4; if (me == 0) - utils::logmesg(lmp,fmt::format(" {} impropers\n",sum/factor)); + utils::logmesg(lmp," {} impropers\n",sum/factor); if (sum != factor*nimpropers) error->all(FLERR,"Impropers assigned incorrectly"); @@ -1625,7 +1624,7 @@ void ReadData::bonus(bigint nbonus, AtomVec *ptr, const char *type) } if (me == 0) - utils::logmesg(lmp,fmt::format(" {} {}\n",natoms,type)); + utils::logmesg(lmp," {} {}\n",natoms,type); } /* ---------------------------------------------------------------------- @@ -1729,7 +1728,7 @@ void ReadData::bodies(int firstpass, AtomVec *ptr) } if (me == 0 && firstpass) - utils::logmesg(lmp,fmt::format(" {} bodies\n",natoms)); + utils::logmesg(lmp," {} bodies\n",natoms); } /* ---------------------------------------------------------------------- */ diff --git a/src/read_dump.cpp b/src/read_dump.cpp index ddb793c629..370752f698 100644 --- a/src/read_dump.cpp +++ b/src/read_dump.cpp @@ -157,13 +157,14 @@ void ReadDump::command(int narg, char **arg) domain->print_box(" "); if (me == 0) - utils::logmesg(lmp, fmt::format(" {} atoms before read\n",natoms_prev) - + fmt::format(" {} atoms in snapshot\n",nsnap_all) - + fmt::format(" {} atoms purged\n",npurge_all) - + fmt::format(" {} atoms replaced\n",nreplace_all) - + fmt::format(" {} atoms trimmed\n",ntrim_all) - + fmt::format(" {} atoms added\n",nadd_all) - + fmt::format(" {} atoms after read\n",atom->natoms)); + utils::logmesg(lmp," {} atoms before read\n" + " {} atoms in snapshot\n" + " {} atoms purged\n" + " {} atoms replaced\n" + " {} atoms trimmed\n" + " {} atoms added\n" + " {} atoms after read\n",natoms_prev,nsnap_all, + npurge_all,nreplace_all,ntrim_all,nadd_all,atom->natoms); } /* ---------------------------------------------------------------------- */ diff --git a/src/read_restart.cpp b/src/read_restart.cpp index 2742dc5e4e..40e4414543 100644 --- a/src/read_restart.cpp +++ b/src/read_restart.cpp @@ -467,7 +467,7 @@ void ReadRestart::command(int narg, char **arg) MPI_Allreduce(&nblocal,&natoms,1,MPI_LMP_BIGINT,MPI_SUM,world); if (me == 0) - utils::logmesg(lmp,fmt::format(" {} atoms\n",natoms)); + utils::logmesg(lmp," {} atoms\n",natoms); if (natoms != atom->natoms) error->all(FLERR,"Did not assign all restart atoms correctly"); @@ -524,8 +524,8 @@ void ReadRestart::command(int narg, char **arg) MPI_Barrier(world); if (comm->me == 0) - utils::logmesg(lmp,fmt::format(" read_restart CPU = {:.3f} seconds\n", - MPI_Wtime()-time1)); + utils::logmesg(lmp," read_restart CPU = {:.3f} seconds\n", + MPI_Wtime()-time1); } /* ---------------------------------------------------------------------- @@ -634,8 +634,8 @@ void ReadRestart::header() if (flag == VERSION) { char *version = read_string(); if (me == 0) - utils::logmesg(lmp,fmt::format(" restart file = {}, LAMMPS = {}\n", - version,lmp->version)); + utils::logmesg(lmp," restart file = {}, LAMMPS = {}\n", + version,lmp->version); delete [] version; // we have no forward compatibility, thus exit with error @@ -809,7 +809,7 @@ void ReadRestart::header() argcopy[i] = read_string(); atom->create_avec(style,nargcopy,argcopy,1); if (comm->me ==0) - utils::logmesg(lmp,fmt::format(" restoring atom style {} from restart\n",style)); + utils::logmesg(lmp," restoring atom style {} from restart\n",style); for (int i = 0; i < nargcopy; i++) delete [] argcopy[i]; delete [] argcopy; delete [] style; @@ -950,15 +950,14 @@ void ReadRestart::force_fields() force->create_pair(style,1); delete [] style; if (comm->me ==0) - utils::logmesg(lmp,fmt::format(" restoring pair style {} from " - "restart\n", force->pair_style)); + utils::logmesg(lmp," restoring pair style {} from restart\n", + force->pair_style); force->pair->read_restart(fp); } else if (flag == NO_PAIR) { style = read_string(); if (comm->me ==0) - utils::logmesg(lmp,fmt::format(" pair style {} stores no " - "restart info\n", style)); + utils::logmesg(lmp," pair style {} stores no restart info\n", style); force->create_pair("none",0); force->pair_restart = style; @@ -967,8 +966,8 @@ void ReadRestart::force_fields() force->create_bond(style,1); delete [] style; if (comm->me ==0) - utils::logmesg(lmp,fmt::format(" restoring bond style {} from " - "restart\n", force->bond_style)); + utils::logmesg(lmp," restoring bond style {} from restart\n", + force->bond_style); force->bond->read_restart(fp); } else if (flag == ANGLE) { @@ -976,8 +975,8 @@ void ReadRestart::force_fields() force->create_angle(style,1); delete [] style; if (comm->me ==0) - utils::logmesg(lmp,fmt::format(" restoring angle style {} from " - "restart\n", force->angle_style)); + utils::logmesg(lmp," restoring angle style {} from restart\n", + force->angle_style); force->angle->read_restart(fp); } else if (flag == DIHEDRAL) { @@ -985,8 +984,8 @@ void ReadRestart::force_fields() force->create_dihedral(style,1); delete [] style; if (comm->me ==0) - utils::logmesg(lmp,fmt::format(" restoring dihedral style {} from " - "restart\n", force->dihedral_style)); + utils::logmesg(lmp," restoring dihedral style {} from restart\n", + force->dihedral_style); force->dihedral->read_restart(fp); } else if (flag == IMPROPER) { @@ -994,8 +993,8 @@ void ReadRestart::force_fields() force->create_improper(style,1); delete [] style; if (comm->me ==0) - utils::logmesg(lmp,fmt::format(" restoring improper style {} from " - "restart\n", force->improper_style)); + utils::logmesg(lmp," restoring improper style {} from restart\n", + force->improper_style); force->improper->read_restart(fp); } else error->all(FLERR, diff --git a/src/replicate.cpp b/src/replicate.cpp index 95bf615d04..5a596c524c 100644 --- a/src/replicate.cpp +++ b/src/replicate.cpp @@ -647,9 +647,8 @@ void Replicate::command(int narg, char **arg) MPI_Reduce(&num_replicas_added, &sum, 1, MPI_INT, MPI_SUM, 0, world); double avg = (double) sum / nprocs; if (me == 0) - utils::logmesg(lmp,fmt::format(" average # of replicas added to proc =" - " {:.2f} out of {} ({:.2f}%)\n", - avg,nx*ny*nz,avg/(nx*ny*nz)*100.0)); + utils::logmesg(lmp," average # of replicas added to proc = {:.2f} out " + "of {} ({:.2f}%)\n",avg,nx*ny*nz,avg/(nx*ny*nz)*100.0); } else { for (int iproc = 0; iproc < nprocs; iproc++) { @@ -753,7 +752,7 @@ void Replicate::command(int narg, char **arg) MPI_Allreduce(&nblocal,&natoms,1,MPI_LMP_BIGINT,MPI_SUM,world); if (me == 0) { - utils::logmesg(lmp,fmt::format(" {} atoms\n",natoms)); + utils::logmesg(lmp," {} atoms\n",natoms); } if (natoms != atom->natoms) @@ -763,16 +762,16 @@ void Replicate::command(int narg, char **arg) const char *molstyle = ""; if (atom->molecular == Atom::TEMPLATE) molstyle = "template "; if (atom->nbonds) { - utils::logmesg(lmp,fmt::format(" {} {}bonds\n",atom->nbonds,molstyle)); + utils::logmesg(lmp," {} {}bonds\n",atom->nbonds,molstyle); } if (atom->nangles) { - utils::logmesg(lmp,fmt::format(" {} {}angles\n",atom->nangles,molstyle)); + utils::logmesg(lmp," {} {}angles\n",atom->nangles,molstyle); } if (atom->ndihedrals) { - utils::logmesg(lmp,fmt::format(" {} {}dihedrals\n",atom->ndihedrals,molstyle)); + utils::logmesg(lmp," {} {}dihedrals\n",atom->ndihedrals,molstyle); } if (atom->nimpropers) { - utils::logmesg(lmp,fmt::format(" {} {}impropers\n",atom->nimpropers,molstyle)); + utils::logmesg(lmp," {} {}impropers\n",atom->nimpropers,molstyle); } } @@ -799,6 +798,5 @@ void Replicate::command(int narg, char **arg) MPI_Barrier(world); if (me == 0) - utils::logmesg(lmp,fmt::format(" replicate CPU = {:.3f} seconds\n", - MPI_Wtime()-time1)); + utils::logmesg(lmp," replicate CPU = {:.3f} seconds\n",MPI_Wtime()-time1); } diff --git a/src/reset_mol_ids.cpp b/src/reset_mol_ids.cpp index 39f7307ca1..9501c19861 100644 --- a/src/reset_mol_ids.cpp +++ b/src/reset_mol_ids.cpp @@ -131,11 +131,11 @@ void ResetMolIDs::command(int narg, char **arg) if (comm->me == 0) { if (nchunk < 0) - utils::logmesg(lmp,fmt::format(" number of new molecule IDs = unknown\n")); + utils::logmesg(lmp," number of new molecule IDs = unknown\n"); else - utils::logmesg(lmp,fmt::format(" number of new molecule IDs = {}\n",nchunk)); - utils::logmesg(lmp,fmt::format(" reset_mol_ids CPU = {:.3f} seconds\n", - MPI_Wtime()-time1)); + utils::logmesg(lmp," number of new molecule IDs = {}\n",nchunk); + utils::logmesg(lmp," reset_mol_ids CPU = {:.3f} seconds\n", + MPI_Wtime()-time1); } } diff --git a/src/set.cpp b/src/set.cpp index fdc0c37bfd..c36df7f1c7 100644 --- a/src/set.cpp +++ b/src/set.cpp @@ -600,11 +600,11 @@ void Set::command(int narg, char **arg) if (comm->me == 0) { if (strcmp(arg[origarg],"cc") == 0) - utils::logmesg(lmp,fmt::format(" {} settings made for {} index {}\n", - allcount,arg[origarg],arg[origarg+1])); + utils::logmesg(lmp," {} settings made for {} index {}\n", + allcount,arg[origarg],arg[origarg+1]); else - utils::logmesg(lmp,fmt::format(" {} settings made for {}\n", - allcount,arg[origarg])); + utils::logmesg(lmp," {} settings made for {}\n", + allcount,arg[origarg]); } } diff --git a/src/special.cpp b/src/special.cpp index d263112756..2d90f377a2 100644 --- a/src/special.cpp +++ b/src/special.cpp @@ -92,7 +92,7 @@ void Special::build() // print max # of 1-2 neighbors if (me == 0) - utils::logmesg(lmp,fmt::format("{:>6} = max # of 1-2 neighbors\n",maxall)); + utils::logmesg(lmp,"{:>6} = max # of 1-2 neighbors\n",maxall); // done if special_bond weights for 1-3, 1-4 are set to 1.0 @@ -115,7 +115,7 @@ void Special::build() // print max # of 1-3 neighbors if (me == 0) - utils::logmesg(lmp,fmt::format("{:>6} = max # of 1-3 neighbors\n",maxall)); + utils::logmesg(lmp,"{:>6} = max # of 1-3 neighbors\n",maxall); // done if special_bond weights for 1-4 are set to 1.0 @@ -138,7 +138,7 @@ void Special::build() // print max # of 1-4 neighbors if (me == 0) - utils::logmesg(lmp,fmt::format("{:>6} = max # of 1-4 neighbors\n",maxall)); + utils::logmesg(lmp,"{:>6} = max # of 1-4 neighbors\n",maxall); // finish processing the onetwo, onethree, onefour lists @@ -690,8 +690,7 @@ void Special::combine() force->special_extra = 0; if (me == 0) - utils::logmesg(lmp,fmt::format("{:>6} = max # of special " - "neighbors\n",atom->maxspecial)); + utils::logmesg(lmp,"{:>6} = max # of special neighbors\n",atom->maxspecial); if (lmp->kokkos) { AtomKokkos* atomKK = (AtomKokkos*) atom; @@ -793,8 +792,8 @@ void Special::angle_trim() MPI_Allreduce(&onethreecount,&allcount,1,MPI_DOUBLE,MPI_SUM,world); if (me == 0) - utils::logmesg(lmp,fmt::format(" {} = # of 1-3 neighbors " - "before angle trim\n",allcount)); + utils::logmesg(lmp," {} = # of 1-3 neighbors before angle trim\n", + allcount); // if angles or dihedrals are defined // rendezvous angle 1-3 and dihedral 1-3,2-4 pairs @@ -1023,8 +1022,8 @@ void Special::angle_trim() MPI_Allreduce(&onethreecount,&allcount,1,MPI_DOUBLE,MPI_SUM,world); if (me == 0) - utils::logmesg(lmp,fmt::format(" {} = # of 1-3 neighbors " - "after angle trim\n",allcount)); + utils::logmesg(lmp," {} = # of 1-3 neighbors after angle trim\n", + allcount); } /* ---------------------------------------------------------------------- @@ -1053,8 +1052,8 @@ void Special::dihedral_trim() MPI_Allreduce(&onefourcount,&allcount,1,MPI_DOUBLE,MPI_SUM,world); if (me == 0) - utils::logmesg(lmp,fmt::format(" {} = # of 1-4 neighbors " - "before dihedral trim\n",allcount)); + utils::logmesg(lmp," {} = # of 1-4 neighbors before dihedral trim\n", + allcount); // if dihedrals are defined, rendezvous the dihedral 1-4 pairs @@ -1197,8 +1196,8 @@ void Special::dihedral_trim() MPI_Allreduce(&onefourcount,&allcount,1,MPI_DOUBLE,MPI_SUM,world); if (me == 0) - utils::logmesg(lmp,fmt::format(" {} = # of 1-4 neighbors " - "after dihedral trim\n",allcount)); + utils::logmesg(lmp," {} = # of 1-4 neighbors after dihedral trim\n", + allcount); } /* ---------------------------------------------------------------------- @@ -1313,6 +1312,6 @@ void Special::fix_alteration() void Special::timer_output(double time1) { if (comm->me == 0) - utils::logmesg(lmp,fmt::format(" special bonds CPU = {:.3f} seconds\n", - MPI_Wtime()-time1)); + utils::logmesg(lmp," special bonds CPU = {:.3f} seconds\n", + MPI_Wtime()-time1); } diff --git a/src/timer.cpp b/src/timer.cpp index 9c8cf5db8c..79fb63e7b5 100644 --- a/src/timer.cpp +++ b/src/timer.cpp @@ -294,8 +294,7 @@ void Timer::modify_params(int narg, char **arg) strftime(timebuf,32,"%H:%M:%S",tm); } - utils::logmesg(lmp,fmt::format("New timer settings: style={} mode={} " - "timeout={}\n",timer_style[_level], - timer_mode[_sync],timebuf)); + utils::logmesg(lmp,"New timer settings: style={} mode={} timeout={}\n", + timer_style[_level],timer_mode[_sync],timebuf); } } diff --git a/src/utils.cpp b/src/utils.cpp index 4071b7b61b..fedf86149e 100644 --- a/src/utils.cpp +++ b/src/utils.cpp @@ -1099,10 +1099,8 @@ FILE *utils::open_potential(const std::string &name, LAMMPS *lmp, std::string date = get_potential_date(filepath, "potential"); std::string units = get_potential_units(filepath, "potential"); - if (!date.empty() && (me == 0)) { - logmesg(lmp, fmt::format("Reading potential file {} " - "with DATE: {}\n", name, date)); - } + if (!date.empty() && (me == 0)) + logmesg(lmp,"Reading potential file {} with DATE: {}\n", name, date); if (auto_convert == nullptr) { if (!units.empty() && (units != unit_style) && (me == 0)) {