OpenMPI 0.1.1

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

- File List
- Globals

mpool_base_tree.h
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-2006 The Regents of the University of California.
11 * All rights reserved.
12 * Copyright (c) 2007 Cisco Systems, Inc. All rights reserved.
13 * $COPYRIGHT$
14 *
15 * Additional copyrights may follow
16 *
17 * $HEADER$
18 */
19
20 #ifndef MCA_MPOOL_BASE_TREE_H
21 #define MCA_MPOOL_BASE_TREE_H
22
23 #include "ompi_config.h"
24
25 #define MCA_MPOOL_BASE_TREE_MAX 8
26 #include "opal/mca/mca.h"
27 #include "ompi/class/ompi_free_list.h"
28 #include "ompi/mca/mpool/mpool.h"
29
30 BEGIN_C_DECLS
31
32 /*
33 * Data structures for the tree of allocated memory
34 * used for MPI_Alloc_mem and MPI_Free_mem
35 */
36
37 /**
38 * The item in the tree itself
39 */
40 struct mca_mpool_base_tree_item_t
41 {
42 ompi_free_list_item_t super; /**< the parent class */
43 void* key; /**< the address this was alloc'd on */
44 size_t num_bytes; /**< the number of bytes in this alloc, only for
45 debugging reporting with
46 mpi_show_mpi_alloc_mem_leaks */
47 mca_mpool_base_module_t* mpools[MCA_MPOOL_BASE_TREE_MAX]; /**< the mpools */
48 mca_mpool_base_registration_t* regs[MCA_MPOOL_BASE_TREE_MAX]; /**< the registrations */
49 uint8_t count; /**< length of the mpools/regs array */
50 };
51 typedef struct mca_mpool_base_tree_item_t mca_mpool_base_tree_item_t;
52
53 OMPI_DECLSPEC OBJ_CLASS_DECLARATION(mca_mpool_base_tree_item_t);
54
55 /*
56 * initialize the rb tree
57 */
58 int mca_mpool_base_tree_init(void);
59
60 /*
61 * insert an item in the rb tree
62 */
63 int mca_mpool_base_tree_insert(mca_mpool_base_tree_item_t* item);
64
65 /*
66 * remove an item from the rb tree
67 */
68 int mca_mpool_base_tree_delete(mca_mpool_base_tree_item_t* item);
69
70
71 /**
72 * find the item in the rb tree
73 */
74 mca_mpool_base_tree_item_t* mca_mpool_base_tree_find(void* base);
75
76 /*
77 * get a tree item from the free list
78 */
79 mca_mpool_base_tree_item_t* mca_mpool_base_tree_item_get(void);
80
81 /*
82 * put tree item back into the free list
83 */
84 void mca_mpool_base_tree_item_put(mca_mpool_base_tree_item_t* item);
85
86 /*
87 * For debugging, print a show_help kind of message if there are items
88 * left in the tree.
89 */
90 void mca_mpool_base_tree_print(void);
91
92 END_C_DECLS
93
94 #endif /* MCA_MPOOL_BASE_TREE_H */
mca_mpool_base_tree_item_t::super
ompi_free_list_item_t super
the parent class
Definition: mpool_base_tree.h:42
mca_mpool_base_tree_item_t::count
uint8_t count
length of the mpools/regs array
Definition: mpool_base_tree.h:49
mca_mpool_base_tree_item_t::num_bytes
size_t num_bytes
the number of bytes in this alloc, only for debugging reporting with mpi_show_mpi_alloc_mem_leaks ...
Definition: mpool_base_tree.h:44
mca_mpool_base_tree_item_t::regs
mca_mpool_base_registration_t * regs[MCA_MPOOL_BASE_TREE_MAX]
the registrations
Definition: mpool_base_tree.h:48
mca_mpool_base_registration_t
Definition: mpool.h:44
mca_mpool_base_tree_item_t::key
void * key
the address this was alloc'd on
Definition: mpool_base_tree.h:43
mca.h
Top-level interface for all MCA components.
mca_mpool_base_tree_item_t
The item in the tree itself.
Definition: mpool_base_tree.h:40
ompi_free_list_item_t
Definition: ompi_free_list.h:62
mpool.h
Copyright (c) 2004-2007 The Trustees of Indiana University and Indiana University Research and Techno...
mca_mpool_base_tree_item_t::mpools
mca_mpool_base_module_t * mpools[MCA_MPOOL_BASE_TREE_MAX]
the mpools
Definition: mpool_base_tree.h:47
mca_mpool_base_tree_find
mca_mpool_base_tree_item_t * mca_mpool_base_tree_find(void *base)
find the item in the rb tree
Definition: mpool_base_tree.c:129
OBJ_CLASS_DECLARATION
#define OBJ_CLASS_DECLARATION(NAME)
Declaration for class descriptor.
Definition: opal_object.h:236
mca_mpool_base_module_t
mpool module descriptor.
Definition: mpool.h:174