ViewVC Help
View File | Revision Log | Show Annotations | View Changeset | Root Listing
root/group/trunk/runParallel/runParallel.c
(Generate patch)

Comparing trunk/runParallel/runParallel.c (file contents):
Revision 2932 by chuckv, Wed Jul 12 22:01:11 2006 UTC vs.
Revision 2933 by chuckv, Fri Jul 14 20:39:56 2006 UTC

# Line 3 | Line 3
3   #include <stdlib.h>
4   #include <unistd.h>
5   #include <dirent.h>
6 + #include "getfile.h"
7  
8  
9  
9
10   int main(int argc, char *argv[]){
11  
12 <  int myid,numprocs,i,rank;
12 >  int myid,numprocs,rank,i;
13 >  int nrst_files;
14 >  char * dirname = "./";
15 >  char **fname;
16    extern char **environ;
17    char *newargv[] ={
18      "/bin/echo",
# Line 20 | Line 23 | int main(int argc, char *argv[]){
23    MPI_Comm_size(MPI_COMM_WORLD,&numprocs);
24    MPI_Comm_rank(MPI_COMM_WORLD,&myid);
25  
26 <  for (rank = 0;rank<numprocs;rank++){
27 <    if (rank == myid){
28 <      execve(argv[0],newargv,environ);
29 <    }
30 <  }
31 <
26 > //  for (rank = 0;rank<numprocs;rank++){
27 > //    if (rank == myid){
28 > //      execve(argv[0],newargv,environ);
29 > //    }
30 > //  }
31 >        nrst_files = nfiles(&dirname,myid);
32 >        for (i=0;i<nrst_files;i++){
33 >                getfilename(i,fname);
34 >                newargv[1] = *fname;    
35 >                execve(argv[0],newargv,environ);
36 >        }
37 >        
38    MPI_Finalize();
39 <
31 <
39 > return(0);
40   }

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines