QMCPACK / QMCPACK/qmcpack

Need a precise use of MPIObjectBase

Open
#859 0 comments 0 reactions 0 assignees View on GitHub
discussion
Dominant language
C++
Stars
403
Forks
154
Avg merge
1d 12h
Merged PRs (30d)
82

Description

I just noticed MPIObjectBase show up as a base class to several classes owing pointer to Communicate object. The constructor allows optional input pointer. When the input is not give, the global one is taken. initCommunicator() can be used to override the already defined pointer. I can feel the convenience but it is quite unsafe.

I'm thinking of always requiring the input pointer instead of having it optional. This will require all the constructors of classes based on MPIObjectBase to add an extra communicator argument. But the hierachy and consistent can be secured. The pointer to Communicate object should also be also defined as const.

Maybe the MPIObjectBase can be simplified to just keep myComm in the derived class but my requirement is the same, use const as much as possible and create it at construction.

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.