Changeset 1337 for trunk/examples/extended/parallel/MPI/mpi_interface/src
- Timestamp:
- Sep 30, 2010, 2:47:17 PM (14 years ago)
- Location:
- trunk/examples/extended/parallel/MPI/mpi_interface/src
- Files:
-
- 9 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/examples/extended/parallel/MPI/mpi_interface/src/G4MPIbatch.cc
r807 r1337 24 24 // ******************************************************************** 25 25 // 26 // $Id: G4MPIbatch.cc,v 1. 1 2007/11/16 14:05:41 kmura Exp $27 // $Name: $26 // $Id: G4MPIbatch.cc,v 1.2 2010/05/18 06:06:21 kmura Exp $ 27 // $Name: geant4-09-04-beta-01 $ 28 28 // 29 29 // ==================================================================== … … 34 34 #include "G4MPIbatch.hh" 35 35 #include "G4MPImanager.hh" 36 #include "G4UImanager.hh" 36 37 #include "G4UIcommandStatus.hh" 38 #include <vector> 39 40 //////////////////////////////////////////////////////////////////////// 41 static void Tokenize(const G4String& str, std::vector<G4String>& tokens) 42 //////////////////////////////////////////////////////////////////////// 43 { 44 const char* delimiter= " "; 45 46 str_size pos0= str.find_first_not_of(delimiter); 47 str_size pos = str.find_first_of(delimiter, pos0); 48 49 while (pos != G4String::npos || pos0 != G4String::npos) { 50 if (str[pos0] == '\"') { 51 pos = str.find_first_of("\"", pos0+1); 52 if(pos != G4String::npos) pos++; 53 } 54 if (str[pos0] == '\'') { 55 pos = str.find_first_of("\'", pos0+1); 56 if(pos != G4String::npos) pos++; 57 } 58 59 tokens.push_back(str.substr(pos0, pos-pos0)); 60 pos0 = str.find_first_not_of(delimiter, pos); 61 pos = str.find_first_of(delimiter, pos0); 62 } 63 } 37 64 38 65 // ==================================================================== … … 72 99 ////////////////////////////////// 73 100 { 74 enum { BUFSIZE= 256 }; 75 char linebuf[BUFSIZE]; 76 101 enum { BUFSIZE= 4096 }; 102 static char linebuf[BUFSIZE]; 103 104 G4String cmdtotal= ""; 105 G4bool qcontinued= false; 77 106 while(batchStream.good()) { 78 107 batchStream.getline(linebuf, BUFSIZE); 79 108 80 109 G4String cmdline(linebuf); 81 cmdline= cmdline.strip(G4String::both); 82 cmdline= cmdline.strip(G4String::both, '\011'); // remove TAB 83 cmdline= TruncateCommand(cmdline); 84 85 str_size ic= cmdline.find_first_of('#'); 86 if(ic != G4String::npos) { 87 cmdline= cmdline(0, ic); 88 } 89 90 if(batchStream.eof()) { 91 if(cmdline.size()==0) { 92 return "exit"; 93 } else { 94 return cmdline; 95 } 110 111 // TAB-> ' ' conversion 112 str_size nb=0; 113 while ((nb= cmdline.find('\t',nb)) != G4String::npos) { 114 cmdline.replace(nb, 1, " "); 96 115 } 97 116 98 if(cmdline.size()==0) continue; // skip null line 99 return cmdline; 100 } 117 // strip 118 cmdline= cmdline.strip(G4String::both); 101 119 102 return "exit"; // dummy 120 // skip null line if single line 121 if(!qcontinued && cmdline.size()==0) continue; 122 123 // '#' is treated as echoing something 124 if(cmdline[(size_t)0]=='#') return cmdline; 125 126 // tokenize... 127 std::vector<G4String> tokens; 128 Tokenize(cmdline, tokens); 129 qcontinued= false; 130 for (G4int i=0; i< G4int(tokens.size()); i++) { 131 // string after '#" is ignored 132 if(tokens[i][(size_t)0] == '#' ) break; 133 // '\' or '_' is treated as continued line. 134 if(tokens[i] == '\\' || tokens[i] == '_' ) { 135 qcontinued= true; 136 // check nothing after line continuation character 137 if( i != G4int(tokens.size())-1) { 138 G4Exception("unexpected character after " 139 "line continuation character"); 140 } 141 break; // stop parsing 142 } 143 cmdtotal+= tokens[i]; 144 cmdtotal+= " "; 145 } 146 147 if(qcontinued) continue; // read the next line 148 149 if(cmdtotal.size() != 0) break; 150 if(batchStream.eof()) break; 151 } 152 153 // strip again 154 cmdtotal= cmdtotal.strip(G4String::both); 155 156 // bypass some commands 157 cmdtotal= BypassCommand(cmdtotal); 158 159 // finally, 160 if(batchStream.eof() && cmdtotal.size()==0) { 161 return "exit"; 162 } 163 164 return cmdtotal; 103 165 } 104 166 … … 110 172 G4String newCommand="", scommand; // newCommand is always "" in slaves 111 173 112 if(isMaster) newCommand= ReadCommand(); 113 // broadcast a new G4 command 114 scommand= g4MPI-> BcastCommand(newCommand); 115 if(scommand == "exit" ) return 0; 116 117 while(1){ 118 G4int rc= ExecCommand(scommand); 119 if(rc != fCommandSucceeded) break; 120 121 if(isMaster) newCommand= ReadCommand(); 122 scommand= g4MPI-> BcastCommand(newCommand); 123 if(scommand == "exit" ) { 124 if(isBatchMode) { 125 if(g4MPI-> CheckThreadStatus()) { 126 g4MPI-> JoinBeamOnThread(); 127 break; 128 } 129 } else { 130 break; 174 while(1) { 175 if (isMaster) newCommand = ReadCommand(); 176 // broadcast a new G4 command 177 scommand = g4MPI-> BcastCommand(newCommand); 178 if(scommand == "exit") return 0; 179 180 // just echo something 181 if( scommand[(size_t)0] == '#') { 182 if(G4UImanager::GetUIpointer()-> GetVerboseLevel()==2) { 183 G4cout << scommand << G4endl; 131 184 } 185 continue; 186 } 187 188 G4int rc = ExecCommand(scommand); 189 if (rc != fCommandSucceeded) { 190 G4cerr << G4endl << "***** Batch is interupted!! *****" << G4endl; 191 break; 132 192 } 133 193 } 134 194 135 195 return 0; 136 196 } -
trunk/examples/extended/parallel/MPI/mpi_interface/src/G4MPImanager.cc
r807 r1337 24 24 // ******************************************************************** 25 25 // 26 // $Id: G4MPImanager.cc,v 1. 1 2007/11/16 14:05:41 kmura Exp $27 // $Name: $26 // $Id: G4MPImanager.cc,v 1.2 2010/05/18 06:06:21 kmura Exp $ 27 // $Name: geant4-09-04-beta-01 $ 28 28 // 29 29 // ==================================================================== … … 68 68 //////////////////////////// 69 69 G4MPImanager::G4MPImanager() 70 : verbose(0), 70 : verbose(0), 71 71 qfcout(false), 72 72 qinitmacro(false), … … 75 75 masterWeight(1.) 76 76 //////////////////////////// 77 { 77 { 78 78 //MPI::Init(); 79 79 MPI::Init_thread(MPI::THREAD_SERIALIZED); … … 86 86 : verbose(0), qfcout(false), 87 87 qinitmacro(false), qbatchmode(false), 88 threadID(0), 88 threadID(0), 89 89 masterWeight(1.) 90 90 ///////////////////////////////////////////////// … … 140 140 isMaster= (rank == RANK_MASTER); 141 141 isSlave= (rank != RANK_MASTER); 142 142 143 143 // initialize MPI communicator 144 144 COMM_G4COMMAND= MPI::COMM_WORLD.Dup(); … … 231 231 char str[1024]; 232 232 sprintf(str, prefix.c_str(), rank); 233 G4String fname(str); 233 G4String fname(str); 234 234 fscout.open(fname.c_str(), std::ios::out); 235 235 } … … 265 265 G4int runid, eventid, neventTBP; 266 266 267 if (run) { // running... 267 G4StateManager* stateManager= G4StateManager::GetStateManager(); 268 G4ApplicationState g4state= stateManager-> GetCurrentState(); 269 270 if (run) { 268 271 runid= run-> GetRunID(); 269 272 neventTBP= run -> GetNumberOfEventToBeProcessed(); 270 273 eventid= run-> GetNumberOfEvent(); 274 if(g4state == G4State_GeomClosed || g4state == G4State_EventProc) { 275 status-> StopTimer(); 276 } 271 277 } else { 272 278 runid= 0; … … 274 280 neventTBP= 0; 275 281 } 276 277 G4StateManager* stateManager= G4StateManager::GetStateManager();278 G4ApplicationState g4state= stateManager-> GetCurrentState();279 282 280 283 status-> SetStatus(rank, runid, neventTBP, eventid, g4state); … … 308 311 nev+= status-> GetEventID(); 309 312 nevtp+= status-> GetNEventToBeProcessed(); 310 //mpistate= status-> GetG4State();311 313 cputime+= status-> GetCPUTime(); 312 314 } … … 322 324 << G4endl 323 325 << "* #ranks= " << size 324 << " event= " << nev << "/" << nevtp 325 << " state= " << strStatus 326 << " event= " << nev << "/" << nevtp 327 << " state= " << strStatus 326 328 << " time= " << cputime << "s" 327 329 << G4endl; 328 330 } else { 329 331 status-> Pack(buff); 330 COMM_G4COMMAND.Send(buff, G4MPIstatus::NSIZE, MPI::INT, 332 COMM_G4COMMAND.Send(buff, G4MPIstatus::NSIZE, MPI::INT, 331 333 RANK_MASTER, TAG_G4STATUS); 332 334 } … … 352 354 if(isMaster) { 353 355 // print master 354 G4cout << "* rank= " << rank 355 << " seed= " << CLHEP::HepRandom::getTheSeed() 356 G4cout << "* rank= " << rank 357 << " seed= " << CLHEP::HepRandom::getTheSeed() 356 358 << G4endl; 357 359 // receive from each slave 358 360 for (G4int islave=1; islave< size; islave++) { 359 361 COMM_G4COMMAND.Recv(&buff, 1, MPI::LONG, islave, TAG_G4SEED); 360 G4cout << "* rank= " << islave 362 G4cout << "* rank= " << islave 361 363 << " seed= " << buff 362 364 << G4endl; … … 391 393 // get slave status 392 394 for (G4int islave=1; islave< size; islave++) { 393 COMM_G4COMMAND.Recv(&buff, 1, MPI::UNSIGNED, islave, TAG_G4STATUS); 395 MPI::Request request= COMM_G4COMMAND.Irecv(&buff, 1, MPI::UNSIGNED, 396 islave, TAG_G4STATUS); 397 MPI::Status status; 398 while(! request.Test(status)) { 399 Wait(100); 400 } 394 401 qstatus |= buff; 395 402 } … … 452 459 static G4String cmdstr; 453 460 cmdstr= command; 454 G4int rc= pthread_create(&threadID, 0, 461 G4int rc= pthread_create(&threadID, 0, 455 462 (Func_t)thread_ExecuteThreadCommand, 456 463 (void*)&cmdstr); … … 487 494 488 495 // waiting message exhausts CPU in LAM! 489 //COMM_G4COMMAND.Bcast(sbuff, BUFF_SIZE, MPI::CHAR, RANK_MASTER);496 //COMM_G4COMMAND.Bcast(sbuff, ssize, MPI::CHAR, RANK_MASTER); 490 497 491 498 // another implementation … … 514 521 ///////////////////////////////////////////////////////////////////////// 515 522 { 523 G4bool currentmode= qbatchmode; 524 qbatchmode= true; 516 525 G4MPIbatch* batchSession= new G4MPIbatch(fname, qbatch); 517 526 batchSession-> SessionStart(); 518 527 delete batchSession; 528 qbatchmode= currentmode; 519 529 } 520 530 … … 552 562 } 553 563 564 /////////////////////////////// 565 void G4MPImanager::WaitBeamOn() 566 /////////////////////////////// 567 { 568 G4int buff= 0; 569 if (qbatchmode) { // valid only in batch mode 570 if(isMaster) { 571 // receive from each slave 572 for (G4int islave=1; islave< size; islave++) { 573 MPI::Request request= COMM_G4COMMAND.Irecv(&buff, 1, MPI::INT, 574 islave, TAG_G4STATUS); 575 MPI::Status status; 576 while(! request.Test(status)) { 577 Wait(1000); 578 } 579 } 580 } else { 581 buff= 1; 582 COMM_G4COMMAND.Send(&buff, 1, MPI::INT, RANK_MASTER, TAG_G4STATUS); 583 } 584 } 585 } 554 586 555 587 ///////////////////////////////////////////////// -
trunk/examples/extended/parallel/MPI/mpi_interface/src/G4MPImessenger.cc
r807 r1337 24 24 // ******************************************************************** 25 25 // 26 // $Id: G4MPImessenger.cc,v 1. 1 2007/11/16 14:05:41 kmura Exp $27 // $Name: $26 // $Id: G4MPImessenger.cc,v 1.2 2010/05/18 06:06:21 kmura Exp $ 27 // $Name: geant4-09-04-beta-01 $ 28 28 // 29 29 // ==================================================================== … … 72 72 execute= new G4UIcmdWithAString("/mpi/execute", this); 73 73 execute-> SetGuidance("Execute a macro file. (=/control/execute)"); 74 execute-> SetParameterName("fileName", false, false); 74 execute-> SetParameterName("fileName", false, false); 75 75 76 76 // /mpi/beamOn … … 88 88 89 89 // /mpi/.beamOn 90 dotbeamOn= new G4UIcmdWithAnInteger("/mpi/.beamOn", this); 91 dotbeamOn-> SetGuidance("Start a parallel run w/o thread. (=/run/beamOn)"); 92 dotbeamOn-> SetParameterName("numberOfEvent", true, false); 93 dotbeamOn-> SetDefaultValue(1); 94 dotbeamOn-> SetRange("numberOfEvent>=0"); 90 dotbeamOn= new G4UIcommand("/mpi/.beamOn", this); 91 dotbeamOn-> SetGuidance("Start a parallel run w/o thread."); 92 93 p1= new G4UIparameter("numberOfEvent", 'i', true); 94 p1-> SetDefaultValue(1); 95 p1-> SetParameterRange("numberOfEvent>=0"); 96 dotbeamOn-> SetParameter(p1); 97 98 p2= new G4UIparameter("divide", 'b', true); 99 p2-> SetDefaultValue(true); 100 dotbeamOn-> SetParameter(p2); 95 101 96 102 // /mpi/weightForMaster … … 99 105 masterWeight-> SetParameterName("weight", false, false); 100 106 masterWeight-> SetRange("weight>=0. && weight<=1."); 107 108 // /mpi/wait 109 waitall= new G4UIcmdWithoutParameter("/mpi/wait", this); 110 waitall-> SetGuidance( "Wait until beamOn-s on all nodes are done. " 111 "(batch mode only)"); 101 112 102 113 // /mpi/showSeeds … … 132 143 delete dotbeamOn; 133 144 delete masterWeight; 145 delete waitall; 134 146 delete showSeeds; 135 147 delete setMasterSeed; 136 148 delete setSeed; 137 149 138 150 delete dir; 139 151 } … … 162 174 163 175 } else if (command == dotbeamOn){ // /mpi/.beamOn 164 G4int nevent= dotbeamOn-> GetNewIntValue(newValue); 165 g4MPI-> BeamOn(nevent); 176 std::istringstream is(newValue); 177 G4int nevent; 178 G4bool qdivide; 179 is >> nevent >> qdivide; 180 g4MPI-> BeamOn(nevent, qdivide); 166 181 167 182 } else if (command == masterWeight){ // /mpi/masterWeight 168 183 G4double weight= masterWeight-> GetNewDoubleValue(newValue); 169 184 g4MPI-> SetMasterWeight(weight); 170 185 186 } else if (command == waitall) { 187 g4MPI-> WaitBeamOn(); 188 171 189 } else if (command == showSeeds){ // /mpi/showSeeds 172 190 g4MPI-> ShowSeeds(); 173 191 174 192 } else if (command == setMasterSeed){ // /mpi/setMasterSeed 175 193 std::istringstream is(newValue); … … 178 196 g4MPI-> GetSeedGenerator()-> SetMasterSeed(seed); 179 197 g4MPI-> DistributeSeeds(); 180 198 181 199 } else if (command == setSeed){ // /mpi/setSeed 182 200 std::istringstream is(newValue); -
trunk/examples/extended/parallel/MPI/mpi_interface/src/G4MPIrandomSeedGenerator.cc
r807 r1337 25 25 // 26 26 // $Id: G4MPIrandomSeedGenerator.cc,v 1.1 2007/11/16 14:05:41 kmura Exp $ 27 // $Name: $27 // $Name: geant4-09-04-beta-01 $ 28 28 // 29 29 // ==================================================================== -
trunk/examples/extended/parallel/MPI/mpi_interface/src/G4MPIsession.cc
r807 r1337 24 24 // ******************************************************************** 25 25 // 26 // $Id: G4MPIsession.cc,v 1. 1 2007/11/16 14:05:41 kmura Exp $27 // $Name: $26 // $Id: G4MPIsession.cc,v 1.2 2010/05/18 06:06:21 kmura Exp $ 27 // $Name: geant4-09-04-beta-01 $ 28 28 // 29 29 // ==================================================================== … … 125 125 } else if(nC == "pwd") { // show current directory 126 126 G4cout << "Current Command Directory : " 127 127 << GetCurrentWorkingDirectory() << G4endl; 128 128 newCommand= nullString; 129 129 … … 195 195 g4MPI-> ExecuteMacroFile(g4MPI->GetMacroFileName(), true); 196 196 return 0; 197 } 198 197 } 198 199 199 // interactive session 200 200 G4String newCommand="", scommand; // newCommand is always "" in slaves 201 202 if(isMaster) newCommand= GetCommand(); 203 // broadcast a new G4 command 204 scommand= g4MPI-> BcastCommand(newCommand); 205 if(scommand == "exit" ) return 0; 206 207 while(1){ 201 202 while(1) { 203 if(isMaster) newCommand = GetCommand(); 204 // broadcast a new G4 command 205 scommand = g4MPI-> BcastCommand(newCommand); 206 if(scommand == "exit") { 207 G4bool qexit = TryForcedTerminate(); 208 if(qexit) break; 209 else scommand = ""; 210 } 208 211 ExecCommand(scommand); 209 210 // get next ...211 if(isMaster) newCommand= GetCommand();212 scommand= g4MPI-> BcastCommand(newCommand);213 if(scommand == "exit" ) {214 G4bool qexit= TryForcedTerminate();215 if(qexit) break;216 else scommand="";217 }218 212 } 219 213 … … 254 248 xmessage= g4MPI->BcastCommand(""); 255 249 } 256 250 257 251 if(xmessage == "kill me") { 258 252 G4RunManager* runManager= G4RunManager::GetRunManager(); -
trunk/examples/extended/parallel/MPI/mpi_interface/src/G4MPIstatus.cc
r807 r1337 24 24 // ******************************************************************** 25 25 // 26 // $Id: G4MPIstatus.cc,v 1. 1 2007/11/16 14:05:41 kmura Exp $27 // $Name: $26 // $Id: G4MPIstatus.cc,v 1.2 2010/05/18 06:06:21 kmura Exp $ 27 // $Name: geant4-09-04-beta-01 $ 28 28 // 29 29 // ==================================================================== … … 43 43 ////////////////////////// 44 44 G4MPIstatus::G4MPIstatus() 45 : rank(0), runID(0), 45 : rank(0), runID(0), 46 46 nEventToBeProcessed(0), 47 47 eventID(0), … … 51 51 { 52 52 timer= new G4Timer; 53 timer-> Start();54 53 } 55 54 … … 64 63 65 64 ///////////////////////////////////////////////////// 66 void G4MPIstatus::SetStatus(G4int arank, G4int runid, 65 void G4MPIstatus::SetStatus(G4int arank, G4int runid, 67 66 G4int noe, G4int evtid, 68 67 G4ApplicationState state) … … 74 73 eventID= evtid; 75 74 g4state= state; 76 77 timer-> Stop(); 78 cputime= timer-> GetUserElapsed(); 75 if (timer-> IsValid()) cputime= timer-> GetUserElapsed(); 76 else cputime = 0.; 79 77 } 80 78 … … 83 81 void G4MPIstatus::Pack(G4int* data) const 84 82 ///////////////////////////////////////// 85 { 83 { 86 84 data[0]= rank; 87 85 data[1]= runID; … … 115 113 { 116 114 // * rank= 001 run= 10002 event= 00001 / 100000 state= Idle" 117 G4cout << "* rank= " << rank 118 << " run= " << runID 115 G4cout << "* rank= " << rank 116 << " run= " << runID 119 117 << " event= " << eventID << " / " << nEventToBeProcessed 120 118 << " state= " << GetStateString(g4state) -
trunk/examples/extended/parallel/MPI/mpi_interface/src/G4UImpish.cc
r807 r1337 25 25 // 26 26 // $Id: G4UImpish.cc,v 1.1 2007/11/16 14:05:41 kmura Exp $ 27 // $Name: $27 // $Name: geant4-09-04-beta-01 $ 28 28 // 29 29 // ==================================================================== -
trunk/examples/extended/parallel/MPI/mpi_interface/src/G4VMPIseedGenerator.cc
r807 r1337 25 25 // 26 26 // $Id: G4VMPIseedGenerator.cc,v 1.1 2007/11/16 14:05:41 kmura Exp $ 27 // $Name: $27 // $Name: geant4-09-04-beta-01 $ 28 28 // ==================================================================== 29 29 // G4VMPIseedGenerator.cc -
trunk/examples/extended/parallel/MPI/mpi_interface/src/G4VMPIsession.cc
r807 r1337 24 24 // ******************************************************************** 25 25 // 26 // $Id: G4VMPIsession.cc,v 1. 1 2007/11/16 14:05:41 kmura Exp $27 // $Name: $26 // $Id: G4VMPIsession.cc,v 1.2 2010/05/18 06:06:21 kmura Exp $ 27 // $Name: geant4-09-04-beta-01 $ 28 28 // 29 29 // ==================================================================== … … 94 94 95 95 /////////////////////////////////////////////////// 96 G4int G4VMPIsession::ExecCommand(G4String a Command)96 G4int G4VMPIsession::ExecCommand(G4String acommand) 97 97 /////////////////////////////////////////////////// 98 98 { 99 if(a Command.length()<2) return fCommandSucceeded;99 if(acommand.length()<2) return fCommandSucceeded; 100 100 101 101 G4UImanager* UI= G4UImanager::GetUIpointer(); 102 102 G4int returnVal= 0; 103 103 104 G4String command= BypassCommand(a Command);105 104 G4String command= BypassCommand(acommand); 105 106 106 // "/mpi/beamOn is threaded out. 107 107 if(command(0,11) == "/mpi/beamOn") { 108 g4MPI-> ExecuteBeamOnThread( aCommand);108 g4MPI-> ExecuteBeamOnThread(command); 109 109 returnVal= fCommandSucceeded; 110 110 } else if(command(0,12) == "/mpi/.beamOn") { // care for beamOn … … 183 183 str_size idx; 184 184 while( (idx= acommand.find("//")) != G4String::npos) { 185 G4String command1= acommand(0,idx+1); 185 G4String command1= acommand(0,idx+1); 186 186 G4String command2= acommand(idx+2, acommand.size()-idx-2); 187 187 acommand= command1 + command2; … … 199 199 { 200 200 // bypass some commands 201 // /run/beamon -> /mpi/.beamOn 202 // /control/execute -> /mpi/execute 201 // * /mpi/beamOn 202 // -> /mpi/.beamOn (batch session) 203 // 204 // * /run/beamOn 205 // -> /mpi/.beamOn (batch session) 206 // -> /mpi/beamOn (interactive session) 207 // 208 // * /control/execute -> /mpi/execute 203 209 204 210 G4String acommand= command; 205 211 212 // /mpi/beamOn 213 if(acommand(0,11) == "/mpi/beamOn") { 214 if(g4MPI-> IsBatchMode()) { 215 acommand= "/mpi/.beamOn"; 216 if(command.length() > 11) { 217 acommand +=command.substr(11); 218 } 219 } 220 } 221 222 // /run/beamOn 206 223 if(acommand(0,11) == "/run/beamOn") { 207 if(g4MPI-> GetVerbose()>0 && isMaster) {208 G4cout << "/run/beamOn is overridden by /mpi/.beamOn"209 << G4endl;210 }211 212 acommand= "/mpi/.beamOn ";213 214 224 G4String strarg= ""; 215 225 G4bool qget= false; … … 222 232 continue; 223 233 } 224 225 234 if(qget) { 226 235 strarg+= command[idx]; … … 228 237 } 229 238 } 230 acommand += strarg; 231 } 232 239 240 if(g4MPI-> IsBatchMode()) { // batch session 241 acommand= "/mpi/.beamOn "; 242 if(command.length() > 11) acommand += strarg; 243 } else { // interactive session 244 if(g4MPI-> GetVerbose()>0 && isMaster) { 245 G4cout << "/run/beamOn is overridden by /mpi/.beamOn" << G4endl; 246 } 247 acommand= "/mpi/beamOn "; 248 if(command.length() > 11) acommand += strarg; 249 } 250 } 251 252 // /control/execute 233 253 if(acommand(0,16) == "/control/execute") { 234 254 if(g4MPI-> GetVerbose()>0 && isMaster) { 235 G4cout << "/control/execute is overridden by /mpi/execute" 255 G4cout << "/control/execute is overridden by /mpi/execute" 236 256 << G4endl; 237 257 } 238 239 258 acommand.replace(0, 16, "/mpi/execute "); 240 259 }
Note: See TracChangeset
for help on using the changeset viewer.