Skip to content
Snippets Groups Projects
Commit 93fa9dfb authored by Martin Bauer's avatar Martin Bauer
Browse files

Test field gathering also in case of multiple blocks per process

parent 2e2c0a89
Branches
Tags
No related merge requests found
......@@ -35,7 +35,8 @@ waLBerla_compile_test( FILES adaptors/AdaptorTest.cpp DEPENDS blockforest gui lb
waLBerla_execute_test( NAME AdaptorTest )
waLBerla_compile_test( FILES FieldGatherTest.cpp DEPENDS blockforest gui )
waLBerla_execute_test( NAME FieldGatherTest PROCESSES 3 )
waLBerla_execute_test( NAME FieldGatherTest3 COMMAND $<TARGET_FILE:FieldGatherTest> PROCESSES 3 )
waLBerla_execute_test( NAME FieldGatherTest1 COMMAND $<TARGET_FILE:FieldGatherTest> PROCESSES 1 )
waLBerla_compile_test( FILES FieldFileIOTest.cpp DEPENDS blockforest )
waLBerla_execute_test( NAME FieldFileIOTest1Proc COMMAND $<TARGET_FILE:FieldFileIOTest> PROCESSES 1 )
......
......@@ -36,10 +36,11 @@ int main( int argc, char ** argv )
debug::enterTestMode();
walberla::Environment walberlaEnv( argc, argv );
bool oneBlockPerProcess = MPIManager::instance()->numProcesses() != 1;
auto blocks = blockforest::createUniformBlockGrid( 1, 3, 1, // blocks in x,y,z
10u, 20u, 1u, // nr of cells per block
1.0, // dx
true // one block per process
oneBlockPerProcess
);
typedef GhostLayerField<cell_idx_t,3> MyField;
BlockDataID fieldID = field::addToStorage<MyField>( blocks, "Field" );
......@@ -65,9 +66,10 @@ int main( int argc, char ** argv )
boundingBox.min()[ 1 ] = 10;
boundingBox.max()[ 1 ] = 29;
field::gather<MyField>( gatheredField, blocks, fieldID, boundingBox,1 );
auto targetRank = MPIManager::instance()->numProcesses() -1;
field::gather<MyField>( gatheredField, blocks, fieldID, boundingBox, targetRank );
WALBERLA_EXCLUSIVE_WORLD_SECTION( 1 )
WALBERLA_EXCLUSIVE_WORLD_SECTION( targetRank )
{
for( auto cellIt = gatheredField.beginXYZ(); cellIt != gatheredField.end(); ++cellIt )
{
......
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