Changeset 25
- Timestamp:
- Nov 30, 2011, 1:12:35 PM (13 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/oar/mpilauncher.cpp
r24 r25 88 88 int main(int argc, char **argv) { 89 89 vector < string > files = vector < string > (); 90 string rep; // root directory where to find 91 // subdirectories 90 string rep; // root folder where to find subfolders 92 91 int rank, size, nbdir, stride; 93 92 int nbcmd; … … 104 103 string finalCommand; // command to execute 105 104 106 MPI_Init(&argc, &argv); /* starts MPI */ 107 MPI_Comm_rank(MPI_COMM_WORLD, &rank); /* get current process id */ 108 MPI_Comm_size(MPI_COMM_WORLD, &size); /* get number of processes 109 */ 105 MPI_Init(&argc, &argv); // starts MPI 106 MPI_Comm_rank(MPI_COMM_WORLD, &rank); // get current process id 107 MPI_Comm_size(MPI_COMM_WORLD, &size); // get number of processes 110 108 111 109 if (argc < 3) { … … 122 120 commandfile = argv[2]; 123 121 nbcmd = getListOfCommand(commandfile, files); 124 // if (rank==0){125 // cout<<"Command file is "<<commandfile<<endl;126 // for (unsigned int i = 0;i < nbcmd;i++)127 // cout<<"["<<files[i]<<"]"<<endl;128 // }129 130 // Number of commands should divide by number of cpus131 // if (nbcmd%size != 0) {132 // if(rank ==0)133 // cerr <<nbcmd<<" command(s) to process in "<<commandfile134 // <<" cannot fit on "<<size<<" processe(s)"135 // <<endl<<"FAILED"<<endl;136 // }137 // else {138 // execute the command139 122 int reste; 140 123 stride = nbcmd / size; … … 151 134 system(files[nbcmd - rank].c_str()); 152 135 } 153 // }154 136 } 155 137 else {
Note: See TracChangeset
for help on using the changeset viewer.