initialize and finalize the subroutine libraries as follows
int my_rank,p;
/* Obtain info on number of processes and rank of current process.
* Initialize MPI session if applicable.
*/
dm_init(&p,&my_rank);
/* call to library functions */
...
/* Finalize MPI session if applicable */
dm_exit();
Initialization will start an MPI-session if applicable and provide
you with the number of processes (1 if you run in serial) and the
rank of the current process. Exiting will finalize an existing MPI
session if applicable.