Haven't looked but suspect this is simply because the parallel machinery is unaware of @runs_once and so by the time @runs_once's memoization implementation kicks in, it's already inside its own multiprocessing subprocess, and so of course the reliance on shared state for memoization to function, means it runs once per host.
Assuming that's accurate, make the parallel machinery aware of @runs_once's desired behavior, either by looking for an existing attribute, or adding a 'hint' in @runs_once's implementation and look for that.
Haven't looked but suspect this is simply because the parallel machinery is unaware of
@runs_onceand so by the time@runs_once's memoization implementation kicks in, it's already inside its own multiprocessing subprocess, and so of course the reliance on shared state for memoization to function, means it runs once per host.Assuming that's accurate, make the parallel machinery aware of
@runs_once's desired behavior, either by looking for an existing attribute, or adding a 'hint' in@runs_once's implementation and look for that.