Skip to content

Commit ba3ed1f

Browse files
committed
add fence to more ADIO layers
1 parent 41d607c commit ba3ed1f

File tree

9 files changed

+29
-2
lines changed

9 files changed

+29
-2
lines changed

src/mpi/romio/adio/ad_nfs/ad_nfs.c

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,7 @@ struct ADIOI_Fns_struct ADIO_NFS_operations = {
3232
ADIOI_GEN_IreadStrided, /* IreadStrided */
3333
ADIOI_GEN_IwriteStrided, /* IwriteStrided */
3434
ADIOI_GEN_Flush, /* Flush */
35+
ADIOI_GEN_Fence, /* Fence */
3536
ADIOI_NFS_Resize, /* Resize */
3637
ADIOI_GEN_Delete, /* Delete */
3738
ADIOI_NFS_Feature, /* Features */

src/mpi/romio/adio/ad_testfs/Makefile.mk

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,7 @@ romio_other_sources += \
2020
adio/ad_testfs/ad_testfs_iwrite.c \
2121
adio/ad_testfs/ad_testfs_wait.c \
2222
adio/ad_testfs/ad_testfs_flush.c \
23+
adio/ad_testfs/ad_testfs_fence.c \
2324
adio/ad_testfs/ad_testfs_seek.c \
2425
adio/ad_testfs/ad_testfs_resize.c \
2526
adio/ad_testfs/ad_testfs_hints.c \

src/mpi/romio/adio/ad_testfs/ad_testfs.c

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,7 @@ struct ADIOI_Fns_struct ADIO_TESTFS_operations = {
3030
ADIOI_TESTFS_IreadStrided, /* IreadStrided */
3131
ADIOI_TESTFS_IwriteStrided, /* IwriteStrided */
3232
ADIOI_TESTFS_Flush, /* Flush */
33+
ADIOI_TESTFS_Fence, /* Fence */
3334
ADIOI_TESTFS_Resize, /* Resize */
3435
ADIOI_TESTFS_Delete, /* Delete */
3536
ADIOI_GEN_Feature, /* Features */

src/mpi/romio/adio/ad_testfs/ad_testfs.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -62,6 +62,7 @@ void ADIOI_TESTFS_IwriteStrided(ADIO_File fd, const void *buf, int count,
6262
ADIO_Offset offset, ADIO_Request * request, int
6363
*error_code);
6464
void ADIOI_TESTFS_Flush(ADIO_File fd, int *error_code);
65+
void ADIOI_TESTFS_Fence(ADIO_File fd, int *error_code);
6566
void ADIOI_TESTFS_Resize(ADIO_File fd, ADIO_Offset size, int *error_code);
6667
ADIO_Offset ADIOI_TESTFS_SeekIndividual(ADIO_File fd, ADIO_Offset offset,
6768
int whence, int *error_code);
Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
/*
2+
* Copyright (C) by Argonne National Laboratory
3+
* See COPYRIGHT in top-level directory
4+
*/
5+
6+
#include "ad_testfs.h"
7+
#include "adioi.h"
8+
9+
void ADIOI_TESTFS_Fence(ADIO_File fd, int *error_code)
10+
{
11+
int myrank, nprocs;
12+
13+
*error_code = MPI_SUCCESS;
14+
15+
MPI_Comm_size(fd->comm, &nprocs);
16+
MPI_Comm_rank(fd->comm, &myrank);
17+
FPRINTF(stdout, "[%d/%d] ADIOI_TESTFS_Fence called on %s\n", myrank, nprocs, fd->filename);
18+
}

src/mpi/romio/adio/ad_ufs/ad_ufs.c

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -35,6 +35,7 @@ struct ADIOI_Fns_struct ADIO_UFS_operations = {
3535
ADIOI_GEN_IreadStrided, /* IreadStrided */
3636
ADIOI_GEN_IwriteStrided, /* IwriteStrided */
3737
ADIOI_GEN_Flush, /* Flush */
38+
ADIOI_GEN_Fence, /* Fence */
3839
ADIOI_GEN_Resize, /* Resize */
3940
ADIOI_GEN_Delete, /* Delete */
4041
ADIOI_GEN_Feature, /* Features */

src/mpi/romio/adio/include/adioi.h

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -226,6 +226,7 @@ struct ADIOI_Fns_struct {
226226
MPI_Datatype datatype, int file_ptr_type,
227227
ADIO_Offset offset, ADIO_Request * request, int *error_code);
228228
void (*ADIOI_xxx_Flush) (ADIO_File fd, int *error_code);
229+
void (*ADIOI_xxx_Fence) (ADIO_File fd, int *error_code);
229230
void (*ADIOI_xxx_Resize) (ADIO_File fd, ADIO_Offset size, int *error_code);
230231
void (*ADIOI_xxx_Delete) (const char *filename, int *error_code);
231232
int (*ADIOI_xxx_Feature) (ADIO_File fd, int flag);
@@ -397,6 +398,7 @@ void ADIOI_Info_print_keyvals(MPI_Info info);
397398

398399
void ADIOI_GEN_Fcntl(ADIO_File fd, int flag, ADIO_Fcntl_t * fcntl_struct, int *error_code);
399400
void ADIOI_GEN_Flush(ADIO_File fd, int *error_code);
401+
void ADIOI_GEN_Fence(ADIO_File fd, int *error_code);
400402
void ADIOI_GEN_OpenColl(ADIO_File fd, int rank, int access_mode, int *error_code);
401403
void ADIOI_SCALEABLE_OpenColl(ADIO_File fd, int rank, int access_mode, int *error_code);
402404
void ADIOI_FAILSAFE_OpenColl(ADIO_File fd, int rank, int access_mode, int *error_code);

src/mpi/romio/mpi-io/fence.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -36,11 +36,11 @@ int MPI_File_fence(MPI_File fh)
3636
{
3737
int error_code;
3838
ADIO_File adio_fh;
39-
static char myname[] = "MPI_FILE_SYNC";
39+
static char myname[] = "MPI_FILE_FENCE";
4040
#ifdef MPI_hpux
4141
int fl_xmpi;
4242

43-
HPMP_IO_START(fl_xmpi, BLKMPIFILESYNC, TRDTBLOCK, adio_fh, MPI_DATATYPE_NULL, -1);
43+
HPMP_IO_START(fl_xmpi, BLKMPIFILEFENCE, TRDTBLOCK, adio_fh, MPI_DATATYPE_NULL, -1);
4444
#endif /* MPI_hpux */
4545
ROMIO_THREAD_CS_ENTER();
4646

src/mpi/romio/mpi-io/mpioprof.h

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -139,6 +139,8 @@
139139
#define MPI_File_get_atomicity PMPI_File_get_atomicity
140140
#undef MPI_File_sync
141141
#define MPI_File_sync PMPI_File_sync
142+
#undef MPI_File_fence
143+
#define MPI_File_fence PMPI_File_fence
142144

143145
#undef MPI_Type_create_subarray
144146
#define MPI_Type_create_subarray PMPI_Type_create_subarray

0 commit comments

Comments
 (0)