ViewVC Help
View File | Revision Log | Show Annotations | View Changeset | Root Listing
root/group/trunk/runParallel/runParallel.c
Revision: 2933
Committed: Fri Jul 14 20:39:56 2006 UTC (18 years ago) by chuckv
Content type: text/plain
File size: 781 byte(s)
Log Message:
Fixed more buggies

File Contents

# User Rev Content
1 chuckv 2929 #include "mpi.h"
2     #include <stdio.h>
3     #include <stdlib.h>
4     #include <unistd.h>
5     #include <dirent.h>
6 chuckv 2933 #include "getfile.h"
7 chuckv 2929
8    
9    
10     int main(int argc, char *argv[]){
11    
12 chuckv 2933 int myid,numprocs,rank,i;
13     int nrst_files;
14     char * dirname = "./";
15     char **fname;
16 chuckv 2929 extern char **environ;
17     char *newargv[] ={
18     "/bin/echo",
19     "Hey this now spews on multiple machines",
20     NULL
21     };
22     MPI_Init(&argc,&argv);
23     MPI_Comm_size(MPI_COMM_WORLD,&numprocs);
24     MPI_Comm_rank(MPI_COMM_WORLD,&myid);
25    
26 chuckv 2933 // 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 chuckv 2929 MPI_Finalize();
39 chuckv 2933 return(0);
40 chuckv 2929 }