Error handling in tofh_type%compute is not parallel safe
The compute
method of the TofH
derived type has several fail-safe error checks that call TLS_fatal
which is a collective procedure, yet compute
is called independently on individual cells. This has led to hang in one case. The proper call is to TLS_panic
.
Actually there is a newer inverse_func
class that has generalized the older one-off TofH
type. In the new class the error handling has been redesigned to either pass back an optional error status and message for the caller to handle, or to call the system exit()
, which will cause MPI to abort -- admittedly not graceful. The TofH
type should perhaps be reimplemented as an extension of this inverse_func
class.