1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
 herr_t
 ss_finalize(void)
 {
     SS_ENTER(ss_finalize, herr_t);
     size_t          tableidx;
     ss_pers_class_t *pcls;

     if (sslib_g.initialized && !sslib_g.finalized) {
         /* Issue warnings about files that are still open with write access and close all files. */
         ss_file_closeall(sslib_g.warnings);

         /* Shut down asynchronous I/O threads */
         ss_aio_finalize();

         /* Free error reporting buffer */
         ss_err_cntl_g.ptr = SS_FREE(ss_err_cntl_g.ptr);
         ss_err_cntl_g.ptrlen = 0;

         /* Library has been finalized */
         sslib_g.finalized = TRUE;

 #ifdef HAVE_PARALLEL

         /* Free MPI structure for each type of class */
         for (tableidx=0; tableidx<SS_PERS_NCLASSES; tableidx++) {
             pcls = SS_PERS_CLASS(tableidx);
             if (!pcls)continue;
             if (pcls->serialized)MPI_Type_free(&(pcls->serialized));
          }
 #endif

     }
     SS_LEAVE(0);
 }