Skip to content
Commit 194bef90 authored by Giovanni Bussi's avatar Giovanni Bussi
Browse files

Better support for exceptions and mixed compilers

I added a plumed_cmd_nothrow function to the interface, that is used from
C++. This allows better support for mixed compilers (e.g. MD code and PLUMED
compiled with different compilers or linked against different std libraries).

Notice that I tried in the past to achieve the same using cmd("setErrorHandler"),
but this does not work correctly with some combination of compilers.
In addition, it implies throwing from a extern "C" function, which is not standard
and might lead to portability issues.

The plumed_cmd_nothrow implementation catches any exception raised within plumed,
converts it to an error code, and rethrows it within the MD code. This approach
should be more robust.
parent c3305ba4
Loading
Loading
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please to comment