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