00001
00002
00003
00004
00005
00006
00007
00008 #include "ad_pfs.h"
00009
00010 void ADIOI_PFS_Flush(ADIO_File fd, int *error_code)
00011 {
00012 int err, np_total, np_comm;
00013 static char myname[] = "ADIOI_PFS_FLUSH";
00014
00015
00016
00017 err = fsync(fd->fd_sys);
00018 if (err == -1) {
00019 *error_code = MPIO_Err_create_code(MPI_SUCCESS, MPIR_ERR_RECOVERABLE,
00020 myname, __LINE__, MPI_ERR_IO,
00021 "**io",
00022 "**io %s", strerror(errno));
00023 }
00024 else *error_code = MPI_SUCCESS;
00025
00026
00027
00028
00029
00030
00031 MPI_Comm_size(MPI_COMM_WORLD, &np_total);
00032 MPI_Comm_size(fd->comm, &np_comm);
00033 if ((np_total == np_comm) && (!(fd->atomicity))) {
00034 err = _setiomode(fd->fd_sys, M_UNIX);
00035 err = _setiomode(fd->fd_sys, M_ASYNC);
00036 }
00037
00038 }