The source project of this merge request has been removed.
Close some HDFGroups to avoid small memory leaks
This one should probably be assigned to @jolien-creighton as he wrote the HDF interface. We're seeing some strange failures when running NR injections using pycbc_optimal_snr
which uses the multiprocessing module. I still don't know what's causing the failures, but I found some memory leaks in the process. This pull request is to fix those memory leaks.
And if interested here is a minimal example to reproduce the strange errors
#!/usr/bin/env python
import multiprocessing
import random
import lal
import lalsimulation
inj_table = range(1000)
def print_id(x):
lalsimulation.SimInspiralNRWaveformGetHplusHcross\
(0.2, 1.2, 1./4096., 20. * lal.MSUN_SI, 20. * lal.MSUN_SI, 100 * lal.PC_SI, 20, 20, 0, 0, 0, 0, 0, 0, '/home/salemi/git/lvcnr-lfs/SXS/SXS_BBH_0180_Res4.h5', None)
print x, multiprocessing.current_process().pid
# REMOVE THIS LINE AND IT WORKS!!
print_id(inj_table[0])
pool = multiprocessing.Pool(processes=4)
pool.map(print_id, inj_table)
I don't understand why removing the indicated line would make this work or not ... The mentioned H5 file is present on atlas or CIT.