root/orte/test/system/ulfm.c

/* [<][>][^][v][top][bottom][index][help] */

DEFINITIONS

This source file includes following definitions.
  1. main

   1 /* -*- C -*-
   2  */
   3 
   4 #include "orte_config.h"
   5 
   6 #include <stdio.h>
   7 #include <unistd.h>
   8 #include <stdlib.h>
   9 #include <signal.h>
  10 
  11 #include "opal/mca/pmix/pmix.h"
  12 #include "orte/runtime/runtime.h"
  13 #include "orte/util/proc_info.h"
  14 #include "orte/util/name_fns.h"
  15 #include "orte/runtime/orte_globals.h"
  16 #include "orte/mca/errmgr/errmgr.h"
  17 
  18 int main(int argc, char* argv[])
  19 {
  20 
  21     int i, rc;
  22     double pi;
  23     pid_t pid;
  24     char hostname[OPAL_MAXHOSTNAMELEN];
  25 
  26     if (0 > (rc = orte_init(&argc, &argv, ORTE_PROC_NON_MPI))) {
  27         fprintf(stderr, "orte_abort: couldn't init orte - error code %d\n", rc);
  28         return rc;
  29     }
  30     pid = getpid();
  31     gethostname(hostname, sizeof(hostname));
  32 
  33     if (1 < argc) {
  34         rc = strtol(argv[1], NULL, 10);
  35     } else {
  36         rc = 3;
  37     }
  38 
  39     printf("orte_abort: Name %s Host: %s Pid %ld\n", ORTE_NAME_PRINT(ORTE_PROC_MY_NAME),
  40               hostname, (long)pid);
  41     fflush(stdout);
  42 
  43     if (orte_process_info.my_name.vpid == (orte_process_info.num_procs-1)) {
  44         printf("ulfm[%ld]: exiting\n", (long)pid);
  45         exit(0);
  46     }
  47 
  48     printf("ulfm[%ld]: entering fence\n", (long)pid);
  49     /* everyone else enters barrier - this should complete */
  50     opal_pmix.fence(NULL, 0);
  51     return 0;
  52 }

/* [<][>][^][v][top][bottom][index][help] */