#include <stdio.h>
#include "localmpi.h"
#define extern
#include "extern.h"
#undef extern
int mpi_allocate ( int argc, char ** argv )
{
mpi_err = MPI_Init ( &argc, &argv );
if ( mpi_err != MPI_SUCCESS )
{
handle_err ( "mpi_allocate" );
fprintf ( stderr, "Fatal: Could not initialize MPI\n" );
return ( 1 );
}
mpi_err = MPI_Comm_rank ( MPI_COMM_WORLD, &my_rank );
if ( mpi_err != MPI_SUCCESS )
{
handle_err ( "mpi_allocate" );
return ( 1 );
}
mpi_err = MPI_Comm_size ( MPI_COMM_WORLD, &num_procs );
if ( mpi_err != MPI_SUCCESS )
{
handle_err ( "mpi_allocate" );
return ( mpi_err );
}
return ( 0 );
}