00001
00002
00003
00004
00005
00006
00007
00008 #include "ad_pvfs.h"
00009
00010 void ADIOI_PVFS_Resize(ADIO_File fd, ADIO_Offset size, int *error_code)
00011 {
00012 int err;
00013 int rank;
00014 static char myname[] = "ADIOI_PVFS_RESIZE";
00015
00016
00017
00018
00019 MPI_Comm_rank(fd->comm, &rank);
00020 if (rank == fd->hints->ranklist[0]) {
00021 err = pvfs_ftruncate64(fd->fd_sys, size);
00022 }
00023 MPI_Bcast(&err, 1, MPI_INT, fd->hints->ranklist[0], fd->comm);
00024
00025 if (err == -1) {
00026 *error_code = MPIO_Err_create_code(MPI_SUCCESS, MPIR_ERR_RECOVERABLE,
00027 myname, __LINE__, MPI_ERR_IO,
00028 "**io",
00029 "**io %s", strerror(errno));
00030 }
00031 else *error_code = MPI_SUCCESS;
00032 }