Commit 933cc22b authored by Matouš Fencl's avatar Matouš Fencl Committed by Tomáš Oberhuber

MPI ready in tnlDirectEikonal*

parent 97ee2879
......@@ -25,8 +25,6 @@
#include <solvers/pde/tnlLinearSystemAssembler.h>
#include <functions/tnlMeshFunction.h>
#include <TNL/Meshes/DistributedMeshes/DistributedGridIO.h>
template< typename Mesh,
typename DifferentialOperator,
typename BoundaryCondition,
......
......@@ -123,24 +123,12 @@ setInitialCondition( const Config::ParameterContainer& parameters,
{
this->bindDofs( mesh, dofs );
const String& initialConditionFile = parameters.getParameter< String >( "initial-condition" );
if(CommunicatorType::isDistributed())
if( ! this->solution.boundLoad( initialConditionFile ) )
{
std::cout<<"Nodes Distribution: " << uPointer->getMesh().getDistributedMesh()->printProcessDistr() << std::endl;
if(distributedIOType==Meshes::DistributedMeshes::MpiIO)
Meshes::DistributedMeshes::DistributedGridIO<MeshFunctionType,Meshes::DistributedMeshes::MpiIO> ::load(initialConditionFile, *uPointer );
if(distributedIOType==Meshes::DistributedMeshes::LocalCopy)
Meshes::DistributedMeshes::DistributedGridIO<MeshFunctionType,Meshes::DistributedMeshes::LocalCopy> ::load(initialConditionFile, *uPointer );
uPointer->template synchronize<CommunicatorType>();
std::cerr << "I am not able to load the initial condition from the file " << initialConditionFile << "." <<std::endl;
return false;
}
else
{
if( ! this->solution.boundLoad( initialConditionFile ) )
{
std::cerr << "I am not able to load the initial condition from the file " << initialConditionFile << "." <<std::endl;
return false;
}
}
return true;
return true;
}
template< typename Mesh,
......
......@@ -99,7 +99,7 @@ tnlDirectEikonalMethodsBase< Meshes::Grid< 2, Real, Device, Index > >::
updateBlocks( InterfaceMapType interfaceMap,
MeshFunctionType aux,
MeshFunctionType helpFunc,
ArrayContainer BlockIterHost, IndexType numThreadsPerBlock/*, Real **sArray*/ )
ArrayContainer BlockIterHost, int numThreadsPerBlock/*, Real **sArray*/ )
{
#pragma omp parallel for schedule( dynamic )
for( IndexType i = 0; i < BlockIterHost.getSize(); i++ )
......@@ -267,13 +267,13 @@ updateBlocks( InterfaceMapType interfaceMap,
template< typename Real,
typename Device,
typename Index >
template< IndexType sizeSArray >
template< int sizeSArray >
void
tnlDirectEikonalMethodsBase< Meshes::Grid< 3, Real, Device, Index > >::
updateBlocks( const InterfaceMapType& interfaceMap,
const MeshFunctionType& aux,
MeshFunctionType& helpFunc,
ArrayContainer BlockIterHost, IndexType numThreadsPerBlock/*, Real **sArray*/ )
ArrayContainer BlockIterHost, int numThreadsPerBlock/*, Real **sArray*/ )
{
//#pragma omp parallel for schedule( dynamic )
for( IndexType i = 0; i < BlockIterHost.getSize(); i++ )
......
......@@ -97,11 +97,11 @@ solve( const MeshPointer& mesh,
if( i == 0 ) {
printf( "0: mesh x: %d\n", mesh->getDimensions().x() );
printf( "0: mesh y: %d\n", mesh->getDimensions().y() );
aux.save("aux_proc0.tnl");
for( int k = 0; k < 16*16; k++ )
//aux.save("aux_proc0.tnl");
/*for( int k = 0; k < mesh->getDimensions().x()*mesh->getDimensions().y(); k++ )
aux[ k ] = 10;
for( int k = 0; k < 16; k++ ){
for( int l = 0; l < 16; l++ )
for( int k = 0; k < mesh->getDimensions().x(); k++ ){
for( int l = 0; l < mesh->getDimensions().y(); l++ )
printf("%f.2\t",aux[ k * 16 + l ] );
printf("\n");
}*/
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment