root/orte/test/mpi/segv.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 
   8 #include <stdio.h>
   9 #include <unistd.h>
  10 #include "mpi.h"
  11 
  12 int main(int argc, char* argv[])
  13 {
  14     int rank, size;
  15     char *foo=0;
  16 
  17     MPI_Init(&argc, &argv);
  18     MPI_Comm_rank(MPI_COMM_WORLD, &rank);
  19     MPI_Comm_size(MPI_COMM_WORLD, &size);
  20 
  21     printf("Hello, World, I am %d of %d\n", rank, size);
  22 
  23     if (1 == rank) {
  24         sleep(2);
  25         *foo = 42;
  26     }
  27 
  28     MPI_Finalize();
  29     return 0;
  30 }

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