root/ompi/mpiext/affinity/c/example.c

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

DEFINITIONS

This source file includes following definitions.
  1. main

   1 #include <stdio.h>
   2 #include <mpi.h>
   3 #include "mpi-ext.h"
   4 
   5 int main(int argc, char* argv[])
   6 {
   7     int rank;
   8     char ompi_bound[OMPI_AFFINITY_STRING_MAX];
   9     char current_binding[OMPI_AFFINITY_STRING_MAX];
  10     char exists[OMPI_AFFINITY_STRING_MAX];
  11 
  12     MPI_Init(NULL, NULL);
  13     MPI_Comm_rank(MPI_COMM_WORLD, &rank);
  14 
  15     OMPI_Affinity_str(OMPI_AFFINITY_RSRC_STRING_FMT,
  16                       ompi_bound, current_binding, exists);
  17     printf("rank %d (resource string): \n"
  18            "       ompi_bound: %s\n"
  19            "  current_binding: %s\n"
  20            "           exists: %s\n",
  21            rank, ompi_bound, current_binding, exists);
  22 
  23     OMPI_Affinity_str(OMPI_AFFINITY_LAYOUT_FMT,
  24                       ompi_bound, current_binding, exists);
  25     printf("rank %d (layout): \n"
  26            "       ompi_bound: %s\n"
  27            "  current_binding: %s\n"
  28            "           exists: %s\n",
  29            rank, ompi_bound, current_binding, exists);
  30     MPI_Finalize();
  31     return 0;
  32 }

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