[Numpy-discussion] parallel compilation with numpy.distutils in numpy 1.10

Sturla Molden sturla.molden at gmail.com
Fri Oct 10 15:09:47 EDT 2014


Julian Taylor <jtaylor.debian at googlemail.com> wrote:

> There is still one problem in regards to parallelizing fortran 90. The
> ccompiler.py contains following comment:
>     # build any sources in same order as they were originally specified
>     #   especially important for fortran .f90 files using modules
> 
> This indicates the f90 builds cannot be trivially parallelized. I do not
> know much fortran, can someone explain to me when ordering of single
> file compiles is an issue in f90?


Sure :)

When a Fortran module is compiled, the compiler emits an object file (.o)
and a module file (.mod). The module file plays the role of a header file
in C. So when another Fortran file imports the module with a use statement,
the compiler looks for the module file. Because the .mod file is generated
by the compiler, unlike the .h file in C, the ordering of compilation is
more critical in Fortran 90 than in C. If B.f90 has a "use A" statement,
then A.f90 must be compiled before B.f90. CMake has an intelligent system
for working out the correct order of compilation of Fortran 90 files.


Sturla




More information about the NumPy-Discussion mailing list