2005-06-30 18:31:41 +04:00
|
|
|
/*
|
2005-11-05 22:57:48 +03:00
|
|
|
* Copyright (c) 2004-2005 The Trustees of Indiana University and Indiana
|
|
|
|
* University Research and Technology
|
|
|
|
* Corporation. All rights reserved.
|
|
|
|
* Copyright (c) 2004-2005 The University of Tennessee and The University
|
|
|
|
* of Tennessee Research Foundation. All rights
|
|
|
|
* reserved.
|
2005-06-30 18:31:41 +04:00
|
|
|
* 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.
|
|
|
|
* $COPYRIGHT$
|
|
|
|
*
|
|
|
|
* Additional copyrights may follow
|
|
|
|
*
|
|
|
|
* $HEADER$
|
|
|
|
*/
|
|
|
|
/**
|
|
|
|
* @file
|
|
|
|
*/
|
|
|
|
#ifndef MCA_MPOOL_VAPI_H
|
|
|
|
#define MCA_MPOOL_VAPI_H
|
|
|
|
|
2005-07-03 20:22:16 +04:00
|
|
|
#include "opal/class/opal_list.h"
|
2005-06-30 18:31:41 +04:00
|
|
|
#include "class/ompi_free_list.h"
|
2005-07-04 03:09:55 +04:00
|
|
|
#include "opal/event/event.h"
|
2005-06-30 18:31:41 +04:00
|
|
|
#include "mca/mpool/mpool.h"
|
2005-08-25 19:04:22 +04:00
|
|
|
#include <vapi.h>
|
|
|
|
#include <vapi_types.h>
|
2005-06-30 18:31:41 +04:00
|
|
|
#if defined(c_plusplus) || defined(__cplusplus)
|
|
|
|
extern "C" {
|
|
|
|
#endif
|
|
|
|
|
|
|
|
|
2005-09-27 06:01:21 +04:00
|
|
|
|
2005-07-01 01:28:35 +04:00
|
|
|
struct mca_mpool_mvapi_component_t {
|
2005-06-30 18:31:41 +04:00
|
|
|
mca_mpool_base_component_t super;
|
2005-09-13 02:28:23 +04:00
|
|
|
char* rcache_name;
|
2005-06-30 18:31:41 +04:00
|
|
|
};
|
|
|
|
|
2005-07-01 01:28:35 +04:00
|
|
|
typedef struct mca_mpool_mvapi_component_t mca_mpool_mvapi_component_t;
|
2005-06-30 18:31:41 +04:00
|
|
|
|
2005-07-01 01:28:35 +04:00
|
|
|
OMPI_COMP_EXPORT extern mca_mpool_mvapi_component_t mca_mpool_mvapi_component;
|
2005-06-30 18:31:41 +04:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
struct mca_mpool_base_resources_t {
|
|
|
|
VAPI_hca_hndl_t hca; /* the hca (nic) */
|
|
|
|
VAPI_pd_hndl_t pd_tag; /* the protection domain */
|
|
|
|
};
|
|
|
|
typedef struct mca_mpool_base_resources_t mca_mpool_base_resources_t;
|
|
|
|
|
2005-07-01 01:28:35 +04:00
|
|
|
struct mca_mpool_mvapi_module_t {
|
2005-06-30 18:31:41 +04:00
|
|
|
mca_mpool_base_module_t super;
|
|
|
|
struct mca_mpool_base_resources_t hca_pd;
|
2005-07-01 01:28:35 +04:00
|
|
|
}; typedef struct mca_mpool_mvapi_module_t mca_mpool_mvapi_module_t;
|
2005-06-30 18:31:41 +04:00
|
|
|
|
|
|
|
|
2005-07-01 01:28:35 +04:00
|
|
|
struct mca_mpool_mvapi_registration_t {
|
2005-06-30 18:31:41 +04:00
|
|
|
mca_mpool_base_registration_t base_reg;
|
|
|
|
VAPI_mr_hndl_t hndl;
|
|
|
|
/* Memory region handle */
|
|
|
|
|
|
|
|
VAPI_lkey_t l_key;
|
|
|
|
/* Local key to registered memory, needed for
|
|
|
|
* posting send/recv requests */
|
|
|
|
|
|
|
|
VAPI_rkey_t r_key;
|
|
|
|
/* Remote key to registered memory, need to send this
|
|
|
|
* to remote processes for incoming RDMA ops */
|
2005-07-15 19:52:13 +04:00
|
|
|
|
2005-06-30 18:31:41 +04:00
|
|
|
};
|
2005-07-01 01:28:35 +04:00
|
|
|
typedef struct mca_mpool_mvapi_registration_t mca_mpool_mvapi_registration_t;
|
|
|
|
OMPI_DECLSPEC OBJ_CLASS_DECLARATION(mca_mpool_mvapi_registration_t);
|
2005-06-30 18:31:41 +04:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
/*
|
|
|
|
* Initializes the mpool module.
|
|
|
|
*/
|
2005-07-01 01:28:35 +04:00
|
|
|
void mca_mpool_mvapi_module_init(mca_mpool_mvapi_module_t* mpool);
|
2005-06-30 18:31:41 +04:00
|
|
|
|
|
|
|
|
|
|
|
/*
|
|
|
|
* Returns base address of shared memory mapping.
|
|
|
|
*/
|
2005-07-01 01:28:35 +04:00
|
|
|
void* mca_mpool_mvapi_base(mca_mpool_base_module_t*);
|
2005-06-30 18:31:41 +04:00
|
|
|
|
|
|
|
/**
|
|
|
|
* Allocate block of shared memory.
|
|
|
|
*/
|
2005-07-01 01:28:35 +04:00
|
|
|
void* mca_mpool_mvapi_alloc(
|
2005-06-30 18:31:41 +04:00
|
|
|
mca_mpool_base_module_t* mpool,
|
|
|
|
size_t size,
|
|
|
|
size_t align,
|
2005-09-13 02:28:23 +04:00
|
|
|
uint32_t flags,
|
2005-06-30 18:31:41 +04:00
|
|
|
mca_mpool_base_registration_t** registration);
|
|
|
|
|
|
|
|
/**
|
|
|
|
* realloc function typedef
|
|
|
|
*/
|
2005-07-01 01:28:35 +04:00
|
|
|
void* mca_mpool_mvapi_realloc(
|
2005-06-30 18:31:41 +04:00
|
|
|
mca_mpool_base_module_t* mpool,
|
|
|
|
void* addr,
|
|
|
|
size_t size,
|
|
|
|
mca_mpool_base_registration_t** registration);
|
|
|
|
|
|
|
|
/**
|
|
|
|
* register function typedef
|
|
|
|
*/
|
2005-07-01 01:28:35 +04:00
|
|
|
int mca_mpool_mvapi_register(
|
2005-06-30 18:31:41 +04:00
|
|
|
mca_mpool_base_module_t* mpool,
|
|
|
|
void *addr,
|
|
|
|
size_t size,
|
2005-09-13 02:28:23 +04:00
|
|
|
uint32_t flags,
|
2005-06-30 18:31:41 +04:00
|
|
|
mca_mpool_base_registration_t** registration);
|
|
|
|
|
2005-07-01 01:28:35 +04:00
|
|
|
int mca_mpool_mvapi_deregister(
|
2005-06-30 18:31:41 +04:00
|
|
|
mca_mpool_base_module_t* mpool,
|
|
|
|
mca_mpool_base_registration_t* );
|
|
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
* free function typedef
|
|
|
|
*/
|
2005-07-01 01:28:35 +04:00
|
|
|
void mca_mpool_mvapi_free(mca_mpool_base_module_t* mpool,
|
2005-06-30 18:31:41 +04:00
|
|
|
void * addr,
|
|
|
|
mca_mpool_base_registration_t* registration);
|
|
|
|
|
2005-09-04 08:20:55 +04:00
|
|
|
|
|
|
|
int mca_mpool_mvapi_find(
|
|
|
|
struct mca_mpool_base_module_t* mpool,
|
|
|
|
void* addr,
|
|
|
|
size_t size,
|
2005-09-13 02:28:23 +04:00
|
|
|
ompi_pointer_array_t *regs,
|
|
|
|
uint32_t *cnt
|
2005-09-04 08:20:55 +04:00
|
|
|
);
|
|
|
|
|
|
|
|
int mca_mpool_mvapi_release(
|
|
|
|
struct mca_mpool_base_module_t* mpool,
|
|
|
|
mca_mpool_base_registration_t* registraion
|
|
|
|
);
|
|
|
|
|
2005-09-13 02:28:23 +04:00
|
|
|
int mca_mpool_mvapi_retain(
|
|
|
|
struct mca_mpool_base_module_t* mpool,
|
|
|
|
mca_mpool_base_registration_t* registraion
|
|
|
|
);
|
|
|
|
|
2005-09-04 08:20:55 +04:00
|
|
|
|
2005-06-30 18:31:41 +04:00
|
|
|
#if defined(c_plusplus) || defined(__cplusplus)
|
|
|
|
}
|
|
|
|
#endif
|
|
|
|
|
|
|
|
#endif
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|