OpenMPI 0.1.1

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

- File List
- Globals

base.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) 2008-2009 Cisco Systems, Inc. All rights reserved.
13 * $COPYRIGHT$
14 *
15 * Additional copyrights may follow
16 *
17 * $HEADER$
18 */
19 /**
20 * @file
21 */
22 #ifndef MCA_MEM_BASE_H
23 #define MCA_MEM_BASE_H
24
25 #include "ompi_config.h"
26
27 #include "opal/class/opal_list.h"
28 #include "opal/mca/mca.h"
29 #include "ompi/mca/mpool/mpool.h"
30
31 BEGIN_C_DECLS
32
33 static inline unsigned int my_log2(unsigned long val) {
34 unsigned int count = 0;
35 while(val > 0) {
36 val = val >> 1;
37 count++;
38 }
39 return count > 0 ? count-1: 0;
40 }
41 static inline void *down_align_addr(void* addr, unsigned int shift) {
42 return (void*) (((intptr_t) addr) & (~(intptr_t) 0) << shift);
43 }
44
45 static inline void *up_align_addr(void*addr, unsigned int shift) {
46 return (void*) ((((intptr_t) addr) | ~((~(intptr_t) 0) << shift)));
47 }
48
49 struct mca_mpool_base_selected_module_t {
50 opal_list_item_t super;
51 mca_mpool_base_component_t *mpool_component;
52 mca_mpool_base_module_t *mpool_module;
53 void* user_data;
54 struct mca_mpool_base_resources_t *mpool_resources;
55 };
56 typedef struct mca_mpool_base_selected_module_t mca_mpool_base_selected_module_t;
57
58 OMPI_DECLSPEC OBJ_CLASS_DECLARATION(mca_mpool_base_selected_module_t);
59
60 /*
61 * Data structures for the tree of allocated memory
62 */
63
64 /*
65 * Global functions for MCA: overall mpool open and close
66 */
67
68 OMPI_DECLSPEC int mca_mpool_base_open(void);
69 OMPI_DECLSPEC int mca_mpool_base_init(bool enable_progress_threads, bool enable_mpi_threads);
70 OMPI_DECLSPEC int mca_mpool_base_close(void);
71 OMPI_DECLSPEC mca_mpool_base_component_t* mca_mpool_base_component_lookup(const char* name);
72 OMPI_DECLSPEC mca_mpool_base_module_t* mca_mpool_base_module_create(
73 const char* name,
74 void* user_data,
75 struct mca_mpool_base_resources_t* mpool_resources);
76 OMPI_DECLSPEC mca_mpool_base_module_t* mca_mpool_base_module_lookup(const char* name);
77 OMPI_DECLSPEC int mca_mpool_base_module_destroy(mca_mpool_base_module_t *module);
78
79 /*
80 * Globals
81 */
82 OMPI_DECLSPEC extern int mca_mpool_base_output;
83 OMPI_DECLSPEC extern opal_list_t mca_mpool_base_components;
84 extern opal_list_t mca_mpool_base_modules;
85 OMPI_DECLSPEC extern uint32_t mca_mpool_base_page_size;
86 OMPI_DECLSPEC extern uint32_t mca_mpool_base_page_size_log;
87
88 /* only used within base -- no need to DECLSPEC */
89 extern int mca_mpool_base_used_mem_hooks;
90
91 END_C_DECLS
92
93 #endif /* MCA_MEM_BASE_H */
mca_mpool_base_selected_module_t
Definition: base.h:49
mca_mpool_base_open
OMPI_DECLSPEC int mca_mpool_base_open(void)
Function for finding and opening either all MCA components, or the one that was specifically requeste...
Definition: mpool_base_open.c:63
opal_list.h
The opal_list_t interface is used to provide a generic doubly-linked list container for Open MPI...
mca_mpool_base_component_2_0_0_t
mpool component descriptor.
Definition: mpool.h:154
mca.h
Top-level interface for all MCA components.
opal_list_item_t
Definition: opal_list.h:98
OBJ_CLASS_DECLARATION
ORTE_DECLSPEC OBJ_CLASS_DECLARATION(mca_oob_base_info_t)
declare the association structure as a class
mca_mpool_base_init
OMPI_DECLSPEC int mca_mpool_base_init(bool enable_progress_threads, bool enable_mpi_threads)
Function for weeding out mpool modules that don't want to run.
Definition: mpool_base_init.c:37
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
user_data
Definition: t-test1.c:28
mca_mpool_base_resources_t
Definition: mpool_fake.h:38
mca_mpool_base_module_t
mpool module descriptor.
Definition: mpool.h:174