Documentation for G4UImanager::GetLastReturnCode()

We have a simulation framework with executables and macro files which are submitted to batch. Is there any way to have the main program recognize and report on failures from the macro files? We run the macros with the usual

UImanager->ExecuteMacroFile(filename);

function call. But this function returns void, so there’s no way to know directly whether the macro succeeded or failed, other than parsing the log file after the fact.

What’s more, if the failure caused the Geant4 job to crash or abort, there isn’t even a non-zero return code :frowning: All jobs return 0 (“success”), even if they failed.

Would the function G4UImanager::GetLastReturnCode() be suitable for this? Is there any documentation available which explains what it returns? Is there a table or an enum of values with meanings?

1 Like

Any update on this? I was about to post the same question on this forum.

Nope. Never got a reply. In the code, the only place the funcion is used is reporting “Command aborted” with a value, followed by a call to CommandFailed().