Let us go through first.c step by step. The program begins with an opening
MPI_Init ( &argc, &argv );and ends with
MPI_Finalize ();
All MPI programs must do that. You can have some other stuff before
MPI_Init
and after MPI_Finalize
, but that must not be MPI.
You should not assume that your job becomes parallel only after you issue
the MPI_Init
call though. What happens before MPI_Init
and
after MPI_Finalize
is system dependent. LAM will start all
processes on the parallel machine from the very beginning.