This flag is shared between the threads, if any thread fails, this is set and before the new threads get dispatched or run, this flag is checked.
In case it is set, the program aborts.
Checking int return types of MPI functions is inefficient. The default
error handler will abort the problem. If somebody changes that, then
they should know what they are doing.
According to MPI standard the ERROR field of MPI_Status might not be initialized
unless for operations that return multiple statuses, see Section 3.7.5
of the standard. In older OpenMPI versions (<=4.0.x) we were lucky
that ERROR was initialized to 0 always. This is not the case for 4.1.y
at least. See https://github.com/open-mpi/ompi/issues/12049.
Therefore we use the retun code to determine whether there was an
error. Note that the default error handler usually is to abort the
application if errors occur. In that case the error code will always
return success.
We actually do set the number of OpenMP threads based on
OMP_NUM_THREADS or command line option ThreadsPerProcess for OpenMP already
in opm-simulators and these settings should just be used here, too. Hence
the new flag for skipping the command line parameter and use the
number of threads that OpenMP has available.
Querying it here results in different behavior as for FlowMainEbos.hpp:
In opm-simulators variable OMP_NUM_THREADS takes precedence over the
command line parameter, but here it would only be used if the command
line option was not used at all.