Skip to content
This repository was archived by the owner on Sep 30, 2022. It is now read-only.

Commit e06a77e

Browse files
committed
mtl/portals4: Some little patches
1 parent 1b03546 commit e06a77e

File tree

4 files changed

+31
-23
lines changed

4 files changed

+31
-23
lines changed

ompi/mca/mtl/portals4/mtl_portals4.h

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -42,23 +42,23 @@ struct mca_mtl_portals4_module_t {
4242
mca_mtl_base_module_t base;
4343

4444
/* add_procs() can get called multiple times. this prevents multiple calls to portals4_init_interface(). */
45-
int need_init;
45+
int32_t need_init;
4646

4747
/* Use the logical to physical table to accelerate portals4 adressing: 1 (true) : 0 (false) */
48-
int use_logical;
48+
int32_t use_logical;
4949
/* Use flow control: 1 (true) : 0 (false) */
50-
int use_flowctl;
50+
int32_t use_flowctl;
5151

5252
/** Eager limit; messages greater than this use a rendezvous protocol */
53-
unsigned long long eager_limit;
53+
uint64_t eager_limit;
5454
/** Size of short message blocks */
55-
unsigned long long recv_short_size;
55+
uint64_t recv_short_size;
5656
/** Number of short message blocks which should be created during startup */
57-
int recv_short_num;
57+
uint32_t recv_short_num;
5858
/** Length of the send event queues */
59-
int send_queue_size;
59+
uint32_t send_queue_size;
6060
/** Length of the receive event queues */
61-
int recv_queue_size;
61+
uint32_t recv_queue_size;
6262
/** Protocol for long message transfer */
6363
enum { eager, rndv } protocol;
6464

ompi/mca/mtl/portals4/mtl_portals4_component.c

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -224,7 +224,7 @@ ompi_mtl_portals4_component_open(void)
224224
ompi_mtl_portals4.send_eq_h = PTL_INVALID_HANDLE;
225225
ompi_mtl_portals4.recv_eq_h = PTL_INVALID_HANDLE;
226226
ompi_mtl_portals4.zero_md_h = PTL_INVALID_HANDLE;
227-
227+
ompi_mtl_portals4.send_md_h = PTL_INVALID_HANDLE;
228228
ompi_mtl_portals4.long_overflow_me_h = PTL_INVALID_HANDLE;
229229
ompi_mtl_portals4.recv_idx = (ptl_pt_index_t) ~0UL;
230230
ompi_mtl_portals4.read_idx = (ptl_pt_index_t) ~0UL;
@@ -364,6 +364,7 @@ ompi_mtl_portals4_component_init(bool enable_progress_threads,
364364
"My nid,pid = %x,%x",
365365
id.phys.nid, id.phys.pid));
366366

367+
ompi_mtl_portals4.base.mtl_max_tag = MTL_PORTALS4_MAX_TAG;
367368
return &ompi_mtl_portals4.base;
368369

369370
error:

ompi/mca/mtl/portals4/mtl_portals4_recv.c

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -91,6 +91,7 @@ ompi_mtl_portals4_recv_progress(ptl_event_t *ev,
9191
opal_output_verbose(1, ompi_mtl_base_framework.framework_output,
9292
"%s:%d: PTL_EVENT_PUT with ni_fail_type: %d",
9393
__FILE__, __LINE__, ev->ni_fail_type);
94+
ret = PTL_FAIL;
9495
goto callback_error;
9596
}
9697

@@ -118,7 +119,7 @@ ompi_mtl_portals4_recv_progress(ptl_event_t *ev,
118119
to pull the second part of the message. */
119120
ret = read_msg((char*) ptl_request->delivery_ptr + ompi_mtl_portals4.eager_limit,
120121
((msg_length > ptl_request->delivery_len) ?
121-
ptl_request->delivery_len : msg_length) - ompi_mtl_portals4.eager_limit,
122+
ptl_request->delivery_len : msg_length) - ompi_mtl_portals4.eager_limit,
122123
ev->initiator,
123124
ev->hdr_data,
124125
ompi_mtl_portals4.eager_limit,
@@ -159,6 +160,7 @@ ompi_mtl_portals4_recv_progress(ptl_event_t *ev,
159160
opal_output_verbose(1, ompi_mtl_base_framework.framework_output,
160161
"%s:%d: PTL_EVENT_REPLY with ni_fail_type: %d",
161162
__FILE__, __LINE__, ev->ni_fail_type);
163+
ret = PTL_FAIL;
162164
goto callback_error;
163165
}
164166

@@ -204,6 +206,7 @@ ompi_mtl_portals4_recv_progress(ptl_event_t *ev,
204206
opal_output_verbose(1, ompi_mtl_base_framework.framework_output,
205207
"%s:%d: PTL_EVENT_PUT_OVERFLOW with ni_fail_type: %d",
206208
__FILE__, __LINE__, ev->ni_fail_type);
209+
ret = PTL_FAIL;
207210
goto callback_error;
208211
}
209212

@@ -285,7 +288,7 @@ ompi_mtl_portals4_recv_progress(ptl_event_t *ev,
285288

286289
ret = read_msg((char*) ptl_request->delivery_ptr + ev->mlength,
287290
((msg_length > ptl_request->delivery_len) ?
288-
ptl_request->delivery_len : msg_length) - ev->mlength,
291+
ptl_request->delivery_len : msg_length) - ev->mlength,
289292
ev->initiator,
290293
ev->hdr_data,
291294
ev->mlength,

ompi/mca/mtl/portals4/mtl_portals4_recv_short.c

Lines changed: 16 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -37,6 +37,7 @@ static int
3737
ompi_mtl_portals4_recv_block_progress(ptl_event_t *ev,
3838
ompi_mtl_portals4_base_request_t* ptl_base_request)
3939
{
40+
int ret = OMPI_SUCCESS;
4041
ompi_mtl_portals4_recv_short_request_t *ptl_request =
4142
(ompi_mtl_portals4_recv_short_request_t*) ptl_base_request;
4243
ompi_mtl_portals4_recv_short_block_t *block = ptl_request->block;
@@ -59,10 +60,10 @@ ompi_mtl_portals4_recv_block_progress(ptl_event_t *ev,
5960
opal_list_remove_item(&ompi_mtl_portals4.recv_short_blocks,
6061
&block->base);
6162
OPAL_THREAD_UNLOCK(&ompi_mtl_portals4.short_block_mutex);
62-
ompi_mtl_portals4_recv_short_block_free(block);
63+
ret = ompi_mtl_portals4_recv_short_block_free(block);
6364
} else {
6465
OPAL_THREAD_UNLOCK(&ompi_mtl_portals4.short_block_mutex);
65-
ompi_mtl_portals4_activate_block(block);
66+
ret = ompi_mtl_portals4_activate_block(block);
6667
}
6768
break;
6869

@@ -99,12 +100,12 @@ ompi_mtl_portals4_recv_block_progress(ptl_event_t *ev,
99100
opal_list_remove_item(&ompi_mtl_portals4.recv_short_blocks,
100101
&block->base);
101102
OPAL_THREAD_UNLOCK(&ompi_mtl_portals4.short_block_mutex);
102-
ompi_mtl_portals4_recv_short_block_free(block);
103+
ret = ompi_mtl_portals4_recv_short_block_free(block);
103104
} else {
104105
OPAL_THREAD_UNLOCK(&ompi_mtl_portals4.short_block_mutex);
105106
OPAL_OUTPUT_VERBOSE((10, ompi_mtl_base_framework.framework_output,
106107
"mtl:portals4 PTL_EVENT_AUTO_UNLINK received after PTL_EVENT_AUTO_FREE"));
107-
ompi_mtl_portals4_activate_block(block);
108+
ret = ompi_mtl_portals4_activate_block(block);
108109
}
109110
break;
110111

@@ -150,7 +151,7 @@ ompi_mtl_portals4_recv_block_progress(ptl_event_t *ev,
150151
break;
151152
}
152153

153-
return OMPI_SUCCESS;
154+
return ret;
154155
}
155156

156157

@@ -244,7 +245,8 @@ ompi_mtl_portals4_activate_block(ompi_mtl_portals4_recv_short_block_t *block)
244245
int
245246
ompi_mtl_portals4_recv_short_init(void)
246247
{
247-
int i;
248+
int ret = OMPI_SUCCESS;
249+
uint32_t i;
248250

249251
OBJ_CONSTRUCT(&ompi_mtl_portals4.short_block_mutex, opal_mutex_t);
250252
OBJ_CONSTRUCT(&(ompi_mtl_portals4.recv_short_blocks), opal_list_t);
@@ -258,33 +260,35 @@ ompi_mtl_portals4_recv_short_init(void)
258260
}
259261
opal_list_append(&ompi_mtl_portals4.recv_short_blocks,
260262
&block->base);
261-
ompi_mtl_portals4_activate_block(block);
263+
ret = ompi_mtl_portals4_activate_block(block);
262264
}
263265

264-
return OMPI_SUCCESS;
266+
return ret;
265267
}
266268

267269

268270
int
269271
ompi_mtl_portals4_recv_short_fini(void)
270272
{
271273
opal_list_item_t *item;
274+
int ret = OMPI_SUCCESS;
272275

273276
OPAL_THREAD_LOCK(&ompi_mtl_portals4.short_block_mutex);
274277
while (NULL != (item = opal_list_remove_first(&ompi_mtl_portals4.recv_short_blocks))) {
275278
ompi_mtl_portals4_recv_short_block_t *block =
276279
(ompi_mtl_portals4_recv_short_block_t*) item;
277-
ompi_mtl_portals4_recv_short_block_free(block);
280+
ret = ompi_mtl_portals4_recv_short_block_free(block);
278281
}
279282
OPAL_THREAD_UNLOCK(&ompi_mtl_portals4.short_block_mutex);
280283

281-
return OMPI_SUCCESS;
284+
return ret;
282285
}
283286

284287

285288
int
286289
ompi_mtl_portals4_recv_short_link(int count)
287290
{
291+
int ret = OMPI_SUCCESS;
288292
int active = ompi_mtl_portals4.active_recv_short_blocks;
289293
int i;
290294

@@ -295,9 +299,9 @@ ompi_mtl_portals4_recv_short_link(int count)
295299
if (NULL == block) {
296300
return OMPI_ERR_OUT_OF_RESOURCE;
297301
}
298-
ompi_mtl_portals4_activate_block(block);
302+
ret = ompi_mtl_portals4_activate_block(block);
299303
}
300304
}
301305

302-
return OMPI_SUCCESS;
306+
return ret;
303307
}

0 commit comments

Comments
 (0)