2004-06-16 15:41:29 +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.
|
2005-03-24 12:43:37 +00:00
|
|
|
* Copyright (c) 2004-2005 The Regents of the University of California.
|
|
|
|
* All rights reserved.
|
2004-11-22 01:38:40 +00:00
|
|
|
* $COPYRIGHT$
|
|
|
|
*
|
|
|
|
* Additional copyrights may follow
|
|
|
|
*
|
2004-06-16 15:41:29 +00:00
|
|
|
* $HEADER$
|
|
|
|
*/
|
|
|
|
/**
|
|
|
|
* @file
|
|
|
|
*/
|
|
|
|
#ifndef MCA_MPOOL_SM_H
|
|
|
|
#define MCA_MPOOL_SM_H
|
|
|
|
|
2005-07-03 16:22:16 +00:00
|
|
|
#include "opal/class/opal_list.h"
|
2004-06-16 15:41:29 +00:00
|
|
|
#include "class/ompi_free_list.h"
|
2005-07-03 23:09:55 +00:00
|
|
|
#include "opal/event/event.h"
|
2004-06-16 15:41:29 +00:00
|
|
|
#include "mca/mpool/mpool.h"
|
|
|
|
#include "mca/allocator/allocator.h"
|
2004-10-20 22:31:03 +00:00
|
|
|
#if defined(c_plusplus) || defined(__cplusplus)
|
|
|
|
extern "C" {
|
|
|
|
#endif
|
2004-06-16 15:41:29 +00:00
|
|
|
|
|
|
|
struct mca_mpool_sm_component_t {
|
2005-05-31 17:06:55 +00:00
|
|
|
mca_mpool_base_component_t super;
|
|
|
|
/* mca_allocator_base_module_t* sm_allocator; */
|
|
|
|
char* sm_allocator_name;
|
|
|
|
size_t sm_size;
|
|
|
|
/* struct mca_mpool_sm_mmap_t *sm_mmap; */
|
2004-06-16 15:41:29 +00:00
|
|
|
};
|
|
|
|
typedef struct mca_mpool_sm_component_t mca_mpool_sm_component_t;
|
|
|
|
|
2004-10-22 16:06:05 +00:00
|
|
|
OMPI_COMP_EXPORT extern mca_mpool_sm_component_t mca_mpool_sm_component;
|
2005-05-31 17:06:55 +00:00
|
|
|
/* OMPI_COMP_EXPORT extern mca_mpool_base_module_t mca_mpool_sm_module; */
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
struct mca_mpool_sm_module_t {
|
|
|
|
mca_mpool_base_module_t super;
|
|
|
|
mca_allocator_base_module_t * sm_allocator;
|
|
|
|
struct mca_mpool_sm_mmap_t *sm_mmap;
|
|
|
|
}; typedef struct mca_mpool_sm_module_t mca_mpool_sm_module_t;
|
|
|
|
|
|
|
|
/*
|
|
|
|
* Initializes the mpool module.
|
|
|
|
*/
|
|
|
|
void mca_mpool_sm_module_init(mca_mpool_sm_module_t* mpool);
|
|
|
|
|
2004-06-17 20:33:52 +00:00
|
|
|
|
|
|
|
/*
|
|
|
|
* Returns base address of shared memory mapping.
|
|
|
|
*/
|
2005-05-31 17:06:55 +00:00
|
|
|
void* mca_mpool_sm_base(mca_mpool_base_module_t*);
|
2004-06-17 20:33:52 +00:00
|
|
|
|
2004-06-16 15:41:29 +00:00
|
|
|
/**
|
2004-06-17 20:33:52 +00:00
|
|
|
* Allocate block of shared memory.
|
2004-06-16 15:41:29 +00:00
|
|
|
*/
|
2005-06-21 17:10:28 +00:00
|
|
|
void* mca_mpool_sm_alloc(
|
|
|
|
mca_mpool_base_module_t* mpool,
|
|
|
|
size_t size,
|
|
|
|
size_t align,
|
2005-06-24 21:12:38 +00:00
|
|
|
mca_mpool_base_registration_t** registration);
|
2004-08-02 00:24:22 +00:00
|
|
|
|
2004-06-16 15:41:29 +00:00
|
|
|
/**
|
|
|
|
* realloc function typedef
|
|
|
|
*/
|
2005-06-21 17:10:28 +00:00
|
|
|
void* mca_mpool_sm_realloc(
|
|
|
|
mca_mpool_base_module_t* mpool,
|
|
|
|
void* addr,
|
|
|
|
size_t size,
|
2005-06-24 21:12:38 +00:00
|
|
|
mca_mpool_base_registration_t** registration);
|
2004-08-02 00:24:22 +00:00
|
|
|
|
2004-06-16 15:41:29 +00:00
|
|
|
/**
|
|
|
|
* free function typedef
|
|
|
|
*/
|
2005-06-21 17:10:28 +00:00
|
|
|
void mca_mpool_sm_free(
|
|
|
|
mca_mpool_base_module_t* mpool,
|
2005-06-21 21:20:23 +00:00
|
|
|
void * addr,
|
2005-06-24 21:12:38 +00:00
|
|
|
mca_mpool_base_registration_t* registration);
|
2004-08-02 00:24:22 +00:00
|
|
|
|
2004-06-16 15:41:29 +00:00
|
|
|
|
2004-10-20 22:31:03 +00:00
|
|
|
#if defined(c_plusplus) || defined(__cplusplus)
|
|
|
|
}
|
|
|
|
#endif
|
2004-06-16 15:41:29 +00:00
|
|
|
|
|
|
|
#endif
|
2005-05-31 17:06:55 +00:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|