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

Fixed Partitioner::getOwner

parent 859e6374
No related branches found
No related tags found
No related merge requests found
......@@ -43,7 +43,12 @@ public:
__cuda_callable__
static int getOwner( Index i, Index globalSize, int partitions )
{
return min( partitions - 1, i / (globalSize / partitions) );
int owner = i * partitions / globalSize;
if( owner < partitions - 1 && i >= getOffset( globalSize, owner + 1, partitions ) )
owner++;
TNL_ASSERT_GE( i, getOffset( globalSize, owner, partitions ), "BUG in getOwner" );
TNL_ASSERT_LT( i, getOffset( globalSize, owner + 1, partitions ), "BUG in getOwner" );
return owner;
}
// Gets the offset of data for given rank.
......
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