[dcmf] Re: [PATCH] This test will repeatedly call the low-level critical-section functions for performance testing.
Joseph Ratterman
jratt at us.ibm.com
Tue Feb 5 11:23:39 CST 2008
Here are the results from running this test:
$ mpirun -np 1 -nofree -mode SMP ./build-tests/perf/dcmf/CS.cnk
DCMF_THREAD_SINGLE: Called Enter/Exit 10000 times at 78.0386 cycles each.
DCMF_THREAD_FUNNELED: Called Enter/Exit 10000 times at 78.0054 cycles
each.
DCMF_THREAD_SERIALIZED: Called Enter/Exit 10000 times at 78.0029 cycles
each.
DCMF_THREAD_MULTIPLE: Called Enter/Exit 10000 times at 180.063 cycles
each.
$ mpirun -np 1 -nofree -mode DUAL ./build-tests/perf/dcmf/CS.cnk
DCMF_THREAD_SINGLE: Called Enter/Exit 10000 times at 78.0378 cycles each.
DCMF_THREAD_FUNNELED: Called Enter/Exit 10000 times at 78.0032 cycles
each.
DCMF_THREAD_SERIALIZED: Called Enter/Exit 10000 times at 78.0019 cycles
each.
DCMF_THREAD_MULTIPLE: Called Enter/Exit 10000 times at 196.044 cycles
each.
While this is a doubling in the time it takes to lock/unlock, that alone
wouldn't drop the one process/thread performance from 4.47 to 1 MMPS. We
will look into it more after we get the benchmark.
Thanks,
Joe Ratterman
Joseph Ratterman/Rochester/IBM at IBMUS
02/05/08 11:19 AM
To
DCMF <dcmf at lists.anl-external.org>
cc
Joseph Ratterman/Rochester/IBM at IBMUS
Subject
[PATCH] This test will repeatedly call the low-level critical-section
functions for performance testing.
This is helpful when trying to understand performance degradations in
MPI_THREAD_MULTIPLE.
Signed-off-by: Joe Ratterman <jratt at us.ibm.com>
---
sys/tests/perf/Makefile.in | 2 +-
sys/tests/perf/dcmf/CS.c | 64
+++++++++++++++++++++++++++++++++
sys/tests/perf/{ => dcmf}/Makefile.in | 4 +-
3 files changed, 67 insertions(+), 3 deletions(-)
create mode 100644 sys/tests/perf/dcmf/CS.c
copy sys/tests/perf/{ => dcmf}/Makefile.in (96%)
diff --git a/sys/tests/perf/Makefile.in b/sys/tests/perf/Makefile.in
index 22a7ac7..4266989 100644
--- a/sys/tests/perf/Makefile.in
+++ b/sys/tests/perf/Makefile.in
@@ -12,6 +12,6 @@
# end_generated_IBM_copyright_prolog #
VPATH = @abs_srcdir@
-SUBDIRS = mpi spi mpid
+SUBDIRS = mpi spi mpid dcmf
TESTS =
include @abs_top_builddir@/Make.rules
diff --git a/sys/tests/perf/dcmf/CS.c b/sys/tests/perf/dcmf/CS.c
new file mode 100644
index 0000000..080f5df
--- /dev/null
+++ b/sys/tests/perf/dcmf/CS.c
@@ -0,0 +1,64 @@
+/* begin_generated_IBM_copyright_prolog */
+/* */
+/* ---------------------------------------------------------------- */
+/* (C)Copyright IBM Corp. 2007, 2008 */
+/* IBM CPL License */
+/* ---------------------------------------------------------------- */
+/* */
+/* end_generated_IBM_copyright_prolog */
+/**
+ * \file perf/dcmf/CS.c
+ * \brief Test the performance of the low-level critical-section
functions
+ */
+
+
+#include <tests.h>
+#define NUM 10000
+DCMF_Configure_t config;
+
+
+double time_CS(uint32_t x)
+{
+ uint64_t start, stop;
+ uint32_t i;
+
+ start = DCMF_Timebase();
+ for (i=0; i<x; ++i) {
+ DCMF_CriticalSection_enter(0);
+ DCMF_CriticalSection_exit(0);
+ }
+ stop = DCMF_Timebase();
+
+ return (double)(stop-start)/(double)x;
+}
+
+
+#define time_run(c) time_run_long(c, #c)
+void time_run_long(DCMF_Thread thread_level, char* thread_string)
+{
+ double time;
+ DCMF_Result rc;
+
+ config.thread_level = thread_level;
+ rc = DCMF_Messager_configure (&config, &config);
+ assert(rc == DCMF_SUCCESS);
+ assert(config.thread_level == thread_level);
+ time = time_CS(NUM);
+ printf("%s: Called Enter/Exit %u times at %g cycles each.\n",
thread_string, NUM, time);
+}
+
+
+int main()
+{
+ config.interrupts = DCMF_INTERRUPTS_OFF;
+
+ MPI_INIT;
+
+ time_run(DCMF_THREAD_SINGLE);
+ time_run(DCMF_THREAD_FUNNELED);
+ time_run(DCMF_THREAD_SERIALIZED);
+ time_run(DCMF_THREAD_MULTIPLE);
+
+ MPI_FINALIZE;
+ return (0);
+}
diff --git a/sys/tests/perf/Makefile.in b/sys/tests/perf/dcmf/Makefile.in
similarity index 96%
copy from sys/tests/perf/Makefile.in
copy to sys/tests/perf/dcmf/Makefile.in
index 22a7ac7..4c474b6 100644
--- a/sys/tests/perf/Makefile.in
+++ b/sys/tests/perf/dcmf/Makefile.in
@@ -12,6 +12,6 @@
# end_generated_IBM_copyright_prolog #
VPATH = @abs_srcdir@
-SUBDIRS = mpi spi mpid
-TESTS =
+SUBDIRS =
+TESTS = CS.c
include @abs_top_builddir@/Make.rules
--
1.5.4
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.alcf.anl.gov/pipermail/dcmf/attachments/20080205/3bea67b9/attachment.htm>
More information about the dcmf
mailing list