Parallelization of Nested for loops

General OpenMP discussion

Parallelization of Nested for loops

Postby ChemMeister » Mon Jan 30, 2012 9:50 am

Hello,

Can someone please provide with the correct syntaz for using openMP to parallelize nested loops, lets say we have the following sample code
Code: Select all
double mySum=0;
for(short i = 1; i <= 12; ++i)
{
for(short j = 1; j <= 12; ++j)
{
for(short k = 1; k <= 12; ++k)
mySum += (i+j)/k;
}
}



Any additional pointers will be greatly appreciated. Thanks
ChemMeister
 
Posts: 1
Joined: Mon Jan 30, 2012 9:28 am

Re: Parallelization of Nested for loops

Postby ftinetti » Mon Jan 30, 2012 9:54 am

ftinetti
 
Posts: 582
Joined: Wed Feb 10, 2010 2:44 pm


Return to Using OpenMP

Who is online

Users browsing this forum: No registered users and 3 guests