This source file includes following definitions.
- main
1
2
3
4
5
6
7
8 #include "orte_config.h"
9
10 #include <stdio.h>
11 #include <unistd.h>
12
13 #include "opal/class/opal_list.h"
14 #include "opal/util/opal_environ.h"
15
16 #include "orte/util/proc_info.h"
17 #include "orte/util/name_fns.h"
18 #include "orte/runtime/orte_globals.h"
19 #include "orte/runtime/runtime.h"
20 #include "orte/mca/ess/ess.h"
21
22 int main(int argc, char* argv[])
23 {
24 int rc, i, restart=-1;
25 char hostname[OPAL_MAXHOSTNAMELEN], *rstrt;
26 pid_t pid;
27
28 if (0 > (rc = orte_init(&argc, &argv, ORTE_PROC_NON_MPI))) {
29 fprintf(stderr, "orte_nodename: couldn't init orte - error code %d\n", rc);
30 return rc;
31 }
32
33 if (NULL != (rstrt = getenv("OMPI_MCA_orte_num_restarts"))) {
34 restart = strtol(rstrt, NULL, 10);
35 }
36
37 gethostname(hostname, sizeof(hostname));
38 pid = getpid();
39
40 printf("orte_nodename: Node %s Name %s Pid %ld Restarts: %d\n",
41 hostname, ORTE_NAME_PRINT(ORTE_PROC_MY_NAME), (long)pid, restart);
42
43 for (i=0; NULL != environ[i]; i++) {
44 if (0 == strncmp(environ[i], "OMPI_MCA", strlen("OMPI_MCA"))) {
45 printf("\t%s\n", environ[i]);
46 }
47 }
48
49 orte_finalize();
50 return 0;
51 }