OpenMPI 0.1.1

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

- File List
- Globals

mpool_rgpusm.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) 2012 NVIDIA Corporation. All rights reserved.
14 *
15 * $COPYRIGHT$
16 *
17 * Additional copyrights may follow
18 *
19 * $HEADER$
20 */
21 /**
22 * @file
23 */
24 #ifndef MCA_MPOOL_RGPUSM_H
25 #define MCA_MPOOL_RGPUSM_H
26
27 #include "ompi_config.h"
28 #include "opal/class/opal_list.h"
29 #include "ompi/class/ompi_free_list.h"
30 #include "ompi/mca/mpool/mpool.h"
31
32 BEGIN_C_DECLS
33
34 struct mca_mpool_rgpusm_component_t {
35 mca_mpool_base_component_t super;
36 char* rcache_name;
37 size_t rcache_size_limit;
38 bool print_stats;
39 uint32_t leave_pinned;
40 int output;
41 };
42 typedef struct mca_mpool_rgpusm_component_t mca_mpool_rgpusm_component_t;
43
44 OMPI_DECLSPEC extern mca_mpool_rgpusm_component_t mca_mpool_rgpusm_component;
45
46 struct mca_mpool_base_resources_t {
47 void *reg_data;
48 size_t sizeof_reg;
49 int (*register_mem)(void *base, size_t size, mca_mpool_base_registration_t *newreg,
50 mca_mpool_base_registration_t *hdrreg);
51 int (*deregister_mem)(void *reg_data, mca_mpool_base_registration_t *reg);
52 };
53 typedef struct mca_mpool_base_resources_t mca_mpool_base_resources_t;
54
55 struct mca_mpool_rgpusm_module_t {
56 mca_mpool_base_module_t super;
57 struct mca_mpool_base_resources_t resources;
58 ompi_free_list_t reg_list;
59 opal_list_t lru_list;
60 uint32_t stat_cache_hit;
61 uint32_t stat_cache_valid;
62 uint32_t stat_cache_invalid;
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_rgpusm_module_t mca_mpool_rgpusm_module_t;
68
69 /*
70 * Initializes the mpool module.
71 */
72 void mca_mpool_rgpusm_module_init(mca_mpool_rgpusm_module_t *mpool);
73
74 /**
75 * register block of memory
76 */
77 int mca_mpool_rgpusm_register(mca_mpool_base_module_t* mpool, void *addr,
78 size_t size, uint32_t flags, mca_mpool_base_registration_t **reg);
79
80 /**
81 * deregister memory
82 */
83 int mca_mpool_rgpusm_deregister(mca_mpool_base_module_t *mpool,
84 mca_mpool_base_registration_t *reg);
85
86 /**
87 * free memory allocated by alloc function
88 */
89 void mca_mpool_rgpusm_free(mca_mpool_base_module_t *mpool, void * addr,
90 mca_mpool_base_registration_t *reg);
91
92 /**
93 * find registration for a given block of memory
94 */
95 int mca_mpool_rgpusm_find(struct mca_mpool_base_module_t* mpool, void* addr,
96 size_t size, mca_mpool_base_registration_t **reg);
97
98 /**
99 * unregister all registration covering the block of memory
100 */
101 int mca_mpool_rgpusm_release_memory(mca_mpool_base_module_t* mpool, void *base,
102 size_t size);
103
104 /**
105 * finalize mpool
106 */
107 void mca_mpool_rgpusm_finalize(struct mca_mpool_base_module_t *mpool);
108
109 /**
110 * Fault Tolerance Event Notification Function
111 * @param state Checkpoint Stae
112 * @return OMPI_SUCCESS or failure status
113 */
114 int mca_mpool_rgpusm_ft_event(int state);
115
116 END_C_DECLS
117 #endif
mca_mpool_rgpusm_ft_event
int mca_mpool_rgpusm_ft_event(int state)
Fault Tolerance Event Notification Function.
Definition: mpool_rgpusm_module.c:611
mca_mpool_rgpusm_free
void mca_mpool_rgpusm_free(mca_mpool_base_module_t *mpool, void *addr, mca_mpool_base_registration_t *reg)
free memory allocated by alloc function
Definition: mpool_rgpusm_module.c:451
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_rgpusm_finalize
void mca_mpool_rgpusm_finalize(struct mca_mpool_base_module_t *mpool)
finalize mpool
Definition: mpool_rgpusm_module.c:547
mca_mpool_rgpusm_deregister
int mca_mpool_rgpusm_deregister(mca_mpool_base_module_t *mpool, mca_mpool_base_registration_t *reg)
deregister memory
Definition: mpool_rgpusm_module.c:495
mca_mpool_rgpusm_register
int mca_mpool_rgpusm_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_rgpusm_module.c:185
mca_mpool_rgpusm_component_t
Definition: mpool_rgpusm.h:34
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...
opal_list_t
Definition: opal_list.h:147
mca_mpool_rgpusm_release_memory
int mca_mpool_rgpusm_release_memory(mca_mpool_base_module_t *mpool, void *base, size_t size)
unregister all registration covering the block of memory
mca_mpool_rgpusm_find
int mca_mpool_rgpusm_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_rgpusm_module.c:459
mca_mpool_rgpusm_module_t
Definition: mpool_rgpusm.h:55
mca_mpool_base_resources_t
Definition: mpool_fake.h:38
mca_mpool_base_module_t
mpool module descriptor.
Definition: mpool.h:174