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.
Loading
Please sign in to comment