use std::stoX() functions

This commit is contained in:
Axel Kohlmeyer
2024-07-30 03:57:23 -04:00
parent 92cbbaab6a
commit 620af2599b
6 changed files with 19 additions and 18 deletions

View File

@ -181,10 +181,10 @@ void Universe::add_world(char *str)
if ((found == 0) || (found == (part.size() - 1))) {
valid = false;
} else if (found == std::string::npos) {
nper = atoi(part.c_str());
nper = std::stoi(part);
} else {
n = atoi(part.substr(0,found).c_str());
nper = atoi(part.substr(found+1).c_str());
n = std::stoi(part.substr(0,found));
nper = std::stoi(part.substr(found+1));
}
}
@ -193,8 +193,7 @@ void Universe::add_world(char *str)
if (n < 1 || nper < 1) valid = false;
if (!valid)
error->universe_all(FLERR,fmt::format("Invalid partition string '{}'",
str));
error->universe_all(FLERR, fmt::format("Invalid partition string '{}'", str));
} else nper = nprocs;
memory->grow(procs_per_world,nworlds+n,"universe:procs_per_world");