MCPopulation now gives walkers useful walker and parent ids - #5063
Conversation
ye-luo
left a comment
There was a problem hiding this comment.
Thank you for breaking up the initial PR.
I leave a few comments and questions but questions needs to be sorted out but should not be blocking.
| walkers_.back()->Weight = 1.0; | ||
| // this does count as a walker creation so it gets a new walker id | ||
| auto walker_id = nextWalkerID(); | ||
| walkers_.back()->setWalkerID(walker_id); |
There was a problem hiding this comment.
Fuse the above 2 lines in one?
There was a problem hiding this comment.
Seems just as clear will do.
| walker_configs.resize(walker_elec_particle_sets_.size(), elec_particle_set_->getTotalNum()); | ||
| for (int iw = 0; iw < walker_elec_particle_sets_.size(); iw++) | ||
| { | ||
| // The semantics of this call are not what would I would expecte. |
| { | ||
| walkers_[iw] = std::make_unique<MCPWalker>(elec_particle_set_->getTotalNum()); | ||
| int parent_id = 0; | ||
| walkers_[iw] = std::make_unique<MCPWalker>(walker_ids[iw], parent_id, elec_particle_set_->getTotalNum() ); |
There was a problem hiding this comment.
could you do "0 /* parent_id */"?
Comment: shocked to find out Walker class has 4 constructors.
| auto walker_id = nextWalkerID(); | ||
| app_warning() << "Spawning walker ID " << walker_id << " this is living walker number " << walkers_.size() | ||
| << "which is beyond the allocated walker reserves, ideally this should never happen." << '\n'; | ||
| walkers_.push_back(std::make_unique<MCPWalker>(*(walkers_.back()), walker_id, 0)); |
|
Please address the remaining minor issues and this PR will be ready to go. |
|
Test this please |
|
I have no ideas on the osx CI failure and can't reproduce it, I can't build with gcc-12 at all on my mac, there are problems just compiling with GCC-12 and the osx headers for me. Homebrew is onto gcc-14 at this point. gcc-14 has some sort of issue with catch. current llvm is fine. @jptowns already reported this bus error but resolved it by going to gcc-14 but with M1/2 mac and not sure the OSX rev. But I have compile issues with that gcc in osx 14.5 on my x86 mac... |
Proposed changes
segment of #5010
WalkerMCPopulationWhat type(s) of changes does this code introduce?
There is should be no user observable change except due to #5019 where walker_id's will be different but still undependable.
Does this introduce a breaking change?
What systems has this change been tested on?
OSX laptop
linux x86 vm
Checklist
Update the following with a yes where the items apply. If you're unsure about any of them, don't hesitate to ask. This is
simply a reminder of what we are going to look for before merging your code.