HELP ME!

General OpenMP discussion

HELP ME!

Postby lesiu2208 » Tue Jan 03, 2012 9:15 am

Hi, I'm trying to use OMP on for loop:

for(int x=0; x<i; x++){
if(x==licznik-1){
cout<<(dane[x+1]+dane[x])/2<<endl;
licznik+=f;
}
}

how can I paraller that loop? please help.
lesiu2208
 
Posts: 1
Joined: Tue Jan 03, 2012 9:11 am

Re: HELP ME!

Postby MarkB » Fri Feb 17, 2012 5:36 am

You will need to rewrite your code to avoid the incrementing of licznik. Something like
Code: Select all
if (x%f == licznik-1 ) {
cout<<(dane[x+1]+dane[x])/2<<endl;
}

should work OK.
MarkB
 
Posts: 422
Joined: Thu Jan 08, 2009 10:12 am


Return to Using OpenMP

Who is online

Users browsing this forum: No registered users and 9 guests

cron