root/examples/hello_c.c

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

DEFINITIONS

This source file includes following definitions.
  1. main

   1 /*
   2  * Copyright (c) 2004-2006 The Trustees of Indiana University and Indiana
   3  *                         University Research and Technology
   4  *                         Corporation.  All rights reserved.
   5  * Copyright (c) 2006      Cisco Systems, Inc.  All rights reserved.
   6  *
   7  * Sample MPI "hello world" application in C
   8  */
   9 
  10 #include <stdio.h>
  11 #include "mpi.h"
  12 
  13 int main(int argc, char* argv[])
  14 {
  15     int rank, size, len;
  16     char version[MPI_MAX_LIBRARY_VERSION_STRING];
  17 
  18     MPI_Init(&argc, &argv);
  19     MPI_Comm_rank(MPI_COMM_WORLD, &rank);
  20     MPI_Comm_size(MPI_COMM_WORLD, &size);
  21     MPI_Get_library_version(version, &len);
  22     printf("Hello, world, I am %d of %d, (%s, %d)\n",
  23            rank, size, version, len);
  24     MPI_Finalize();
  25 
  26     return 0;
  27 }

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