Skip to content
Snippets Groups Projects
Commit 166b7c6a authored by Stephan Schulz's avatar Stephan Schulz
Browse files

-DCM_ALL_FORTRAN_ERROR_ABORT to directly abort on any errors (#25)

parent 951c95b9
Branches
No related tags found
1 merge request!8Refactor
...@@ -5,6 +5,8 @@ option(CM_ALL_VORONOI "Voronoi-based loadbalancing scheme (requires Voro++)" OFF ...@@ -5,6 +5,8 @@ option(CM_ALL_VORONOI "Voronoi-based loadbalancing scheme (requires Voro++)" OFF
option(CM_ALL_FORTRAN "VTK output routine" OFF) option(CM_ALL_FORTRAN "VTK output routine" OFF)
option(CM_ALL_DEBUG "Enable debug information" OFF) option(CM_ALL_DEBUG "Enable debug information" OFF)
option(CM_ALL_USE_F08 "Use some Fortran 2008 features (mpi_f08)" OFF) option(CM_ALL_USE_F08 "Use some Fortran 2008 features (mpi_f08)" OFF)
option(CM_ALL_FORTRAN_ERROR_ABORT "Abort on any error when using the
Fortran interface" OFF)
option(CM_ALL_TESTS "Enables test suite" OFF) option(CM_ALL_TESTS "Enables test suite" OFF)
option(CM_ALL_AUTO_DOC "Enables creation of auto-documentation") option(CM_ALL_AUTO_DOC "Enables creation of auto-documentation")
...@@ -65,6 +67,10 @@ if (CM_ALL_DEBUG) ...@@ -65,6 +67,10 @@ if (CM_ALL_DEBUG)
add_compile_options("-DALL_DEBUG_ENABLED") add_compile_options("-DALL_DEBUG_ENABLED")
endif(CM_ALL_DEBUG) endif(CM_ALL_DEBUG)
if(CM_ALL_FORTRAN_ERROR_ABORT)
add_compile_options("-DALL_FORTRAN_ERROR_ABORT")
endif()
if(CM_ALL_USE_F08 AND MPI_Fortran_HAVE_F08_MODULE) if(CM_ALL_USE_F08 AND MPI_Fortran_HAVE_F08_MODULE)
add_compile_options("-DALL_USE_F08") add_compile_options("-DALL_USE_F08")
elseif(CM_ALL_USE_F08 AND NOT MPI_Fortran_HAVE_F08_MODULE) elseif(CM_ALL_USE_F08 AND NOT MPI_Fortran_HAVE_F08_MODULE)
......
...@@ -96,6 +96,10 @@ Optional requirements: ...@@ -96,6 +96,10 @@ Optional requirements:
- `-DCM_ALL_USE_F08=ON` (default: `OFF`): Enable usage of `mpi_f08` - `-DCM_ALL_USE_F08=ON` (default: `OFF`): Enable usage of `mpi_f08`
module for MPI. Requires Fortran 2008 capable compiler and module for MPI. Requires Fortran 2008 capable compiler and
compatible MPI installation. compatible MPI installation.
- `-DCM_ALL_FORTRAN_ERROR_ABORT=ON` (default: `OFF): Abort
execution on any error when using the Fortran interface instead
of setting the error number and leaving error handling to the
user.
- `-DCM_ALL_VORONOI=ON` (default: `OFF`): Enable Voronoi mesh - `-DCM_ALL_VORONOI=ON` (default: `OFF`): Enable Voronoi mesh
method and subsequently compilation and linkage of Voro++. method and subsequently compilation and linkage of Voro++.
- `-DCM_ALL_TESTING=ON` (default: `OFF`): Turns on unit and feature - `-DCM_ALL_TESTING=ON` (default: `OFF`): Turns on unit and feature
......
...@@ -41,11 +41,16 @@ static const char* ALL_errdesc; ...@@ -41,11 +41,16 @@ static const char* ALL_errdesc;
typedef ALL::ALL<double, double> ALL_t; typedef ALL::ALL<double, double> ALL_t;
#ifdef ALL_FORTRAN_ERROR_ABORT
#define ALL_try
#define ALL_catch
#else
#define ALL_try try { #define ALL_try try {
#define ALL_catch } catch (ALL::CustomException &e) { \ #define ALL_catch } catch (ALL::CustomException &e) { \
ALL_errno = e.get_error_id(); \ ALL_errno = e.get_error_id(); \
ALL_errdesc = e.what(); \ ALL_errdesc = e.what(); \
} }
#endif
/* /*
This interface is unstable and subject to change! It is only used for the This interface is unstable and subject to change! It is only used for the
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment