This source file includes following definitions.
- ADIOI_GEN_Resize
1
2
3
4
5
6
7
8 #include "adio.h"
9
10 #ifdef HAVE_UNISTD_H
11 #include <unistd.h>
12 #endif
13
14 void ADIOI_GEN_Resize(ADIO_File fd, ADIO_Offset size, int *error_code)
15 {
16 int err, rank;
17 static char myname[] = "ADIOI_GEN_RESIZE";
18
19 MPI_Comm_rank(fd->comm, &rank);
20
21
22 if (rank == fd->hints->ranklist[0]) {
23 ADIOI_Assert(size == (off_t) size);
24 err = ftruncate(fd->fd_sys, (off_t)size);
25 }
26
27
28 MPI_Bcast(&err, 1, MPI_INT, fd->hints->ranklist[0], fd->comm);
29
30
31 if (err == -1) {
32 *error_code = ADIOI_Err_create_code(myname, fd->filename, errno);
33 return;
34 }
35
36
37 *error_code = MPI_SUCCESS;
38 }