Commit 66107cdf authored by Vít Hanousek's avatar Vít Hanousek
Browse files

Add MPIIO Save and Load Test Both CPU and GPU.

Fix Auto distribution when no distribution is specified.
parent dafe0492
Loading
Loading
Loading
Loading
+2 −2
Original line number Diff line number Diff line
@@ -161,7 +161,7 @@ class MpiCommunicator
        {
#ifdef HAVE_MPI
            /***HACK for linear distribution***/
           int sum=0;
      /*     int sum=0;
           for(int i=0;i<dim;i++)
                sum+=distr[i];
           if(sum==0) //uživatel neovlivňuje distribuci
@@ -172,7 +172,7 @@ class MpiCommunicator
                    distr[i]=1;
               }
               distr[dim-1]=0;
            }
            }*/
            /***END OF HACK***/

            MPI_Dims_create(nproc, dim, distr);
+4 −1
Original line number Diff line number Diff line
@@ -31,7 +31,10 @@ class DistributedMesh<Grid< 1, RealType, Device, Index >>
      static constexpr int getMeshDimension() { return 1; };    

      DistributedMesh()
      : isSet(false ){};
      : isSet(false )
      {
           domainDecomposition.setValue(0);
      };

      bool setup( const Config::ParameterContainer& parameters,
                  const String& prefix )
+4 −1
Original line number Diff line number Diff line
@@ -33,7 +33,10 @@ class DistributedMesh<Grid< 2, RealType, Device, Index >>
     
   public:
      DistributedMesh()
      : domainDecomposition( 0 ), isSet( false ) {};
      : domainDecomposition( 0 ), isSet( false )
      {
           domainDecomposition.setValue(0);
      };
      
      void setDomainDecomposition( const CoordinatesType& domainDecomposition )
      {
+4 −1
Original line number Diff line number Diff line
@@ -40,7 +40,10 @@ class DistributedMesh<Grid< 3, RealType, Device, Index >>
      static constexpr int getMeshDimension() { return 3; };    

      DistributedMesh()
      : isSet( false ) {};
      : isSet( false )
      {
           domainDecomposition.setValue(0);
      };
      
      static void configSetup( Config::ConfigDescription& config )
      {
+27 −11
Original line number Diff line number Diff line
@@ -23,12 +23,29 @@ ADD_EXECUTABLE( CopyEntitesTest CopyEntitiesTest.cpp )
                              ${GTEST_BOTH_LIBRARIES}
                              tnl )

ADD_EXECUTABLE( DistributedGridIOTest DistributedGridIOTest.cpp )
   TARGET_COMPILE_OPTIONS( DistributedGridIOTest PRIVATE ${CXX_TESTS_FLAGS} )
IF( BUILD_CUDA )
    CUDA_ADD_EXECUTABLE( DistributedGridIOTest DistributedGridIOTest.cu OPTIONS ${CXX_TESTS_FLAGS})
       TARGET_LINK_LIBRARIES( DistributedGridIOTest
                                  ${GTEST_BOTH_LIBRARIES}
                                  tnl )

    CUDA_ADD_EXECUTABLE( DistributedGridIO_MPIIOTest DistributedGridIO_MPIIOTest.cu OPTIONS ${CXX_TESTS_FLAGS})
    TARGET_LINK_LIBRARIES( DistributedGridIO_MPIIOTest 
                                    ${GTEST_BOTH_LIBRARIES}
                                    tnl )
ELSE(  BUILD_CUDA )               
    ADD_EXECUTABLE( DistributedGridIOTest DistributedGridIOTest.cpp OPTIONS ${CXX_TESTS_FLAGS})
       TARGET_LINK_LIBRARIES( DistributedGridIOTest
                                  ${GTEST_BOTH_LIBRARIES}
                                  tnl )

    ADD_EXECUTABLE( DistributedGridIO_MPIIOTest DistributedGridIO_MPIIOTest.cpp OPTIONS ${CXX_TESTS_FLAGS})
       TARGET_LINK_LIBRARIES( DistributedGridIO_MPIIOTest
                                  ${GTEST_BOTH_LIBRARIES}
                                  tnl )
ENDIF( BUILD_CUDA )

 
ADD_TEST( NAME CopyEntitesTest COMMAND ${EXECUTABLE_OUTPUT_PATH}/CopyEntitesTest${CMAKE_EXECUTABLE_SUFFIX} )
   
SET (mpi_test_parameters_1d -np 4 -H localhost:4 "${EXECUTABLE_OUTPUT_PATH}/DistributedGridTest_1D${CMAKE_EXECUTABLE_SUFFIX}")
@@ -43,12 +60,11 @@ ADD_TEST( NAME DistributedGridTest_3D COMMAND "mpirun" ${mpi_test_parameters_3d}
SET (mpi_test_parameters_IO -np 4 "${EXECUTABLE_OUTPUT_PATH}/DistributedGridIOTest${CMAKE_EXECUTABLE_SUFFIX}")
ADD_TEST( NAME DistributedGridIOTest COMMAND "mpirun" ${mpi_test_parameters_IO})

IF( BUILD_CUDA )
    CUDA_ADD_EXECUTABLE( GPUDistributedGridIOTest GPUDistributedGridIOTest.cu OPTIONS ${CXX_TESTS_FLAGS})
    TARGET_LINK_LIBRARIES( GPUDistributedGridIOTest 
                                    ${GTEST_BOTH_LIBRARIES}
                                    tnl )   
ENDIF( BUILD_CUDA )  
SET (mpi_test_parameters_IOMPIIO -np 4 "${EXECUTABLE_OUTPUT_PATH}/DistributedGridIO_MPIIOTest${CMAKE_EXECUTABLE_SUFFIX}")
ADD_TEST( NAME DistributedGridIO_MPIIOTest COMMAND "mpirun" ${mpi_test_parameters_IOMPIIO})




endif()
Loading