00001
00002
00003
00004
00005
00006
00007 #include "adio.h"
00008 #include "adio_extern.h"
00009 #ifdef ROMIO_INSIDE_MPICH2
00010 #include "mpiimpl.h"
00011 #endif
00012
00013 void ADIO_End(int *error_code)
00014 {
00015 ADIOI_Flatlist_node *curr, *next;
00016 ADIOI_Datarep *datarep, *datarep_next;
00017
00018
00019
00020
00021
00022 #if 0
00023 PMPI_File_set_errhandler(MPI_FILE_NULL, MPI_ERRORS_RETURN);
00024 #endif
00025
00026
00027 curr = CtvAccess(ADIOI_Flatlist);
00028 while (curr) {
00029 if (curr->blocklens) ADIOI_Free(curr->blocklens);
00030 if (curr->indices) ADIOI_Free(curr->indices);
00031 next = curr->next;
00032 ADIOI_Free(curr);
00033 curr = next;
00034 }
00035 CtvAccess(ADIOI_Flatlist) = NULL;
00036
00037
00038 if (CtvAccess(ADIOI_Ftable)) ADIOI_Free(CtvAccess(ADIOI_Ftable));
00039 #ifndef HAVE_MPI_INFO
00040 if (MPIR_Infotable) ADIOI_Free(MPIR_Infotable);
00041 #endif
00042
00043
00044
00045 datarep = CtvAccess(ADIOI_Datarep_head);
00046 while (datarep) {
00047 datarep_next = datarep->next;
00048 #ifdef HAVE_MPIU_FUNCS
00049 MPIU_Free(datarep->name);
00050 #else
00051 ADIOI_Free(datarep->name);
00052 #endif
00053 ADIOI_Free(datarep);
00054 datarep = datarep_next;
00055 }
00056
00057 if( CtvAccess(ADIOI_syshints) != MPI_INFO_NULL)
00058 MPI_Info_free(&CtvAccess(ADIOI_syshints));
00059
00060 MPI_Op_free(&CtvAccess(ADIO_same_amode));
00061
00062 *error_code = MPI_SUCCESS;
00063 }
00064
00065
00066
00067
00068
00069
00070 int ADIOI_End_call(MPI_Comm comm, int keyval, void *attribute_val, void
00071 *extra_state)
00072 {
00073 int error_code;
00074
00075 ADIOI_UNREFERENCED_ARG(comm);
00076 ADIOI_UNREFERENCED_ARG(attribute_val);
00077 ADIOI_UNREFERENCED_ARG(extra_state);
00078
00079 MPI_Keyval_free(&keyval);
00080
00081
00082
00083
00084 if (CtvAccess(ADIOI_cb_config_list_keyval) != MPI_KEYVAL_INVALID)
00085 MPI_Keyval_free(&CtvAccess(ADIOI_cb_config_list_keyval));
00086
00087 ADIO_End(&error_code);
00088 return error_code;
00089 }