×
INTELLIGENT WORK FORUMS
FOR COMPUTER PROFESSIONALS

Log In

Come Join Us!

Are you a
Computer / IT professional?
Join Tek-Tips Forums!
  • Talk With Other Members
  • Be Notified Of Responses
    To Your Posts
  • Keyword Search
  • One-Click Access To Your
    Favorite Forums
  • Automated Signatures
    On Your Posts
  • Best Of All, It's Free!
  • Students Click Here

*Tek-Tips's functionality depends on members receiving e-mail. By joining you are opting in to receive e-mail.

Posting Guidelines

Promoting, selling, recruiting, coursework and thesis posting is forbidden.

Students Click Here

Jobs

run parallel program

run parallel program

run parallel program

(OP)
Dear all
How can i run a fortran program in parallel with openmpi or mpi
to reduce time


i try to run fortran program on 8 cores with linux so
i compile and run my program with gfortan and mpi

gfortran -o pp test.f90
mpirun -n 8 ./pp
my question is why serial is faster than parallel
and parallel program show 8 copies of my results
thank you
my program is
PROGRAM test
REAL :: a, b,c

a = 1
b=500


DO WHILE (a < 10)
PRINT* ,a
c=a*b/a

a = a + 1
END DO

END program test

RE: run parallel program

It depends entirely on what you are doing and what your machine can handle. Some programs run better in parallel, some better in serial. A machine with one core would do everything very well in serial.

Note that it is not just the computation time. Parallel programming has the added complication of scheduling, which is hidden from you. So even though the actual computation time will be less, if you add the scheduling time, both methods may seem equal or the parallel method may seem to take longer.

RE: run parallel program

It seems that what you are doing is running the same process on the 8 cores. That's why you get 8 times the same output.

You should learn some parallel programming in order to parallelize your code, or try with the automatic parallelization that the intel fortran compiler has. You can't get automatic parallelization with the gfortran compiler.

Red Flag This Post

Please let us know here why this post is inappropriate. Reasons such as off-topic, duplicates, flames, illegal, vulgar, or students posting their homework.

Red Flag Submitted

Thank you for helping keep Tek-Tips Forums free from inappropriate posts.
The Tek-Tips staff will check this out and take appropriate action.

Reply To This Thread

Posting in the Tek-Tips forums is a member-only feature.

Click Here to join Tek-Tips and talk with other members! Already a Member? Login

Close Box

Join Tek-Tips® Today!

Join your peers on the Internet's largest technical computer professional community.
It's easy to join and it's free.

Here's Why Members Love Tek-Tips Forums:

Register now while it's still free!

Already a member? Close this window and log in.

Join Us             Close