1
1
openmpi/orte/test/mpi/mpi_info.c
Ralph Castain 5f7a5c4793 Update test to include all keys
This commit was SVN r27311.
2012-09-12 05:02:51 +00:00

44 строки
802 B
C

/* -*- C -*-
*
* $HEADER$
*
* The most basic of MPI applications
*/
#include <stdio.h>
#include "mpi.h"
int main(int argc, char* argv[])
{
char value[MPI_MAX_INFO_VAL];
int flag;
char *keys[] = {
"command",
"argv",
"maxprocs",
"soft",
"host",
"arch",
"wdir",
"thread_level",
"ompi_num_apps",
"ompi_first_rank",
"ompi_np",
"ompi_positioned_file_dir"
};
int i, nk;
MPI_Init(&argc, &argv);
nk = sizeof(keys) / sizeof(char*);
for (i=0; i < nk; i++) {
MPI_Info_get(MPI_INFO_ENV, keys[i], MPI_MAX_INFO_VAL,
value, &flag);
fprintf(stderr, "%s: %s\n", keys[i], (flag) ? value : "Not found");
}
MPI_Finalize();
return 0;
}