57 G4cin.ignore(30,
'\n');
67 G4cin.getline(temp, 100);
86 if( command(0,11) ==
"/mpi/beamOn" ) {
87 g4mpi_-> ExecuteBeamOnThread(command);
89 }
else if( command(0,12) ==
"/mpi/.beamOn" ) {
93 G4cout <<
"G4MPIsession:: beamOn is still running." <<
G4endl;
97 returnVal = UI-> ApplyCommand(command);
100 returnVal = UI-> ApplyCommand(command);
103 G4int paramIndex = returnVal % 100;
106 G4int commandStatus = returnVal - paramIndex;
113 switch( commandStatus ) {
117 G4cerr <<
"command <" << UI-> SolveAlias(command)
118 <<
"> not found" <<
G4endl;
121 G4cerr <<
"illegal application state -- command refused" <<
G4endl;
127 G4cerr <<
"Parameter is out of candidate list (index "
128 << paramIndex <<
")" <<
G4endl;
130 << cmd->
GetParameter(paramIndex)-> GetParameterCandidates()
134 G4cerr <<
"Parameter is wrong type and/or is not omittable (index "
135 << paramIndex <<
")" <<
G4endl;
141 G4cerr <<
"command refused (" << commandStatus <<
")" <<
G4endl;
155 if( iarg != G4String::npos ) {
156 strarg = acommand(iarg, acommand.size()-iarg);
157 acommand = acommand(0,iarg);
161 while( (idx = acommand.find(
"//")) != G4String::npos) {
162 G4String command1 = acommand(0,idx+1);
163 G4String command2 = acommand(idx+2, acommand.size()-idx-2);
164 acommand = command1 + command2;
190 if( acommand(0,11) ==
"/mpi/beamOn" ) {
191 #ifdef G4MULTITHREADED
192 acommand =
"/mpi/.beamOn";
193 if(command.length() > 11) {
194 acommand += command.substr(11);
197 if(
g4mpi_-> IsBatchMode()) {
198 acommand =
"/mpi/.beamOn";
199 if(command.length() > 11) {
200 acommand += command.substr(11);
207 if( acommand(0,11) ==
"/run/beamOn" ) {
212 for (
str_size idx = 10; idx < command.size(); idx++ ) {
213 if( command[idx] ==
' ' || command[idx] ==
'\011' ) {
219 strarg += command[idx];
224 if(
g4mpi_-> IsBatchMode() ) {
225 acommand =
"/mpi/.beamOn ";
226 if( command.length() > 11 ) acommand += strarg;
228 #ifdef G4MULTITHREADED
230 G4cout <<
"/run/beamOn is overridden by /mpi/.beamOn" <<
G4endl;
232 acommand =
"/mpi/.beamOn ";
233 if( command.length() > 11 ) acommand += strarg;
236 G4cout <<
"/run/beamOn is overridden by /mpi/beamOn" <<
G4endl;
238 acommand =
"/mpi/beamOn ";
239 if( command.length() > 11 ) acommand += strarg;
245 if( acommand(0,16) ==
"/control/execute" ) {
247 G4cout <<
"/control/execute is overridden by /mpi/execute"
250 acommand.
replace(0, 16,
"/mpi/execute ");
G4String BypassCommand(const G4String &command) const
G4String & replace(unsigned int, unsigned int, const char *, unsigned int)
A base class for MPI sessions.
G4UIparameter * GetParameter(G4int i) const
virtual G4bool GetHelpChoice(G4int &aval)
static G4UImanager * GetUIpointer()
static G4MPImanager * GetManager()
void Print(G4Element &ele)
G4GLOB_DLL std::ostream G4cerr
G4UIcommand * FindCommand(const char *commandName) const
G4int ExecCommand(const G4String &acommand)
std::string::size_type str_size
virtual void ExitHelp() const
G4GLOB_DLL std::ostream G4cout
virtual G4int ReceiveG4cout(const G4String &coutString)
G4String TruncateCommand(const G4String &command) const
virtual G4int ReceiveG4cerr(const G4String &cerrString)
virtual void PauseSessionStart(const G4String &msg)