Intel® Fortran Compiler
Build applications that can scale for the future with optimized code designed for Intel® Xeon® and compatible processors.
29264 Discussions

Request to know the build changes to support multithreaded

vkota
Beginner
528 Views
Hello all,

We have an existing application written a long time ago in Fortran and we have been updating the compilers and keep building the application to be on update. But it is always single threaded. Now, as per the need, we want to build the application for multithreaded.

Please let me know if we can build it to support multithreaded and what could be the flag/compiler settings to compile the application?


Thanks.

Sincerely,
Vijay
0 Kudos
3 Replies
TimP
Honored Contributor III
528 Views
In the easiest cases, /Qparallel may be effective for automatic addition of OpenMP threading. You're likely to need OpenMP directives, with the associated compile options set, and attention to suitable organization of data parallel DO loops. This will involve studying at least the examples in the help file or on the openmp.org site.
0 Kudos
vkota
Beginner
528 Views
Thanks Tim, I'll go through your suggestions and come back again.
0 Kudos
Martyn_C_Intel
Employee
528 Views

The other relatively painless way to introduce threading is to make use of threaded library routines, such as those in Intel's Math Kernel Library. If your application contains matrix multiplications or other linear algebra, Fourier transforms, etc, you might find this useful.

There are some online articles about multithreading. For example, http://software.intel.com/en-us/articles/intel-guide-for-developing-multithreaded-applications/ , where sections 4.1 and 4.2 cover the topics Tim and I brought up.

http://software.intel.com/en-us/articles/threading-fortran-applications-for-parallel-performance-on-multi-core-systems/ (Fortran-specific)

http://software.intel.com/en-us/articles/automatic-parallelization-with-intel-compilers/

If youwant to write code using OpenMP, you'll probably want to download material from www.openmp.org, get yourself a book and/or attend a tutorial.

0 Kudos
Reply