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 };
54 
55 typedef struct mca_mtl_psm2_module_t mca_mtl_psm2_module_t;
56 
57 extern mca_mtl_psm2_module_t ompi_mtl_psm2;
58 
59 struct mca_mtl_psm2_component_t {
60     mca_mtl_base_component_2_0_0_t          super;  /**< base MTL component */
61 };
62 typedef struct mca_mtl_psm2_component_t mca_mtl_psm2_component_t;
63 
64 OMPI_DECLSPEC extern mca_mtl_psm2_component_t mca_mtl_psm2_component;
65 
66 #define PSM2_MAKE_MQTAG(ctxt,rank,utag,tag) \
67     do {                                    \
68       (tag).tag0 = utag;                    \
69       (tag).tag1 = rank;                    \
70       (tag).tag2 = ctxt;                    \
71     } while (0)
72 
73 #define PSM2_MAKE_TAGSEL(user_rank, user_tag, user_ctxt, tag, _tagsel)  \
74 	do {								\
75         (tag).tag0 = user_tag;                                          \
76         (tag).tag1 = user_rank;                                         \
77         (tag).tag2 = user_ctxt;                                         \
78         (_tagsel).tag0 = 0xffffffffULL;                                 \
79         (_tagsel).tag1 = 0xffffffffULL;                                 \
80         (_tagsel).tag2 = 0xffffffffULL;                                 \
81         if((user_tag) == MPI_ANY_TAG)                                   \
82         {                                                               \
83             (_tagsel).tag0 = 0x80000000ULL;                             \
84             (tag).tag0 = 0x00000000ULL;                                 \
85         }                                                               \
86         if((user_rank) == MPI_ANY_SOURCE)                               \
87         {                                                               \
88             (_tagsel).tag1 = 0x00000000ULL;                             \
89         }                                                               \
90     } while (0)
91 
92 END_C_DECLS
93 
94 #endif  /* MTL_PSM2_TYPES_H_HAS_BEEN_INCLUDED */
95