You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I want to check in code to eliminate the use of exceptions in iPic3D.
Allowing exceptions has performance penalties. In particular, while developing an array class for iPic3D, I observed that looping through array elements took three times as long if the body of the destructor of the array class was nonempty. This performance penalty disappeared when I compiled with the -fno-exceptions flag.
I see no reason to retain exception handling in iPic3D. This is not an event-driven application. All current use of exceptions is used to generate error messages, which can be handled adequately with simple calls to eprintf(). Therefore, I am going through the code and replacing each throwing of an exception such as
eprintf("make_dataset fails for %s", tag.c_str());
Note that the eprintf() macro automatically prints file, line number, and method name, so there is no need to add any of that information to the call to eprintf().
In my initial implementation of this change I simply comment out all occurences of try and all catch blocks and all calls to throw, replacing each call to throw with a call to eprintf. I leave it for later to decide whether to completely eliminate the Exception and OutputException classes in the PSK namespace or whether for some reason to revert to supporting the possibility of exceptions via pre-processor branching directives.
The text was updated successfully, but these errors were encountered:
From issue #42: it is unnecessary to recompile the code when we change the processor topology. The number of subdomains in each direction is how given iniside the input file.
The modifications are based on the code implemented in:
alecjohnson/iPic3D@8b81a53alecjohnson/iPic3D@2ac8e76alecjohnson/iPic3D@51fa54d
The GEM.inp file has been modified to include the new input options.
From issue #50: CollectiveIO is an abstract base class that is not really used. CollectiveIO was eliminated. All calls to CollectiveIO are now set to Collective.
The Makefile has been updated.
I want to check in code to eliminate the use of exceptions in iPic3D.
Allowing exceptions has performance penalties. In particular, while developing an array class for iPic3D, I observed that looping through array elements took three times as long if the body of the destructor of the array class was nonempty. This performance penalty disappeared when I compiled with the
-fno-exceptions
flag.I see no reason to retain exception handling in iPic3D. This is not an event-driven application. All current use of exceptions is used to generate error messages, which can be handled adequately with simple calls to
eprintf()
. Therefore, I am going through the code and replacing each throwing of an exception such aswith printing of an error message such as
Note that the
eprintf()
macro automatically prints file, line number, and method name, so there is no need to add any of that information to the call toeprintf()
.In my initial implementation of this change I simply comment out all occurences of
try
and allcatch
blocks and all calls tothrow
, replacing each call tothrow
with a call toeprintf
. I leave it for later to decide whether to completely eliminate theException
andOutputException
classes in thePSK
namespace or whether for some reason to revert to supporting the possibility of exceptions via pre-processor branching directives.The text was updated successfully, but these errors were encountered: