1
1

Add new loop mode OPAL_EVLOOP_ONELOOP that behaved like OPAL_EVLOOP_ONCE

did pre-libevent update.  The problem is that the behavior of 
OPAL_EVLOOP_ONCE was changed by the OMPI team, which them broke things
during the update, so it had to be reverted to the old meaning of
loop until one event occurs.  OPAL_EVLOOP_ONELOOP will go through the
event loop once (like EVLOOP_NONBLOCK) but will pause in the event
library for a bit (like EVLOOP_ONCE).

fixes trac:234

This commit was SVN r11081.

The following Trac tickets were found above:
  Ticket 234 --> https://svn.open-mpi.org/trac/ompi/ticket/234
Этот коммит содержится в:
Brian Barrett 2006-08-01 22:23:57 +00:00
родитель 7aac77a37c
Коммит a84e557815
5 изменённых файлов: 19 добавлений и 11 удалений

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

@ -114,17 +114,19 @@ int ompi_mpi_finalize(void)
/* Proceed with MPI_FINALIZE */ /* Proceed with MPI_FINALIZE */
ompi_mpi_finalized = true; ompi_mpi_finalized = true;
#if OMPI_ENABLE_PROGRESS_THREADS == 0 #if OMPI_ENABLE_PROGRESS_THREADS == 0
opal_progress_events(OPAL_EVLOOP_NONBLOCK); opal_progress_events(OPAL_EVLOOP_ONELOOP);
#endif #endif
/* Change progress function priority back to RTE level stuff */
opal_progress_mpi_disable();
/* If maffinity was setup, tear it down */ /* If maffinity was setup, tear it down */
if (ompi_mpi_maffinity_setup) { if (ompi_mpi_maffinity_setup) {
opal_maffinity_base_close(); opal_maffinity_base_close();
} }
/* Change progress function priority back to RTE level stuff */
opal_progress_mpi_disable();
/* begin recording compound command */ /* begin recording compound command */
/* if (OMPI_SUCCESS != (ret = orte_gpr.begin_compound_cmd())) { /* if (OMPI_SUCCESS != (ret = orte_gpr.begin_compound_cmd())) {
return ret; return ret;

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

@ -591,11 +591,6 @@ int ompi_mpi_init(int argc, char **argv, int requested, int *provided)
goto error; goto error;
} }
/* BWB - is this still needed? */
#if OMPI_ENABLE_PROGRESS_THREADS == 0
opal_progress_events(OPAL_EVLOOP_NONBLOCK);
#endif
/* Second barrier -- wait for message from /* Second barrier -- wait for message from
RMGR_PROC_STAGE_GATE_MGR to arrive */ RMGR_PROC_STAGE_GATE_MGR to arrive */
@ -624,6 +619,12 @@ int ompi_mpi_init(int argc, char **argv, int requested, int *provided)
return ret; return ret;
} }
#if OMPI_ENABLE_PROGRESS_THREADS == 0
/* switch from letting us sit in the event library for a bit each
time through opal_progress() to completely non-blocking */
opal_progress_events(OPAL_EVLOOP_NONBLOCK);
#endif
/* put the event library in "high performance MPI mode" */ /* put the event library in "high performance MPI mode" */
if (OMPI_SUCCESS != opal_progress_mpi_enable()) { if (OMPI_SUCCESS != opal_progress_mpi_enable()) {
error = "opal_progress_mpi_enable() failed"; error = "opal_progress_mpi_enable() failed";

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

@ -609,7 +609,8 @@ opal_event_base_loop(struct event_base *base, int flags)
opal_event_process_active(base); opal_event_process_active(base);
if (!base->event_count_active && (flags & OPAL_EVLOOP_ONCE)) if (!base->event_count_active && (flags & OPAL_EVLOOP_ONCE))
done = 1; done = 1;
} else if (flags & OPAL_EVLOOP_NONBLOCK) } else if ((flags & OPAL_EVLOOP_NONBLOCK) ||
(flags & OPAL_EVLOOP_ONELOOP))
done = 1; done = 1;
if (evsel->recalc(base, evbase, 0) == -1) { if (evsel->recalc(base, evbase, 0) == -1) {

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

@ -174,6 +174,10 @@ int opal_event_base_set(struct event_base *, struct opal_event *);
#define OPAL_EVLOOP_ONCE 0x01 #define OPAL_EVLOOP_ONCE 0x01
#define OPAL_EVLOOP_NONBLOCK 0x02 #define OPAL_EVLOOP_NONBLOCK 0x02
/* run once through the loop, but do have the default timeout.
Need to be both something special *AND* EVLOOP_ONCE */
#define OPAL_EVLOOP_ONELOOP 0x03
OMPI_DECLSPEC int opal_event_loop(int); OMPI_DECLSPEC int opal_event_loop(int);
int opal_event_base_loop(struct event_base *, int); int opal_event_base_loop(struct event_base *, int);
int opal_event_loopexit(struct timeval *); /* Causes the loop to exit */ int opal_event_loopexit(struct timeval *); /* Causes the loop to exit */

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

@ -33,7 +33,7 @@
/* /*
* default parameters * default parameters
*/ */
static int opal_progress_event_flag = OPAL_EVLOOP_ONCE; static int opal_progress_event_flag = OPAL_EVLOOP_ONELOOP;
#if OPAL_PROGRESS_USE_TIMERS #if OPAL_PROGRESS_USE_TIMERS
static const opal_timer_t opal_progress_default_tick_rate = 10000; /* 10ms */ static const opal_timer_t opal_progress_default_tick_rate = 10000; /* 10ms */
#else #else