00001
00002
00003
00004
00005
00006
00007
00008 #include "ad_zoidfs.h"
00009 #include "ad_zoidfs_common.h"
00010
00011
00012
00013
00014
00015
00016
00017 void ADIOI_ZOIDFS_Flush(ADIO_File fd, int *error_code)
00018 {
00019 int ret, rank, dummy=0, dummy_in=0;
00020 ADIOI_ZOIDFS_object *zoidfs_obj_ptr;
00021 static char myname[] = "ADIOI_ZOIDFS_FLUSH";
00022
00023 *error_code = MPI_SUCCESS;
00024
00025 zoidfs_obj_ptr = (ADIOI_ZOIDFS_object*)fd->fs_ptr;
00026
00027 MPI_Comm_rank(fd->comm, &rank);
00028
00029
00030
00031 MPI_Reduce(&dummy_in, &dummy, 1, MPI_INT, MPI_SUM,
00032 fd->hints->ranklist[0], fd->comm);
00033
00034 if (rank == fd->hints->ranklist[0]) {
00035 ret = zoidfs_commit(zoidfs_obj_ptr, ZOIDFS_NO_OP_HINT);
00036 }
00037 MPI_Bcast(&ret, 1, MPI_INT, fd->hints->ranklist[0], fd->comm);
00038
00039
00040 if (ret != 0) {
00041 *error_code = MPIO_Err_create_code(MPI_SUCCESS,
00042 MPIR_ERR_RECOVERABLE,
00043 myname, __LINE__,
00044 ADIOI_ZOIDFS_error_convert(ret),
00045 "Error in zoidfs_commit", 0);
00046 }
00047
00048 }
00049
00050
00051
00052