OpenMPI 0.1.1

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

- File List
- Globals

fcache.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-2005 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-2011 University of Houston. All rights reserved.
13 * $COPYRIGHT$
14 *
15 * Additional copyrights may follow
16 *
17 * $HEADER$
18 */
19
20 #ifndef OMPI_MCA_FCACHE_H
21 #define OMPI_MCA_FCACHE_H
22
23 #include "ompi_config.h"
24 #include "mpi.h"
25 #include "opal/mca/mca.h"
26 #include "opal/mca/base/base.h"
27
28 BEGIN_C_DECLS
29
30 struct mca_io_ompio_file_t;
31 struct mca_io_ompio_io_servers;
32 /*
33 * Macro for use in components that are of type coll
34 */
35 #define MCA_FCACHE_BASE_VERSION_2_0_0 \
36 MCA_BASE_VERSION_2_0_0, \
37 "fcache", 2, 0, 0
38
39 /*
40 * This framework provides the functionality required to cache information
41 * about the layout of a file on the parallel file system. It does not provide
42 * the implementation of any actual MPI level functions, but can be used
43 * by the fcoll modules or the fbtl modules to retrieve information such as
44 * stripe size, stripe depth and first I/O server without requiring any OS
45 * level operation.
46 *
47 * These are the component function prototypes. These function pointers
48 * go into the component structure. These functions (query() and finalize()
49 * are called during fcache_base_select(). Each component is query() ied
50 * and subsequently, all the unselected components are finalize() 'ed
51 * so that any *stuff* they did during query() can be undone. By
52 * similar logic, finalize() is also called on the component which
53 * was selected when the communicator is being destroyed.
54 *
55 * So, to sum it up, every component carries 4 functions:
56 * 1. open() - called during MPI_INIT
57 * 2. close() - called during MPI_FINALIZE
58 * 3. query() - called to select a particular component
59 * 4. finalize() - called when actions taken during query have
60 * to be undone
61 */
62
63 /*
64 * **************** component struct *******************************
65 * *********** These functions go in the component struct **********
66 * **************** component struct *******************************
67 */
68
69 typedef int (*mca_fcache_base_component_init_query_1_0_0_fn_t)
70 (bool enable_progress_threads,
71 bool enable_mpi_threads);
72
73 typedef struct mca_fcache_base_module_1_0_0_t *
74 (*mca_fcache_base_component_file_query_1_0_0_fn_t) (int *priority);
75
76 typedef int (*mca_fcache_base_component_file_unquery_1_0_0_fn_t)
77 (struct mca_io_ompio_file_t *file);
78
79 /*
80 * ****************** component struct ******************************
81 * Structure for fcache v2.0.0 components.This is chained to MCA v2.0.0
82 * ****************** component struct ******************************
83 */
84 struct mca_fcache_base_component_2_0_0_t {
85 mca_base_component_t fcachem_version;
86 mca_base_component_data_t fcachem_data;
87
88 mca_fcache_base_component_init_query_1_0_0_fn_t fcachem_init_query;
89 mca_fcache_base_component_file_query_1_0_0_fn_t fcachem_file_query;
90 mca_fcache_base_component_file_unquery_1_0_0_fn_t fcachem_file_unquery;
91 };
92 typedef struct mca_fcache_base_component_2_0_0_t mca_fcache_base_component_2_0_0_t;
93 typedef struct mca_fcache_base_component_2_0_0_t mca_fcache_base_component_t;
94
95 /*
96 * ***********************************************************************
97 * ************************ Interface function definitions **************
98 * These are the typedefcache for the function pointers to various fcache
99 * backend functions which will be used by the various fcache components
100 * ***********************************************************************
101 */
102
103 typedef int (*mca_fcache_base_module_init_1_0_0_fn_t)
104 (struct mca_io_ompio_file_t *file);
105
106 typedef int (*mca_fcache_base_module_finalize_1_0_0_fn_t)
107 (struct mca_io_ompio_file_t *file);
108
109 typedef int (*mca_fcache_base_module_get_file_layout_fn_t)(
110 char* filename,
111 int *num_io_servers,
112 size_t *depth,
113 int *file_io_servers);
114
115 typedef int (*mca_fcache_base_module_set_file_layout_fn_t)(
116 char* filename,
117 int *num_io_servers,
118 size_t *depth,
119 int *file_io_servers);
120
121 typedef int (*mca_fcache_base_module_get_io_servers_fn_t)(
122 char* filename,
123 struct mca_io_ompio_io_servers *io_servers,
124 int num_io_servers);
125
126 /*
127 * ***********************************************************************
128 * *************************** module structure *************************
129 * ***********************************************************************
130 */
131 struct mca_fcache_base_module_1_0_0_t {
132 /*
133 * Per-file initialization function. This is called only
134 * on the module which is selected. The finalize corresponding to
135 * this function is present on the component struct above
136 */
137 mca_fcache_base_module_init_1_0_0_fn_t fcache_module_init;
138 mca_fcache_base_module_finalize_1_0_0_fn_t fcache_module_finalize;
139
140 /* FCACHE function pointers */
141 mca_fcache_base_module_get_file_layout_fn_t fcache_get_file_layout;
142 mca_fcache_base_module_set_file_layout_fn_t fcache_set_file_layout;
143 mca_fcache_base_module_get_io_servers_fn_t fcache_get_io_servers;
144 };
145 typedef struct mca_fcache_base_module_1_0_0_t mca_fcache_base_module_1_0_0_t;
146 typedef mca_fcache_base_module_1_0_0_t mca_fcache_base_module_t;
147
148 END_C_DECLS
149
150 #endif /* OMPI_MCA_FCACHE_H */
mca_base_component_2_0_0_t
Common type for all MCA components.
Definition: mca.h:250
mca_fcache_base_module_1_0_0_t
Definition: fcache.h:131
mca.h
Top-level interface for all MCA components.
mca_io_ompio_file_t
Back-end structure for MPI_File.
Definition: io_ompio.h:121
mca_base_component_data_2_0_0_t
Meta data for MCA v2.0.0 components.
Definition: mca.h:309
mca_fcache_base_component_2_0_0_t
Definition: fcache.h:84