[dcmf] [PATCH] This test will repeatedly call the low-level critical-section functions for performance testing.
Douglas Miller
dougmill at us.ibm.com
Tue Feb 5 12:26:25 CST 2008
I looked into a specialized sort of "cache thrashing" mutexing, but it
wasn't lwarx/stwcx. I found that lockboxes were generally better behaved
than my cache-thrashing algorithm, but that when uncontested the
cache-thrashing (or not, in that case) had better performance.
_______________________________________________
Douglas Miller BlueGene MPI Development
IBM Corp., Rochester, MN USA Bldg 030-2 C214
dougmill at us.ibm.com Douglas Miller/Rochester/IBM
Sameer
Kumar/Watson/IBM
To
02/05/2008 12:06 Kazutomo Yoshii
PM <kazutomo at mcs.anl.gov>, Douglas
Miller/Rochester/IBM at IBMUS
cc
DCMF <dcmf at lists.anl-external.org>,
dcmf-bounces at lists.anl-external.org
, Joseph
Ratterman/Rochester/IBM at IBMUS
Subject
Re: [dcmf] [PATCH] This test will
repeatedly call the low-level
critical-section functions for
performance testing.(Document link:
Douglas Miller)
Kaz,
Exploring larx-stwx vs lockbox has always been on the list but hasnt
quite gotten the priority. Doug Miller at Rochester briefly looked at it.
But, I am not sure if we have results about that.
Doug,
Can you please clarify?
sameer.
Kazutomo Yoshii
<kazutomo at mcs.anl
.gov> To
Sent by: Joseph
dcmf-bounces at list Ratterman/Rochester/IBM at IBMUS
s.anl-external.or cc
g DCMF <dcmf at lists.anl-external.org>
Subject
Re: [dcmf] [PATCH] This test will
02/05/2008 12:27 repeatedly call the low-level
PM critical-section functions for
performance testing.
I noticed that there is a code fragment
that lwarx/stwarx is used for CriticalSection().
( sys/messaging/sysdep/prod/BGP/MutexImpl.h )
it's not used now. Is this a plan for future release?
or just test code?
Do you have any performance comparison
between lockbox device and lwarx/stwarx instruction?
- kaz
> 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
_______________________________________________
dcmf mailing list
dcmf at lists.anl-external.org
http://lists.anl-external.org/cgi-bin/mailman/listinfo/dcmf
More information about the dcmf
mailing list