Hello, i have a sequence structure that will save timetag saving data for each run.
`
@kernel
def run(self, run_index: TInt32):
self.exp.core.break_realtime()
self._num_of_timetags = 0
time_now = _np.int64(-1)
timetag_end_time = self._pmt.gate_rising_mu(self._timetag_time_mu)
while time_now <= timetag_end_time:
time_now = self.exp.core.get_rtio_counter_mu()
self.read_timetags(time_now)
self.save_timetags(run_index, self._timetags[: self._num_of_timetags])
@rpc(flags={"async"})
def save_timetags(self, index: TInt32, timetags: TArray(TInt64, 1)):
timetags_flatten = _np.mod(timetags, self._timetag_time_mu)
self.exp.add_datasets(
{f"timetags_{index}": timetags_flatten * self.exp.core.mu_to_seconds(1)}
)`
It looks like if two runs are too close to each other, there comes to a problem where consecutive rpc calls are fired too frequently, and according to ARTIQ manual
Submitting asynchronous RPCs too rapidly, as well as submitting asynchronous RPCs with arguments
that are too large, can still block until completion.
I wonder is there any way to do away with this? The block is observed usually at about 10 to 50 runs, but then it just stuck there forever and would never reach completition. (This is easy to reproduce by the code below)
for i in range(2):
self.save_timetags(run_index, self._timetags[: self._num_of_timetags])
I wonder is there any way to do away with this? Maybe adding a queue or making the rpc call mutex-like?
Thanks for any response in advance.