2004-01-11 21:31:52 +00:00
|
|
|
/*
|
2004-11-22 01:38:40 +00:00
|
|
|
* Copyright (c) 2004-2005 The Trustees of Indiana University.
|
|
|
|
* All rights reserved.
|
|
|
|
* Copyright (c) 2004-2005 The Trustees of the University of Tennessee.
|
|
|
|
* All rights reserved.
|
2004-11-28 20:09:25 +00:00
|
|
|
* Copyright (c) 2004-2005 High Performance Computing Center Stuttgart,
|
|
|
|
* University of Stuttgart. All rights reserved.
|
2004-11-22 01:38:40 +00:00
|
|
|
* $COPYRIGHT$
|
|
|
|
*
|
|
|
|
* Additional copyrights may follow
|
|
|
|
*
|
2004-01-11 21:31:52 +00:00
|
|
|
* $HEADER$
|
|
|
|
*/
|
|
|
|
|
2004-06-07 15:33:53 +00:00
|
|
|
#include "ompi_config.h"
|
2004-01-11 21:31:52 +00:00
|
|
|
|
|
|
|
#include <stdio.h>
|
|
|
|
#include <stdlib.h>
|
|
|
|
|
|
|
|
#include "mpi.h"
|
2005-01-20 00:03:23 +00:00
|
|
|
#include "include/constants.h"
|
2004-01-11 21:31:52 +00:00
|
|
|
#include "mca/mca.h"
|
2004-03-17 18:45:16 +00:00
|
|
|
#include "mca/base/base.h"
|
2004-01-11 21:31:52 +00:00
|
|
|
|
|
|
|
|
2004-03-17 18:45:16 +00:00
|
|
|
int mca_base_alloc_mem(MPI_Aint size, MPI_Info info, void *baseptr)
|
2004-01-11 21:31:52 +00:00
|
|
|
{
|
|
|
|
void *temp;
|
|
|
|
|
|
|
|
/* Error checks */
|
|
|
|
|
|
|
|
if (0 == size)
|
2005-01-20 00:03:23 +00:00
|
|
|
return OMPI_SUCCESS;
|
2004-01-11 21:31:52 +00:00
|
|
|
else if (size < 0)
|
2004-06-07 15:33:53 +00:00
|
|
|
return OMPI_ERROR;
|
2004-01-11 21:31:52 +00:00
|
|
|
|
|
|
|
/* 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)
|
2004-06-07 15:33:53 +00:00
|
|
|
return OMPI_ERROR;
|
2004-01-11 21:31:52 +00:00
|
|
|
|
|
|
|
/* All done */
|
|
|
|
|
|
|
|
*((void **) baseptr) = temp;
|
2005-01-20 00:03:23 +00:00
|
|
|
return OMPI_SUCCESS;
|
2004-01-11 21:31:52 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
|
2004-03-17 18:45:16 +00:00
|
|
|
int mca_base_free_mem(void *baseptr)
|
2004-01-11 21:31:52 +00:00
|
|
|
{
|
|
|
|
if (NULL != baseptr)
|
2004-02-10 00:09:36 +00:00
|
|
|
free(baseptr);
|
2004-01-11 21:31:52 +00:00
|
|
|
|
2005-01-20 00:03:23 +00:00
|
|
|
return OMPI_SUCCESS;
|
2004-01-11 21:31:52 +00:00
|
|
|
}
|
|
|
|
|