Co-Array Fortran: Questions & Answers for Amateur Programmers

  • Context: Fortran 
  • Thread starter Thread starter natski
  • Start date Start date
  • Tags Tags
    Fortran
Join the discussion
Registration is free. Ask a follow-up in this thread, or start your own.
2 replies · 5K views
natski
Messages
262
Reaction score
2
Hi Guys,

I have coded in f77/f90 for a few years in what I would consider a fairly amateurish way but I am now hitting the CPU wall for some programs and need to parallelize some programs to make use of multiple cores.

Looking around Google, I quickly came across this co-array business which seems a perfect solution. I really want something intrinsic to Fortran rather than an extra layer. However, I am quite confused as to what is going on and would really appreciate to hear the views of the physicsforums.com community.

Firstly, it appears to me Intel have not released a Fortran compiler which has co-arrays, is this correct? If so, I don't understand why all the references to co-arrays talk about Fortran 2008 due to implement this feature, but it is now 2010 and still no compiler? I mean that's missing a deadline by >2 years which seems bizarre for a company like Intel. What's going on there??

Secondly, the only compiler, I *think*, which has this intrinsic co-array mode is g95 and even here there seems to be some issues. g95 seems to require a console which just doesn't make any sense to me why such a thing would be required... Also, the compiler is designed to run multiples images across a network rather than across multiple cores in a single machine. I really need the latter which makes me dumbfounded as to how to proceed.

So this leaves me thinking, there is no solution currently present to produce an intrinsic coarray-type Fortran program... or at least certainly not an optimized one... is this correct too?

Natski
 
Physics news on Phys.org
natski said:
Hi Guys,

I have coded in f77/f90 for a few years in what I would consider a fairly amateurish way but I am now hitting the CPU wall for some programs and need to parallelize some programs to make use of multiple cores.

Looking around Google, I quickly came across this co-array business which seems a perfect solution. I really want something intrinsic to Fortran rather than an extra layer. However, I am quite confused as to what is going on and would really appreciate to hear the views of the physicsforums.com community.

Firstly, it appears to me Intel have not released a Fortran compiler which has co-arrays, is this correct? If so, I don't understand why all the references to co-arrays talk about Fortran 2008 due to implement this feature, but it is now 2010 and still no compiler? I mean that's missing a deadline by >2 years which seems bizarre for a company like Intel. What's going on there??

Secondly, the only compiler, I *think*, which has this intrinsic co-array mode is g95 and even here there seems to be some issues. g95 seems to require a console which just doesn't make any sense to me why such a thing would be required... Also, the compiler is designed to run multiples images across a network rather than across multiple cores in a single machine. I really need the latter which makes me dumbfounded as to how to proceed.

So this leaves me thinking, there is no solution currently present to produce an intrinsic coarray-type Fortran program... or at least certainly not an optimized one... is this correct too?

Natski
The coarray console for g95 is for setting up the network for the coarray program-- ie logging into the remote machines, transferring the executable and generally getting everything going. I'm thinking that may be a little too complicated, and have been considering alternatives.

I've been working on a version of the coarray library optimized for SMP machines, no networking involved. The linux version (x86, x86-64 and ia64) should be done within a few days. Ports to architectures like sparc or ppc should be pretty straighforward, but first I'm planning on a windows version that will hopefully be done in a few more weeks. Check www.g95.org for updates.

Like you, I've been pretty excited about coarrays-- they're integrated with the language much better than any of the parallel libraries and are far more readable code-wise than the huge and cryptic CALL statements of MPI or PVM.

Andy
 
Thanks for the response Andy! Great to hear a new version is coming to linux very soon. I'm sure this will give a new lease of life to many of scripts!