File: pml_ob1_rdmafrag.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 (86 lines) | stat: -rw-r--r-- 2,977 bytes parent folder | download | duplicates (4)
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
83
84
85
86
/* -*- Mode: C; c-basic-offset:4 ; indent-tabs-mode:nil -*- */
/*
 * Copyright (c) 2004-2005 The Trustees of Indiana University and Indiana
 *                         University Research and Technology
 *                         Corporation.  All rights reserved.
 * Copyright (c) 2004-2019 The University of Tennessee and The University
 *                         of Tennessee Research Foundation.  All rights
 *                         reserved.
 * Copyright (c) 2004-2005 High Performance Computing Center Stuttgart,
 *                         University of Stuttgart.  All rights reserved.
 * Copyright (c) 2004-2005 The Regents of the University of California.
 *                         All rights reserved.
 * Copyright (c) 2014-2015 Los Alamos National Security, LLC. All rights
 *                         reserved.
 * $COPYRIGHT$
 *
 * Additional copyrights may follow
 *
 * $HEADER$
 */
/**
 *  @file
 */

#ifndef MCA_PML_OB1_RDMAFRAG_H
#define MCA_PML_OB1_RDMAFRAG_H

#include "pml_ob1_hdr.h"

BEGIN_C_DECLS

typedef enum {
    MCA_PML_OB1_RDMA_PUT,
    MCA_PML_OB1_RDMA_GET
} mca_pml_ob1_rdma_state_t;

struct mca_pml_ob1_rdma_frag_t;

typedef void (*mca_pml_ob1_rdma_frag_callback_t)(struct mca_pml_ob1_rdma_frag_t *frag, int64_t rdma_length);

/**
 * Used to keep track of local and remote RDMA operations.
 */
struct mca_pml_ob1_rdma_frag_t {
    opal_free_list_item_t super;
    mca_bml_base_btl_t *rdma_bml;
    mca_pml_ob1_hdr_t rdma_hdr;
    mca_pml_ob1_rdma_state_t rdma_state;
    size_t rdma_length;  /* how much the fragment will transfer */
    opal_atomic_size_t rdma_bytes_remaining;  /* how much is left to be transferred */
    void *rdma_req;
    uint32_t retries;
    mca_pml_ob1_rdma_frag_callback_t cbfunc;

    uint64_t rdma_offset;
    void *local_address;
    mca_btl_base_registration_handle_t *local_handle;

    uint64_t remote_address;
    uint8_t remote_handle[MCA_BTL_REG_HANDLE_MAX_SIZE];
};
typedef struct mca_pml_ob1_rdma_frag_t mca_pml_ob1_rdma_frag_t;

OBJ_CLASS_DECLARATION(mca_pml_ob1_rdma_frag_t);


#define MCA_PML_OB1_RDMA_FRAG_ALLOC(frag)                          \
    do {                                                           \
        frag = (mca_pml_ob1_rdma_frag_t *)                         \
            opal_free_list_wait (&mca_pml_ob1.rdma_frags);         \
    } while(0)

#define MCA_PML_OB1_RDMA_FRAG_RETURN(frag)                              \
    do {                                                                \
        if (frag->local_handle) {                                       \
            mca_bml_base_deregister_mem (frag->rdma_bml, frag->local_handle); \
            frag->local_handle = NULL;                                  \
        }                                                               \
        opal_free_list_return (&mca_pml_ob1.rdma_frags,                 \
                               (opal_free_list_item_t*)frag);           \
    } while (0)

END_C_DECLS

#endif