def close(self):

        import h5py  # do it here to avoid warning from autodoc in Sphinx

        for hdf5_case_record_file in self.hdf5_case_record_file_objects.values() :
            hdf5_case_record_file.close()

        # if 1 or not MPI or get_rank() == 0 : # only rank 0 process needs to write the primary case recording file

        # add the individual case recording files to the main hdf5 file
        iteration_case_grp = create_group(self.hdf5_main_file_object, "iteration_cases")
        iteration_case_grp = self.hdf5_main_file_object.create_group("iteration_cases")

        for driver_path, filename in self.case_recording_filenames.items():
            # Create an external link to the root group "/" in the driver specific iteration cases
            # B['External'] = h5py.ExternalLink("dset.h5", "/dset")
            iteration_case_grp[driver_path] = h5py.ExternalLink(filename, "/") # root should work
        self.hdf5_main_file_object.close()

        self._cases = None
Called before writing each message to file f.
dataset/ETHPy150Open OpenMDAO/OpenMDAO-Framework/openmdao.lib/src/openmdao/lib/casehandlers/hdf5case.py/HDF5CaseRecorder.close--crossover with--dataset/ETHPy150Open babble/babble/include/jython/Lib/mailbox.py/mbox._pre_message_hook