2004-01-11 21:31:52 +00:00
|
|
|
/*
|
|
|
|
* $HEADER$
|
|
|
|
*/
|
|
|
|
|
|
|
|
#include "lam_config.h"
|
|
|
|
|
|
|
|
#include <stdio.h>
|
|
|
|
#include <stdlib.h>
|
|
|
|
|
|
|
|
#include "mpi.h"
|
|
|
|
#include "mca/mca.h"
|
2004-01-30 03:51:25 +00:00
|
|
|
#include "mca/mpi/base/base.h"
|
2004-01-11 21:31:52 +00:00
|
|
|
|
|
|
|
|
|
|
|
int mca_mpi_alloc_mem(MPI_Aint size, MPI_Info info, void *baseptr)
|
|
|
|
{
|
|
|
|
void *temp;
|
|
|
|
|
|
|
|
/* Error checks */
|
|
|
|
|
|
|
|
if (0 == size)
|
|
|
|
return MPI_SUCCESS;
|
|
|
|
else if (size < 0)
|
|
|
|
return LAM_ERROR;
|
|
|
|
|
|
|
|
/* Do the alloc */
|
|
|
|
|
2004-02-10 00:09:36 +00:00
|
|
|
temp = malloc(size);
|
2004-01-11 21:31:52 +00:00
|
|
|
if (NULL == temp)
|
|
|
|
return LAM_ERROR;
|
|
|
|
|
|
|
|
/* All done */
|
|
|
|
|
|
|
|
*((void **) baseptr) = temp;
|
|
|
|
return MPI_SUCCESS;
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
int mca_mpi_free_mem(void *baseptr)
|
|
|
|
{
|
|
|
|
if (NULL != baseptr)
|
2004-02-10 00:09:36 +00:00
|
|
|
free(baseptr);
|
2004-01-11 21:31:52 +00:00
|
|
|
|
|
|
|
return MPI_SUCCESS;
|
|
|
|
}
|
|
|
|
|