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

Fortran multiprocessor cpu?

gholamghar
Beginner
823 Views
hello
i have intel core 2 quad and my operating system is windows,every time i execute my fortran code it takes 8 hours to finish and just 25% of my cpu is used during the run(cpu usage=25%),it means just one core of my processor is used,so is there any way that i can use all the 4 cores of my processor for executing my fortran code so that the executing time is reduced?
thanks in advance
0 Kudos
4 Replies
jimdempseyatthecove
Honored Contributor III
823 Views

Welcome to the world of parallel programming.

If you have the source code, and are willing to invest some of your time in recoding, then you can increase the utilization of coresand generally improve theperformance of the application.

Study the examples relating to OpenMP in Fortran.

Most applications can benefit from parallel programming. It is not all that hard, once you are famillier with the techniques.

Jim Dempsey
0 Kudos
gholamghar
Beginner
823 Views
thank you,i am running my code in my personal computer with a intel processor core 2 quad and 2 gigabytes of ram,you said i should use OPENMP with my code while running in my personal computer,i have heard about MPI is it possible to use MPI method with my personal computer too or MPI can be used just in clusters?
(in your opinion which one is easier to learn the techniques?)

0 Kudos
Steven_L_Intel1
Employee
823 Views
You can use MPI but it is not designed for optimal use on a single system. OpenMP looks complicated but if you start slow it's not bad. You may want to try as an experiment adding the /parallel option and see if you get an acceptable speedup. The compiler can automatically parallelize, but it is very conservative in doing so. Enabling optimization reports allows the compiler to tell you what is stopping it from parallelizing a loop.

I strongly recommend reading the sections of the Optimizing Applications documentation that discuss parallel processing.
0 Kudos
jimdempseyatthecove
Honored Contributor III
823 Views

OpenMP would be the route to take.

MPI is suitable when you have multiple processors that do not have shared memory
or
When you have a shared memory system but each process (application) has a limited amount of addressable memory (x32 application running on x64 platform or running with more than 3GB).
or
When you must compartmentalize code | code | data |data

You will get help here on the forum.

Jim Dempsey


0 Kudos
Reply