-2

I would like to know if it's possible to run a program written in fortran, which is quite "heavy", exploiting all the 24 threads of the CPUs.

I am using intel parallel studio XE 2011 and the routine is written in fortran 77.

Marcus Müller
  • 34,677
  • 4
  • 53
  • 94
  • 2
    It's certainly possible and you should direct your researches, in the first instance, towards 'OpenMP'. – High Performance Mark Dec 16 '15 at 14:03
  • Sorry for reply late on this. I figured out my code had some problems, now I am ready to try to parallelize it. I was reading [here](https://people.sc.fsu.edu/~jburkardt/f77_src/openmp/openmp.html) and [here](https://www.ncsu.edu/hpc/Courses/7shared.html) and [here](http://people.ds.cam.ac.uk/nmm1/openmp/Notes/notes_2.pdf). I am not an expert in programming, I am just a mechanical engineer and I have learnt the fortran basis recently, so sorry if what I say it's just a bullshit. I have understand that it's possible to parallelize loops like DO, FOR, by adding the "pragmas". It's only that? – Italo Persechino Jan 26 '16 at 10:43

1 Answers1

0

Sure, that's possible. There's quite some ways to go about this, but:

What I'm used to is having your "system logic" in a more versatile logic that directly supports things like pthreads or boost threads etc; most likely something like C or C++, and then spawning different threads for different parts of your calculation or parallelizable data parts, etc. Notice that modern compilers can generate binaries from fortran that adhere to normal C calling conventions, so that calling fortran functions doesn't have more overhead than calling other C, C++, ... functions. You should make damn sure not to modify global state in your fortran functions, though!

There's no parallelization framework for fortran77 that I would be aware of; there are a few in existence, but as far as I can tell they depend on language features that weren't there in F77. As @HighPerformanceMark pointed out, OpenMP could very well work with the intel compilers.

Marcus Müller
  • 34,677
  • 4
  • 53
  • 94