reformat source

This commit is contained in:
Axel Kohlmeyer
2025-04-05 00:53:28 -04:00
parent e0847f2195
commit c60bff2b97
2 changed files with 10 additions and 15 deletions

View File

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

View File

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