00001
00002
00003
00004
00005
00006
00007
00008 #include "ad_gridftp.h"
00009 #include "adioi.h"
00010
00011 void ADIOI_GRIDFTP_Close(ADIO_File fd, int *error_code)
00012 {
00013 int err;
00014 static char myname[]="ADIOI_GRIDFTP_Close";
00015
00016 globus_result_t result;
00017
00018 MPI_Barrier(fd->comm);
00019
00020
00021 result = globus_ftp_client_operationattr_destroy(&(oattr[fd->fd_sys]));
00022 if (result != GLOBUS_SUCCESS )
00023 {
00024 globus_err_handler("globus_ftp_client_operationattr_destroy",
00025 myname,result);
00026 *error_code = MPIO_Err_create_code(MPI_SUCCESS, MPIR_ERR_RECOVERABLE,
00027 myname, __LINE__, MPI_ERR_IO,
00028 "**io",
00029 "**io %s",globus_object_printable_to_string(globus_error_get(result)));
00030 return;
00031 }
00032 result=globus_ftp_client_handle_destroy(&(gridftp_fh[fd->fd_sys]));
00033 if (result != GLOBUS_SUCCESS )
00034 {
00035 globus_err_handler("globus_ftp_client_handle_destroy",
00036 myname,result);
00037 *error_code = MPIO_Err_create_code(MPI_SUCCESS, MPIR_ERR_RECOVERABLE,
00038 myname, __LINE__, MPI_ERR_IO,
00039 "**io",
00040 "**io %s", globus_object_printable_to_string(globus_error_get(result)));
00041 return;
00042 }
00043
00044 fd->fd_sys = -1;
00045 fd->fp_ind=0;
00046 fd->fp_sys_posn=0;
00047 num_gridftp_handles--;
00048
00049 *error_code = MPI_SUCCESS;
00050 }