This source file includes following definitions.
- main
1
2
3
4
5
6
7
8
9 #include "orte_config.h"
10
11 #include <stdio.h>
12 #include <unistd.h>
13
14 #include "orte/runtime/runtime.h"
15 #include "orte/util/proc_info.h"
16 #include "orte/util/name_fns.h"
17 #include "orte/runtime/orte_globals.h"
18 #include "orte/mca/errmgr/errmgr.h"
19
20 int main(int argc, char* argv[])
21 {
22
23 int i, rc;
24 double pi;
25 pid_t pid;
26 char hostname[OPAL_MAXHOSTNAMELEN];
27
28 if (0 > (rc = orte_init(&argc, &argv, ORTE_PROC_NON_MPI))) {
29 fprintf(stderr, "orte_abort: couldn't init orte - error code %d\n", rc);
30 return rc;
31 }
32 pid = getpid();
33 gethostname(hostname, sizeof(hostname));
34
35 if (1 < argc) {
36 rc = strtol(argv[1], NULL, 10);
37 } else {
38 rc = 3;
39 }
40
41 printf("orte_abort: Name %s Host: %s Pid %ld\n", ORTE_NAME_PRINT(ORTE_PROC_MY_NAME),
42 hostname, (long)pid);
43 fflush(stdout);
44
45 i = 0;
46 while (1) {
47 i++;
48 pi = i / 3.14159256;
49 if (i > 10000) i = 0;
50 if ((ORTE_PROC_MY_NAME->vpid == 3 ||
51 (orte_process_info.num_procs <= 3 && ORTE_PROC_MY_NAME->vpid == 0))
52 && i == 9995) {
53 orte_errmgr.abort(rc, NULL);
54 }
55 }
56
57 return 0;
58 }