root/examples/hello_oshmem_cxx.cc

/* [<][>][^][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 (c) 2017      Research Organization for Information Science
   6  *                         and Technology (RIST). All rights reserved.
   7  * $COPYRIGHT$
   8  *
   9  * Additional copyrights may follow
  10  *
  11  * $HEADER$
  12  */
  13 
  14 #include <iostream>
  15 #include "shmem.h"
  16 
  17 #if !defined(OSHMEM_SPEC_VERSION) || OSHMEM_SPEC_VERSION < 10200
  18 #error This application uses API 1.2 and up
  19 #endif
  20 
  21 int main(int argc, char* argv[])
  22 {
  23     int proc, nproc;
  24     char name[SHMEM_MAX_NAME_LEN];
  25     int major, minor;
  26 
  27     shmem_init();
  28     nproc = shmem_n_pes();
  29     proc = shmem_my_pe();
  30     shmem_info_get_name(name);
  31     shmem_info_get_version(&major, &minor);
  32 
  33     std::cout << "Hello, world, I am " << proc << " of " << nproc << ": " << name
  34               << " (version: " << major << "." << minor << ")" << std::endl;
  35 
  36     shmem_finalize();
  37 
  38     return 0;
  39 }

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