ExpHP / rsp2

phonons in rust
Apache License 2.0
2 stars 1 forks source link

try rayon for displacements? #14

Closed ExpHP closed 6 years ago

ExpHP commented 7 years ago

might be better than lammps internal parallelization simply because it's trivially parallelelizable

ExpHP commented 7 years ago

see https://users.rust-lang.org/t/parallel-work-collected-sequentially/13504

ExpHP commented 7 years ago

pointless, lammps appears to segfault if opened multiple times in parallel, even with OMP_NUM_THREADS=1 and processors 1 1 1

ExpHP commented 7 years ago

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.)

ExpHP commented 6 years ago

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