Hi Malek,

Thank you so much for your quick response. Let me try out and see if it works.

Regards,
Dibakar

On 09/21/11, Malek Musleh   wrote:
> Hi Dibakar,
> 
> It is most likely because the threads are all getting mapped to the
> same core. This happens, because the GOMP Affinity environment is
> empty by default, and thus all scheduling is being handled by the
> kernel.
> 
> Try Inserting this into your c program, and see what it prints out as
> the environment variable.
> 
>   pPath = getenv ("GOMP_CPU_AFFINITY");
>   if (pPath!=NULL)
>     printf ("GOMP_CPU_AFFINITY is: %s\n",pPath);
>   else {
>     printf("GOMP_CPu__AFFINITY Not Set\n");
>     putenv("GOMP_CPU_AFFINITY=0");
>     pPath = getenv("GOMP_CPU_AFFINITY");
>     printf ("GOMP_CPU_AFFINITY is: %s\n",pPath);
>     //exit(1);
>   }
> 
> If it is NULL, you can specify the GOMP_AFFINITY with the putenv()
> command, as the following for example:
> 
> [0 1 2], so in this case, the OMP will map each thread to the
> specified core number in order of starting from the left, and then
> wrapping around.
> 
> So if you have 4 threads and 3 cores,
> 
> Thread 1 --> Core 0
> Thread 2 --> Core 1
> Thread 3 --> Core 2
> Thread 4 --> Core 0
> 
> There are other ways to specify the argument for putenv, (I might not
> have the correct syntax, but you can search the GOMP Manual or do a
> quick google search).
> 
> Hope this helps.
> 
> Malek
> 
> On Wed, Sep 21, 2011 at 4:27 PM, Dibakar Gope <[email protected]> wrote:
> > Hi All,
> >
> > I am trying to execute some multi-threaded rodinia (parallel) benchmarks in 
> > Gem5 ALPHA FS mode. The rodinia benchmarks do have the OpenMP pragmas. I 
> > can compile the rodinia benchmarks with required ALPHA cross compiler and 
> > updated gcc version and eventually can launch them in gem5. So, in order to 
> > run the benchmarks with 4 threads, I set the command line options (-n as 
> > 4).  However I can see in the final stats.txt that the 4 cores are not 
> > dividing the parallel portion of the benchmarks equally, and as a result 
> > one of the core is executing almost the entire ROI region.
> >
> > So, is it the proper way to launch the multiple threads in gem5 by 
> > mentioning that many cores in the command line?
> >
> > Thanks,
> > Dibakar Gope
> > PhD Student, UW-Madison
> > _______________________________________________
> > gem5-users mailing list
> > [email protected]
> > http://m5sim.org/cgi-bin/mailman/listinfo/gem5-users
> >
> _______________________________________________
> gem5-users mailing list
> [email protected]
> http://m5sim.org/cgi-bin/mailman/listinfo/gem5-users

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

Reply via email to