nlcpy.request.flush

nlcpy.request.flush(VENode venode=None, bool sync=True)

Flushes stacked requests on VH to specified VE.

Parameters
venodeVENode

Targe VE node. If set to ‘None’, the current active VE node is set.

syncbool

Whether synchronize completion of VE execution. Defaults to True.

Examples

>>> import nlcpy as vp
>>> ve0 = vp.venode.VE(0)
>>> # First, none request on VH and VE
>>> ve0.status['stacked_request_on_VH'], ve0.status['running_request_on_VE']
(0, 0)
>>> # Execute some function
>>> _ = vp.arange(10)
>>> # A request is stacked on VH
>>> ve0.status['stacked_request_on_VH'], ve0.status['running_request_on_VE']
(1, 0)
>>> # Flush requests into VE#0 without synchronize
>>> vp.request.flush(venode=vp.venode.VE(0), sync=False)
>>> # Requests are running on VE
>>> # (write_mem request for function arguments and arange kernel request)
>>> ve0.status['stacked_request_on_VH'], ve0.status['running_request_on_VE']
(0, 2)
>>> # Flush requests into VE#0 with synchronize
>>> vp.request.flush(venode=vp.venode.VE(0), sync=True)
>>> # None request on VH and VE
>>> ve0.status['stacked_request_on_VH'], ve0.status['running_request_on_VE']
(0, 0)