Skip to content
Snippets Groups Projects
Commit a3437606 authored by Jakub Klinkovský's avatar Jakub Klinkovský
Browse files

Fixed DistributedArrayExample

parent 501b1942
No related branches found
No related tags found
No related merge requests found
...@@ -17,9 +17,9 @@ void distributedArrayExample() ...@@ -17,9 +17,9 @@ void distributedArrayExample()
using IndexType = typename ArrayType::IndexType; using IndexType = typename ArrayType::IndexType;
using LocalRangeType = typename ArrayType::LocalRangeType; using LocalRangeType = typename ArrayType::LocalRangeType;
const MPI_Comm group = TNL::MPI::AllGroup(); const MPI_Comm communicator = MPI_COMM_WORLD;
//const int rank = TNL::MPI::GetRank(group); //const int rank = TNL::MPI::GetRank(communicator);
const int nproc = TNL::MPI::GetSize(group); const int nproc = TNL::MPI::GetSize(communicator);
/*** /***
* We set size to prime number to force non-uniform distribution of the distributed array. * We set size to prime number to force non-uniform distribution of the distributed array.
...@@ -27,9 +27,9 @@ void distributedArrayExample() ...@@ -27,9 +27,9 @@ void distributedArrayExample()
const int size = 97; const int size = 97;
const int ghosts = (nproc > 1) ? 4 : 0; const int ghosts = (nproc > 1) ? 4 : 0;
const LocalRangeType localRange = Containers::Partitioner< IndexType >::splitRange( size, group ); const LocalRangeType localRange = Containers::Partitioner< IndexType >::splitRange( size, communicator );
ArrayType a( localRange, ghosts, size, group ); ArrayType a( localRange, ghosts, size, communicator );
a.forElements( 0, size, [=] __cuda_callable__ ( const int idx, int& value ) { value = idx; } ); a.forElements( 0, size, [] __cuda_callable__ ( int idx, int& value ) { value = idx; } );
//LocalArrayType localArray = a; //LocalArrayType localArray = a;
//std::cout << a << std::endl; //std::cout << a << std::endl;
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment