Commit b4921c85 authored by Tomáš Oberhuber's avatar Tomáš Oberhuber
Browse files

Fixed CUDA compilation.

parent a76beec2
Loading
Loading
Loading
Loading
+7 −4
Original line number Diff line number Diff line
@@ -10,8 +10,6 @@

#pragma once

#ifdef HAVE_MPI

#include <iostream>
#include <fstream>
#include <mpi.h>
@@ -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
@@ -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)
@@ -109,8 +110,10 @@ class MpiCommunicator
            }
         }
         MPI::Finalize();
#endif         
      };

#ifdef HAVE_MPI      
      static bool IsInitialized()
      {
         return MPI::Is_initialized();
@@ -205,6 +208,7 @@ class MpiCommunicator
      }
      
      static MPI::Request NullRequest;
#endif      
      static std::streambuf *psbuf;
      static std::streambuf *backup;
      static std::ofstream filestr;
@@ -220,6 +224,5 @@ bool MpiCommunicator::redirect;

}//namespace Communicators
} // namespace TNL
#endif

+4 −2
Original line number Diff line number Diff line
@@ -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;
  
@@ -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;

@@ -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;