1
1

mtl/portals4: Some little patches

Этот коммит содержится в:
Pascal Deveze 2016-07-05 13:08:35 +02:00
родитель b87ed1ad4a
Коммит 49e9936914
4 изменённых файлов: 31 добавлений и 23 удалений

Просмотреть файл

@ -42,23 +42,23 @@ struct mca_mtl_portals4_module_t {
mca_mtl_base_module_t base; mca_mtl_base_module_t base;
/* add_procs() can get called multiple times. this prevents multiple calls to portals4_init_interface(). */ /* add_procs() can get called multiple times. this prevents multiple calls to portals4_init_interface(). */
int need_init; int32_t need_init;
/* Use the logical to physical table to accelerate portals4 adressing: 1 (true) : 0 (false) */ /* Use the logical to physical table to accelerate portals4 adressing: 1 (true) : 0 (false) */
int use_logical; int32_t use_logical;
/* Use flow control: 1 (true) : 0 (false) */ /* Use flow control: 1 (true) : 0 (false) */
int use_flowctl; int32_t use_flowctl;
/** Eager limit; messages greater than this use a rendezvous protocol */ /** Eager limit; messages greater than this use a rendezvous protocol */
unsigned long long eager_limit; uint64_t eager_limit;
/** Size of short message blocks */ /** Size of short message blocks */
unsigned long long recv_short_size; uint64_t recv_short_size;
/** Number of short message blocks which should be created during startup */ /** Number of short message blocks which should be created during startup */
int recv_short_num; uint32_t recv_short_num;
/** Length of the send event queues */ /** Length of the send event queues */
int send_queue_size; uint32_t send_queue_size;
/** Length of the receive event queues */ /** Length of the receive event queues */
int recv_queue_size; uint32_t recv_queue_size;
/** Protocol for long message transfer */ /** Protocol for long message transfer */
enum { eager, rndv } protocol; enum { eager, rndv } protocol;

Просмотреть файл

@ -224,7 +224,7 @@ ompi_mtl_portals4_component_open(void)
ompi_mtl_portals4.send_eq_h = PTL_INVALID_HANDLE; ompi_mtl_portals4.send_eq_h = PTL_INVALID_HANDLE;
ompi_mtl_portals4.recv_eq_h = PTL_INVALID_HANDLE; ompi_mtl_portals4.recv_eq_h = PTL_INVALID_HANDLE;
ompi_mtl_portals4.zero_md_h = PTL_INVALID_HANDLE; ompi_mtl_portals4.zero_md_h = PTL_INVALID_HANDLE;
ompi_mtl_portals4.send_md_h = PTL_INVALID_HANDLE;
ompi_mtl_portals4.long_overflow_me_h = PTL_INVALID_HANDLE; ompi_mtl_portals4.long_overflow_me_h = PTL_INVALID_HANDLE;
ompi_mtl_portals4.recv_idx = (ptl_pt_index_t) ~0UL; ompi_mtl_portals4.recv_idx = (ptl_pt_index_t) ~0UL;
ompi_mtl_portals4.read_idx = (ptl_pt_index_t) ~0UL; ompi_mtl_portals4.read_idx = (ptl_pt_index_t) ~0UL;
@ -364,6 +364,7 @@ ompi_mtl_portals4_component_init(bool enable_progress_threads,
"My nid,pid = %x,%x", "My nid,pid = %x,%x",
id.phys.nid, id.phys.pid)); id.phys.nid, id.phys.pid));
ompi_mtl_portals4.base.mtl_max_tag = MTL_PORTALS4_MAX_TAG;
return &ompi_mtl_portals4.base; return &ompi_mtl_portals4.base;
error: error:

Просмотреть файл

@ -91,6 +91,7 @@ ompi_mtl_portals4_recv_progress(ptl_event_t *ev,
opal_output_verbose(1, ompi_mtl_base_framework.framework_output, opal_output_verbose(1, ompi_mtl_base_framework.framework_output,
"%s:%d: PTL_EVENT_PUT with ni_fail_type: %d", "%s:%d: PTL_EVENT_PUT with ni_fail_type: %d",
__FILE__, __LINE__, ev->ni_fail_type); __FILE__, __LINE__, ev->ni_fail_type);
ret = PTL_FAIL;
goto callback_error; goto callback_error;
} }
@ -118,7 +119,7 @@ ompi_mtl_portals4_recv_progress(ptl_event_t *ev,
to pull the second part of the message. */ to pull the second part of the message. */
ret = read_msg((char*) ptl_request->delivery_ptr + ompi_mtl_portals4.eager_limit, ret = read_msg((char*) ptl_request->delivery_ptr + ompi_mtl_portals4.eager_limit,
((msg_length > ptl_request->delivery_len) ? ((msg_length > ptl_request->delivery_len) ?
ptl_request->delivery_len : msg_length) - ompi_mtl_portals4.eager_limit, ptl_request->delivery_len : msg_length) - ompi_mtl_portals4.eager_limit,
ev->initiator, ev->initiator,
ev->hdr_data, ev->hdr_data,
ompi_mtl_portals4.eager_limit, ompi_mtl_portals4.eager_limit,
@ -159,6 +160,7 @@ ompi_mtl_portals4_recv_progress(ptl_event_t *ev,
opal_output_verbose(1, ompi_mtl_base_framework.framework_output, opal_output_verbose(1, ompi_mtl_base_framework.framework_output,
"%s:%d: PTL_EVENT_REPLY with ni_fail_type: %d", "%s:%d: PTL_EVENT_REPLY with ni_fail_type: %d",
__FILE__, __LINE__, ev->ni_fail_type); __FILE__, __LINE__, ev->ni_fail_type);
ret = PTL_FAIL;
goto callback_error; goto callback_error;
} }
@ -204,6 +206,7 @@ ompi_mtl_portals4_recv_progress(ptl_event_t *ev,
opal_output_verbose(1, ompi_mtl_base_framework.framework_output, opal_output_verbose(1, ompi_mtl_base_framework.framework_output,
"%s:%d: PTL_EVENT_PUT_OVERFLOW with ni_fail_type: %d", "%s:%d: PTL_EVENT_PUT_OVERFLOW with ni_fail_type: %d",
__FILE__, __LINE__, ev->ni_fail_type); __FILE__, __LINE__, ev->ni_fail_type);
ret = PTL_FAIL;
goto callback_error; goto callback_error;
} }
@ -285,7 +288,7 @@ ompi_mtl_portals4_recv_progress(ptl_event_t *ev,
ret = read_msg((char*) ptl_request->delivery_ptr + ev->mlength, ret = read_msg((char*) ptl_request->delivery_ptr + ev->mlength,
((msg_length > ptl_request->delivery_len) ? ((msg_length > ptl_request->delivery_len) ?
ptl_request->delivery_len : msg_length) - ev->mlength, ptl_request->delivery_len : msg_length) - ev->mlength,
ev->initiator, ev->initiator,
ev->hdr_data, ev->hdr_data,
ev->mlength, ev->mlength,

Просмотреть файл

@ -37,6 +37,7 @@ static int
ompi_mtl_portals4_recv_block_progress(ptl_event_t *ev, ompi_mtl_portals4_recv_block_progress(ptl_event_t *ev,
ompi_mtl_portals4_base_request_t* ptl_base_request) ompi_mtl_portals4_base_request_t* ptl_base_request)
{ {
int ret = OMPI_SUCCESS;
ompi_mtl_portals4_recv_short_request_t *ptl_request = ompi_mtl_portals4_recv_short_request_t *ptl_request =
(ompi_mtl_portals4_recv_short_request_t*) ptl_base_request; (ompi_mtl_portals4_recv_short_request_t*) ptl_base_request;
ompi_mtl_portals4_recv_short_block_t *block = ptl_request->block; ompi_mtl_portals4_recv_short_block_t *block = ptl_request->block;
@ -58,10 +59,10 @@ ompi_mtl_portals4_recv_block_progress(ptl_event_t *ev,
opal_list_remove_item(&ompi_mtl_portals4.recv_short_blocks, opal_list_remove_item(&ompi_mtl_portals4.recv_short_blocks,
&block->base); &block->base);
OPAL_THREAD_UNLOCK(&ompi_mtl_portals4.short_block_mutex); OPAL_THREAD_UNLOCK(&ompi_mtl_portals4.short_block_mutex);
ompi_mtl_portals4_recv_short_block_free(block); ret = ompi_mtl_portals4_recv_short_block_free(block);
} else { } else {
OPAL_THREAD_UNLOCK(&ompi_mtl_portals4.short_block_mutex); OPAL_THREAD_UNLOCK(&ompi_mtl_portals4.short_block_mutex);
ompi_mtl_portals4_activate_block(block); ret = ompi_mtl_portals4_activate_block(block);
} }
break; break;
@ -89,12 +90,12 @@ ompi_mtl_portals4_recv_block_progress(ptl_event_t *ev,
opal_list_remove_item(&ompi_mtl_portals4.recv_short_blocks, opal_list_remove_item(&ompi_mtl_portals4.recv_short_blocks,
&block->base); &block->base);
OPAL_THREAD_UNLOCK(&ompi_mtl_portals4.short_block_mutex); OPAL_THREAD_UNLOCK(&ompi_mtl_portals4.short_block_mutex);
ompi_mtl_portals4_recv_short_block_free(block); ret = ompi_mtl_portals4_recv_short_block_free(block);
} else { } else {
OPAL_THREAD_UNLOCK(&ompi_mtl_portals4.short_block_mutex); OPAL_THREAD_UNLOCK(&ompi_mtl_portals4.short_block_mutex);
OPAL_OUTPUT_VERBOSE((10, ompi_mtl_base_framework.framework_output, OPAL_OUTPUT_VERBOSE((10, ompi_mtl_base_framework.framework_output,
"mtl:portals4 PTL_EVENT_AUTO_UNLINK received after PTL_EVENT_AUTO_FREE")); "mtl:portals4 PTL_EVENT_AUTO_UNLINK received after PTL_EVENT_AUTO_FREE"));
ompi_mtl_portals4_activate_block(block); ret = ompi_mtl_portals4_activate_block(block);
} }
break; break;
@ -133,7 +134,7 @@ ompi_mtl_portals4_recv_block_progress(ptl_event_t *ev,
break; break;
} }
return OMPI_SUCCESS; return ret;
} }
@ -227,7 +228,8 @@ ompi_mtl_portals4_activate_block(ompi_mtl_portals4_recv_short_block_t *block)
int int
ompi_mtl_portals4_recv_short_init(void) ompi_mtl_portals4_recv_short_init(void)
{ {
int i; int ret = OMPI_SUCCESS;
uint32_t i;
OBJ_CONSTRUCT(&ompi_mtl_portals4.short_block_mutex, opal_mutex_t); OBJ_CONSTRUCT(&ompi_mtl_portals4.short_block_mutex, opal_mutex_t);
OBJ_CONSTRUCT(&(ompi_mtl_portals4.recv_short_blocks), opal_list_t); OBJ_CONSTRUCT(&(ompi_mtl_portals4.recv_short_blocks), opal_list_t);
@ -241,10 +243,10 @@ ompi_mtl_portals4_recv_short_init(void)
} }
opal_list_append(&ompi_mtl_portals4.recv_short_blocks, opal_list_append(&ompi_mtl_portals4.recv_short_blocks,
&block->base); &block->base);
ompi_mtl_portals4_activate_block(block); ret = ompi_mtl_portals4_activate_block(block);
} }
return OMPI_SUCCESS; return ret;
} }
@ -252,22 +254,24 @@ int
ompi_mtl_portals4_recv_short_fini(void) ompi_mtl_portals4_recv_short_fini(void)
{ {
opal_list_item_t *item; opal_list_item_t *item;
int ret = OMPI_SUCCESS;
OPAL_THREAD_LOCK(&ompi_mtl_portals4.short_block_mutex); OPAL_THREAD_LOCK(&ompi_mtl_portals4.short_block_mutex);
while (NULL != (item = opal_list_remove_first(&ompi_mtl_portals4.recv_short_blocks))) { while (NULL != (item = opal_list_remove_first(&ompi_mtl_portals4.recv_short_blocks))) {
ompi_mtl_portals4_recv_short_block_t *block = ompi_mtl_portals4_recv_short_block_t *block =
(ompi_mtl_portals4_recv_short_block_t*) item; (ompi_mtl_portals4_recv_short_block_t*) item;
ompi_mtl_portals4_recv_short_block_free(block); ret = ompi_mtl_portals4_recv_short_block_free(block);
} }
OPAL_THREAD_UNLOCK(&ompi_mtl_portals4.short_block_mutex); OPAL_THREAD_UNLOCK(&ompi_mtl_portals4.short_block_mutex);
return OMPI_SUCCESS; return ret;
} }
int int
ompi_mtl_portals4_recv_short_link(int count) ompi_mtl_portals4_recv_short_link(int count)
{ {
int ret = OMPI_SUCCESS;
int active = ompi_mtl_portals4.active_recv_short_blocks; int active = ompi_mtl_portals4.active_recv_short_blocks;
int i; int i;
@ -278,9 +282,9 @@ ompi_mtl_portals4_recv_short_link(int count)
if (NULL == block) { if (NULL == block) {
return OMPI_ERR_OUT_OF_RESOURCE; return OMPI_ERR_OUT_OF_RESOURCE;
} }
ompi_mtl_portals4_activate_block(block); ret = ompi_mtl_portals4_activate_block(block);
} }
} }
return OMPI_SUCCESS; return ret;
} }