OpenMPI  0.1.1
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 
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 };
57 
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 */
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
The opal_list_t interface is used to provide a generic doubly-linked list container for Open MPI...
mpool component descriptor.
Definition: mpool.h:154
Top-level interface for all MCA components.
Definition: opal_list.h:98
ORTE_DECLSPEC OBJ_CLASS_DECLARATION(mca_oob_base_info_t)
declare the association structure as a class
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
Copyright (c) 2004-2007 The Trustees of Indiana University and Indiana University Research and Techno...
Definition: opal_list.h:147
Definition: t-test1.c:28
Definition: mpool_fake.h:38
mpool module descriptor.
Definition: mpool.h:174