Sniper with OpenMP program giving 99% idle time for most of the cores.

377 views
Skip to first unread message

isha....@stonybrook.edu

unread,
Apr 24, 2015, 7:36:27 PM4/24/15
to snip...@googlegroups.com
I am integrating my openmp program with Sniper. I can see that there are some instructions running on each core but the idle time for most of the cores(except 1 or 2) is 99% which means that only 1-2 cores are doing all the work. I am also setting MAX_NUM_THREADS to 32(or higher) but not getting any difference. Do i have to add something else in the openmp code to fix this issue? Or do I need to change the run-sniper flags?

I am running with following command:

../../run-sniper -n 32 -c gainestown --roi --fast-forward --no-cache-warming ./test_openmp 256 32 4

Thanks,
Isha

Wim Heirman

unread,
Apr 27, 2015, 7:37:05 AM4/27/15
to snip...@googlegroups.com
Hi Isha,

What OpenMP runtime and compiler are you using? You'll probably need to set OMP_NUM_THREADS. When using the Intel runtime, you can also set KMP_AFFINITY=verbose to see how many threads are being created and to what cores they are being bound. You can also check the dumpstats.py output for the threads.instructions_by_core statistics, they will have one column per thread and one row per core, and allow you to see for each thread how many instructions it executed on each core.

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/d/optout.

isha....@stonybrook.edu

unread,
Apr 30, 2015, 7:07:09 PM4/30/15
to snip...@googlegroups.com
Hi Wim,

Thank you for the reply. I have set the environment variable but this does not help. I have copy pasted the simple openmp code, makefile and the sim.out snapshot. Its weird that I am not getting proper parallelism even for this simple parallel for. Would appreciate any help.

  int main()

  {

    const int size = 25600;

    double sinTable[size];


    SimRoiStart();

    #pragma omp parallel for

    for(int n=0; n<size; ++n)

      sinTable[n] = n;

    SimRoiEnd();

        return 0;

}


I am using the following configuration in the Makefile:

export OMP_NUM_THREADS=10000
TARGET=abc
include ../shared/Makefile.shared

$(SNIPER_CFLAGS) += -fopenmp

$(TARGET): $(TARGET).o
        $(CC) $(TARGET).o -std=c99 -lm $(SNIPER_LDFLAGS) -fopenmp -o $(TARGET)

run_$(TARGET):
        ../../run-sniper -n 4 -c gainestown --roi --fast-forward ./abc

CLEAN_EXTRA=viz


Sim.out screenshot: 


Wim Heirman

unread,
May 8, 2015, 2:21:44 AM5/8/15
to snip...@googlegroups.com
What is in sim.out? Is it empty or did you not paste it?

I'm not too sure what will happen if you export OMP_NUM_THREADS from the Makefile. Can you run it like this on the command line:
OMP_NUM_THREADS=4  ../../run-sniper -n 4 -c gainestown --roi -- ./abc

Is there any other console output that may hint at some error? I'm sure setting OMP_NUM_THREADS to 10000 is way too high and will crash the application before it does any parallel work.

-Wim


isha....@stonybrook.edu

unread,
May 8, 2015, 9:08:03 AM5/8/15
to snip...@googlegroups.com
Hi Wim,

Thank you for the reply. I tried pasting the screenshot for sim.out in previous post but there must be some problem. sim.out basically shows just 1 core with idle time as -0.7% and all other as 100%. I tried running the command(../../run-sniper -n 4 -c gainestown --roi --fast-forward ./abc) from the console but it fails with the error: Application received fatal signal 11 at eip 0x400565. 

However when I run it using make above shown sim.out is generated. I think the number of threads etc shouldn't be a problem. Probably we are missing on some flags that sniper uses to run openmp program in parallel. Not sure though.

Zi Yi Xu

unread,
Jul 6, 2021, 11:18:23 PM7/6/21
to Sniper simulator

Hi, I am wondering how you solved this problem. I am encountering similar issues. I think that maybe we should compile the application using Sniper flags, although I am not sure which flags to use. Thanks!
Reply all
Reply to author
Forward
0 new messages