This source file includes following definitions.
- ADIOI_GPFS_Flush
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16 #include "ad_gpfs.h"
17
18 void ADIOI_GPFS_Flush(ADIO_File fd, int *error_code)
19 {
20 int err=0;
21 static char myname[] = "ADIOI_GPFS_FLUSH";
22
23 int rank;
24
25 MPI_Comm_rank(fd->comm, &rank);
26
27
28
29
30
31
32
33
34
35
36 MPI_Barrier(fd->comm);
37
38 if (rank == fd->hints->ranklist[0]) {
39 err = fsync(fd->fd_sys);
40 DBG_FPRINTF(stderr,"aggregation:fsync %s, err=%#X, errno=%#X\n",fd->filename, err, errno);
41
42 if (err == -1) err = errno;
43 else err = 0;
44 }
45 MPI_Bcast(&err, 1, MPI_UNSIGNED, fd->hints->ranklist[0], fd->comm);
46 DBGV_FPRINTF(stderr,"aggregation result:fsync %s, errno %#X,\n",fd->filename, err);
47
48 if (err)
49 {
50 errno = err;
51 err = -1;
52 }
53
54
55 if (err == -1)
56 {
57 *error_code = MPIO_Err_create_code(MPI_SUCCESS, MPIR_ERR_RECOVERABLE,
58 myname, __LINE__, MPI_ERR_IO,
59 "**io",
60 "**io %s", strerror(errno));
61 DBGT_FPRINTF(stderr,"fsync %s, err=%#X, errno=%#X\n",fd->filename, err, errno);
62 return;
63 }
64
65
66 *error_code = MPI_SUCCESS;
67 }
68