I have a problem when apply parallel (using omp parallel for schedule(atuo)), please help me resolve it.
The problem is explained as below:
1. Setup environment
- Win XP 32 bit
- Visual Studio 2008
- Intel Parallel Studio 2011
- Configure Floating Point Model: Stric (/fp:strick)
- Source code apply parallel
void ParallelOMP(short * outputData)
int datasize = 512*512;
#pragma omp parallel for schedule(auto)
for(int i=0; i<datasize; i++)
double cal = (i%5 * 10/3) + i/5;
outputData[i] = (short)cal;
-Code calculate [total] variable
public static extern void ParallelOMP(short outputData);
private void btn_Compute_Click(object sender, EventArgs e)
short inputData = new short[512 * 512];
double kernel = -0.80000000000000004;
short input = 155;
double total = -37.692307692307693;
total += kernel * input;
MessageBox.Show("total = " + total.ToString("G17"));
- When apply parallel, [total] = -161.69230769230771
- When not apply parallel, [total] = -161.69230769230768
Why when use "omp parallel for schedule(auto)" to different calculation result with environment is 32bit.
How "schedule(auto)" affect to calculation result above? If use "omp parallel for" or "omp parallel for schedule(static)" not effect to calculation result.
Note: At Win7 64bit, value of [total] variable is the same when apply or not apply parallel and value is -161.69230769230768.
I don't known what the problem is. Does anyone have experience about it?