In control-replicated execution mode, there are legitimate cases where we want to perform a computation on only one copy of the top-level program, e.g. writing out to a log file, or making a database operation.
A check like if get_rank() == 0: is unfortunately unsafe, because it leaves the door open to doing some operation that ends up launching Legion work (e.g. printing out a cuPyNumeric ndarray triggers an inline mapping), which is a violation of the control replication model.
We could perhaps provide this through something like an execution scope, that raises an exception if an unsafe operation is launched.
In control-replicated execution mode, there are legitimate cases where we want to perform a computation on only one copy of the top-level program, e.g. writing out to a log file, or making a database operation.
A check like
if get_rank() == 0:is unfortunately unsafe, because it leaves the door open to doing some operation that ends up launching Legion work (e.g. printing out a cuPyNumeric ndarray triggers an inline mapping), which is a violation of the control replication model.We could perhaps provide this through something like an execution scope, that raises an exception if an unsafe operation is launched.