GEOS-DEV / GEOS-DEV/GEOS

Packing by index is inconsistent between `Group` and `ObjectManagerBase`

Open
#1,805 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

type: cleanup / refactor
Dominant language
C++
Stars
287
Forks
109
Avg merge
4d 41m
Merged PRs (30d)
5

Description

In Group, if packList is empty, we pack everything. In ObjectManagerBase, if packList is empty, we pack nothing.
I did not check everywhere, but I think that BufferOps respect the content of packList.

Isn't this discrepancy a bit dangerous?


When packing by index in https://github.com/GEOSX/GEOSX/blob/e7b071ea48cb14145699a2371280a6a463e427e7/src/coreComponents/dataRepository/Group.cpp#L386-L391
we basically have something like

if( packList.empty() ) {
  packedSize += wrapperPair.second->pack( buffer, true, onDevice, events );
} else {
  packedSize += wrapperPair.second->packByIndex( buffer, packList, true, onDevice, events );
}

while when packing by index in https://github.com/GEOSX/GEOSX/blob/e7b071ea48cb14145699a2371280a6a463e427e7/src/coreComponents/mesh/ObjectManagerBase.cpp#L243-L249
we roughly get the following behavior (the code is a little more complex for real, but this is the idea)

if( packList.size() > 0 )
{
  // ... SNIP ... 
  packedSize += wrapper.packByIndex( buffer, packList, true, onDevice, events );
  // ... SNIP ...
}
// Hereafter continue with the "recursive" part and nothing is done if packList is empty.
  • Passes the integrated tests

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Compare the packing-by-index paths in src/coreComponents/dataRepository/Group.cpp and src/coreComponents/mesh/ObjectManagerBase.cpp, then inspect the related BufferOps behavior mentioned in the issue. Determine the intended empty-packList semantics, make the behavior consistent, and run the integrated tests to verify the result.

Written by the indexing model from the issue text.

Assessment

Tech stack
cpp
Domain
data, hpc
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
48/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.