OpenMPI  0.1.1
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 
36  char* rcache_name;
37  size_t rcache_size_limit;
38  bool print_stats;
39  uint32_t leave_pinned;
40  int output;
41 };
43 
44 OMPI_DECLSPEC extern mca_mpool_rgpusm_component_t mca_mpool_rgpusm_component;
45 
47  void *reg_data;
48  size_t sizeof_reg;
49  int (*register_mem)(void *base, size_t size, mca_mpool_base_registration_t *newreg,
51  int (*deregister_mem)(void *reg_data, mca_mpool_base_registration_t *reg);
52 };
54 
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;
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  */
78  size_t size, uint32_t flags, mca_mpool_base_registration_t **reg);
79 
80 /**
81  * deregister memory
82  */
85 
86 /**
87  * free memory allocated by alloc function
88  */
89 void mca_mpool_rgpusm_free(mca_mpool_base_module_t *mpool, void * addr,
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  */
102  size_t size);
103 
104 /**
105  * finalize mpool
106  */
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
int mca_mpool_rgpusm_ft_event(int state)
Fault Tolerance Event Notification Function.
Definition: mpool_rgpusm_module.c:611
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
The opal_list_t interface is used to provide a generic doubly-linked list container for Open MPI...
Definition: mpool.h:44
mpool component descriptor.
Definition: mpool.h:154
void mca_mpool_rgpusm_finalize(struct mca_mpool_base_module_t *mpool)
finalize mpool
Definition: mpool_rgpusm_module.c:547
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
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
Definition: mpool_rgpusm.h:34
Definition: ompi_free_list.h:39
Copyright (c) 2004-2007 The Trustees of Indiana University and Indiana University Research and Techno...
Definition: opal_list.h:147
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
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
Definition: mpool_rgpusm.h:55
Definition: mpool_fake.h:38
mpool module descriptor.
Definition: mpool.h:174