mirror of
https://develop.openfoam.com/Development/openfoam.git
synced 2025-11-28 03:28:01 +00:00
STYLE: adjust globalIndex/CompactListList overflow reporting
- report location with previous good offset and the new count that would cause overflow. Simpler to report and the (very long) list of input sizes is not particularly useful for diagnostics either. ENH: add globalIndex comparison operators - for outputting lists of globalIndex
This commit is contained in:
@ -49,12 +49,14 @@ Foam::globalIndex::calcListOffsets
|
||||
label start = 0;
|
||||
for (label i = 0; i < len; ++i)
|
||||
{
|
||||
const label count = lists[i].size();
|
||||
|
||||
values[i] = start;
|
||||
start += lists[i].size();
|
||||
start += count;
|
||||
|
||||
if (checkOverflow && start < values[i])
|
||||
{
|
||||
reportOverflowAndExit(i);
|
||||
reportOverflowAndExit(i, values[i], count);
|
||||
}
|
||||
}
|
||||
values[len] = start;
|
||||
@ -1005,12 +1007,12 @@ OutputContainer Foam::globalIndex::scatter
|
||||
// The globalIndex might be correct on master only,
|
||||
// so scatter local sizes to ensure consistency
|
||||
|
||||
const label localLen
|
||||
const label count
|
||||
(
|
||||
UPstream::listScatterValues<label>(this->localSizes(), comm)
|
||||
);
|
||||
|
||||
OutputContainer localData(localLen);
|
||||
OutputContainer localData(count);
|
||||
this->scatter(allData, localData, tag, commsType, comm);
|
||||
|
||||
return localData;
|
||||
|
||||
Reference in New Issue
Block a user