openmp do loops

Pascal pascal22p at parois.net
Thu Nov 4 06:13:07 EDT 2010


Hi,

I would like to parallelize this loop:
do i=1,hklsize
fcalctable(i)=structfact(hkltable(1,i),hkltable(2,i),hkltable(3,i))
end do


I thought I would do this:
!$OMP PARALLEL DO default(private) shared(hkltable, fcalctable,hklsize)
do i=1,hklsize
fcalctable(i)=structfact(hkltable(1,i),hkltable(2,i),hkltable(3,i))
end do
!$OMP END PARALLEL DO

However it seems that the order of the final table is not guarantee 
compared to the serial version. I need a j element of the table to stay 
there because I have an other table and I am using the index to match 
the data.

Regards,
Pascal



More information about the Python-list mailing list