Loading src/TNL/Communicators/MpiCommunicator.h +7 −4 Original line number Diff line number Diff line Loading @@ -10,8 +10,6 @@ #pragma once #ifdef HAVE_MPI #include <iostream> #include <fstream> #include <mpi.h> Loading Loading @@ -80,6 +78,7 @@ class MpiCommunicator static void setupRedirection() { #ifdef HAVE_MPI if(isDistributed() && redirect ) { //redirect all stdout to files, only 0 take to go to console Loading @@ -96,10 +95,12 @@ class MpiCommunicator std::cout.rdbuf(psbuf); } } #endif }; static void Finalize() { #ifdef HAVE_MPI if(isDistributed()) { if(MPI::COMM_WORLD.Get_rank()!=0) Loading @@ -109,8 +110,10 @@ class MpiCommunicator } } MPI::Finalize(); #endif }; #ifdef HAVE_MPI static bool IsInitialized() { return MPI::Is_initialized(); Loading Loading @@ -205,6 +208,7 @@ class MpiCommunicator } static MPI::Request NullRequest; #endif static std::streambuf *psbuf; static std::streambuf *backup; static std::ofstream filestr; Loading @@ -220,6 +224,5 @@ bool MpiCommunicator::redirect; }//namespace Communicators } // namespace TNL #endif tests/mpi/GPUmeshFunctionEvaluateTest.cu +4 −2 Original line number Diff line number Diff line Loading @@ -48,6 +48,7 @@ int main ( int argc, char *argv[]) typedef typename MeshType::Cell Cell; typedef typename MeshType::IndexType IndexType; typedef typename MeshType::PointType PointType; using CoordinatesType = MeshType::CoordinatesType; typedef DistributedMesh<MeshType> DistributedMeshType; Loading Loading @@ -80,7 +81,7 @@ int main ( int argc, char *argv[]) globalGrid.setDomain(globalOrigin,globalProportions); int distr[DIMENSION]; CoordinatesType distr; for(int i=0;i<DIMENSION;i++) distr[i]=1; Loading @@ -99,7 +100,8 @@ int main ( int argc, char *argv[]) typename MeshType::CoordinatesType overlap; overlap.setValue(1); DistributedMeshType distrgrid; distrgrid.template setGlobalGrid<CommunicatorType>(globalGrid,overlap, distr); distrgrid.setDomainDecomposition( distr ); distrgrid.template setGlobalGrid<CommunicatorType>(globalGrid,overlap); SharedPointer<MeshType> gridptr; SharedPointer<MeshFunctionType> meshFunctionptr; Loading Loading
src/TNL/Communicators/MpiCommunicator.h +7 −4 Original line number Diff line number Diff line Loading @@ -10,8 +10,6 @@ #pragma once #ifdef HAVE_MPI #include <iostream> #include <fstream> #include <mpi.h> Loading Loading @@ -80,6 +78,7 @@ class MpiCommunicator static void setupRedirection() { #ifdef HAVE_MPI if(isDistributed() && redirect ) { //redirect all stdout to files, only 0 take to go to console Loading @@ -96,10 +95,12 @@ class MpiCommunicator std::cout.rdbuf(psbuf); } } #endif }; static void Finalize() { #ifdef HAVE_MPI if(isDistributed()) { if(MPI::COMM_WORLD.Get_rank()!=0) Loading @@ -109,8 +110,10 @@ class MpiCommunicator } } MPI::Finalize(); #endif }; #ifdef HAVE_MPI static bool IsInitialized() { return MPI::Is_initialized(); Loading Loading @@ -205,6 +208,7 @@ class MpiCommunicator } static MPI::Request NullRequest; #endif static std::streambuf *psbuf; static std::streambuf *backup; static std::ofstream filestr; Loading @@ -220,6 +224,5 @@ bool MpiCommunicator::redirect; }//namespace Communicators } // namespace TNL #endif
tests/mpi/GPUmeshFunctionEvaluateTest.cu +4 −2 Original line number Diff line number Diff line Loading @@ -48,6 +48,7 @@ int main ( int argc, char *argv[]) typedef typename MeshType::Cell Cell; typedef typename MeshType::IndexType IndexType; typedef typename MeshType::PointType PointType; using CoordinatesType = MeshType::CoordinatesType; typedef DistributedMesh<MeshType> DistributedMeshType; Loading Loading @@ -80,7 +81,7 @@ int main ( int argc, char *argv[]) globalGrid.setDomain(globalOrigin,globalProportions); int distr[DIMENSION]; CoordinatesType distr; for(int i=0;i<DIMENSION;i++) distr[i]=1; Loading @@ -99,7 +100,8 @@ int main ( int argc, char *argv[]) typename MeshType::CoordinatesType overlap; overlap.setValue(1); DistributedMeshType distrgrid; distrgrid.template setGlobalGrid<CommunicatorType>(globalGrid,overlap, distr); distrgrid.setDomainDecomposition( distr ); distrgrid.template setGlobalGrid<CommunicatorType>(globalGrid,overlap); SharedPointer<MeshType> gridptr; SharedPointer<MeshFunctionType> meshFunctionptr; Loading