Closed ExpHP closed 6 years ago
pointless, lammps appears to segfault if opened multiple times in parallel, even with OMP_NUM_THREADS=1
and processors 1 1 1
Trying this again because letting OpenMP handle parallelism basically destroys any hope of using the computer for anything else during a computation; it starts to run magnitudes slower than it would with no threading, likely due to frequent synchronization barriers.
Restricting calls to lammps_open
and lammps_close
via a mutex appears to resolve the segmentation faults, presenting a very easy way forward.
I am still not certain however why the segfaults occur in the first place. (the only global state manipulation I've spotted so far in the lammps code base are MPI_Init() and MPI_Finalize(); but I was getting segfaults even when using lammps' trivial "STUBS" implementation of MPI.)
this feature was brought back ages ago since the mutex solution seemed to be working perfectly for AIREBO. However, it's not good enough for kolmogorov/crespi/z, see #37
might be better than lammps internal parallelization simply because it's trivially parallelelizable