invoking Spec benchmarks in an iterative program
CASTalk.com Forum Index CASTalk.com
Discussion of DSP, FPGA, storage and embedded system.
 
 FAQFAQ   MemberlistMemberlist     RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 
 
Google
 
Web castalk.com
invoking Spec benchmarks in an iterative program

 
Post new topic   Reply to topic    CASTalk.com Forum Index -> Computer Architecture
Author Message
Vasanth Venkatachalam
Guest





Posted: Sat Oct 29, 2005 12:15 am    Post subject: invoking Spec benchmarks in an iterative program Reply with quote

I want to write a program that runs a chosen specCPU 2000 benchmark in a
loop
over many iterations and calculates the clock cycles in each iteration by
reading the timestamp counter.

In other words, something like this:

for (int i = 0; i < numiterations; i++)
{
start = rdtsc()
run the benchmark one time
end = rdtsc();
totalcycles += end - start;
}
averagecycles = totalcycles/numiterations;

The problem is that all of these benchmarks seem to be invoked using the
runspec and specinvoke scripts.
I am concerned that to invoke them my program, I would have to use the
exec( ) system call to invoke the
appropriate commands (e.g., specinvoke); this system call would create
additional overhead that I don't want
to measure. Is there any way I can do this without having to rely on the
exec( ) system call? For example, could I call the main subroutine of each
benchmark directly through my program?

Vasanth
Back to top
Vasanth Venkatachalam
Guest





Posted: Sat Oct 29, 2005 12:15 am    Post subject: Re: invoking Spec benchmarks in an iterative program Reply with quote

Those won't suffice because I am running some very focused experiments where
I am
also doing other things between the iterations. For this, I have to be able
to invoke each
benchmark in a loop from within a program (as described below), and not from
the command line.
That's my main problem.

"Rick Jones" <rick.jones2@hp.com> wrote in message
news:Fsx8f.15583$_F4.10810@news.cpqcorp.net...
Quote:
I thought the SPECcpu suite's scripts had hooks one could call to get
profiling information? You would let them start and stop the
profiling stuff via the hooks rather than you running the spec stuff
from within your own stuff.

rick jones
--
denial, anger, bargaining, depression, acceptance, rebirth...
where do you want to be today?
these opinions are mine, all mine; HP might not want them anyway... :)
feel free to post, OR email to rick.jones2 in hp.com but NOT BOTH...
Back to top
Rick Jones
Guest





Posted: Sat Oct 29, 2005 12:15 am    Post subject: Re: invoking Spec benchmarks in an iterative program Reply with quote

I thought the SPECcpu suite's scripts had hooks one could call to get
profiling information? You would let them start and stop the
profiling stuff via the hooks rather than you running the spec stuff
from within your own stuff.

rick jones
--
denial, anger, bargaining, depression, acceptance, rebirth...
where do you want to be today?
these opinions are mine, all mine; HP might not want them anyway... :)
feel free to post, OR email to rick.jones2 in hp.com but NOT BOTH...
Back to top
Vasanth Venkatachalam
Guest





Posted: Sat Oct 29, 2005 12:15 am    Post subject: Re: invoking Spec benchmarks in an iterative program Reply with quote

To clarify further...

I also need to do other things between the iterations. For example, after
every 10 iterations
I want to make a syscall that, e.g., puts the hard drive into a lower power
state or messes with the display. To do these kinds of things I need to
invoke the benchmark in a loop from my program, rather from the command
line. Unless of course there's a way of hacking the makefiles to insert this
extra stuff in there...

That's my main problem.

"Rick Jones" <rick.jones2@hp.com> wrote in message
news:Fsx8f.15583$_F4.10810@news.cpqcorp.net...
Quote:
I thought the SPECcpu suite's scripts had hooks one could call to get
profiling information? You would let them start and stop the
profiling stuff via the hooks rather than you running the spec stuff
from within your own stuff.

rick jones
--
denial, anger, bargaining, depression, acceptance, rebirth...
where do you want to be today?
these opinions are mine, all mine; HP might not want them anyway... :)
feel free to post, OR email to rick.jones2 in hp.com but NOT BOTH...
Back to top
Rick Jones
Guest





Posted: Sat Oct 29, 2005 12:15 am    Post subject: Re: invoking Spec benchmarks in an iterative program Reply with quote

Vasanth Venkatachalam <vvenkata@uci.edu> wrote:
Quote:
I also need to do other things between the iterations. For example,
after every 10 iterations I want to make a syscall that, e.g., puts
the hard drive into a lower power state or messes with the
display. To do these kinds of things I need to invoke the benchmark
in a loop from my program, rather from the command line. Unless of
course there's a way of hacking the makefiles to insert this extra
stuff in there...

Using the supplied hooks, can't you just store some state in a file in
the filesystem and use that to trigger the other things you want to
do every N'th iteration?

FWIW, I would expect that in your specific example of putting the hard
drive into a lower power state you would (should) see no difference in
performance as SPECcpu goes to great lengths to avoid doing any
meaninful disc I/O in the benchmark itself.

rick jones

the one thing I learned from combinatorics was to count the spaces
between the books rather than the books themselves... ie turn the
thing inside-out.

--
firebug n, the idiot who tosses a lit cigarette out his car window
these opinions are mine, all mine; HP might not want them anyway... :)
feel free to post, OR email to rick.jones2 in hp.com but NOT BOTH...
Back to top
Vasanth Venkatachalam
Guest





Posted: Sat Oct 29, 2005 12:15 am    Post subject: Re: invoking Spec benchmarks in an iterative program Reply with quote

"Rick Jones" <rick.jones2@hp.com> wrote in message
news:8cy8f.15588$vL4.297@news.cpqcorp.net...
Quote:
Using the supplied hooks, can't you just store some state in a file in
the filesystem and use that to trigger the other things you want to
do every N'th iteration?

Can you tell me in which files I can take a look at these hooks you're
describing?
Is it possible to modify these files to incorporate my system calls?

Quote:
FWIW, I would expect that in your specific example of putting the hard
drive into a lower power state you would (should) see no difference in
performance as SPECcpu goes to great lengths to avoid doing any
meaninful disc I/O in the benchmark itself.

This was just an example. I will actually be doing some things that will
affect performance.


Quote:
rick jones

the one thing I learned from combinatorics was to count the spaces
between the books rather than the books themselves... ie turn the
thing inside-out.

--
firebug n, the idiot who tosses a lit cigarette out his car window
these opinions are mine, all mine; HP might not want them anyway... :)
feel free to post, OR email to rick.jones2 in hp.com but NOT BOTH...
Back to top
Rick Jones
Guest





Posted: Sat Oct 29, 2005 6:41 am    Post subject: Re: invoking Spec benchmarks in an iterative program Reply with quote

Vasanth Venkatachalam <vvenkata@uci.edu> wrote:
Quote:
"Rick Jones" <rick.jones2@hp.com> wrote in message
news:8cy8f.15588$vL4.297@news.cpqcorp.net...
Using the supplied hooks, can't you just store some state in a file in
the filesystem and use that to trigger the other things you want to
do every N'th iteration?

Can you tell me in which files I can take a look at these hooks you're
describing?
Is it possible to modify these files to incorporate my system calls?

Alas I've only seen them mentioned in passing emails. I've been more
involved in other SPEC suites so never had to actually track it down
myself.

I was hoping that my mentioning them here would bring a bonafide
SPECcpu guru out of the woodwork...

Until that happens, the best I can suggest is digging deep into the
docs that come with the benchmark and/or can be found online at
www.spec.org.

I would think the hooks would be visible in the scripts provided by
SPEC, so some vi/emacs/whatever there may help.

The idea (as I recall it) behind the hooks is to allow someone to
start things like profilers and the like. As for inserting system
calls, I believe that these hooks allow one to run scripts to
initialize profilers or stats gatherers or otherwise affect the state
of the system.

Quote:
FWIW, I would expect that in your specific example of putting the
hard drive into a lower power state you would (should) see no
difference in performance as SPECcpu goes to great lengths to avoid
doing any meaninful disc I/O in the benchmark itself.

This was just an example. I will actually be doing some things that
will affect performance.

Understood.

rick jones

FWIW, there should also be a "support" email address in the
documentation that comes with the suite when you buy it from SPEC.
That may be another route to take.

--
a wide gulf separates "what if" from "if only"
these opinions are mine, all mine; HP might not want them anyway... :)
feel free to post, OR email to rick.jones2 in hp.com but NOT BOTH...
Back to top
Guest






Posted: Mon Oct 31, 2005 1:15 am    Post subject: Re: invoking Spec benchmarks in an iterative program Reply with quote

On Fri, 28 Oct 2005 14:23:44 -0700, "Vasanth Venkatachalam"
<vvenkata@uci.edu> sprachen:

Quote:
I am concerned that to invoke them my program, I would have to use the
exec( ) system call to invoke the appropriate commands (e.g., specinvoke);
this system call would create additional overhead that I don't want
to measure.

Would the overhead be a static amount tho? If it is, you could always
just allow for it in your final calculation.

------------------------------------------------------------------------

if love is a drug, then, ideally, it's a healing, healthful drug... it's
kind of like prozac is supposed to work (without the sexual side
effects and long-term damage to the brain and psyche)
Back to top
Jan Vorbrüggen
Guest





Posted: Mon Oct 31, 2005 9:15 am    Post subject: Re: invoking Spec benchmarks in an iterative program Reply with quote

I would think the easiest way to go about this would be to turn the main
program of your chosen benchmark(s) into a subroutine/function and call
that from your controlling program. You would need to look at some things
such as releasing memory and closing files.

Jan
Back to top
 
Post new topic   Reply to topic    CASTalk.com Forum Index -> Computer Architecture All times are GMT
Page 1 of 1

 
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum




VoIP Electronics Powered by phpBB