Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Found on bunya make fails (unless nlopt disabled) due to mpi.rank #487

Merged
merged 7 commits into from
Jan 10, 2024
10 changes: 5 additions & 5 deletions src/Handlers/acOptimize.cpp.Rt
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ int acOptimize::OptimizerInit () {
pugi::xml_attribute attr;
nlopt_result res;
material=0.0;
if (solver->mpi.rank == 0) {
if (solver->mpi_rank == 0) {
if (Pars == 0) {
ERROR("Error: No parameters defined!\n");
return -1;
Expand All @@ -18,7 +18,7 @@ int acOptimize::OptimizerInit () {
}
GetParameters(start);
DEBUG_M;
if (solver->mpi.rank == 0) {
if (solver->mpi_rank == 0) {
method="MMA";
attr = node.attribute("method");
if (attr) {
Expand All @@ -40,15 +40,15 @@ int acOptimize::OptimizerInit () {
}
}
double * bound = NULL;
if (solver->mpi.rank == 0) bound = new double[Pars];
if (solver->mpi_rank == 0) bound = new double[Pars];
Parameters(PAR_LOWER, bound);
if (solver->mpi.rank == 0) {
if (solver->mpi_rank == 0) {
output("lower set to %lf\n", bound[0]);
nlopt_set_lower_bounds(opt, bound);
for (int i=0;i<Pars;i++) if (start[i] < bound[i]) start[i] = bound[i];
}
Parameters(PAR_UPPER, bound);
if (solver->mpi.rank == 0) {
if (solver->mpi_rank == 0) {
output("upper set to %lf\n", bound[0]);
nlopt_set_upper_bounds(opt, bound);
for (int i=0;i<Pars;i++) if (start[i] > bound[i]) start[i] = bound[i];
Expand Down
Loading