Added try/catch statements in OpenMP regions and tMPI start
commit4fb0842dea2696182c6e281eb99d92827493d791
authorErik Lindahl <erik@kth.se>
Sat, 3 Oct 2015 17:36:13 +0000 (3 19:36 +0200)
committerGerrit Code Review <gerrit@gerrit.gromacs.org>
Mon, 5 Oct 2015 19:10:43 +0000 (5 21:10 +0200)
tree6372a54b30ee8c32b2b36d2acf782c73a4ec10ed
parent64f3de276ffb40548e6df5df588ba0afff6eb63e
Added try/catch statements in OpenMP regions and tMPI start

OpenMP cannot handle exceptions when they are thrown inside an
OpenMP region, but caught outside of it. Instead we catch these
exceptions inside the region and exit with a fatal error. Not
beautiful, but at least we will know what happened, and exceptions
should only occur in catastrophic scenarios in parallel regions
(where we already call the fata error handler). For trivial OpenMP
blocks that should never through there are comments noting this, so
we remember to add a try/catch pair if necessary in the future.
There is also a new catch-all in the tMPI entry point function.

Refs #1828.

Change-Id: I52103a076b7f0a5e8ac1f740160e4de0fa97f638
38 files changed:
src/gromacs/correlationfunctions/crosscorr.cpp
src/gromacs/correlationfunctions/manyautocorrelation.cpp
src/gromacs/domdec/domdec.cpp
src/gromacs/domdec/domdec_constraints.cpp
src/gromacs/domdec/domdec_topology.cpp
src/gromacs/ewald/pme-grid.cpp
src/gromacs/ewald/pme-redistribute.cpp
src/gromacs/ewald/pme-solve.cpp
src/gromacs/ewald/pme-spread.cpp
src/gromacs/ewald/pme.cpp
src/gromacs/fft/fft5d.cpp
src/gromacs/gmxana/gmx_hbond.cpp
src/gromacs/gmxana/gmx_wham.cpp
src/gromacs/gmxana/nsfactor.cpp
src/gromacs/gmxlib/gmx_thread_affinity.cpp
src/gromacs/gmxlib/nonbonded/nb_free_energy.cpp
src/gromacs/listed-forces/listed-forces.cpp
src/gromacs/listed-forces/manage-threading.cpp
src/gromacs/mdlib/calcmu.cpp
src/gromacs/mdlib/clincs.cpp
src/gromacs/mdlib/constr.cpp
src/gromacs/mdlib/coupling.cpp
src/gromacs/mdlib/force.cpp
src/gromacs/mdlib/mdatoms.cpp
src/gromacs/mdlib/minimize.cpp
src/gromacs/mdlib/nbnxn_atomdata.cpp
src/gromacs/mdlib/nbnxn_grid.cpp
src/gromacs/mdlib/nbnxn_kernels/nbnxn_kernel_file_generator/nbnxn_kernel_simd_template.cpp.pre
src/gromacs/mdlib/nbnxn_kernels/nbnxn_kernel_ref.c
src/gromacs/mdlib/nbnxn_kernels/simd_2xnn/nbnxn_kernel_simd_2xnn.cpp
src/gromacs/mdlib/nbnxn_kernels/simd_4xn/nbnxn_kernel_simd_4xn.cpp
src/gromacs/mdlib/nbnxn_search.cpp
src/gromacs/mdlib/sim_util.cpp
src/gromacs/mdlib/tgroup.cpp
src/gromacs/mdlib/update.cpp
src/gromacs/mdlib/vsite.cpp
src/gromacs/pbcutil/pbc.cpp
src/programs/mdrun/runner.cpp