56 G4cin.ignore(30,
'\n');
66 G4cin.getline(temp, 100);
85 if( command(0,11) ==
"/mpi/beamOn" ) {
86 g4mpi_-> ExecuteBeamOnThread(command);
88 }
else if( command(0,12) ==
"/mpi/.beamOn" ) {
92 G4cout <<
"G4MPIsession:: beamOn is still running." <<
G4endl;
96 returnVal = UI-> ApplyCommand(command);
99 returnVal = UI-> ApplyCommand(command);
102 G4int paramIndex = returnVal % 100;
105 G4int commandStatus = returnVal - paramIndex;
112 switch( commandStatus ) {
116 G4cerr <<
"command <" << UI-> SolveAlias(command)
117 <<
"> not found" <<
G4endl;
120 G4cerr <<
"illegal application state -- command refused" <<
G4endl;
126 G4cerr <<
"Parameter is out of candidate list (index "
127 << paramIndex <<
")" <<
G4endl;
129 << cmd->
GetParameter(paramIndex)-> GetParameterCandidates()
133 G4cerr <<
"Parameter is wrong type and/or is not omittable (index "
134 << paramIndex <<
")" <<
G4endl;
140 G4cerr <<
"command refused (" << commandStatus <<
")" <<
G4endl;
154 if( iarg != G4String::npos ) {
155 strarg = acommand(iarg, acommand.size()-iarg);
156 acommand = acommand(0,iarg);
160 while( (idx = acommand.find(
"//")) != G4String::npos) {
161 G4String command1 = acommand(0,idx+1);
162 G4String command2 = acommand(idx+2, acommand.size()-idx-2);
163 acommand = command1 + command2;
189 if( acommand(0,11) ==
"/mpi/beamOn" ) {
190 #ifdef G4MULTITHREADED
191 acommand =
"/mpi/.beamOn";
192 if(command.length() > 11) {
193 acommand += command.substr(11);
196 if(
g4mpi_-> IsBatchMode()) {
197 acommand =
"/mpi/.beamOn";
198 if(command.length() > 11) {
199 acommand += command.substr(11);
206 if( acommand(0,11) ==
"/run/beamOn" ) {
211 for (
str_size idx = 10; idx < command.size(); idx++ ) {
212 if( command[idx] ==
' ' || command[idx] ==
'\011' ) {
218 strarg += command[idx];
223 if(
g4mpi_-> IsBatchMode() ) {
224 acommand =
"/mpi/.beamOn ";
225 if( command.length() > 11 ) acommand += strarg;
227 #ifdef G4MULTITHREADED
229 G4cout <<
"/run/beamOn is overridden by /mpi/.beamOn" <<
G4endl;
231 acommand =
"/mpi/.beamOn ";
232 if( command.length() > 11 ) acommand += strarg;
235 G4cout <<
"/run/beamOn is overridden by /mpi/beamOn" <<
G4endl;
237 acommand =
"/mpi/beamOn ";
238 if( command.length() > 11 ) acommand += strarg;
244 if( acommand(0,16) ==
"/control/execute" ) {
246 G4cout <<
"/control/execute is overridden by /mpi/execute"
249 acommand.
replace(0, 16,
"/mpi/execute ");
std::string::size_type str_size
virtual G4bool GetHelpChoice(G4int &aval)
G4String & replace(unsigned int, unsigned int, const char *, unsigned int)
static G4UImanager * GetUIpointer()
G4String BypassCommand(const G4String &command) const
virtual void ExitHelp() const
G4GLOB_DLL std::ostream G4cout
G4UIparameter * GetParameter(G4int i) const
G4String TruncateCommand(const G4String &command) const
virtual G4int ReceiveG4cerr(const G4String &cerrString)
virtual void PauseSessionStart(const G4String &msg)
static G4MPImanager * GetManager()
virtual G4int ReceiveG4cout(const G4String &coutString)
G4UIcommand * FindCommand(const char *commandName) const
G4int ExecCommand(const G4String &acommand)
G4GLOB_DLL std::ostream G4cerr
A base class for MPI sessions.
void Print(G4Element &ele)