Debian Codegraph @

testsuite/test_old/launcher.cc

raw
1 #include <stdio.h>
2 #include <unistd.h>
3 #include <rts.h>
4
5
6 extern char **environ;
7
8
9 int main(int nargs, char **argv) {
10 int err;
11
12 BGLPersonality whoAmI;
13
14 rts_get_personality(&whoAmI, sizeof whoAmI);
15
16 if(whoAmI.zCoord < whoAmI.zSize / 2) {
17 printf("%d starts as first\n", whoAmI.zCoord);
18 err = execve("/gpfs/scratch/o/orjan/application1", argv, environ);
19 } else {
20 printf("%d starts as second\n", whoAmI.zCoord);
21 err = execve("/gpfs/scratch/o/orjan/application2", argv, environ);
22 }
23
24 //Should not get here....
25 printf("Note: execve call returned %d\n", err);
26 return(-1);
27 }