0

I'm developing a scientific code, so of course speed is of the essence. Now because of that portability is not really an issue and so I know how many openmp threads I will have available already when compiling the program. Can I use this information to perform any additional optimization? If yes, how do I do so?

Since it was pointed out that this question is very broad. I want to reduce it a bit to automatic, i.e. compiler optimization. So setting compiler flags or similar things.

Cheers

-A

Azrael3000
  • 1,847
  • 12
  • 23

1 Answers1

0

Well,you can modify the code such that it can be divided into n independent regions(n=no. of threads). U should prefer using sections.They give better speedups as compared to parallel for loops due to reduced inter processor communication.

haxor
  • 211
  • 1
  • 2
  • 11
  • Sections are no faster than `for schedule(static)` work-share construct. – Hristo Iliev May 07 '12 at 14:20
  • Well,I had implemented some codes where i used both parallel for and sections (odd and even loops) and sections seemed to be a little bit faster.It was quite a while ago,maybe it did so for that particular code. – haxor May 08 '12 at 17:18