From c60bff2b971b2499dfa2aaa2d49f73ce45b53911 Mon Sep 17 00:00:00 2001 From: Axel Kohlmeyer Date: Sat, 5 Apr 2025 00:53:28 -0400 Subject: [PATCH] reformat source --- src/lammps.cpp | 7 +++---- src/universe.cpp | 18 +++++++----------- 2 files changed, 10 insertions(+), 15 deletions(-) diff --git a/src/lammps.cpp b/src/lammps.cpp index 72a1b67fb2..d1b05aa279 100644 --- a/src/lammps.cpp +++ b/src/lammps.cpp @@ -528,8 +528,7 @@ LAMMPS::LAMMPS(int narg, char **arg, MPI_Comm communicator) : if (helpflag == 0) { universe->ulogfile = fopen("log.lammps","w"); if (universe->ulogfile == nullptr) - error->universe_warn(FLERR,"Cannot open log.lammps for writing: " - + utils::getsyserror()); + error->universe_warn(FLERR,"Cannot open log.lammps for writing: " + utils::getsyserror()); } } else if (strcmp(arg[logflag],"none") == 0) universe->ulogfile = nullptr; @@ -661,8 +660,8 @@ LAMMPS::LAMMPS(int narg, char **arg, MPI_Comm communicator) : } if ((me == 0) && (!helpflag)) - utils::logmesg(this,"LAMMPS ({}{})\nProcessor partition = {}\n", version, - update_string, universe->iworld); + utils::logmesg(this,"LAMMPS ({}{})\nProcessor partition = {}\n", version, update_string, + universe->iworld); } // check consistency of datatype settings in lmptype.h diff --git a/src/universe.cpp b/src/universe.cpp index fb07e26759..4daa83ef80 100644 --- a/src/universe.cpp +++ b/src/universe.cpp @@ -27,21 +27,18 @@ static constexpr int MAXLINE = 256; create & initialize the universe of processors in communicator ------------------------------------------------------------------------- */ -Universe::Universe(LAMMPS *lmp, MPI_Comm communicator) : Pointers(lmp) +Universe::Universe(LAMMPS *lmp, MPI_Comm communicator) : + Pointers(lmp), uscreen(stdout), ulogfile(nullptr), procs_per_world(nullptr), root_proc(nullptr), + uni2orig(nullptr) { uworld = uorig = communicator; - MPI_Comm_rank(uworld,&me); - MPI_Comm_size(uworld,&nprocs); - - uscreen = stdout; - ulogfile = nullptr; + MPI_Comm_rank(uworld, &me); + MPI_Comm_size(uworld, &nprocs); existflag = 0; nworlds = 0; - procs_per_world = nullptr; - root_proc = nullptr; - memory->create(uni2orig,nprocs,"universe:uni2orig"); + memory->create(uni2orig, nprocs, "universe:uni2orig"); for (int i = 0; i < nprocs; i++) uni2orig[i] = i; } @@ -89,8 +86,7 @@ void Universe::reorder(char *style, char *arg) if (me == 0) { FILE *fp = fopen(arg,"r"); if (fp == nullptr) - error->universe_one(FLERR,fmt::format("Cannot open -reorder " - "file {}: {}",arg, + error->universe_one(FLERR,fmt::format("Cannot open -reorder file {}: {}", arg, utils::getsyserror())); // skip header = blank and comment lines