Skip to content

Commit a2b1a03

Browse files
raafatfekiedgargabriel
authored andcommitted
fs/gpfs: Update component to compile with latest gpfs versions
I updated the gpfs component to match the latest structures and functions definitions and remove compiler wranings. Disabled mpi info setting for the gpfs option "Data Shipping" since it is no longer supported in the latest gpfs versions. Signed-off-by: raafatfeki <[email protected]>
1 parent 715a6e8 commit a2b1a03

File tree

6 files changed

+373
-365
lines changed

6 files changed

+373
-365
lines changed

ompi/mca/fs/gpfs/Makefile.am

Lines changed: 1 addition & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -33,14 +33,9 @@ endif
3333

3434
fs_gpfs_sources = \
3535
fs_gpfs_component.c \
36-
fs_gpfs_file_close.c \
37-
fs_gpfs_file_delete.c \
38-
fs_gpfs_file_get_size.c \
3936
fs_gpfs_file_open.c \
4037
fs_gpfs_file_set_info.c\
41-
fs_gpfs_file_get_info.c\
42-
fs_gpfs_file_set_size.c \
43-
fs_gpfs_file_sync.c \
38+
fs_gpfs_file_get_info.c\
4439
fs_gpfs.c \
4540
fs_gpfs.h
4641

ompi/mca/fs/gpfs/fs_gpfs.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -90,7 +90,7 @@ mca_fs_gpfs_component_file_query (ompio_file_t *fh, int *priority)
9090
tmp = strchr (fh->f_filename, ':');
9191
if (!tmp) {
9292
if (OMPIO_ROOT == fh->f_rank) {
93-
fh->f_fstype = mca_fs_base_get_fstype ( fh->f_filename );
93+
fh->f_fstype = mca_fs_base_get_fstype ( (char *) fh->f_filename );
9494
}
9595
fh->f_comm->c_coll->coll_bcast (&(fh->f_fstype),
9696
1,

ompi/mca/fs/gpfs/fs_gpfs.h

Lines changed: 13 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -35,11 +35,11 @@ BEGIN_C_DECLS
3535
int mca_fs_gpfs_component_init_query(bool enable_progress_threads,
3636
bool enable_mpi_threads);
3737
struct mca_fs_base_module_1_0_0_t *
38-
mca_fs_gpfs_component_file_query(mca_io_ompio_file_t *fh, int *priority);
39-
int mca_fs_gpfs_component_file_unquery(mca_io_ompio_file_t *file);
38+
mca_fs_gpfs_component_file_query(ompio_file_t *fh, int *priority);
39+
int mca_fs_gpfs_component_file_unquery(ompio_file_t *file);
4040

41-
int mca_fs_gpfs_module_init(mca_io_ompio_file_t *file);
42-
int mca_fs_gpfs_module_finalize(mca_io_ompio_file_t *file);
41+
int mca_fs_gpfs_module_init(ompio_file_t *file);
42+
int mca_fs_gpfs_module_finalize(ompio_file_t *file);
4343
OMPI_MODULE_DECLSPEC extern mca_fs_base_component_2_0_0_t mca_fs_gpfs_component;
4444

4545
/*
@@ -48,22 +48,22 @@ OMPI_MODULE_DECLSPEC extern mca_fs_base_component_2_0_0_t mca_fs_gpfs_component;
4848
* ******************************************************************
4949
*/
5050

51-
int mca_fs_gpfs_file_open(struct ompi_communicator_t *comm, char *filename,
52-
int amode, struct ompi_info_t *info, struct mca_io_ompio_file_t *fh);
53-
int mca_fs_gpfs_file_close(struct mca_io_ompio_file_t *fh);
51+
int mca_fs_gpfs_file_open(struct ompi_communicator_t *comm, const char *filename,
52+
int amode, struct opal_info_t *info, struct ompio_file_t *fh);
53+
int mca_fs_gpfs_file_close(struct ompio_file_t *fh);
5454
int mca_fs_gpfs_file_delete(char *filename, struct ompi_info_t *info);
55-
int mca_fs_gpfs_file_set_size(struct mca_io_ompio_file_t *fh,
55+
int mca_fs_gpfs_file_set_size(struct ompio_file_t *fh,
5656
OMPI_MPI_OFFSET_TYPE size);
57-
int mca_fs_gpfs_file_get_size(struct mca_io_ompio_file_t *fh,
57+
int mca_fs_gpfs_file_get_size(struct ompio_file_t *fh,
5858
OMPI_MPI_OFFSET_TYPE * size);
5959
int mca_fs_gpfs_file_get_amode(struct ompi_file_t *fh, int *amode);
60-
int mca_fs_gpfs_file_set_info(struct mca_io_ompio_file_t *fh,
60+
int mca_fs_gpfs_file_set_info(struct ompio_file_t *fh,
6161
struct ompi_info_t *info);
62-
int mca_fs_gpfs_file_get_info(struct mca_io_ompio_file_t *fh,
62+
int mca_fs_gpfs_file_get_info(struct ompio_file_t *fh,
6363
struct ompi_info_t **info_used);
6464
int mca_fs_gpfs_prefetch_hints(int access_mode,
65-
mca_io_ompio_file_t *fh, struct ompi_info_t *info);
66-
int mca_fs_gpfs_io_selection(mca_io_ompio_file_t *fh,
65+
ompio_file_t *fh, struct ompi_info_t *info);
66+
int mca_fs_gpfs_io_selection(ompio_file_t *fh,
6767
struct ompi_info_t *info, struct ompi_info_t *info_selected);
6868
int mca_fs_gpfs_file_sync(struct ompi_file_t *fh);
6969
//CN: Is mca_fs_gpfs_file_seek needed at all. Not used anywhere!
Lines changed: 55 additions & 48 deletions
Original file line numberDiff line numberDiff line change
@@ -1,48 +1,55 @@
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-2011 The University of Tennessee and The University
6-
* of Tennessee Research Foundation. All rights
7-
* reserved.
8-
* Copyright (c) 2004-2015 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-
#include "ompi_config.h"
21-
#include "fs_gpfs.h"
22-
#include "mpi.h"
23-
#include "ompi/constants.h"
24-
#include "ompi/mca/fs/fs.h"
25-
26-
#include <unistd.h>
27-
#include <string.h>
28-
29-
#include <gpfs.h>
30-
#include <fcntl.h>
31-
#include <errno.h>
32-
#include <gpfs_fcntl.h>
33-
34-
/*
35-
* file_get_info_gpfs
36-
*
37-
* Function: - get_info of a file
38-
* Accepts: - same arguments as MPI_File_get_info()
39-
* Returns: - new info object
40-
*/
41-
42-
int mca_fs_gpfs_file_get_info(mca_io_ompio_file_t *fh,
43-
ompi_info_t **info_used) {
44-
fprintf(stderr, "GPFS GET INFO\n");
45-
int ret = OMPI_SUCCESS;
46-
ret = MPI_Info_dup(fh->f_info, *info_used);
47-
return ret;
48-
}
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-2011 The University of Tennessee and The University
6+
* of Tennessee Research Foundation. All rights
7+
* reserved.
8+
* Copyright (c) 2004-2015 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+
#include "ompi_config.h"
21+
#include "fs_gpfs.h"
22+
#include "mpi.h"
23+
#include "ompi/constants.h"
24+
#include "ompi/mca/fs/fs.h"
25+
26+
#include <unistd.h>
27+
#include <string.h>
28+
29+
#include <gpfs.h>
30+
#include <fcntl.h>
31+
#include <errno.h>
32+
#include <gpfs_fcntl.h>
33+
34+
/*
35+
* file_get_info_gpfs
36+
*
37+
* Function: - get_info of a file
38+
* Accepts: - same arguments as MPI_File_get_info()
39+
* Returns: - new info object
40+
*/
41+
42+
int mca_fs_gpfs_file_get_info(ompio_file_t *fh,
43+
ompi_info_t **info_used)
44+
{
45+
int ret = OMPI_SUCCESS;
46+
47+
*info_used = OBJ_NEW(ompi_info_t);
48+
if (NULL == *info_used) {
49+
return OMPI_ERR_OUT_OF_RESOURCE;
50+
}
51+
52+
ret = ompi_info_dup ((ompi_info_t *)fh->f_info, info_used);
53+
54+
return ret;
55+
}

ompi/mca/fs/gpfs/fs_gpfs_file_open.c

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -41,10 +41,10 @@
4141

4242
int
4343
mca_fs_gpfs_file_open (struct ompi_communicator_t *comm,
44-
char* filename,
44+
const char* filename,
4545
int access_mode,
46-
struct ompi_info_t *info,
47-
mca_io_ompio_file_t *fh)
46+
struct opal_info_t *info,
47+
ompio_file_t *fh)
4848
{
4949
int amode;
5050
int old_mask, perm;
@@ -84,7 +84,7 @@ mca_fs_gpfs_file_open (struct ompi_communicator_t *comm,
8484
}
8585

8686
fh->f_amode=access_mode;
87-
mca_fs_gpfs_file_set_info(fh, info);
87+
mca_fs_gpfs_file_set_info(fh, (struct ompi_info_t *) info);
8888

8989
return OMPI_SUCCESS;
9090
}
@@ -93,9 +93,9 @@ int
9393
mca_fs_gpfs_file_get_amode (ompi_file_t *fh,
9494
int *amode)
9595
{
96-
mca_io_ompio_data_t *data;
96+
mca_common_ompio_data_t *data;
9797

98-
data = (mca_io_ompio_data_t *) fh->f_io_selected_data;
98+
data = (mca_common_ompio_data_t *) fh->f_io_selected_data;
9999

100100
*amode = data->ompio_fh.f_amode;
101101

@@ -107,10 +107,10 @@ int
107107
mca_fs_gpfs_file_seek(ompi_file_t *fh, OMPI_MPI_OFFSET_TYPE off, int whence) {
108108
//DEBUG: fprintf(stderr, "GPFS FILE SEEK!");
109109
int ret = OMPI_SUCCESS;
110-
mca_io_ompio_data_t *data;
110+
mca_common_ompio_data_t *data;
111111
OMPI_MPI_OFFSET_TYPE offset, temp_offset;
112112

113-
data = (mca_io_ompio_data_t *) fh->f_io_selected_data;
113+
data = (mca_common_ompio_data_t *) fh->f_io_selected_data;
114114

115115
offset = off * data->ompio_fh.f_etype_size;
116116

@@ -139,15 +139,15 @@ mca_fs_gpfs_file_seek(ompi_file_t *fh, OMPI_MPI_OFFSET_TYPE off, int whence) {
139139
return OMPI_ERROR;
140140
}
141141

142-
ret = ompi_io_ompio_set_explicit_offset(&data->ompio_fh, offset
142+
ret = mca_common_ompio_set_explicit_offset(&data->ompio_fh, offset
143143
/ data->ompio_fh.f_etype_size);
144144
return ret;
145145
}
146146

147147
int mca_fs_gpfs_file_get_position(ompi_file_t *fh, OMPI_MPI_OFFSET_TYPE *offset) {
148-
mca_io_ompio_data_t *data;
148+
mca_common_ompio_data_t *data;
149149

150-
data = (mca_io_ompio_data_t *) fh->f_io_selected_data;
150+
data = (mca_common_ompio_data_t *) fh->f_io_selected_data;
151151

152152
*offset = data->ompio_fh.f_position_in_file_view
153153
/ data->ompio_fh.f_etype_size;

0 commit comments

Comments
 (0)