Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
- Within the task loop, decide on source chunks and make skymodels on the fly.
"""
Nbltf = Nbls * Ntimes * Nfreqs
split_srcs = False
if (Nbltf < Npus) and (Npus < Nsrcs):
split_srcs = True
if split_srcs:
src_inds, Nsrcs_local = simutils.iter_array_split(rank, Nsrcs, Npus)
task_inds = range(Nbltf)
Ntasks_local = Nbltf
else:
task_inds, Ntasks_local = simutils.iter_array_split(rank, Nbltf, Npus)
src_inds = range(Nsrcs)
Nsrcs_local = Nsrcs
return task_inds, src_inds, Ntasks_local, Nsrcs_local