00001
00002
00003
00004
00005
00006
00007
00008 #include "ad_zoidfs.h"
00009 #include "ad_zoidfs_common.h"
00010
00011
00012
00013
00014 void ADIOI_ZOIDFS_Resize(ADIO_File fd, ADIO_Offset size, int *error_code)
00015 {
00016 int ret, rank;
00017 ADIOI_ZOIDFS_object *zoidfs_obj_ptr;
00018 static char myname[] = "ADIOI_ZOIDFS_RESIZE";
00019
00020 *error_code = MPI_SUCCESS;
00021
00022 zoidfs_obj_ptr = (ADIOI_ZOIDFS_object *)fd->fs_ptr;
00023
00024 MPI_Comm_rank(fd->comm, &rank);
00025
00026
00027
00028
00029
00030
00031
00032 if (rank == fd->hints->ranklist[0]) {
00033 NO_STALE(ret, fd, zoidfs_obj_ptr,
00034 zoidfs_resize(zoidfs_obj_ptr, size, ZOIDFS_NO_OP_HINT));
00035 MPI_Bcast(&ret, 1, MPI_INT, fd->hints->ranklist[0], fd->comm);
00036 } else {
00037 MPI_Bcast(&ret, 1, MPI_INT, fd->hints->ranklist[0], fd->comm);
00038 }
00039
00040 if (ret != ZFS_OK) {
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_resize", 0);
00046 return;
00047 }
00048
00049 }
00050
00051
00052
00053