This source file includes following definitions.
- mca_fs_lustre_component_init_query
- mca_fs_lustre_component_file_query
- mca_fs_lustre_component_file_unquery
- mca_fs_lustre_module_init
- mca_fs_lustre_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 #include "ompi_config.h"
30 #include "mpi.h"
31 #include "ompi/mca/fs/fs.h"
32 #include "ompi/mca/fs/base/base.h"
33 #include "ompi/mca/fs/lustre/fs_lustre.h"
34
35 #ifdef HAVE_SYS_STATFS_H
36 #include <sys/statfs.h>
37 #endif
38 #ifdef HAVE_SYS_PARAM_H
39 #include <sys/param.h>
40 #endif
41 #ifdef HAVE_SYS_MOUNT_H
42 #include <sys/mount.h>
43 #endif
44 #ifdef HAVE_SYS_STAT_H
45 #include <sys/stat.h>
46 #endif
47
48 #include <sys/ioctl.h>
49
50
51
52
53
54
55 static mca_fs_base_module_1_0_0_t lustre = {
56 mca_fs_lustre_module_init,
57 mca_fs_lustre_module_finalize,
58 mca_fs_lustre_file_open,
59 mca_fs_base_file_close,
60 mca_fs_base_file_delete,
61 mca_fs_base_file_set_size,
62 mca_fs_base_file_get_size,
63 mca_fs_base_file_sync
64 };
65
66
67
68
69
70
71 int mca_fs_lustre_component_init_query(bool enable_progress_threads,
72 bool enable_mpi_threads)
73 {
74
75
76 return OMPI_SUCCESS;
77 }
78
79 struct mca_fs_base_module_1_0_0_t *
80 mca_fs_lustre_component_file_query (ompio_file_t *fh, int *priority)
81 {
82 char *tmp;
83
84
85
86
87
88
89 *priority = mca_fs_lustre_priority;
90
91 tmp = strchr (fh->f_filename, ':');
92 if (!tmp) {
93
94 if (OMPIO_ROOT == fh->f_rank || MPI_COMM_NULL == fh->f_comm) {
95 fh->f_fstype = mca_fs_base_get_fstype ( fh->f_filename );
96 }
97 if (fh->f_comm != MPI_COMM_NULL) {
98 fh->f_comm->c_coll->coll_bcast (&(fh->f_fstype),
99 1,
100 MPI_INT,
101 OMPIO_ROOT,
102 fh->f_comm,
103 fh->f_comm->c_coll->coll_bcast_module);
104 }
105 }
106 else {
107 if (!strncmp(fh->f_filename, "lustre:", 7) ||
108 !strncmp(fh->f_filename, "LUSTRE:", 7)) {
109 fh->f_fstype = LUSTRE;
110 }
111 }
112
113 if (LUSTRE == fh->f_fstype) {
114 if (*priority < 50) {
115 *priority = 50;
116 return &lustre;
117 }
118 }
119
120 return NULL;
121 }
122
123 int mca_fs_lustre_component_file_unquery (ompio_file_t *file)
124 {
125
126
127
128
129 return OMPI_SUCCESS;
130 }
131
132 int mca_fs_lustre_module_init (ompio_file_t *file)
133 {
134
135
136 file->f_fstype = LUSTRE;
137 return OMPI_SUCCESS;
138 }
139
140
141 int mca_fs_lustre_module_finalize (ompio_file_t *file)
142 {
143 return OMPI_SUCCESS;
144 }