00001
00002
00003
00004
00005
00006
00007
00008
00009 #include "ad_piofs.h"
00010 #ifdef PROFILE
00011 #include "mpe.h"
00012 #endif
00013
00014 void ADIOI_PIOFS_Close(ADIO_File fd, int *error_code)
00015 {
00016 int err;
00017 #ifndef PRINT_ERR_MSG
00018 static char myname[] = "ADIOI_PIOFS_CLOSE";
00019 #endif
00020
00021 #ifdef PROFILE
00022 MPE_Log_event(9, 0, "start close");
00023 #endif
00024 err = close(fd->fd_sys);
00025 #ifdef PROFILE
00026 MPE_Log_event(10, 0, "end close");
00027 #endif
00028 #ifdef PRINT_ERR_MSG
00029 *error_code = (err == 0) ? MPI_SUCCESS : MPI_ERR_UNKNOWN;
00030 #else
00031 if (err == -1) {
00032 *error_code = MPIR_Err_setmsg(MPI_ERR_IO, MPIR_ADIO_ERROR,
00033 myname, "I/O Error", "%s", strerror(errno));
00034 ADIOI_Error(fd, *error_code, myname);
00035 }
00036 else *error_code = MPI_SUCCESS;
00037 #endif
00038 }