OpenMPI 0.1.1

- Main Page
- Related Pages
- Modules
- Data Structures
- Files

- File List
- Globals

btl_vader_frag.h
1 /* -*- Mode: C; c-basic-offset:4 ; indent-tabs-mode:nil -*- */
2 /*
3 * Copyright (c) 2004-2005 The Trustees of Indiana University and Indiana
4 * University Research and Technology
5 * Corporation. All rights reserved.
6 * Copyright (c) 2004-2009 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-2005 The Regents of the University of California.
12 * All rights reserved.
13 * Copyright (c) 2008 Sun Microsystems, Inc. All rights reserved.
14 * Copyright (c) 2009 Cisco Systems, Inc. All rights reserved.
15 * Copyright (c) 2011-2012 Los Alamos National Security, LLC. All rights
16 * reserved.
17 * $COPYRIGHT$
18 *
19 * Additional copyrights may follow
20 *
21 * $HEADER$
22 */
23
24 #ifndef MCA_BTL_VADER_SEND_FRAG_H
25 #define MCA_BTL_VADER_SEND_FRAG_H
26
27 #include "ompi_config.h"
28
29 #define MCA_BTL_VADER_FLAG_INLINE 0
30 #define MCA_BTL_VADER_FLAG_SINGLE_COPY 1
31 #define MCA_BTL_VADER_FLAG_FBOX 2
32
33 struct mca_btl_vader_hdr_t {
34 volatile intptr_t next; /* next item in fifo. many peers may touch this */
35 volatile bool complete; /* fragment completion (usually 1 byte) */
36 mca_btl_base_tag_t tag; /* tag associated with this fragment (used to lookup callback) */
37 char pad[2];
38 int flags; /* vader send flags */
39 int my_smp_rank; /* smp rank of owning process */
40 size_t len; /* length of data following this header */
41 };
42 typedef struct mca_btl_vader_hdr_t mca_btl_vader_hdr_t;
43
44 /**
45 * shared memory send fragment derived type.
46 */
47 struct mca_btl_vader_frag_t {
48 mca_btl_base_descriptor_t base;
49 mca_btl_base_segment_t segment;
50 struct mca_btl_base_endpoint_t *endpoint;
51 mca_btl_vader_hdr_t *hdr; /* in the shared memory region */
52 ompi_free_list_t *my_list;
53 };
54
55 typedef struct mca_btl_vader_frag_t mca_btl_vader_frag_t;
56
57 OBJ_CLASS_DECLARATION(mca_btl_vader_frag_t);
58
59 static inline int mca_btl_vader_frag_alloc (mca_btl_vader_frag_t **frag, ompi_free_list_t *list) {
60 ompi_free_list_item_t *item;
61 int rc;
62
63 OMPI_FREE_LIST_GET(list, item, rc);
64 *frag = (mca_btl_vader_frag_t *) item;
65 if (OPAL_LIKELY(NULL != item)) {
66 (*frag)->hdr->complete = false;
67 (*frag)->hdr->flags = MCA_BTL_VADER_FLAG_INLINE;
68 (*frag)->segment.seg_addr.pval = (char *)((*frag)->hdr + 1);
69 (*frag)->my_list = list;
70 }
71
72 return rc;
73 }
74
75 #define MCA_BTL_VADER_FRAG_ALLOC_EAGER(frag) \
76 mca_btl_vader_frag_alloc (&(frag), &mca_btl_vader_component.vader_frags_eager)
77 #define MCA_BTL_VADER_FRAG_ALLOC_USER(frag) \
78 mca_btl_vader_frag_alloc (&(frag), &mca_btl_vader_component.vader_frags_user)
79 #define MCA_BTL_VADER_FRAG_RETURN(frag) \
80 OMPI_FREE_LIST_RETURN((frag)->my_list, (ompi_free_list_item_t *)(frag))
81
82 static inline void mca_btl_vader_frag_complete (mca_btl_vader_frag_t *frag) {
83 if (OPAL_UNLIKELY(MCA_BTL_DES_SEND_ALWAYS_CALLBACK & frag->base.des_flags)) {
84 /* completion callback */
85 frag->base.des_cbfunc(&mca_btl_vader.super, frag->endpoint,
86 &frag->base, OMPI_SUCCESS);
87 }
88
89 if (OPAL_LIKELY(frag->base.des_flags & MCA_BTL_DES_FLAGS_BTL_OWNERSHIP)) {
90 MCA_BTL_VADER_FRAG_RETURN(frag);
91 }
92 }
93
94 #endif /* MCA_BTL_VADER_SEND_FRAG_H */
mca_btl_base_descriptor_t
A descriptor that holds the parameters to a send/put/get operation along w/ a callback routine that i...
Definition: btl.h:275
mca_btl_base_descriptor_t::des_flags
uint32_t des_flags
hints to BTL
Definition: btl.h:284
mca_btl_vader_t::super
mca_btl_base_module_t super
base BTL interface
Definition: btl_vader.h:133
mca_btl_vader_hdr_t
Definition: btl_vader_frag.h:33
mca_btl_vader_frag_t
shared memory send fragment derived type.
Definition: btl_vader_frag.h:47
ompi_free_list_t
Definition: ompi_free_list.h:39
mca_btl_base_endpoint_t
State of ELAN endpoint connection.
Definition: btl_elan_endpoint.h:33
ompi_free_list_item_t
Definition: ompi_free_list.h:62
mca_btl_base_descriptor_t::des_cbfunc
mca_btl_base_completion_fn_t des_cbfunc
local callback function
Definition: btl.h:281
mca_btl_base_segment_t
Describes a region/segment of memory that is addressable by an BTL.
Definition: btl.h:236
OBJ_CLASS_DECLARATION
#define OBJ_CLASS_DECLARATION(NAME)
Declaration for class descriptor.
Definition: opal_object.h:236