File: vprotocol_base_request.h

package info (click to toggle)
openmpi 5.0.7-1
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid, trixie
  • size: 202,312 kB
  • sloc: ansic: 612,441; makefile: 42,495; sh: 11,230; javascript: 9,244; f90: 7,052; java: 6,404; perl: 5,154; python: 1,856; lex: 740; fortran: 61; cpp: 20; tcl: 12
file content (82 lines) | stat: -rw-r--r-- 3,210 bytes parent folder | download | duplicates (6)
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
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
/*
 * Copyright (c) 2004-2007 The Trustees of the University of Tennessee.
 *                         All rights reserved.
 * $COPYRIGHT$
 *
 * Additional copyrights may follow
 *
 * $HEADER$
 */

#ifndef __INCLUDE_VPROTOCOL_REQUEST_H_
#define __INCLUDE_VPROTOCOL_REQUEST_H_

#include "ompi_config.h"
#include "ompi/mca/pml/base/pml_base_request.h"
#include "../vprotocol.h"

BEGIN_C_DECLS


/** Rebuild the PML requests pools to make room for extra space at end of each
  * request.
  * The extra data is allocated in each requests so that it can hold instances
  * of the req_recv_class and req_send_class fields of the
  * mca_vprotocol_base_module_t. If those fields are NULL the requests are not
  * recreated.
  *  @return OMPI_SUCCESS or failure status
  */
OMPI_DECLSPEC int mca_vprotocol_base_request_parasite(void);


/** Gives the actual address of the protocol specific part of a recv request.
 *   @param req (IN) the address of an ompi_request.
 *   @return address of the custom vprotocol data associated with the request.
 */
#define VPROTOCOL_RECV_FTREQ(req) \
    (((uintptr_t) req) + mca_pml_v.host_pml_req_recv_size)

/** Gives the address of the real request associated with a protocol specific
 * send request.
 *  @param ftreq (IN) the address of a protocol specific request.
 *  @return address of the associated ompi_request_t.
 */
#define VPROTOCOL_RECV_REQ(ftreq) \
    ((mca_pml_base_recv_request_t *) \
        (((uintptr_t) ftreq) - mca_pml_v.host_pml_req_send_size))

/** Gives the actual address of the protocol specific part of a send request.
 *   @param req (IN) the address of an ompi_request.
 *   @return address of the custom vprotocol data associated with the request.
 */
#define VPROTOCOL_SEND_FTREQ(req) \
    (((uintptr_t) req) + mca_pml_v.host_pml_req_send_size)

/** Gives the address of the real request associated with a protocol specific
 * send request.
 *  @param ftreq (IN) the address of a protocol specific request.
 *  @return address of the associated ompi_request_t.
 */
#define VPROTOCOL_SEND_REQ(ftreq) \
    ((mca_pml_base_send_request_t *) \
        (((uintptr_t) ftreq) - mca_pml_v.host_pml_req_send_size))

/** Unified macro to get the actual address of the protocol specific part of
  * an send - or - recv request.
  *  @param request (IN) the address of an ompi_request.
  *  @return address of the custom vprotocol data associated with the request.
  */
#define VPROTOCOL_FTREQ(req) (                                                 \
    assert((MCA_PML_REQUEST_SEND ==                                            \
                ((mca_pml_base_request_t *) req)->req_type) ||                 \
           (MCA_PML_REQUEST_RECV ==                                            \
                ((mca_pml_base_request_t *) req)->req_type)),                  \
    ((MCA_PML_REQUEST_SEND == ((mca_pml_base_request_t *) req)->req_type)      \
        ? VPROTOCOL_SEND_FTREQ(req)                                            \
        : VPROTOCOL_RECV_FTREQ(req)                                            \
    )                                                                          \
)

END_C_DECLS

#endif /* __INCLUDE_VPROTOCOL_REQUEST_H_ */