WHAT: New OMPI_RTE_EVENT_BASE define

WHY: The usnic BTL needs to run some events asynchronously; the ORTE event base 
already exists and is running asynchronously in MPI processes

WHERE: in ompi/mca/rte/rte.h and rte_orte.h

TIMEOUT: COB Friday, 21 Feb 2014

MORE DETAIL:

The WHY line described it pretty well: we want to run some things 
asynchronously in the usnic BTL and we don't really want to re-invent the wheel 
(or add yet another thread in each MPI process).  The ORTE event base is 
already there, there's already a thread servicing it, and Ralph tells me that 
it is safe to add our own events on to it.

The patch below adds the new OMPI_RTE_EVENT_BASE #define.


diff --git a/ompi/mca/rte/orte/rte_orte.h b/ompi/mca/rte/orte/rte_orte.h
index 3c88c6d..3ceadb8 100644
--- a/ompi/mca/rte/orte/rte_orte.h
+++ b/ompi/mca/rte/orte/rte_orte.h
@@ -142,6 +142,9 @@ typedef struct {
 } ompi_orte_tracker_t;
 OBJ_CLASS_DECLARATION(ompi_orte_tracker_t);
 
+/* define the event base that the RTE exports */
+#define OMPI_RTE_EVENT_BASE orte_event_base
+
 END_C_DECLS
 
 #endif /* MCA_OMPI_RTE_ORTE_H */
diff --git a/ompi/mca/rte/rte.h b/ompi/mca/rte/rte.h
index 69ad488..de10dff 100644
--- a/ompi/mca/rte/rte.h
+++ b/ompi/mca/rte/rte.h
@@ -150,7 +150,9 @@
  *        a. OMPI_DB_HOSTNAME
  *        b. OMPI_DB_LOCALITY
  *
- * (g) Communication support
+ * (g) Asynchronous / event support
+ *     1. OMPI_RTE_EVENT_BASE - the libevent base that executes in a
+ *        separate thread
  *
  */
 
@@ -162,6 +164,7 @@
 #include "opal/dss/dss_types.h"
 #include "opal/mca/mca.h"
 #include "opal/mca/base/base.h"
+#include "opal/mca/event/event.h"
 
 BEGIN_C_DECLS
 


Reply via email to