Saving on multiple files fails when compression is active at high frame rate (22 kHz) and low photon counts
When the following conditions met:
- saving with compression on more than one file per acquisition
- maximum
PSI/Eiger-500k
speed on 4-bits sensorpixel_depth
- low pixel count
the acquisition fails due to a wrong offset
when calling H5DOwrite_chunk()
:
[2020/06/24 12:27:10.643687] 7f8207fff700 *Control*Control::Saving HDF5 Container::_writeFile (/users/blissadm/Git/Lima/control/src/CtSaving_Hdf5.cpp:730)-Error: Exception(Error): H5DOwrite_chunk() failedaData.frameNumber=9002, m_file_cnt=10, offset[0]=1001, buf_size=3059 [thrown]
[2020/06/24 12:27:10.643913] 7f8207fff700 *Control*Control::Saving HDF5 Container::_writeFile (/users/blissadm/Git/Lima/control/src/CtSaving_Hdf5.cpp:749)-Error: Exception(Error): Control: _writeFile(/users/blissadm/Git/Lima/control/src/CtSaving_Hdf5.cpp, 730): Error: H5DOwrite_chunk() failedaData.frameNumber=9002, m_file_cnt=10, offset[0]=1001, buf_size=3059 [thrown]
[2020/06/24 12:27:10.643997] 7f8207fff700 *Control*Control::Saving::_setSavingError (/users/blissadm/Git/Lima/control/src/CtSaving.cpp:1947)-Error: m_ctrl.m_status=<AcquisitionStatus=AcqFault, Error=Saving error, ImageCounters=<LastImageAcquired=10603, LastBaseImageReady=10603, LastImageReady=10603, LastImageSaved=9001, LastCounterReady=-1>, saving_mode=1
The current Lima core allows parallelization of saving for the first frame of a file. When photon count is low, compression is very fast and competes with saving. Under these conditions, a new file can be opened while the previous is still in use. However, CtSaving::SaveContainer
implementations are not state-less, and fail when more than one file is open at the same time.
Indeed, the problem is solved with the following patch:
index fd9d695..fff435c 100755
--- a/control/src/CtSaving.cpp
+++ b/control/src/CtSaving.cpp
@@ -2468,7 +2468,6 @@ void CtSaving::SaveContainer::prepare(CtControl& ct)
bool new_file = !(i % pars.framesPerFile);
if (new_file) ++nextNumber;
frame_par.m_pars.nextNumber = nextNumber;
- frame_par.m_threadable = new_file;
}
std::pair<Frame2Params::iterator, bool> result =
m_frame_params.insert(Frame2Params::value_type(i, frame_par));
Edited by Alejandro Homs Puron