2004-01-26 01:07:54 +03:00
|
|
|
/*
|
|
|
|
* $HEADER$
|
|
|
|
*/
|
|
|
|
|
|
|
|
#include "lam_config.h"
|
|
|
|
|
|
|
|
#include "mpi.h"
|
2004-03-17 21:45:16 +03:00
|
|
|
#include "mpi/c/bindings.h"
|
|
|
|
#include "lfc/lam_list.h"
|
|
|
|
#include "info/info.h"
|
2004-04-21 02:13:39 +04:00
|
|
|
#include "errhandler/errhandler.h"
|
|
|
|
#include "communicator/communicator.h"
|
2004-01-26 01:07:54 +03:00
|
|
|
|
|
|
|
#if LAM_HAVE_WEAK_SYMBOLS && LAM_PROFILING_DEFINES
|
|
|
|
#pragma weak MPI_Info_create = PMPI_Info_create
|
|
|
|
#endif
|
|
|
|
|
2004-04-20 22:50:43 +04:00
|
|
|
#if LAM_PROFILING_DEFINES
|
|
|
|
#include "mpi/c/profile/defines.h"
|
|
|
|
#endif
|
|
|
|
|
2004-02-02 01:28:20 +03:00
|
|
|
/**
|
|
|
|
* Create a new info object
|
|
|
|
*
|
|
|
|
* @param info Pointer to the MPI_Info handle
|
|
|
|
*
|
|
|
|
* @retval MPI_SUCCESS
|
|
|
|
* @retval MPI_ERR_ARG
|
2004-02-04 01:34:01 +03:00
|
|
|
* @retval MPI_ERR_SYSRESOURCE
|
2004-02-02 01:28:20 +03:00
|
|
|
*
|
|
|
|
* When an MPI_Info object is not being used, it should be freed using
|
|
|
|
* MPI_Info_free
|
|
|
|
*/
|
2004-01-26 01:07:54 +03:00
|
|
|
int MPI_Info_create(MPI_Info *info) {
|
2004-02-04 01:34:01 +03:00
|
|
|
/* list of invalid conditions
|
|
|
|
* 1. MPI_ERR_ARG - If info is NULL
|
|
|
|
* 2. MPI_ERR_SYSRESOURCE - If LAM_MALLOC fails
|
|
|
|
* NOTE:
|
|
|
|
* Yet to add stuff for fortran handles
|
2004-02-02 01:28:20 +03:00
|
|
|
*/
|
2004-04-21 02:13:39 +04:00
|
|
|
if (MPI_PARAM_CHECK) {
|
|
|
|
if (NULL == info) {
|
|
|
|
return LAM_ERRHANDLER_INVOKE(MPI_COMM_WORLD, MPI_ERR_ARG,
|
|
|
|
"MPI_Info_create");
|
|
|
|
}
|
2004-02-04 01:34:01 +03:00
|
|
|
}
|
|
|
|
|
|
|
|
/*
|
|
|
|
* Call the object create function. This function not only
|
|
|
|
* allocates the space for MPI_Info, but also calls all the
|
2004-04-21 02:13:39 +04:00
|
|
|
* relevant init functions. Should I check if the fortran
|
|
|
|
* handle is valid
|
2004-02-04 01:34:01 +03:00
|
|
|
*/
|
2004-02-10 17:04:27 +03:00
|
|
|
(*info) = OBJ_NEW(lam_info_t);
|
2004-02-04 01:34:01 +03:00
|
|
|
|
|
|
|
if (NULL == (*info)) {
|
2004-04-21 02:13:39 +04:00
|
|
|
return LAM_ERRHANDLER_INVOKE(MPI_COMM_WORLD, MPI_ERR_SYSRESOURCE,
|
|
|
|
"MPI_Info_create");
|
2004-02-04 01:34:01 +03:00
|
|
|
}
|
|
|
|
|
2004-01-26 01:07:54 +03:00
|
|
|
return MPI_SUCCESS;
|
|
|
|
}
|