1 /* -*- Mode: C; c-basic-offset:4 ; indent-tabs-mode:nil -*- */
2 /*
3 * Copyright (c) 2004-2006 The Trustees of Indiana University and Indiana
4 * University Research and Technology
5 * Corporation. All rights reserved.
6 * Copyright (c) 2004-2007 The University of Tennessee and The University
7 * of Tennessee Research Foundation. All rights
8 * reserved.
9 * Copyright (c) 2004-2005 High Performance Computing Center Stuttgart,
10 * University of Stuttgart. All rights reserved.
11 * Copyright (c) 2004-2006 The Regents of the University of California.
12 * All rights reserved.
13 * Copyright (c) 2006 QLogic Corporation. All rights reserved.
14 * Copyright (c) 2011-2017 Los Alamos National Security, LLC. All rights
15 * reserved.
16 * Copyright (c) 2013-2015 Intel, Inc. All rights reserved
17 * $COPYRIGHT$
18 *
19 * Additional copyrights may follow
20 *
21 * $HEADER$
22 */
23
24 #ifndef MTL_PSM2_TYPES_H_HAS_BEEN_INCLUDED
25 #define MTL_PSM2_TYPES_H_HAS_BEEN_INCLUDED
26
27 #include "ompi_config.h"
28 #include "mtl_psm2.h"
29
30 #include "ompi/communicator/communicator.h"
31
32 #include "ompi/mca/mtl/mtl.h"
33 #include "ompi/mca/mtl/base/base.h"
34 #include "mtl_psm2_endpoint.h"
35
36 #include "psm2.h"
37
38
39 BEGIN_C_DECLS
40
41 /**
42 * MTL Module Interface
43 */
44 struct mca_mtl_psm2_module_t {
45 mca_mtl_base_module_t super; /**< base MTL interface */
46
47 int32_t connect_timeout;
48
49 psm2_ep_t ep;
50 psm2_mq_t mq;
51 psm2_epid_t epid;
52 psm2_epaddr_t epaddr;
53 char *psm2_devices;
54 char *psm2_memory;
55 unsigned long psm2_mq_sendreqs_max;
56 unsigned long psm2_mq_recvreqs_max;
57 unsigned long psm2_mq_rndv_hfi_threshold;
58 unsigned long psm2_mq_rndv_shm_threshold;
59 unsigned long psm2_max_contexts_per_job;
60 unsigned long psm2_tracemask;
61 bool psm2_recvthread;
62 bool psm2_shared_contexts;
63 unsigned long psm2_opa_sl;
64 };
65
66 typedef struct mca_mtl_psm2_module_t mca_mtl_psm2_module_t;
67
68 extern mca_mtl_psm2_module_t ompi_mtl_psm2;
69
70 struct mca_mtl_psm2_component_t {
71 mca_mtl_base_component_2_0_0_t super; /**< base MTL component */
72 };
73 typedef struct mca_mtl_psm2_component_t mca_mtl_psm2_component_t;
74
75 OMPI_DECLSPEC extern mca_mtl_psm2_component_t mca_mtl_psm2_component;
76
77 #define PSM2_MAKE_MQTAG(ctxt,rank,utag,tag) \
78 do { \
79 (tag).tag0 = utag; \
80 (tag).tag1 = rank; \
81 (tag).tag2 = ctxt; \
82 } while (0)
83
84 #define PSM2_MAKE_TAGSEL(user_rank, user_tag, user_ctxt, tag, _tagsel) \
85 do { \
86 (tag).tag0 = user_tag; \
87 (tag).tag1 = user_rank; \
88 (tag).tag2 = user_ctxt; \
89 (_tagsel).tag0 = 0xffffffffULL; \
90 (_tagsel).tag1 = 0xffffffffULL; \
91 (_tagsel).tag2 = 0xffffffffULL; \
92 if((user_tag) == MPI_ANY_TAG) \
93 { \
94 (_tagsel).tag0 = 0x80000000ULL; \
95 (tag).tag0 = 0x00000000ULL; \
96 } \
97 if((user_rank) == MPI_ANY_SOURCE) \
98 { \
99 (_tagsel).tag1 = 0x00000000ULL; \
100 } \
101 } while (0)
102
103 END_C_DECLS
104
105 #endif /* MTL_PSM2_TYPES_H_HAS_BEEN_INCLUDED */