Exemplo n.º 1
0
def MPI_Wait(context, args):
    request_ptr, status_ptr = args

    request_id = context.controller.read_int(request_ptr)
    check.check_request_id(context, request_id, 1)
    if context.state.get_persistent_request(request_id) is None:
        context.controller.write_int(request_ptr, consts.MPI_REQUEST_NULL)
    context.state.set_wait([ request_id ], None, status_ptr)
    return True
Exemplo n.º 2
0
def MPI_Waitany(context, args):
    count, requests_ptr, index_ptr, status_ptr = args
    request_ids = context.controller.read_ints(requests_ptr, count)

    for i, request_id in enumerate(request_ids):
        if request_id == consts.MPI_REQUEST_NULL:
            continue
        if context.state.get_persistent_request(request_id) is None:
            check.check_request_id(context, request_id, 2, i)
        elif not context.state.get_request(request_id):
            request_ids[i] = consts.MPI_REQUEST_NULL
    if all(id == consts.MPI_REQUEST_NULL for id in request_ids):
        context.controller.write_int(index_ptr, consts.MPI_UNDEFINED)
        return False
    context.state.set_wait(request_ids, requests_ptr, status_ptr,
                   status=context.state.StatusWaitAny, index_ptr=index_ptr)
    return True
Exemplo n.º 3
0
def MPI_Test(context, args):
    request_ptr, flag_ptr, status_ptr = args
    request_id = context.controller.read_int(request_ptr)
    check.check_request_id(context, request_id, 1)
    context.state.set_test([ request_id ], flag_ptr, request_ptr, status_ptr)
    return True