From 19bebb1506102ae749f4cf848aa601d0bae7e907 Mon Sep 17 00:00:00 2001 From: Ruonan Wang <jason.ruonan.wang@gmail.com> Date: Wed, 10 May 2017 22:46:15 -0400 Subject: [PATCH] Fixed multistep example for no-mpi by adding extra ifdef's --- .../experimental/multistep/reader_allsteps.cpp | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) diff --git a/examples/experimental/multistep/reader_allsteps.cpp b/examples/experimental/multistep/reader_allsteps.cpp index 07341753a..6e669aec5 100644 --- a/examples/experimental/multistep/reader_allsteps.cpp +++ b/examples/experimental/multistep/reader_allsteps.cpp @@ -191,7 +191,9 @@ int main(int argc, char *argv[]) if (rank == 0) Print2DArray(Nparts, vNparts->GetNSteps(), Nwriters, "Nparts"); Delete2DArray(Nparts); +#ifdef ADIOS2_HAVE_MPI MPI_Barrier(MPI_COMM_WORLD); +#endif /* * GlobalArrayFixedDims @@ -227,19 +229,28 @@ int main(int argc, char *argv[]) vGlobalArrayFixedDims->SetStepSelection( 0, vGlobalArrayFixedDims->GetNSteps()); bpReader->Read<double>(*vGlobalArrayFixedDims, GlobalArrayFixedDims[0]); +#ifdef ADIOS2_HAVE_MPI MPI_Barrier(MPI_COMM_WORLD); MPI_Status status; +#endif + int token = 0; +#ifdef ADIOS2_HAVE_MPI if (rank > 0) MPI_Recv(&token, 1, MPI_INT, rank - 1, 0, MPI_COMM_WORLD, &status); std::cout << "Rank " << rank << " read start = " << start << " count = " << count << std::endl; +#endif Print2DArray(GlobalArrayFixedDims, vGlobalArrayFixedDims->GetNSteps(), count, "GlobalArrayFixedDims"); +#ifdef ADIOS2_HAVE_MPI if (rank < nproc - 1) MPI_Send(&token, 1, MPI_INT, rank + 1, 0, MPI_COMM_WORLD); +#endif Delete2DArray(GlobalArrayFixedDims); +#ifdef ADIOS2_HAVE_MPI MPI_Barrier(MPI_COMM_WORLD); +#endif /* * LocalArrayFixedDims @@ -256,7 +267,9 @@ int main(int argc, char *argv[]) } std::cout << "LocalArrayFixedDims is irregular. Cannot read this " "variable yet...\n"; +#ifdef ADIOS2_HAVE_MPI MPI_Barrier(MPI_COMM_WORLD); +#endif /* * LocalArrayFixedDimsJoined @@ -282,7 +295,9 @@ int main(int argc, char *argv[]) vLocalArrayFixedDimsJoined->m_Shape[0], "LocalArrayFixedDimsJoined"); Delete2DArray(LocalArrayFixedDimsJoined); +#ifdef ADIOS2_HAVE_MPI MPI_Barrier(MPI_COMM_WORLD); +#endif /* * GlobalArray which changes size over time @@ -299,7 +314,9 @@ int main(int argc, char *argv[]) "dimension is supposed to be adios::IrregularDim indicating an " "Irregular array\n"); } +#ifdef ADIOS2_HAVE_MPI MPI_Barrier(MPI_COMM_WORLD); +#endif // Close file/stream bpReader->Close(); -- GitLab