[CIG-LONG] new install

Walter Landry wlandry at caltech.edu
Sat Feb 2 10:24:18 PST 2013


Matty <matty.mookerjee at sonoma.edu> wrote:
> Here you go:

This all looks ok.  Lets try making sure that you can compile simple
MPI programss.  Try compiling and running the attached program with

mpicc -c hello.c
mpicc -o hello hello.o
mpirun hello
mpirun -np 2 hello

Cheers,
Walter Landry

-------------------------------------------------

#include <stdio.h>
#include <mpi.h>


int main (argc, argv)
     int argc;
     char *argv[];
{
  int rank, size;

  MPI_Init (&argc, &argv);
  MPI_Comm_rank (MPI_COMM_WORLD, &rank);
  MPI_Comm_size (MPI_COMM_WORLD, &size);
  printf( "Hello world from process %d of %d\n", rank, size );
  MPI_Finalize();
  return 0;
}



More information about the CIG-LONG mailing list