File: osc_ucx_request.h

package info (click to toggle)
openmpi 4.1.0-10
  • links: PTS, VCS
  • area: main
  • in suites: bullseye
  • size: 126,560 kB
  • sloc: ansic: 685,465; makefile: 42,952; f90: 19,220; sh: 7,002; java: 6,360; perl: 3,524; cpp: 2,227; python: 1,350; lex: 989; fortran: 61; tcl: 12
file content (56 lines) | stat: -rw-r--r-- 2,543 bytes parent folder | download | duplicates (3)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
/* -*- Mode: C; c-basic-offset:4 ; indent-tabs-mode:nil -*- */
/*
 * Copyright (c) 2011-2013 Sandia National Laboratories.  All rights reserved.
 * Copyright (c) 2015      Los Alamos National Security, LLC.  All rights
 *                         reserved.
 * Copyright (C) Mellanox Technologies Ltd. 2001-2017. ALL RIGHTS RESERVED.
 * $COPYRIGHT$
 *
 * Additional copyrights may follow
 *
 * $HEADER$
 */

#ifndef OMPI_OSC_UCX_REQUEST_H
#define OMPI_OSC_UCX_REQUEST_H

#include "ompi/request/request.h"

typedef struct ompi_osc_ucx_request {
    ompi_request_t super;
} ompi_osc_ucx_request_t;

OBJ_CLASS_DECLARATION(ompi_osc_ucx_request_t);

typedef struct ompi_osc_ucx_internal_request {
    ompi_osc_ucx_request_t *external_req;
} ompi_osc_ucx_internal_request_t;

#define OMPI_OSC_UCX_REQUEST_ALLOC(win, req)                            \
    do {                                                                \
        opal_free_list_item_t *item;                                    \
        do {                                                            \
            item = opal_free_list_get(&mca_osc_ucx_component.requests); \
            if (item == NULL) {                                         \
                if (mca_osc_ucx_component.ucp_worker != NULL &&         \
                    mca_osc_ucx_component.num_incomplete_req_ops > 0) { \
                    ucp_worker_progress(mca_osc_ucx_component.ucp_worker); \
                }                                                       \
            }                                                           \
        } while (item == NULL);                                         \
        req = (ompi_osc_ucx_request_t*) item;                           \
        OMPI_REQUEST_INIT(&req->super, false);                          \
        req->super.req_mpi_object.win = win;                            \
        req->super.req_complete = false;                                \
        req->super.req_state = OMPI_REQUEST_ACTIVE;                     \
        req->super.req_status.MPI_ERROR = MPI_SUCCESS;                  \
    } while (0)

#define OMPI_OSC_UCX_REQUEST_RETURN(req)                                \
    do {                                                                \
        OMPI_REQUEST_FINI(&request->super);                             \
        opal_free_list_return (&mca_osc_ucx_component.requests,         \
                               (opal_free_list_item_t*) req);           \
    } while (0)

#endif /* OMPI_OSC_UCX_REQUEST_H */