示例#1
0
def barrier(no_more_tasks=False):
    # type: (bool) -> None
    """ Wait for all submitted tasks.

    Calls the external python library (that calls the bindings-common)
    in order to request a barrier.

    :param no_more_tasks: If no more tasks are going to be submitted, remove
                          all objects.
    :return: None
    """
    if __debug__:
        logger.debug("Barrier. No more tasks? %s" % str(no_more_tasks))
    # If noMoreFlags is set, clean up the objects
    if no_more_tasks:
        _clean_objects()

    app_id = 0
    # Call the Runtime barrier (appId 0, not needed for the signature)
    COMPSs.barrier(app_id, no_more_tasks)
示例#2
0
def nested_barrier():
    # type: () -> None
    """ Wait for all submitted tasks within nested task.

    Calls the external python library (that calls the bindings-common)
    in order to request a barrier.

    CAUTION:
    When using agents (nesting), we can not remove all object tracker objects
    as with normal barrier (and no_more_tasks==True), nor leave all objects
    with (no_more_tasks==False). In this case, it is necessary to perform a
    smart object tracker cleanup (remove in, but not inout nor out).

    :return: None
    """
    if __debug__:
        logger.debug("Nested Barrier.")
    _clean_objects()

    # Call the Runtime barrier (appId 0 -- not needed for the signature, and
    # no_more_tasks == True)
    COMPSs.barrier(0, True)