GeoscienceAustralia / ptha

Probabilistic Tsunami Hazard Assessment from major earthquake source-zones
BSD 3-Clause "New" or "Revised" License
20 stars 9 forks source link

avoid requesting a parallel communication when throwing an error in check_multidomain_stability #36

Closed gareth-d-ga closed 11 months ago

gareth-d-ga commented 11 months ago

This applies if the code is compiled with -DTRACK_MULTIDOMAIN_STABILITY

If a process detects instability then it tries to write files, flush those files, then throw an error.

Previously the processes of writing out to files would also attempt a parallel communication (to make the max_U variables consistent), which other processes would not be doing. In principle that won't work, so it's removed by this update. Interestingly the previous code did not hang, but it may have been generating too many error messages as a result of this issue.

I checked that it worked by deliberately creating a multiprocess run that fails on a single domain/image. The error messages seemed clean. The change isn't unit-tested because we don't have a system for "expected failures".