10
10
* University of Stuttgart. All rights reserved.
11
11
* Copyright (c) 2004-2005 The Regents of the University of California.
12
12
* All rights reserved.
13
- * Copyright (c) 2014-2015 Los Alamos National Security, LLC. All rights
13
+ * Copyright (c) 2014-2016 Los Alamos National Security, LLC. All rights
14
14
* reserved.
15
15
* $COPYRIGHT$
16
16
*
@@ -42,6 +42,7 @@ size_t mca_pml_ob1_rdma_btls(
42
42
mca_pml_ob1_com_btl_t * rdma_btls )
43
43
{
44
44
int num_btls = mca_bml_base_btl_array_get_size (& bml_endpoint -> btl_rdma );
45
+ int num_eager_btls = mca_bml_base_btl_array_get_size (& bml_endpoint -> btl_eager );
45
46
double weight_total = 0 ;
46
47
int num_btls_used = 0 ;
47
48
@@ -57,6 +58,22 @@ size_t mca_pml_ob1_rdma_btls(
57
58
(bml_endpoint -> btl_rdma_index + n ) % num_btls );
58
59
mca_btl_base_registration_handle_t * reg_handle = NULL ;
59
60
mca_btl_base_module_t * btl = bml_btl -> btl ;
61
+ /* NTH: go ahead and use an rdma btl if is the only one */
62
+ bool ignore = !mca_pml_ob1 .use_all_rdma ;
63
+
64
+ /* do not use rdma btls that are not in the eager list. this is necessary to avoid using
65
+ * btls that exist on the endpoint only to support RMA. */
66
+ for (int i = 0 ; i < num_eager_btls && ignore ; ++ i ) {
67
+ mca_bml_base_btl_t * eager_btl = mca_bml_base_btl_array_get_index (& bml_endpoint -> btl_eager , i );
68
+ if (eager_btl -> btl_endpoint == bml_btl -> btl_endpoint ) {
69
+ ignore = false;
70
+ break ;
71
+ }
72
+ }
73
+
74
+ if (ignore ) {
75
+ continue ;
76
+ }
60
77
61
78
if (btl -> btl_register_mem ) {
62
79
/* do not use the RDMA protocol with this btl if 1) leave pinned is disabled,
@@ -95,22 +112,66 @@ size_t mca_pml_ob1_rdma_btls(
95
112
return num_btls_used ;
96
113
}
97
114
115
+ size_t mca_pml_ob1_rdma_pipeline_btls_count (mca_bml_base_endpoint_t * bml_endpoint )
116
+ {
117
+ int num_btls = mca_bml_base_btl_array_get_size (& bml_endpoint -> btl_rdma );
118
+ int num_eager_btls = mca_bml_base_btl_array_get_size (& bml_endpoint -> btl_eager );
119
+ int rdma_count = 0 ;
120
+
121
+ for (int i = 0 ; i < num_btls && i < mca_pml_ob1 .max_rdma_per_request ; ++ i ) {
122
+ mca_bml_base_btl_t * bml_btl = mca_bml_base_btl_array_get_next (& bml_endpoint -> btl_rdma );
123
+ /* NTH: go ahead and use an rdma btl if is the only one */
124
+ bool ignore = !mca_pml_ob1 .use_all_rdma ;
125
+
126
+ for (int i = 0 ; i < num_eager_btls && ignore ; ++ i ) {
127
+ mca_bml_base_btl_t * eager_btl = mca_bml_base_btl_array_get_index (& bml_endpoint -> btl_eager , i );
128
+ if (eager_btl -> btl_endpoint == bml_btl -> btl_endpoint ) {
129
+ ignore = false;
130
+ break ;
131
+ }
132
+ }
133
+
134
+ if (!ignore ) {
135
+ ++ rdma_count ;
136
+ }
137
+ }
138
+
139
+ return rdma_count ;
140
+ }
141
+
98
142
size_t mca_pml_ob1_rdma_pipeline_btls ( mca_bml_base_endpoint_t * bml_endpoint ,
99
143
size_t size ,
100
144
mca_pml_ob1_com_btl_t * rdma_btls )
101
145
{
102
- int i , num_btls = mca_bml_base_btl_array_get_size (& bml_endpoint -> btl_rdma );
146
+ int num_btls = mca_bml_base_btl_array_get_size (& bml_endpoint -> btl_rdma );
147
+ int num_eager_btls = mca_bml_base_btl_array_get_size (& bml_endpoint -> btl_eager );
103
148
double weight_total = 0 ;
149
+ int rdma_count = 0 ;
150
+
151
+ for (int i = 0 ; i < num_btls && i < mca_pml_ob1 .max_rdma_per_request ; i ++ ) {
152
+ mca_bml_base_btl_t * bml_btl = mca_bml_base_btl_array_get_next (& bml_endpoint -> btl_rdma );
153
+ /* NTH: go ahead and use an rdma btl if is the only one */
154
+ bool ignore = !mca_pml_ob1 .use_all_rdma ;
155
+
156
+ for (int i = 0 ; i < num_eager_btls && ignore ; ++ i ) {
157
+ mca_bml_base_btl_t * eager_btl = mca_bml_base_btl_array_get_index (& bml_endpoint -> btl_eager , i );
158
+ if (eager_btl -> btl_endpoint == bml_btl -> btl_endpoint ) {
159
+ ignore = false;
160
+ break ;
161
+ }
162
+ }
163
+
164
+ if (ignore ) {
165
+ continue ;
166
+ }
104
167
105
- for (i = 0 ; i < num_btls && i < mca_pml_ob1 .max_rdma_per_request ; i ++ ) {
106
- rdma_btls [i ].bml_btl =
107
- mca_bml_base_btl_array_get_next (& bml_endpoint -> btl_rdma );
108
- rdma_btls [i ].btl_reg = NULL ;
168
+ rdma_btls [rdma_count ].bml_btl = bml_btl ;
169
+ rdma_btls [rdma_count ++ ].btl_reg = NULL ;
109
170
110
- weight_total += rdma_btls [ i ]. bml_btl -> btl_weight ;
171
+ weight_total += bml_btl -> btl_weight ;
111
172
}
112
173
113
- mca_pml_ob1_calc_weighted_length (rdma_btls , i , size , weight_total );
174
+ mca_pml_ob1_calc_weighted_length (rdma_btls , rdma_count , size , weight_total );
114
175
115
- return i ;
176
+ return rdma_count ;
116
177
}
0 commit comments