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

Code refactoring.

parent de921733
Loading
Loading
Loading
Loading
+14 −16
Original line number Diff line number Diff line
@@ -22,12 +22,6 @@
#include <TNL/Meshes/DistributedMeshes/CopyEntitiesHelper.h>
#include <TNL/Functions/MeshFunction.h>







namespace TNL {
namespace Meshes {   
namespace DistributedMeshes {
@@ -166,9 +160,9 @@ class DistributedGridIO<MeshFunctionType,LocalCopy>
template<typename MeshFunctionType> 
class DistributedGridIO<MeshFunctionType,MpiIO>
{

   public:

      using RealType = typename MeshFunctionType::RealType;
      typedef typename MeshFunctionType::MeshType MeshType;
      typedef typename MeshFunctionType::MeshType::CoordinatesType CoordinatesType;
      typedef typename MeshFunctionType::MeshType::PointType PointType;
@@ -188,7 +182,7 @@ class DistributedGridIO<MeshFunctionType,MpiIO>
       MPI_Datatype atype;
       int dataCount=CreateDataTypes(distrGrid,&ftype,&atype);

       double * data=meshFunction.getData().getData();//TYP
       RealType* data=meshFunction.getData().getData();

       //write 
       MPI_File file;
@@ -207,7 +201,11 @@ class DistributedGridIO<MeshFunctionType,MpiIO>
       }
       MPI_Bcast(&headerSize, 1, MPI_INT,0, MPI_COMM_WORLD);

       MPI_File_set_view(file,headerSize,MPI_DOUBLE,ftype,"native",MPI_INFO_NULL);//TYP
       if( std::is_same< RealType, double >::value)
         MPI_File_set_view(file,headerSize,MPI_DOUBLE,ftype,"native",MPI_INFO_NULL);
       if( std::is_same< RealType, float >::value)
         MPI_File_set_view(file,headerSize,MPI_FLOAT,ftype,"native",MPI_INFO_NULL);
       
       MPI_Status wstatus;

       MPI_File_write(file,data,1,atype,&wstatus);
+1 −1
Original line number Diff line number Diff line
@@ -214,7 +214,7 @@ makeSnapshot( const RealType& time,

    if(CommunicatorType::isDistributed())
    {
       Meshes::DistributedMeshes::DistributedGridIO<MeshFunctionType,Meshes::DistributedMeshes::LocalCopy> ::save(fileName.getFileName(), *uPointer );
       Meshes::DistributedMeshes::DistributedGridIO<MeshFunctionType,Meshes::DistributedMeshes::MpiIO> ::save(fileName.getFileName(), *uPointer );
    }
    else
    {