Hello,

I have a couple of queries on statistics. The application I’m working on
has the
following structure as shown below. I have inserted M5 ops as indicated to
collect the statistics
for the specified region of interest. I’m skipping most of the actual code
to keep things simple.

//nthreads is always equal to nprocs
main()
{
//some code
m5_reset_stats();
for(i=0;i<nthreads;i++)
  pthread_create(...,work(i));
for(i=0;i<nthreads;i++)
  pthread_join()
m5_dump_stats();
//some code
}
work(tid)
{
//some code to set thread afiinity
cpu_set_t cpuset;
CPU_SET(tid, &cpuset);
pthread_setaffinity_np(tid, sizeof(cpu_set_t), &cpuset);
//some code
// KERNEL
//come more code
pthread_exit();
}

1. For a shared counter example the KERNEL just increments a shared counter
variable
(after acquiring a shared lock). Since the iterations are equally
distributed among n threads (4 in
this case) it is fair to expect equal amount of work to be done by all the
cores. But according to
the statistics this is not the case.
cpu - numCycles - num_insts
0        3.4 million      141K
1        3.3 million      90K
2        1.9 million      3K
3        3.3 million      500K
The experiment uses TimingSimpleCPU’s with two level cache hierarchy
without support for
Ruby. I have repeated the experiment multiple times to check if i get
similar numbers and I do. It
would be great if someone can explain the difference in number of instns.
executed across the
different threads. Correct me if I have completly missed something here.

2. The second question is regarding statistics collection from a parallel
region of code. If the
KERNEL was iterative what would be the easiest way to collect stats from
specific
regions (i.e sub-kernels) in the kernel. I tried to insert m5 ops at the
start and end of sub-kernels
within the kernel. Since the KERNEL was iterative I ended up with a HUGE
stats file with
thousands of stat dumps (one/several for each iteration of the kernel). Can
someone suggest a
simpler way of collecting stats from sub-kernels in a iterative parallel
application.

Sorry for this rather long email. I would appreciate any help in this
matter. Thanks in advance :-)

Madhavan
_______________________________________________
gem5-users mailing list
[email protected]
http://m5sim.org/cgi-bin/mailman/listinfo/gem5-users

Reply via email to