core icon indicating copy to clipboard operation
core copied to clipboard

Calling apf::synchronize(Numbering * n, Sharing * shr) with a custom sharing deletes the sharing

Open wrtobin opened this issue 7 years ago • 10 comments

Due to the default third argument to

synchronizeFieldData()

not being exposed in the numbering synchronize:

synchronize(Numbering,Sharing)

Using a custom sharing to synchronize a numbering has the side-effect of deleting the numbering.

wrtobin avatar Apr 03 '18 20:04 wrtobin

should the default value for delete_shr be false? It is automatically set to true if passed-in Sharing* == nullptr

wrtobin avatar Apr 03 '18 21:04 wrtobin

The most straightforward thing to do is expose the bool through the numbering synchronize interface and also have it express a default value of true

I'll do that for now since it shouldn't change the existing behavior of deleting a passed in sharing unless you explicitly add the argument for it not to, though I assume the legacy behaviour is a bug.

wrtobin avatar Apr 03 '18 21:04 wrtobin

added in commit 4e65c1e297d75e8cfaf55db64dbd895255d3e8cc

but this may not be the best way to solve this switching the default value in synchronizeFieldData<T>() to false might be the better solution, it depends whether the existing behaviour is really a bug or not.

wrtobin avatar Apr 03 '18 21:04 wrtobin

You are absolutely right. I do not know why its default is set to true. I will change delete_shr to "false" in

  • synchronizeFieldData
  • accumulateFieldData
  • synchronize (in apfNumbering.h)

seegyoung avatar Apr 04 '18 13:04 seegyoung

Has this been fixed?

cwsmith avatar Apr 11 '18 18:04 cwsmith

Commit https://github.com/SCOREC/core/commit/4e65c1e297d75e8cfaf55db64dbd895255d3e8cc allows the bug to be avoided, but I don't know if Seegyoung committed the additional changes she commented about.

wrtobin avatar Apr 11 '18 19:04 wrtobin

Is this resolved now?

cwsmith avatar May 07 '18 12:05 cwsmith

It looks like I took care of it with commit a57d816.

seegyoung avatar May 08 '18 16:05 seegyoung

I think I took care of it on April 4th. However I will take a look again to confirm

seegyoung avatar May 08 '18 17:05 seegyoung

Is this fixed now?

cwsmith avatar Jul 19 '18 20:07 cwsmith