[OMPI devel] OPAL polling optimization

2012-04-19 Thread Alex Margolin

Hi,

I'm writing a new polling module and I stumbled upon some strange code:
The following function is implemented in 
openmpi-trunk/opal/mca/event/libevent2013/libevent/signal.c :


evsig_add(struct event_base *base, evutil_socket_t evsignal, short old, 
short events, void *p)


- It appears the three last paramaters are not used at all!
It's a coincidence that I'm just trying to register ANY signal handler 
to interrupt my ppoll syscall, so It may work out,
but I'm not sure how I'm supposed to use this function to set my own 
handler, not what the other parameters are for.

I've attached my patch for OPAL so far... I'll appreciate any advice.

Alex
Index: mca/event/libevent2013/configure.m4
===
--- mca/event/libevent2013/configure.m4	(revision 26274)
+++ mca/event/libevent2013/configure.m4	(working copy)
@@ -52,6 +52,12 @@
 if test "$enable_event_poll" = "no"; then
 event_args="$event_args --disable-poll"
 fi
+
+AC_ARG_ENABLE(event-mosix-ppoll,
+  AC_HELP_STRING([--disable-event-mosix-ppoll], [disable MOSIX ppoll support]))
+if test "$enable_event_mosix_ppoll" = "no"; then
+event_args="$event_args --disable-mosix-ppoll"
+fi

 AC_ARG_ENABLE(event-devpoll,
   AC_HELP_STRING([--disable-event-devpoll], [disable devpoll support]))
Index: mca/event/libevent2013/libevent2013_module.c
===
--- mca/event/libevent2013/libevent2013_module.c	(revision 26274)
+++ mca/event/libevent2013/libevent2013_module.c	(working copy)
@@ -65,6 +65,9 @@
 #if defined(_EVENT_HAVE_SELECT) && _EVENT_HAVE_SELECT
 extern const struct eventop selectops;
 #endif
+#if defined(_EVENT_HAVE_MOSIX_PPOLL) && _EVENT_HAVE_MOSIX_PPOLL
+extern const struct eventop mosix_ppollops;
+#endif
 #if defined(_EVENT_HAVE_POLL) && _EVENT_HAVE_POLL
 extern const struct eventop pollops;
 #endif
@@ -95,6 +98,9 @@
 #if defined(_EVENT_HAVE_DEVPOLL) && _EVENT_HAVE_DEVPOLL
 	&devpollops,
 #endif
+#if defined(_EVENT_HAVE_MOSIX_PPOLL) && _EVENT_HAVE_MOSIX_PPOLL
+	&mosix_ppollops,
+#endif
 #if defined(_EVENT_HAVE_POLL) && _EVENT_HAVE_POLL
 	&pollops,
 #endif
@@ -194,9 +200,13 @@
 #ifdef __WINDOWS__
"win32",
 #else
+#ifdef _EVENT_HAVE_MOSIX_PPOLL
+   "mosix_ppoll",
+#else
"poll",
 #endif
 #endif
+#endif
&event_module_include);

 if (dumpit) {
Index: mca/event/libevent2013/libevent/configure.in
===
--- mca/event/libevent2013/libevent/configure.in	(revision 26274)
+++ mca/event/libevent2013/libevent/configure.in	(working copy)
@@ -453,9 +453,18 @@
 	needsignal=yes
 fi
 fi
-AM_CONDITIONAL(POLL_BACKEND, [test "x$havepoll" = "xyes" -a "$enable_poll" != "no"])
+
+AM_CONDITIONAL(MOSIX_PPOLL_BACKEND, [test "x$havepoll" = "xyes" -a "$enable_mosix_ppoll" != "no" && test -n "/proc/mosix/mosip"])
+AC_MSG_CHECKING([for mosix_ppoll support])
+AS_IF([test "$enable_mosix_ppoll" != "no" && test "x$havepoll" = "xyes"],
+ [AC_DEFINE(HAVE_MOSIX_PPOLL, 1, [Have MOSIX ppoll support])
+  AC_MSG_RESULT([yes])],
+ [AC_DEFINE(HAVE_MOSIX_PPOLL, 0, [No MOSIX ppoll support])
+  AC_MSG_RESULT([no])])
+
+AM_CONDITIONAL(POLL_BACKEND, [test "x$havepoll" = "xyes" -a "$enable_poll" != "no" -a "$enable_mosix_poll" == "no"])
 AC_MSG_CHECKING([for poll support])
-AS_IF([test "$enable_poll" != "no" && test "x$havepoll" = "xyes"],
+AS_IF([test "$enable_poll" != "no" && test "$enable_mosix_poll" == "no" && test "x$havepoll" = "xyes"],
   [AC_DEFINE(HAVE_POLL, 1, [Have poll support])
AC_MSG_RESULT([yes])],
   [AC_DEFINE(HAVE_POLL, 0, [No poll support])
Index: mca/event/libevent2013/libevent/mosix_ppoll.c
===
--- mca/event/libevent2013/libevent/mosix_ppoll.c	(revision 0)
+++ mca/event/libevent2013/libevent/mosix_ppoll.c	(revision 0)
@@ -0,0 +1,384 @@
+/*	$OpenBSD: mosix_ppoll.c,v 1.2 2002/06/25 15:50:15 mickey Exp $	*/
+
+/*
+ * Copyright 2000-2007 Niels Provos 
+ * Copyright 2007-2010 Niels Provos and Nick Mathewson
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ *notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ *notice, this list of conditions and the following disclaimer in the
+ *documentation and/or other materials provided with the distribution.
+ * 3. The name of the author may not be used to endorse or promote products
+ *derived from this software without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROV

Re: [OMPI devel] OPAL polling optimization

2012-04-19 Thread Ralph Castain
We "ingest" the libevent releases from their distribution. Frankly, I am really 
loath to modify it as they become resistant to helping us with problems if we 
do, and the event lib is deeply embedded in our code.

Would you please take the libevent modifications to them? Nick et al are very 
open to contributions.

As for the "unused" params - I suspect you will find they are present due to 
compatibility with other event_add calls so they can all be called from within 
the same code without additional if-else switching.


On Apr 19, 2012, at 6:43 AM, Alex Margolin wrote:

> Hi,
> 
> I'm writing a new polling module and I stumbled upon some strange code:
> The following function is implemented in 
> openmpi-trunk/opal/mca/event/libevent2013/libevent/signal.c :
> 
> evsig_add(struct event_base *base, evutil_socket_t evsignal, short old, short 
> events, void *p)
> 
> - It appears the three last paramaters are not used at all!
> It's a coincidence that I'm just trying to register ANY signal handler to 
> interrupt my ppoll syscall, so It may work out,
> but I'm not sure how I'm supposed to use this function to set my own handler, 
> not what the other parameters are for.
> I've attached my patch for OPAL so far... I'll appreciate any advice.
> 
> Alex
> ___
> devel mailing list
> de...@open-mpi.org
> http://www.open-mpi.org/mailman/listinfo.cgi/devel




[OMPI devel] After svn up...

2012-04-19 Thread Jeffrey Squyres
You may have missed it at the bottom of my mail last night, but after running 
"svn up" to get all the new Fortran stuff, you might want to run these commands 
to clean out kruft that "svn up" may not remove:

rm -f ompi/mpiext/affinity/OMPI_Affinity_str.3
rm -rf ompi/mpiext/example/f77
rm -f ompi/include/mpi_ext.mod
rm -f ompi/include/mpicxx-ext.h
rm -f ompi/include/mpi-ext.h
rm -f ompi/include/mpif-ext.h
rm -f ompi/include/mpif90-ext.f90
rm -rf ompi/mpiext/example/f77
rm -rf ompi/mpi/f90
rm -rf ompi/mpi/f77
rm -rf orte/threads
rm -rf orte/mca/plm/ccp
rm -rf orte/mca/plm/poe
rm -rf orte/mca/plm/xgrid
rm -rf orte/mca/errmgr/orted
rm -rf orte/mca/errmgr/app
rm -rf orte/mca/errmgr/hnp
rm -rf orte/mca/ras/ccp
rm -rf orte/mca/ess/slurmd
rm -f ompi/tools/wrappers/*f90*
rm -f ompi/tools/wrappers/*f77*
rm -f config/ompi_get_version.sh

-- 
Jeff Squyres
jsquy...@cisco.com
For corporate legal information go to: 
http://www.cisco.com/web/about/doing_business/legal/cri/




[OMPI devel] June Developers Meeting

2012-04-19 Thread Ralph Castain
Hi folks

On the weekly telecon, we settled on the dates for a developer's meeting to 
discuss the OMPI 1.7 release series. Because some of us will be at the MPI 
Forum meeting in Japan in June, and we are hitting the typical vacation season, 
the choice of dates was severely limited. Accordingly, we have decided to meet 
June 6-8 at Cisco in San Jose, with the meeting starting at 1pm on the 6th and 
ending at noon on the 8th to accommodate travel.

I have setup a wiki page for the meeting:

https://svn.open-mpi.org/trac/ompi/wiki/June12Meeting

and populated it with some initial items for the agenda. Note: the details on 
the Cisco meeting room are just taken from the last meeting there and will 
likely change.

I would appreciate it if folks edited the page (or sent email to me) with 
additional items they would like discussed, plus suggestions on how much time 
they feel the discussion should be allocated. I'll then try to create a 
first-cut at the agenda.

Thanks
Ralph




Re: [OMPI devel] [PATCH] Open MPI on ARMv5

2012-04-19 Thread Jeffrey Squyres
Thanks Evan!

(sorry for the delay in replying -- I was on vacation all last week and I'm 
*still* catching up...)

Lief -- does this look good to you?


On Apr 13, 2012, at 11:13 PM, Evan Clinton wrote:

> At present Open MPI only supports ARMv7 processors.  Attached is a
> patch against current trunk (r26270) that extends the atomic
> operations and memory barriers code to work with ARMv5 and ARMv6 ones,
> too.
> 
> For v6, the only changes were to use "mcr p15, 0, r0, c7, c10, 5"
> instead of the unavailable DMB instruction, and to disable the 64 bit
> compare-exchange function (which I understand is not vital for Open
> MPI on 32 bit platforms?).  For v5, it was a bit trickier; the
> processor lacks nice memory barrier instructions or proper atomic
> operations.  Fortunately, the Linux kernel offers several helper
> functions on ARM, and I've used those here.
> 
> The changes build and pass all of the assembly-related tests in the
> test folder and the hello world examples run on my "armv5tel" box
> running Debian with Linux 2.6.32-5.  It should also run fine on ARMv6
> boxes, and presumably v4, but I don't have either to test on.
> 
> Documentation for the Linux kernel helper functions:
> http://git.kernel.org/?p=linux/kernel/git/torvalds/linux.git;a=blob;f=Documentation/arm/kernel_user_helpers.txt
> 
> I've sent in a contributor agreement so there should be no IP problems.
> 
> Hopefully this is useful,
> Evan Clinton
> ___
> devel mailing list
> de...@open-mpi.org
> http://www.open-mpi.org/mailman/listinfo.cgi/devel


-- 
Jeff Squyres
jsquy...@cisco.com
For corporate legal information go to: 
http://www.cisco.com/web/about/doing_business/legal/cri/