File: smsc_knem_internal.h

package info (click to toggle)
openmpi 5.0.8-4
  • links: PTS, VCS
  • area: main
  • in suites:
  • size: 201,684 kB
  • sloc: ansic: 613,078; makefile: 42,353; sh: 11,194; javascript: 9,244; f90: 7,052; java: 6,404; perl: 5,179; python: 1,859; lex: 740; fortran: 61; cpp: 20; tcl: 12
file content (74 lines) | stat: -rw-r--r-- 2,183 bytes parent folder | download | duplicates (5)
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
/* -*- Mode: C; c-basic-offset:4 ; indent-tabs-mode:nil -*- */
/*
 * Copyright (c) 2021      Google, Inc. All rights reserved.
 * $COPYRIGHT$
 *
 * Additional copyrights may follow
 *
 * $HEADER$
 */

#ifndef OPAL_MCA_SMSC_KNEM_SMSC_KNEM_INTERNAL_H
#define OPAL_MCA_SMSC_KNEM_SMSC_KNEM_INTERNAL_H

#include "opal_config.h"

#include "opal/mca/rcache/base/base.h"
#include "opal/mca/rcache/rcache.h"
#include "opal/mca/smsc/knem/smsc_knem.h"

#include <sys/mman.h>

#include <knem_io.h>

struct mca_smsc_knem_registration_data_t {
    uint64_t cookie;
    intptr_t base_addr;
};

typedef struct mca_smsc_knem_registration_data_t mca_smsc_knem_registration_data_t;

struct mca_smsc_knem_registration_handle_t {
    mca_rcache_base_registration_t base;
    mca_smsc_knem_registration_data_t data;
};

typedef struct mca_smsc_knem_registration_handle_t mca_smsc_knem_registration_handle_t;

#define MCA_SMSC_KNEM_REG_HANDLE_TO_DATA(handle) (&(handle)->data)
#define MCA_SMSC_KNEM_REG_DATA_TO_HANDLE(data_ptr)                                            \
    ((mca_smsc_knem_registration_handle_t *) ((uintptr_t) data_ptr                            \
                                              - offsetof(mca_smsc_knem_registration_handle_t, \
                                                         data)))

struct mca_smsc_knem_endpoint_t {
    mca_smsc_endpoint_t super;
};

typedef struct mca_smsc_knem_endpoint_t mca_smsc_knem_endpoint_t;

OBJ_CLASS_DECLARATION(mca_smsc_knem_endpoint_t);

struct mca_smsc_knem_component_t {
    mca_smsc_component_t super;

    int knem_fd;
    unsigned int dma_min;
};

typedef struct mca_smsc_knem_component_t mca_smsc_knem_component_t;

struct mca_smsc_knem_module_t {
    mca_smsc_module_t super;

    /** cache of knem attachments. this cache holds attachments for all peers. the registrations
     * are differentiated by the alloc_base which is set to the endpoint. */
    mca_rcache_base_module_t *rcache;
};

typedef struct mca_smsc_knem_module_t mca_smsc_knem_module_t;

extern mca_smsc_knem_module_t mca_smsc_knem_module;
extern mca_smsc_knem_component_t mca_smsc_knem_component;

#endif /* OPAL_MCA_SMSC_KNEM_SMSC_KNEM_INTERNAL_H */