Distinguish between success/failure and the number of requests
progressed This commit was SVN r4212.
Этот коммит содержится в:
родитель
ba3016bc1e
Коммит
6362a63459
@ -157,9 +157,9 @@ int mca_io_base_component_del(mca_io_base_components_t *comp)
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
int mca_io_base_progress(void)
|
int mca_io_base_progress(int *num_pending)
|
||||||
{
|
{
|
||||||
int ret, count = 0;
|
int ret;
|
||||||
ompi_list_item_t *item;
|
ompi_list_item_t *item;
|
||||||
component_item_t *citem;
|
component_item_t *citem;
|
||||||
|
|
||||||
@ -173,25 +173,23 @@ int mca_io_base_progress(void)
|
|||||||
item = ompi_list_get_next(item)) {
|
item = ompi_list_get_next(item)) {
|
||||||
citem = (component_item_t *) item;
|
citem = (component_item_t *) item;
|
||||||
|
|
||||||
switch(citem->version) {
|
switch (citem->version) {
|
||||||
case MCA_IO_BASE_V_1_0_0:
|
case MCA_IO_BASE_V_1_0_0:
|
||||||
ret = citem->component.v1_0_0.io_progress();
|
ret = citem->component.v1_0_0.io_progress(num_pending);
|
||||||
|
if (OMPI_SUCCESS != ret) {
|
||||||
|
OMPI_THREAD_UNLOCK(&mutex);
|
||||||
|
return ret;
|
||||||
|
}
|
||||||
break;
|
break;
|
||||||
default:
|
|
||||||
ret = -1;
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
|
|
||||||
if (ret > 0) {
|
default:
|
||||||
count += ret;
|
break;
|
||||||
} else {
|
|
||||||
return ret;
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
OMPI_THREAD_UNLOCK(&mutex);
|
OMPI_THREAD_UNLOCK(&mutex);
|
||||||
|
|
||||||
return count;
|
return OMPI_SUCCESS;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
@ -44,7 +44,7 @@ union mca_io_base_modules_t;
|
|||||||
/**
|
/**
|
||||||
* External progress function; invoked from ompi_progress()
|
* External progress function; invoked from ompi_progress()
|
||||||
*/
|
*/
|
||||||
int mca_io_base_progress(void);
|
int mca_io_base_progress(int *num_requests);
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@ -102,7 +102,7 @@ typedef int (*mca_io_base_component_file_delete_unselect_fn_t)
|
|||||||
(char *filename, struct ompi_info_t *info,
|
(char *filename, struct ompi_info_t *info,
|
||||||
struct mca_io_base_delete_t *private_data);
|
struct mca_io_base_delete_t *private_data);
|
||||||
|
|
||||||
typedef int (*mca_io_base_component_progress_fn_t)(void);
|
typedef int (*mca_io_base_component_progress_fn_t)(int *num_pending);
|
||||||
|
|
||||||
/* IO component version and interface functions. */
|
/* IO component version and interface functions. */
|
||||||
struct mca_io_base_component_1_0_0_t {
|
struct mca_io_base_component_1_0_0_t {
|
||||||
|
@ -35,7 +35,7 @@ void ompi_progress_events(int flag)
|
|||||||
void ompi_progress(void)
|
void ompi_progress(void)
|
||||||
{
|
{
|
||||||
/* progress any outstanding communications */
|
/* progress any outstanding communications */
|
||||||
int ret, events = 0;
|
int ret, temp, events = 0;
|
||||||
#if OMPI_HAVE_THREADS == 0
|
#if OMPI_HAVE_THREADS == 0
|
||||||
if (ompi_progress_event_flag != 0) {
|
if (ompi_progress_event_flag != 0) {
|
||||||
ret = ompi_event_loop(ompi_progress_event_flag);
|
ret = ompi_event_loop(ompi_progress_event_flag);
|
||||||
@ -52,11 +52,9 @@ void ompi_progress(void)
|
|||||||
/* Progress IO requests, if there are any */
|
/* Progress IO requests, if there are any */
|
||||||
|
|
||||||
if (ompi_progress_pending_io_reqs > 0) {
|
if (ompi_progress_pending_io_reqs > 0) {
|
||||||
ret = mca_io_base_progress();
|
temp = ompi_progress_pending_io_reqs;
|
||||||
if (ret > 0) {
|
mca_io_base_progress(&ompi_progress_pending_io_reqs);
|
||||||
events += ret;
|
events += (temp - ompi_progress_pending_io_reqs);
|
||||||
ompi_progress_pending_io_reqs -= ret;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
#if 1
|
#if 1
|
||||||
|
Загрузка…
x
Ссылка в новой задаче
Block a user