root/examples/hello_oshmem_c.c

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

DEFINITIONS

This source file includes following definitions.
  1. main

   1 /*
   2  * Copyright (c) 2014      Mellanox Technologies, Inc.
   3  *                         All rights reserved.
   4  * Copyright (c) 2015 Cisco Systems, Inc.  All rights reserved.
   5  * $COPYRIGHT$
   6  *
   7  * Additional copyrights may follow
   8  *
   9  * $HEADER$
  10  */
  11 
  12 #include <stdio.h>
  13 #include "shmem.h"
  14 
  15 #if !defined(OSHMEM_SPEC_VERSION) || OSHMEM_SPEC_VERSION < 10200
  16 #error This application uses API 1.2 and up
  17 #endif
  18 
  19 int main(int argc, char* argv[])
  20 {
  21     int proc, nproc;
  22     char name[SHMEM_MAX_NAME_LEN];
  23     int major, minor;
  24 
  25     shmem_init();
  26     nproc = shmem_n_pes();
  27     proc = shmem_my_pe();
  28     shmem_info_get_name(name);
  29     shmem_info_get_version(&major, &minor);
  30 
  31     printf("Hello, world, I am %d of %d: %s (version: %d.%d)\n",
  32            proc, nproc, name, major, minor);
  33     shmem_finalize();
  34 
  35     return 0;
  36 }

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