root/test/runtime/start_shut.c

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

DEFINITIONS

This source file includes following definitions.
  1. main

   1 /*
   2  * Copyright (c) 2004-2005 The Trustees of Indiana University and Indiana
   3  *                         University Research and Technology
   4  *                         Corporation.  All rights reserved.
   5  * Copyright (c) 2004-2005 The University of Tennessee and The University
   6  *                         of Tennessee Research Foundation.  All rights
   7  *                         reserved.
   8  * Copyright (c) 2004-2005 High Performance Computing Center Stuttgart,
   9  *                         University of Stuttgart.  All rights reserved.
  10  * Copyright (c) 2004-2005 The Regents of the University of California.
  11  *                         All rights reserved.
  12  * $COPYRIGHT$
  13  *
  14  * Additional copyrights may follow
  15  *
  16  * $HEADER$
  17  */
  18 
  19 #include "orte_config.h"
  20 #include "orte/orte_constants.h"
  21 
  22 
  23 #include <stdio.h>
  24 #include <string.h>
  25 #include <stdlib.h>
  26 #ifdef HAVE_SYS_PARAM_H
  27 #include <sys/param.h>
  28 #endif
  29 #ifdef HAVE_NETINET_IN_H
  30 #include <netinet/in.h>
  31 #endif
  32 
  33 #include "support.h"
  34 #include "orte/runtime/runtime.h"
  35 
  36 #define NUM_ITERS 3
  37 
  38 FILE *test_out;
  39 
  40 int main (int argc, char* argv[])
  41 {
  42     int rc, i;
  43 
  44     test_init("orte_start_shut");
  45     test_out = stderr;
  46 
  47     fprintf(test_out, "initialize the system\n");
  48     if (ORTE_SUCCESS != (rc = orte_init(true))) {
  49         fprintf(test_out, "couldn't complete init - error code %d\n", rc);
  50         exit(1);
  51     }
  52 
  53     for (i=0; i < NUM_ITERS; i++) {
  54         if (ORTE_SUCCESS != (rc = orte_finalize())) {
  55             fprintf(test_out, "iter %d: couldn't complete orte system finalize - error %d\n", i, rc);
  56             exit(1);
  57         }
  58         fprintf(test_out, "\tfinalize successful\n");
  59         if (ORTE_SUCCESS != (rc = orte_init(true))) {
  60             fprintf(test_out, "iter %d: couldn't complete orte system init - error code %d\n", i, rc);
  61             exit(1);
  62         }
  63     }
  64 
  65     fprintf(test_out, "shut system down\n");
  66     if (ORTE_SUCCESS != (rc = orte_finalize())) {
  67         fprintf(test_out, "couldn't complete finalize - error code %d\n", rc);
  68         exit(1);
  69     }
  70 
  71     fprintf(test_out, "orte_start_shut: successful\n");
  72 
  73     rc = test_finalize();
  74     fclose(test_out);
  75     return rc;
  76 }

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