Skip to content

Commit

Permalink
Merge remote-tracking branch 'cfdgo/master' into feature/torque
Browse files Browse the repository at this point in the history
  • Loading branch information
llaniewski committed May 22, 2024
2 parents 28166ad + 8500e3b commit 0e7b2e3
Show file tree
Hide file tree
Showing 4 changed files with 5 additions and 5 deletions.
2 changes: 1 addition & 1 deletion src/Handlers/GenericOptimizer.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ int GenericOptimizer::Init () {
int ret;
DEBUG_M;
ret = OptimizerInit();
MPI_Bcast( &ret, 1, MPI_INT, 0, MPI_COMM_WORLD );
MPI_Bcast( &ret, 1, MPI_INT, 0, solver->mpi_comm );
if (ret) {
ERROR("Failed to initialize Optimizer");
return -1;
Expand Down
4 changes: 2 additions & 2 deletions src/Handlers/OptimalControl.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -86,7 +86,7 @@ int OptimalControl::Parameters (int type, double * tab) {
return 0;
case PAR_SET:
output("Setting the params in the zone\n");
MPI_Bcast(tab, Pars, MPI_DOUBLE, 0, MPI_COMM_WORLD);
MPI_Bcast(tab, Pars, MPI_DOUBLE, 0, solver->mpi_comm);
if (f != NULL) {
fprintf(f,"SET");
for (int i=0;i<Pars;i++) fprintf(f,",%lg",(double) tab[i]);
Expand All @@ -97,7 +97,7 @@ int OptimalControl::Parameters (int type, double * tab) {
case PAR_GRAD:
output("Getting gradient of a param in zone\n");
solver->lattice->zSet.get_grad(par_index, zone_number, tmptab);
MPI_Reduce(tmptab, tab, Pars, MPI_DOUBLE, MPI_SUM, 0, MPI_COMM_WORLD);
MPI_Reduce(tmptab, tab, Pars, MPI_DOUBLE, MPI_SUM, 0, solver->mpi_comm);
if (f != NULL) {
fprintf(f,"GRAD");
for (int i=0;i<Pars;i++) fprintf(f,",%lg",(double) tab[i]);
Expand Down
2 changes: 1 addition & 1 deletion src/Handlers/acAndersen.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ double acAndersen::skal(real_t * a, real_t * b) {
for (size_t k=0; k<n; k++) sum += a[k]*b[k];
// TODO: MPI scatter gather
double gsum=0;
MPI_Allreduce ( &sum, &gsum, 1, MPI_DOUBLE, MPI_SUM, MPI_COMM_WORLD );
MPI_Allreduce ( &sum, &gsum, 1, MPI_DOUBLE, MPI_SUM, solver->mpi_comm );
return gsum;
}

Expand Down
2 changes: 1 addition & 1 deletion src/Handlers/cbPID.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -110,7 +110,7 @@ int cbPID::DoIt () {
old_err = err;

}
MPI_Bcast(&control, 1, MPI_DOUBLE, 0, MPI_COMM_WORLD);
MPI_Bcast(&control, 1, MPI_DOUBLE, 0, solver->mpi_comm);
double nval;
/* if (zone_number < 0) {
sval = solver->lattice->zSet.get(setting, 0, (size_t) 0);
Expand Down

0 comments on commit 0e7b2e3

Please sign in to comment.