00001
00002
00003
00004
00005
00006
00007
00008 #include "ad_testfs.h"
00009 #include "adioi.h"
00010 #include "adio_extern.h"
00011
00012 void ADIOI_TESTFS_Fcntl(ADIO_File fd, int flag, ADIO_Fcntl_t *fcntl_struct,
00013 int *error_code)
00014 {
00015 int myrank, nprocs;
00016 static char myname[] = "ADIOI_TESTFS_FCNTL";
00017
00018 *error_code = MPI_SUCCESS;
00019
00020 MPI_Comm_size(fd->comm, &nprocs);
00021 MPI_Comm_rank(fd->comm, &myrank);
00022 FPRINTF(stdout, "[%d/%d] ADIOI_TESTFS_Fcntl called on %s\n",
00023 myrank, nprocs, fd->filename);
00024
00025 switch(flag) {
00026 case ADIO_FCNTL_GET_FSIZE:
00027 fcntl_struct->fsize = 0;
00028 *error_code = MPI_SUCCESS;
00029 break;
00030
00031 case ADIO_FCNTL_SET_DISKSPACE:
00032 *error_code = MPI_SUCCESS;
00033 break;
00034
00035 case ADIO_FCNTL_SET_ATOMICITY:
00036 fd->atomicity = (fcntl_struct->atomicity == 0) ? 0 : 1;
00037 *error_code = MPI_SUCCESS;
00038 break;
00039
00040 default:
00041
00042 *error_code = MPIO_Err_create_code(MPI_SUCCESS, MPIR_ERR_RECOVERABLE,
00043 myname, __LINE__,
00044 MPI_ERR_ARG,
00045 "**flag", "**flag %d", flag);
00046 return;
00047
00048 }
00049 }