[parsec-users] freqmine locks!

Christian Bienia cbienia at CS.Princeton.EDU
Mon Feb 23 13:54:08 EST 2009


Madhavan,

For an OpenMP program the synchronization is inserted by the compiler
according to the hints the programmer added with the OpenMP pragmas. The
best way to familiarize yourself with it is probably to have a look at some
OpenMP tutorials.

The OpenMP standard only specifies the C language constructs and leaves it
to the compiler writers to decide how to implement it best. That means it
can be a little tricky to detect all types of synchronization because
implementations can vary widely. For example, some compilers might implement
the synchronization by falling back to the pthreads library, but others
might choose to implement their own fast synchronization primitives with
inlined atomic instructions. However, counting every occurrence of atomic
instructions should always work.

If everything fails for you then you might be successful by counting the
synchronization primitives manually. To do that simply check how shared
variables are declared with OpenMP, then search in the source code for
occurrences of the key words. Add your own shared counter that gets
incremented every time the variable is accessed, or increment private
counters that get summed up at the end of the parallel phase. This way you
can manually count how often the threads synchronize. For performance
reasons you probably don't want to use pthreads to implement shared
counters. I've written a light-weight counter that uses atomic instructions,
you can find it in the bodytrack source code in the threads/ directory. It
adds almost no overhead to the program and is very fast.

- Chris


-----Original Message-----
From: parsec-users-bounces at lists.cs.princeton.edu
[mailto:parsec-users-bounces at lists.cs.princeton.edu] On Behalf Of m madhavan
Sent: Monday, February 23, 2009 1:42 PM
To: PARSEC Users
Subject: Re: [parsec-users] freqmine locks!

Hi Chris,

The tracing program takes the application binary as input and works with it
to automatically produce the output traces. Can you provide me with some
more information on inserting sync. at build time or direct me to some
references that could help me better understand this(probably an example).
Right Now It is still not clear as to why locks are not represented.

Thank You.

Madhavan.

--- On Mon, 2/23/09, Christian Bienia <cbienia at CS.Princeton.EDU> wrote:

> From: Christian Bienia <cbienia at CS.Princeton.EDU>
> Subject: Re: [parsec-users] freqmine locks!
> To: "'PARSEC Users'" <parsec-users at lists.cs.princeton.edu>
> Date: Monday, February 23, 2009, 9:07 PM
> Hi Madhavan,
> 
> Freqmine has been parallelized with OpenMP, so the details
> of your
> synchronization depend on your OpenMP implementation.
> Moreover, they don't
> show up in the source code because it is all inserted by
> the compiler at
> build time. Depending how your trace program works, it
> might not consider
> that.
> 
> - Chris
> 
> 
> -----Original Message-----
> From: parsec-users-bounces at lists.cs.princeton.edu
> [mailto:parsec-users-bounces at lists.cs.princeton.edu] On
> Behalf Of m madhavan
> Sent: Monday, February 23, 2009 10:12 AM
> To: parsec-users at lists.cs.princeton.edu
> Subject: [parsec-users] freqmine locks!
> 
> Hi,
> 
> I have recently started to work with freqmine application
> in the Parsec
> suite. In the paper "The PARSEC Benchmark Suite:
> Characterization and
> Architectural Implications" on Parsec Workload
> characterization, it has been
> indicated (in table2) that freqmine employs 990025 locks as
> synchronization
> primitives. When I tried to trace the OpenMP application to
> visualize these
> locks I was not able to observe anything in the output
> trace. Am I
> forgetting some detail here. 
> 
> Thank You in advance.
> 
> Madhavan
> 
> 
>       
> _______________________________________________
> parsec-users mailing list
> parsec-users at lists.cs.princeton.edu
> https://lists.cs.princeton.edu/mailman/listinfo/parsec-users
> 
> _______________________________________________
> parsec-users mailing list
> parsec-users at lists.cs.princeton.edu
> https://lists.cs.princeton.edu/mailman/listinfo/parsec-users


      
_______________________________________________
parsec-users mailing list
parsec-users at lists.cs.princeton.edu
https://lists.cs.princeton.edu/mailman/listinfo/parsec-users



More information about the parsec-users mailing list