
Multiprocessing in Python with Fortran and OpenMP - rbanffy
http://www.admin-magazine.com/HPC/Articles/Multicore-Processing-in-Python
======
sevensor
OpenMP is great and all, but you're going to have an awfully hard time beating
numpy on either speed or correctness, since it's using LAPACK under the hood
already.

~~~
milancurcic
False. OpenMP does shared-memory parallelism and has nothing to do with
LAPACK. numpy is completely serial.

~~~
auxym
Numpy can be compiled against a multi-threaded BLAS, for example MKL.

~~~
santaclaus
I've seen OpenMP-based, non-BLAS implementations beat out MKL, on Intel
hardware nonetheless. We emailed the MKL folks and they just shrugged. :)
Don't presume that MKL is the lower limit on performance.

------
pletnes
At this point in time, Fortran is basically a domain specific language,
analogously to using regular expressions for text processing. It is a
nightmare to write full applications in it. The f2py approach to Fortran is
undervalued IMHO, as Fortran is brilliant for certain types of simulation, and
much easier to write and optimize than C/C++.

~~~
msla
A number of languages most naturally live in the Domain-Specific Language
(DSL) world, and only left it because, through some period of history, some
groups didn't have much else. Fortran was a general-purpose language for a
while, because it was the only language other than BASIC or assembly available
at some sites, and it got roped into doing precisely the kind of text-
manipulation stuff it's historically been bad at. If someone is writing a text
adventure in Fortran, you know they don't have any other option.

Cobol is a DSL for record-oriented batch processing, which is extremely useful
for some business tasks and not very useful for most of the rest of the
programming world. RPG (Report Program Generator) is, if anything, even more
restricted than Cobol, but it never "escaped" to the extent Cobol did so it
never got the same kind of derision heaped upon it.

C is most naturally a DSL for OSes and what used to be called "systems
programming": Software that has to run at machine speed, and can sacrifice
usability and debuggability for pure speed. It was never a good choice for
most of what got written in it, but, again, C compilers were available when
other development tools were not, and, on a slow enough computer, _all_
programming becomes "systems programming".

~~~
pjmlp
C compilers only became generally available outside expensive UNIX
workstations around the mid-80's, until then there were dialects like Small-C
for CP/M systems, where C was just yet another language.

Systems programming languages exist since at least 1961, with ESPOL being one
of the first ones. IBM for example did their RISC research with PL/8.

As for pure speed, that is the result of 40 years research in taking advantage
of UB.

"Oh, it was quite a while ago. I kind of stopped when C came out. That was a
big blow. We were making so much good progress on optimizations and
transformations. We were getting rid of just one nice problem after another.
When C came out, at one of the SIGPLAN compiler conferences, there was a
debate between Steve Johnson from Bell Labs, who was supporting C, and one of
our people, Bill Harrison, who was working on a project that I had at that
time supporting automatic optimization...The nubbin of the debate was Steve's
defense of not having to build optimizers anymore because the programmer would
take care of it. That it was really a programmer's issue....

Seibel: Do you think C is a reasonable language if they had restricted its use
to operating-system kernels?

Allen: Oh, yeah. That would have been fine. And, in fact, you need to have
something like that, something where experts can really fine-tune without big
bottlenecks because those are key problems to solve. By 1960, we had a long
list of amazing languages: Lisp, APL, Fortran, COBOL, Algol 60. These are
higher-level than C. We have seriously regressed, since C developed. C has
destroyed our ability to advance the state of the art in automatic
optimization, automatic parallelization, automatic mapping of a high-level
language to the machine. This is one of the reasons compilers are ...
basically not taught much anymore in the colleges and universities."

Fran Allen interview, Excerpted from: Peter Seibel. Coders at Work:
Reflections on the Craft of Programming

