Global Random found Harmful
- Dominant language
- C++
- Stars
- 403
- Forks
- 154
- Avg merge
- 1d 13h
- Merged PRs (30d)
- 90
Description
So
```C++
NonLocalECPotential::NonLocalECPotential(ParticleSet& ions,
ParticleSet& els,
TrialWaveFunction& psi,
bool computeForces,
bool useVP)
: IonConfig(ions),
Psi(psi),
UseTMove(TMOVE_OFF),
myRNG(&Random),
```
Random is a global object and not threadsafe. In the new DMCBatched driver NonLocalECPPotential::evaluate is called in a threaded context. It does this
```C++
PPset[ipp]->randomize_grid(*myRNG);
```
This rather randomly causes SIGSEGV
This took me quite some time to catch in a core dump. Enough with the global objects and unclear scopes.
Contributor guide
Assessment
This issue has not been assessed yet.