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

Sturla Molden sturla.molden at gmail.com
Fri Oct 10 15:24:12 EDT 2014


Sturla Molden <sturla.molden at gmail.com> wrote:

> 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.

So the Fortran 90 files creates a directed asyclic graph. To compute in
parallel one might use a set of coroutines, one for each f90 file, and then
yield from the downstream files in the graph. But on the other hand, it
might not be worth the effort. ;-)


Sturla




More information about the NumPy-Discussion mailing list