root/orte/test/mpi/hello_output.c

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

DEFINITIONS

This source file includes following definitions.
  1. main

   1 /* -*- C -*-
   2  *
   3  * $HEADER$
   4  *
   5  * The most basic of MPI applications
   6  */
   7 #include "opal_config.h"
   8 
   9 #include <stdio.h>
  10 #include "mpi.h"
  11 #include "opal/util/output.h"
  12 
  13 
  14 int main(int argc, char* argv[])
  15 {
  16     int rank, size;
  17     int stream, stream2;
  18 
  19     MPI_Init(&argc, &argv);
  20     MPI_Comm_rank(MPI_COMM_WORLD, &rank);
  21     MPI_Comm_size(MPI_COMM_WORLD, &size);
  22 
  23     stream = opal_output_open(NULL);
  24     opal_output(stream, "(stream) Hello, World, I am %d of %d\n", rank, size);
  25     printf("(printf) Hello, World, I am %d of %d\n", rank, size);
  26 
  27     opal_output_set_verbosity(stream, 10);
  28     opal_output(stream, "this is an opal_output on the verbose stream");
  29 
  30     stream2 = opal_output_open(NULL);
  31     opal_output(stream2, "opal_output stream2");
  32     opal_output_set_verbosity(stream2, 10);
  33     opal_output(stream2, "this is an opal_output on the same verbose stream2");
  34 
  35     MPI_Finalize();
  36     return 0;
  37 }

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