diff --git a/applications/test/parallel-chunks/Test-parallel-chunks.C b/applications/test/parallel-chunks/Test-parallel-chunks.C index 1dc4cb7380..36a6cc63c8 100644 --- a/applications/test/parallel-chunks/Test-parallel-chunks.C +++ b/applications/test/parallel-chunks/Test-parallel-chunks.C @@ -210,7 +210,7 @@ void broadcast_chunks << "Contiguous data only." << sizeof(T) << Foam::abort(FatalError); } - if (UPstream::maxCommsSize <= int(sizeof(T))) + if (UPstream::maxCommsSize <= 0) { // Do in one go Info<< "send " << sendData.size() << " elements in one go" << endl; @@ -230,48 +230,61 @@ void broadcast_chunks // guaranteed that some processor's sending size is some other // processor's receive size. Also we can ignore any local comms. - // We need to send bytes so the number of iterations: + // We need to send chunks so the number of iterations: // maxChunkSize iterations // ------------ ---------- // 0 0 // 1..maxChunkSize 1 // maxChunkSize+1..2*maxChunkSize 2 - // etc. + // ... - const label maxChunkSize(UPstream::maxCommsSize/sizeof(T)); + const label maxChunkSize + ( + max + ( + static_cast