OpenMPI 0.1.1

- Main Page
- Related Pages
- Modules
- Data Structures
- Files

- File List
- Globals

mpool_rdma.h
Go to the documentation of this file.
1 /*
2 * Copyright (c) 2004-2005 The Trustees of Indiana University and Indiana
3 * University Research and Technology
4 * Corporation. All rights reserved.
5 * Copyright (c) 2004-2006 The University of Tennessee and The University
6 * of Tennessee Research Foundation. All rights
7 * reserved.
8 * Copyright (c) 2004-2005 High Performance Computing Center Stuttgart,
9 * University of Stuttgart. All rights reserved.
10 * Copyright (c) 2004-2005 The Regents of the University of California.
11 * All rights reserved.
12 * Copyright (c) 2006 Voltaire. All rights reserved.
13 * Copyright (c) 2011 Los Alamos National Security, LLC. All rights
14 * reserved.
15 *
16 * $COPYRIGHT$
17 *
18 * Additional copyrights may follow
19 *
20 * $HEADER$
21 */
22 /**
23 * @file
24 */
25 #ifndef MCA_MPOOL_OPENIB_H
26 #define MCA_MPOOL_OPENIB_H
27
28 #include "ompi_config.h"
29 #include "opal/class/opal_list.h"
30 #include "ompi/class/ompi_free_list.h"
31 #include "opal/mca/event/event.h"
32 #include "ompi/mca/mpool/mpool.h"
33
34 BEGIN_C_DECLS
35
36 struct mca_mpool_rdma_component_t {
37 mca_mpool_base_component_t super;
38 char* rcache_name;
39 size_t rcache_size_limit;
40 bool print_stats;
41 uint32_t leave_pinned;
42 };
43 typedef struct mca_mpool_rdma_component_t mca_mpool_rdma_component_t;
44
45 OMPI_DECLSPEC extern mca_mpool_rdma_component_t mca_mpool_rdma_component;
46
47 struct mca_mpool_base_resources_t {
48 void *reg_data;
49 size_t sizeof_reg;
50 int (*register_mem)(void *reg_data, void *base, size_t size,
51 mca_mpool_base_registration_t *reg);
52 int (*deregister_mem)(void *reg_data, mca_mpool_base_registration_t *reg);
53 };
54 typedef struct mca_mpool_base_resources_t mca_mpool_base_resources_t;
55
56 struct mca_mpool_rdma_module_t {
57 mca_mpool_base_module_t super;
58 struct mca_mpool_base_resources_t resources;
59 ompi_free_list_t reg_list;
60 opal_list_t lru_list;
61 opal_list_t gc_list;
62 uint32_t stat_cache_hit;
63 uint32_t stat_cache_miss;
64 uint32_t stat_evicted;
65 uint32_t stat_cache_found;
66 uint32_t stat_cache_notfound;
67 }; typedef struct mca_mpool_rdma_module_t mca_mpool_rdma_module_t;
68
69 /*
70 * Initializes the mpool module.
71 */
72 void mca_mpool_rdma_module_init(mca_mpool_rdma_module_t *mpool);
73
74 /*
75 * Returns base address of shared memory mapping.
76 */
77 void *mca_mpool_rdma_base(mca_mpool_base_module_t *mpool);
78
79 /**
80 * Allocate block of registered memory.
81 */
82 void* mca_mpool_rdma_alloc(mca_mpool_base_module_t *mpool, size_t size,
83 size_t align, uint32_t flags,
84 mca_mpool_base_registration_t** registration);
85
86 /**
87 * realloc block of registered memory
88 */
89 void* mca_mpool_rdma_realloc( mca_mpool_base_module_t *mpool, void* addr,
90 size_t size, mca_mpool_base_registration_t** registration);
91
92 /**
93 * register block of memory
94 */
95 int mca_mpool_rdma_register(mca_mpool_base_module_t* mpool, void *addr,
96 size_t size, uint32_t flags, mca_mpool_base_registration_t **reg);
97
98 /**
99 * deregister memory
100 */
101 int mca_mpool_rdma_deregister(mca_mpool_base_module_t *mpool,
102 mca_mpool_base_registration_t *reg);
103
104 /**
105 * free memory allocated by alloc function
106 */
107 void mca_mpool_rdma_free(mca_mpool_base_module_t *mpool, void * addr,
108 mca_mpool_base_registration_t *reg);
109
110 /**
111 * find registration for a given block of memory
112 */
113 int mca_mpool_rdma_find(struct mca_mpool_base_module_t* mpool, void* addr,
114 size_t size, mca_mpool_base_registration_t **reg);
115
116 /**
117 * unregister all registration covering the block of memory
118 */
119 int mca_mpool_rdma_release_memory(mca_mpool_base_module_t* mpool, void *base,
120 size_t size);
121
122 /**
123 * finalize mpool
124 */
125 void mca_mpool_rdma_finalize(struct mca_mpool_base_module_t *mpool);
126
127 /**
128 * Fault Tolerance Event Notification Function
129 * @param state Checkpoint Stae
130 * @return OMPI_SUCCESS or failure status
131 */
132 int mca_mpool_rdma_ft_event(int state);
133
134 END_C_DECLS
135 #endif
mca_mpool_rdma_release_memory
int mca_mpool_rdma_release_memory(mca_mpool_base_module_t *mpool, void *base, size_t size)
unregister all registration covering the block of memory
Definition: mpool_rdma_module.c:450
mca_mpool_rdma_find
int mca_mpool_rdma_find(struct mca_mpool_base_module_t *mpool, void *addr, size_t size, mca_mpool_base_registration_t **reg)
find registration for a given block of memory
Definition: mpool_rdma_module.c:366
mca_mpool_rdma_module_t
Definition: mpool_rdma.h:56
mca_mpool_rdma_free
void mca_mpool_rdma_free(mca_mpool_base_module_t *mpool, void *addr, mca_mpool_base_registration_t *reg)
free memory allocated by alloc function
Definition: mpool_rdma_module.c:358
mca_mpool_rdma_component_t
Definition: mpool_rdma.h:36
mca_mpool_rdma_register
int mca_mpool_rdma_register(mca_mpool_base_module_t *mpool, void *addr, size_t size, uint32_t flags, mca_mpool_base_registration_t **reg)
register block of memory
Definition: mpool_rdma_module.c:229
opal_list.h
The opal_list_t interface is used to provide a generic doubly-linked list container for Open MPI...
mca_mpool_base_registration_t
Definition: mpool.h:44
mca_mpool_base_component_2_0_0_t
mpool component descriptor.
Definition: mpool.h:154
mca_mpool_rdma_alloc
void * mca_mpool_rdma_alloc(mca_mpool_base_module_t *mpool, size_t size, size_t align, uint32_t flags, mca_mpool_base_registration_t **registration)
Allocate block of registered memory.
Definition: mpool_rdma_module.c:94
mca_mpool_rdma_deregister
int mca_mpool_rdma_deregister(mca_mpool_base_module_t *mpool, mca_mpool_base_registration_t *reg)
deregister memory
Definition: mpool_rdma_module.c:407
mca_mpool_rdma_finalize
void mca_mpool_rdma_finalize(struct mca_mpool_base_module_t *mpool)
finalize mpool
Definition: mpool_rdma_module.c:487
ompi_free_list_t
Definition: ompi_free_list.h:39
mpool.h
Copyright (c) 2004-2007 The Trustees of Indiana University and Indiana University Research and Techno...
mca_mpool_rdma_ft_event
int mca_mpool_rdma_ft_event(int state)
Fault Tolerance Event Notification Function.
Definition: mpool_rdma_module.c:551
mca_mpool_rdma_realloc
void * mca_mpool_rdma_realloc(mca_mpool_base_module_t *mpool, void *addr, size_t size, mca_mpool_base_registration_t **registration)
realloc block of registered memory
Definition: mpool_rdma_module.c:344
opal_list_t
Definition: opal_list.h:147
mca_mpool_base_resources_t
Definition: mpool_fake.h:38
mca_mpool_base_module_t
mpool module descriptor.
Definition: mpool.h:174