2006-07-18 02:08:55 +04: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.
|
|
|
|
* Copyright (c) 2004-2005 High Performance Computing Center Stuttgart,
|
|
|
|
* University of Stuttgart. All rights reserved.
|
|
|
|
* Copyright (c) 2004-2005 The Regents of the University of California.
|
|
|
|
* All rights reserved.
|
2007-05-24 19:41:24 +04:00
|
|
|
* Copyright (c) 2007 Los Alamos National Security, LLC. All rights
|
|
|
|
* reserved.
|
2006-07-18 02:08:55 +04:00
|
|
|
* $COPYRIGHT$
|
|
|
|
*
|
|
|
|
* Additional copyrights may follow
|
|
|
|
*
|
|
|
|
* $HEADER$
|
|
|
|
*/
|
|
|
|
|
2006-08-03 04:10:19 +04:00
|
|
|
#ifndef OSC_RDMA_LONGREQ_H
|
|
|
|
#define OSC_RDMA_LONGREQ_H
|
2006-07-18 02:08:55 +04:00
|
|
|
|
|
|
|
#include "osc_rdma.h"
|
|
|
|
|
|
|
|
#include "opal/class/opal_free_list.h"
|
2009-03-13 05:10:32 +03:00
|
|
|
#include "ompi/datatype/datatype.h"
|
2006-07-18 02:08:55 +04:00
|
|
|
#include "ompi/request/request.h"
|
2009-03-13 05:10:32 +03:00
|
|
|
#include "ompi/op/op.h"
|
2006-07-18 02:08:55 +04:00
|
|
|
|
|
|
|
struct ompi_osc_rdma_longreq_t;
|
|
|
|
typedef struct ompi_osc_rdma_longreq_t ompi_osc_rdma_longreq_t;
|
|
|
|
|
2007-05-24 19:41:24 +04:00
|
|
|
typedef void (*ompi_osc_rdma_longreq_cb_fn_t)(ompi_osc_rdma_longreq_t *longreq);
|
2006-07-18 02:08:55 +04:00
|
|
|
|
|
|
|
struct ompi_osc_rdma_longreq_t {
|
|
|
|
opal_free_list_item_t super;
|
2007-05-24 19:41:24 +04:00
|
|
|
ompi_request_t *request;
|
|
|
|
ompi_osc_rdma_longreq_cb_fn_t cbfunc;
|
|
|
|
void *cbdata;
|
2006-07-18 02:08:55 +04:00
|
|
|
|
|
|
|
/* warning - this doesn't always have a sane value */
|
|
|
|
ompi_osc_rdma_module_t *req_module;
|
|
|
|
|
|
|
|
/* for long receives, to avoid a longrecvreq type */
|
|
|
|
struct ompi_op_t *req_op;
|
|
|
|
struct ompi_datatype_t *req_datatype;
|
|
|
|
};
|
|
|
|
OBJ_CLASS_DECLARATION(ompi_osc_rdma_longreq_t);
|
|
|
|
|
|
|
|
static inline int
|
|
|
|
ompi_osc_rdma_longreq_alloc(ompi_osc_rdma_longreq_t **longreq)
|
|
|
|
{
|
|
|
|
opal_free_list_item_t *item;
|
|
|
|
int ret;
|
|
|
|
|
2007-05-24 19:41:24 +04:00
|
|
|
OPAL_FREE_LIST_GET(&mca_osc_rdma_component.c_longreqs,
|
2006-07-18 02:08:55 +04:00
|
|
|
item, ret);
|
|
|
|
|
|
|
|
*longreq = (ompi_osc_rdma_longreq_t*) item;
|
|
|
|
return ret;
|
|
|
|
}
|
|
|
|
|
|
|
|
static inline int
|
|
|
|
ompi_osc_rdma_longreq_free(ompi_osc_rdma_longreq_t *longreq)
|
|
|
|
{
|
2007-05-24 19:41:24 +04:00
|
|
|
OPAL_FREE_LIST_RETURN(&mca_osc_rdma_component.c_longreqs,
|
2006-07-18 02:08:55 +04:00
|
|
|
&longreq->super.super);
|
|
|
|
return OMPI_SUCCESS;
|
|
|
|
}
|
|
|
|
|
|
|
|
#endif
|