Can software parallelization in Fortran reduce CPU usage and execution time?

  • Fortran
  • Thread starter gholamghar
  • Start date
  • Tags
    cpu Fortran
In summary, you can use multiple processors on a large scale by using a message passing interface. This can be done on a personal computer, but will require restructuring your code for parallel implementation. You can also use MPI to send data between processes.
  • #1
gholamghar
27
0
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
 
Technology news on Phys.org
  • #2
For using multiple processors on a large scale, we need to use a message passing interface to let the processors "talk" to each other. We use LAM/MPI if you're curious. Now, this is on large-scale clusters.

When the processors are all on-board, even though the memory is shared between the processors, I would still assume that some coding or MPI would need to be done to let code take full advantage of multiple cores.
 
  • #3
Yup, the obvious answer is MPI. Note that you will have to restructure your code for parallel implementation and add the message sending/receiving functionality into it. MPI is really easy, only about six functions are completely necessary.
 
  • #4
Are there any operations in your program that can be peformed in parallel? These could be split up into multiple threads. Also depending on the GPU in your video card, you might be able to use a GPU math library (ATI and nVIdia have these) which includes some vectorized floating point math operations, 4 to 16 operations in parallel.
 
  • #5
Another option is something called co-array fortran. I heard about it somewhere... it could be worth looking into.
 
  • #6
thank you all,i doubted that maybe i have not said the exact sentences to explain my questin,i am running my code in my personal computer not in a cluster,and my personal computer has just one core 2 quad processor,so you suggest that with MPI i can take advantage of all 4 cores of my processor?
(i have heard about OPENMP,is this like MPI? and could be used on my personal computer or it can be used only in a cluster?)
 
  • #7
You can create a mutli-threaded application, which should end up using one cpu per thread. I've done this with a C program running under windows, but don't know how it would be done in Fortran.
 
Last edited:
  • #8
You don't need to be running on a cluster to use MPI. You can break up your program into smaller pieces and run them in separate processes. Then you can use MPI to send data between the processes.
 
  • #9
My code was taking 35 hours.
I've just enable software parallelization ( /Qparallel) in Intel's Fortran Compiler ( writing in Ms. Visual Studio 2008) and I saved a third of the time!

Please answer me for talk about this process,

Giovane
 

1. What is a Fortran multiprocessor CPU?

A Fortran multiprocessor CPU is a type of central processing unit (CPU) that is specifically designed to run programs written in the Fortran programming language. It contains multiple processor cores that can work together to execute instructions in parallel, allowing for faster and more efficient processing of complex calculations and data.

2. How does a Fortran multiprocessor CPU differ from a standard CPU?

A Fortran multiprocessor CPU differs from a standard CPU in that it has multiple processor cores, which allows it to perform multiple calculations simultaneously. This can greatly improve the speed and efficiency of Fortran programs that are designed to take advantage of parallel processing.

3. What are the benefits of using a Fortran multiprocessor CPU?

The main benefit of using a Fortran multiprocessor CPU is that it can greatly increase the speed and efficiency of programs written in the Fortran language. This is especially important for scientific and engineering applications that require complex calculations and large amounts of data processing.

4. Are there any limitations to using a Fortran multiprocessor CPU?

One limitation of using a Fortran multiprocessor CPU is that it requires programs to be specifically designed to take advantage of parallel processing. This means that not all Fortran programs will see a significant improvement in performance when running on a multiprocessor CPU.

5. How can I determine if my program will benefit from a Fortran multiprocessor CPU?

You can determine if your program will benefit from a Fortran multiprocessor CPU by analyzing its code and identifying any sections that can be executed in parallel. If your program contains a lot of complex calculations or data processing, it is likely that it will see a significant improvement in performance when running on a multiprocessor CPU.

Similar threads

  • Programming and Computer Science
Replies
2
Views
1K
  • Programming and Computer Science
Replies
1
Views
617
  • Programming and Computer Science
Replies
11
Views
2K
  • Programming and Computer Science
Replies
12
Views
1K
  • Programming and Computer Science
Replies
4
Views
7K
  • Programming and Computer Science
Replies
10
Views
2K
  • Programming and Computer Science
Replies
9
Views
1K
  • Programming and Computer Science
Replies
3
Views
1K
  • Engineering and Comp Sci Homework Help
Replies
1
Views
6K
Back
Top