This source file includes following definitions.
- mca_fs_pvfs2_component_init_query
- mca_fs_pvfs2_component_file_query
- mca_fs_pvfs2_component_file_unquery
- mca_fs_pvfs2_module_init
- mca_fs_pvfs2_module_finalize
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30 #include "ompi_config.h"
31 #include "mpi.h"
32 #include "ompi/mca/fs/fs.h"
33 #include "ompi/mca/fs/base/base.h"
34 #include "ompi/mca/fs/pvfs2/fs_pvfs2.h"
35
36 #ifdef HAVE_SYS_STATFS_H
37 #include <sys/statfs.h>
38 #endif
39 #ifdef HAVE_SYS_PARAM_H
40 #include <sys/param.h>
41 #endif
42 #ifdef HAVE_SYS_MOUNT_H
43 #include <sys/mount.h>
44 #endif
45 #ifdef HAVE_SYS_STAT_H
46 #include <sys/stat.h>
47 #endif
48
49
50
51
52
53
54 static mca_fs_base_module_1_0_0_t pvfs2 = {
55 mca_fs_pvfs2_module_init,
56 mca_fs_pvfs2_module_finalize,
57 mca_fs_pvfs2_file_open,
58 mca_fs_pvfs2_file_close,
59 mca_fs_pvfs2_file_delete,
60 mca_fs_pvfs2_file_set_size,
61 mca_fs_pvfs2_file_get_size,
62 mca_fs_pvfs2_file_sync
63 };
64
65
66
67
68
69
70 int mca_fs_pvfs2_component_init_query(bool enable_progress_threads,
71 bool enable_mpi_threads)
72 {
73
74
75 return OMPI_SUCCESS;
76 }
77
78 struct mca_fs_base_module_1_0_0_t *
79 mca_fs_pvfs2_component_file_query (ompio_file_t *fh, int *priority)
80 {
81
82
83
84
85
86
87 char *tmp;
88
89
90
91
92
93
94 *priority = mca_fs_pvfs2_priority;
95
96 tmp = strchr (fh->f_filename, ':');
97 if (!tmp) {
98
99 if (OMPIO_ROOT == fh->f_rank || MPI_COMM_NULL == fh->f_comm) {
100 fh->f_fstype = mca_fs_base_get_fstype ( fh->f_filename );
101 }
102 if (fh->f_comm != MPI_COMM_NULL) {
103 fh->f_comm->c_coll->coll_bcast (&(fh->f_fstype),
104 1,
105 MPI_INT,
106 OMPIO_ROOT,
107 fh->f_comm,
108 fh->f_comm->c_coll->coll_bcast_module);
109 }
110 }
111 else {
112 if (!strncmp(fh->f_filename, "pvfs2:", 6) ||
113 !strncmp(fh->f_filename, "PVFS2:", 6)) {
114 fh->f_fstype = PVFS2;
115 }
116 }
117
118 if (PVFS2 == fh->f_fstype) {
119 if (*priority < 50) {
120 *priority = 50;
121 return &pvfs2;
122 }
123 }
124
125 return NULL;
126 }
127
128 int mca_fs_pvfs2_component_file_unquery (ompio_file_t *file)
129 {
130
131
132
133
134 return OMPI_SUCCESS;
135 }
136
137 int mca_fs_pvfs2_module_init (ompio_file_t *file)
138 {
139
140
141 file->f_fstype = PVFS2;
142 return OMPI_SUCCESS;
143 }
144
145
146 int mca_fs_pvfs2_module_finalize (ompio_file_t *file)
147 {
148 return OMPI_SUCCESS;
149 }