Changeset 25


Ignore:
Timestamp:
Nov 30, 2011, 1:12:35 PM (13 years ago)
Author:
g7moreau
Message:
  • Just clean code
File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/oar/mpilauncher.cpp

    r24 r25  
    8888int main(int argc, char **argv) {
    8989   vector < string > files = vector < string > ();
    90    string rep;          // root directory where to find
    91    // subdirectories
     90   string rep; // root folder where to find subfolders
    9291   int rank, size, nbdir, stride;
    9392   int nbcmd;
     
    104103   string finalCommand; // command to execute
    105104
    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
    110108
    111109   if (argc < 3) {
     
    122120         commandfile = argv[2];
    123121         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 cpus
    131          // if (nbcmd%size != 0) {
    132          // if(rank ==0)
    133          // cerr <<nbcmd<<" command(s) to process in "<<commandfile
    134          // <<" cannot fit on "<<size<<" processe(s)"
    135          // <<endl<<"FAILED"<<endl;
    136          // }
    137          // else {
    138          // execute the command
    139122         int reste;
    140123         stride = nbcmd / size;
     
    151134            system(files[nbcmd - rank].c_str());
    152135            }
    153          // }
    154136         }
    155137      else {
Note: See TracChangeset for help on using the changeset viewer.