00001
00002
00003
00004
00005
00006
00007
00008 #include "ad_pvfs2.h"
00009 #include "ad_pvfs2_common.h"
00010
00011
00012
00013
00014 void ADIOI_PVFS2_Resize(ADIO_File fd, ADIO_Offset size, int *error_code)
00015 {
00016 int ret, rank;
00017 ADIOI_PVFS2_fs *pvfs_fs;
00018 static char myname[] = "ADIOI_PVFS2_RESIZE";
00019
00020 *error_code = MPI_SUCCESS;
00021
00022 pvfs_fs = (ADIOI_PVFS2_fs*)fd->fs_ptr;
00023
00024 MPI_Comm_rank(fd->comm, &rank);
00025
00026
00027
00028
00029
00030
00031
00032
00033
00034
00035 if (rank == fd->hints->ranklist[0]) {
00036 ret = PVFS_sys_truncate(pvfs_fs->object_ref,
00037 size, &(pvfs_fs->credentials));
00038 MPI_Bcast(&ret, 1, MPI_INT, fd->hints->ranklist[0], fd->comm);
00039 } else {
00040 MPI_Bcast(&ret, 1, MPI_INT, fd->hints->ranklist[0], fd->comm);
00041 }
00042
00043 if (ret != 0) {
00044 *error_code = MPIO_Err_create_code(MPI_SUCCESS,
00045 MPIR_ERR_RECOVERABLE,
00046 myname, __LINE__,
00047 ADIOI_PVFS2_error_convert(ret),
00048 "Error in PVFS_sys_truncate", 0);
00049 return;
00050 }
00051
00052 }
00053
00054
00055
00056