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

fix the resistive Alfven wave test with MPI #207

Merged
merged 1 commit into from
Nov 5, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 5 additions & 2 deletions test/MHD/ResistiveAlfvenWave/setup.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
// Analyse data to produce an output
void Analysis(DataBlock & data) {
double etot = 0;
double etotGlob;
IdefixArray4D<real> Vc = data.hydro->Vc;

idefix_reduce("Analysis", data.beg[KDIR],data.end[KDIR],
Expand All @@ -19,14 +20,16 @@ void Analysis(DataBlock & data) {
}, Kokkos::Sum<double>(etot));

#ifdef WITH_MPI
MPI_Reduce(MPI_IN_PLACE, &etot, 1, MPI_DOUBLE, MPI_SUM, 0, MPI_COMM_WORLD);
MPI_Reduce(&etot, &etotGlob, 1, MPI_DOUBLE, MPI_SUM, 0, MPI_COMM_WORLD);
#else
etotGlob = etot;
#endif

if(idfx::prank == 0) {
std::ofstream f;
f.open(FILENAME,std::ios::app);
f.precision(10);
f << std::scientific << data.t << "\t" << etot << std::endl;
f << std::scientific << data.t << "\t" << etotGlob << std::endl;
f.close();
}

Expand Down
2 changes: 2 additions & 0 deletions test/MHD/ResistiveAlfvenWave/testme.py
Original file line number Diff line number Diff line change
Expand Up @@ -39,3 +39,5 @@ def testMe(test):
test.reconstruction=2
test.mpi=False
testMe(test)
test.mpi=True
testMe(test)