Find the IPC value of each running thread

317 views
Skip to first unread message

mehdi...@gmail.com

unread,
Oct 19, 2013, 6:26:39 AM10/19/13
to snip...@googlegroups.com
Hi,

Is there any way to find the IPC of each running thread?

best,
Mehdi Kamal 

Wim Heirman

unread,
Oct 20, 2013, 5:56:27 AM10/20/13
to snip...@googlegroups.com
Mehdi,

The sim.out output file lists instruction count and number of simulated cycles for every core, dividing these gives you the per-core IPC. In addition, the cpistack.py script computes the CPI breakdown for each core. Unless you are doing thread scheduling, these will also be the IPC numbers for each thread.

If you do do thread migrations or time-sharing, have a look at the detailed statistics (obtained through tools/dumpstats.py or the Python interface). thread.core_elapsed_time gives you the time each thread was scheduled (in fs, fs_to_cycles allows you to convert this to cycles assuming you did not change any frequencies at runtime), while thread.instruction_count gives you each thread's instruction count.

Regards,
Wim




--
--
--
You received this message because you are subscribed to the Google
Groups "Sniper simulator" group.
To post to this group, send email to snip...@googlegroups.com
To unsubscribe from this group, send email to
snipersim+...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/snipersim?hl=en
 
---
You received this message because you are subscribed to the Google Groups "Sniper simulator" group.
To unsubscribe from this group and stop receiving emails from it, send an email to snipersim+...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.

mehdi...@gmail.com

unread,
Oct 20, 2013, 10:08:36 AM10/20/13
to snip...@googlegroups.com
Wim, thanks for your reply.

mehdi...@gmail.com

unread,
Oct 23, 2013, 2:57:49 AM10/23/13
to snip...@googlegroups.com
Hi Wim,

I want to find the IPC of the threads during the simulation inside the python script. It seems the dumpstats.py has "--partial=" argument to provide a specific duration that the reported data will belong to this duration. However, I could not find a way to provide a duration between two specific time for example between 10000 and 20000 (--partial=10000:20000) similar to mcpat.py. In this case an error is raised which says "invalid prefix ...". Please let me know how I can access to thread.instruction_count inside my python script code, and how I can define a profiling duration for the dumpstats.py.

Best,

Trevor E. Carlson

unread,
Oct 23, 2013, 3:19:32 AM10/23/13
to mehdi...@gmail.com, snip...@googlegroups.com
Mehdi,

The '--partial' flag is only for use on the command line, and only works for labels that have been explicitly saved (like roi-begin, roi-end, etc.)

In order to look at the IPC of specific threads inside the simulator, you will want to modify the sniper/scripts/ipctrace.py file and instead of using 'performance_model' on line 26 and modify it to use the per-thread instruction count 'thread' and 'instruction_count'.

Get back to us if you run into any problems,
Trevor

mehdi...@gmail.com

unread,
Oct 23, 2013, 3:56:11 AM10/23/13
to snip...@googlegroups.com, mehdi...@gmail.com
Hi Trevor,

Thanks for your replay. I have used "sim.util.StatsDelta().getter" command, and following code

    A = [sim.util.StatsDelta().getter('thread',thread,'instruction_count').delta for thread in range(sim.thread.get_nthreads())]
    print A

But, it returns None. What is wrong with this code?

Trevor E. Carlson

unread,
Oct 23, 2013, 6:01:39 AM10/23/13
to mehdi...@gmail.com, snip...@googlegroups.com
Mehdi,

Yes, I see the issue here. The problem is that the thread statistics aren't registered until after the thread starts. I've created a simple script that should be a good starting point for you. Only when the threads start, will this script register a new stats metric callback. It then prints out the IPC for each thread.

Trevor

ipcthreadtrace.py

mehdi...@gmail.com

unread,
Oct 23, 2013, 6:19:11 AM10/23/13
to snip...@googlegroups.com, mehdi...@gmail.com

Thanks Trevor, it works :)

Zilmarij Iqbal

unread,
Jul 11, 2021, 6:10:01 AM7/11/21
to Sniper simulator
Hi,

I am facing the same issue with with time_delta, which gives None when printed.  Find the script extract below:



def setup(self, args):
    print '------------------------------------------'
        self.sd = sim.util.StatsDelta()
        self.stats = {
        'time': [ self.sd.getter('performance_model', core, 'elapsed_time') for core in range(sim.config.ncores) ] }

        sim.util.EveryIns(long(1000000), self.periodicins, roi_only = True)
   
    def periodicins(self, time, time_delta):
        for core in range(sim.config.ncores):
           time_delta = self.stats['time'][core].delta

           print " time is ", time_delta         ##returns None



Any help would be appreciated to solve the issue.


Thanks,
Zilmarij Iqbal

Zilmarij Iqbal

unread,
Sep 25, 2021, 5:45:26 AM9/25/21
to Sniper simulator
Update: I was missing specifying the statsdelta-self.sd  arguement in sim.util.Every().


Zilmarij Iqbal
Reply all
Reply to author
Forward
0 new messages