Skip to content

Commit 1fa7fb3

Browse files
committed
change mpi spawn api
1 parent e33a632 commit 1fa7fb3

File tree

2 files changed

+18
-10
lines changed

2 files changed

+18
-10
lines changed

src/sst/elements/ariel/frontend/pin3/pin3frontend.cc

Lines changed: 17 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -118,11 +118,11 @@ Pin3Frontend::Pin3Frontend(ComponentId_t id, Params& params, uint32_t cores, uin
118118
mpimode = 0;
119119
#endif
120120

121-
if (mpimode) {
121+
//if (mpimode) { //TODO put this back
122122
mpilauncher = params.find<std::string>("mpilauncher", ARIEL_STRINGIZE(MPILAUNCHER_EXECUTABLE));
123123
mpiranks = params.find<int>("mpiranks", 1);
124124
mpitracerank = params.find<int>("mpitracerank", 0);
125-
}
125+
//}
126126

127127
// MPI Launcher error checking
128128
if (mpimode == 1) {
@@ -385,14 +385,13 @@ int Pin3Frontend::forkPINChildMPI(const char* app, char** args, std::map<std::st
385385
}
386386

387387
for (int i = app_idx; args[i] != NULL; i++) {
388-
printf(" app %d - %s\n", i, args[1]);
388+
printf(" apparg %d - %s\n", i, args[i]);
389389
}
390390

391-
int count = 1;
392-
char *array_of_commands[] = {args[0]};
393-
char *argv[] = {"20", NULL};
394-
char **array_of_argv[] = {args+1};
395-
int array_of_maxprocs[] = {1};
391+
int count = 2;
392+
char *array_of_commands[] = {args[0], args[app_idx]};
393+
char **array_of_argv[] = {args+1, args+app_idx+1};
394+
int array_of_maxprocs[] = {1,1};
396395

397396
/* Working for 1 rank
398397
int count = 1;
@@ -402,10 +401,19 @@ int Pin3Frontend::forkPINChildMPI(const char* app, char** args, std::map<std::st
402401
int array_of_maxprocs[] = {1};
403402
*/
404403

404+
/*
405405
int ret = SST::Core::Interprocess::SST_MPI_Comm_spawn_multiple(count,
406406
array_of_commands,
407407
array_of_argv,
408-
array_of_maxprocs);
408+
array_of_maxprocs,
409+
tracerank);
410+
*/
411+
printf("[SST ELEMENTS] ranks: %d, tracerank: %d\n", mpiranks, mpitracerank);
412+
int ret = SST::Core::Interprocess::SST_MPI_Comm_spawn_multiple(
413+
args,
414+
mpiranks,
415+
mpitracerank
416+
);
409417

410418
//TODO: Check ret and exit is non-zero
411419
free(app2);

src/sst/elements/ariel/tests/testMPI/ariel-reduce.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
mpi_mode = True
88
ncores= 1
99
mpiranks = 1
10-
tracerank = 0
10+
tracerank = 1
1111
size = 1024
1212
#size = 2048000
1313

0 commit comments

Comments
 (0)