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

Fixed tnl-init. Did not work with one MPI process.

parent c6ff1efd
Loading
Loading
Loading
Loading
+4 −5
Original line number Diff line number Diff line
@@ -8,8 +8,9 @@

/* See Copyright Notice in tnl/Copyright */

#ifndef TNL_HEAT_EQUATION_H_
#define TNL_HEAT_EQUATION_H_
#pragma once

#define MPIIO

#include <TNL/Solvers/Solver.h>
#include <TNL/Solvers/FastBuildConfigTag.h>
@@ -109,5 +110,3 @@ int main( int argc, char* argv[] )
      return EXIT_FAILURE;
   return EXIT_SUCCESS;
}
 No newline at end of file

#endif /* TNL_HEAT_EQUATION_H_ */
+0 −1
Original line number Diff line number Diff line
@@ -182,7 +182,6 @@ class MpiCommunicator
         }
      }
   

    };
    
    MPI::Request MpiCommunicator::NullRequest;
+6 −9
Original line number Diff line number Diff line
@@ -13,11 +13,8 @@
#include <iostream>
#include <mpi.h>

//#ifdef MPIIO
#include <TNL/Communicators/MpiCommunicator.h>
//#endif

#include <TNL/File.h>
#include <TNL/Communicators/MpiCommunicator.h>
#include <TNL/Meshes/DistributedMeshes/DistributedMesh.h>
#include <TNL/Meshes/DistributedMeshes/CopyEntitiesHelper.h>
#include <TNL/Functions/MeshFunction.h>
@@ -156,7 +153,6 @@ class DistributedGridIO<MeshFunctionType,LocalCopy>
 * BAD IMPLEMENTTION creating MPI-Types at every save! -- I dont want contamine more places by MPI..
 */

#ifdef MPIIO
template<typename MeshFunctionType> 
class DistributedGridIO<MeshFunctionType,MpiIO>
{
@@ -171,6 +167,7 @@ class DistributedGridIO<MeshFunctionType,MpiIO>
    
    static bool save(const String& fileName, MeshFunctionType &meshFunction)
    {
#ifdef MPIIO       
        auto *distrGrid=meshFunction.getMesh().getDistributedMesh();
        
        if(distrGrid==NULL) //not distributed
@@ -214,8 +211,11 @@ class DistributedGridIO<MeshFunctionType,MpiIO>

       MPI_Type_free(&atype);
       MPI_Type_free(&ftype);

       return true;
#else
       std::cerr << "MPI-IO is not supported by your system." << std::endl;
       return false;
#endif       
    };

    template<typename DitsributedGridType>
@@ -402,9 +402,6 @@ class DistributedGridIO<MeshFunctionType,MpiIO>
    
};

#endif


}
}
}
+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::MpiIO> ::save(fileName.getFileName(), *uPointer );
       Meshes::DistributedMeshes::DistributedGridIO<MeshFunctionType,Meshes::DistributedMeshes::LocalCopy> ::save(fileName.getFileName(), *uPointer );
    }
    else
    {
+4 −0
Original line number Diff line number Diff line
@@ -83,5 +83,9 @@ int main( int argc, char* argv[] )
   if( ! resolveMeshType( parsedMeshType, parameters ) )
      return EXIT_FAILURE;

#ifdef HAVE_MPI
   Communicators::MpiCommunicator::Finalize();
#endif
      
   return EXIT_SUCCESS;
}
Loading