Problem 734 - G4UIbatch should not simply continue if invalid command is encountered
Summary: G4UIbatch should not simply continue if invalid command is encountered
Status: RESOLVED FIXED
Alias: None
Product: Geant4
Classification: Unclassified
Component: interfaces (show other problems)
Version: 7.0
Hardware: All All
: P5 enhancement
Assignee: asai
URL:
Depends on:
Blocks:
 
Reported: 2005-03-29 16:14 CEST by DRay
Modified: 2005-05-19 11:08 CEST (History)
0 users

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this problem.
Description DRay 2005-03-29 16:14:13 CEST
If one is running a macro file in batch mode, then a command which is invalid
for some reason should cause the simulation to terminate, rather than the
command simply being ignored. Presumably, the command was typed in wrongly by
the person composing the macro, and not running the proper command will lead to
undetermined Monte Carlo results.

81         G4int rc = UImanager->ApplyCommand(commandLine);

In my opinion, Geant should throw an exception if rc is nonzero.
Comment 1 asai 2005-05-19 11:08:59 CEST
Thank you for reporting about this concern.
It makes lots of sense to terminate the batch execution if a coomand in the
macro file is invalid. On the other hand, issuing an exception and terminating
the entire program might not be a desired behavior if the macro file is issued
from an interactive session. I modified G4UIbatch so that it now aborts the
execution of the problematic macro file (and any other parent macro files which
issued this macro file) if a command is invalid. Thus, if the program is purely
in the batch mode, the program terminates, while program comes back to the
interactive mode if this problematic macro file is issued by an interactive
command. This modification should be included in the coming release.