A provocative title I’ll admit, and I’ll readily admit from the start that other’s experiences may be quite different. But from my perspective coarrays are not ready for serious use. I work mostly with domain decomposition methods for PDEs and the question for me is whether Fortran coarrays can be a competitive parallel programming alternative to MPI. Computational performance is the key concern, but also performance portability – I expect things to work reasonably uniformly across multiple compilers, and am not comfortable with solutions that limit me practically to a single compiler/platform. To answer that question I’ve been considering several coarray implementations, and a reference MPI implementation, of a core halo exchange operation. So far I’ve been able to test using the NAG, Intel, and GNU Fortran (with OpenCoarrays) compilers. The results have been quite surprising and discouraging. Here are some sample results for a typical test case:
- The ratio of the time of a compiler’s best coarray implementation to the best reference MPI time: gfortran: 1690; Intel: 5.42; NAG: 1.15.
The Intel result doesn’t seem half bad until you consider this result for the same test case:
- The ratio of the time of a compiler’s worst coarray implementation to the time of it’s best coarray implementation: gfortran: 3.7; NAG: 9; Intel 12700!
Of the 4 coarray implementations, Intel performed roughly similar to gfortran on 3 of them, namely 3 to 4 orders of magnitude worse than MPI, and only on 1 did it approach the performance of MPI. Such wild variability isn’t acceptable to me.
So of the 3 compilers only NAG coarrays was competitive with MPI; in fact with some small tweaking its coarray implementation could be made faster than MPI.
I’ve created a repository for the code and tests (previously mentioned in an earlier post). You can find detailed results and much explanation there. I’d truly welcome any feedback you might have – create an issue or start a discussion there.
There’s one final issue regarding the usability of coarrays the greatly concerns me, and that is whether it can co-operate with MPI and work in mixed-language contexts. There’s an existing topic about using a coarray library in a non-Fortran program. Top of my list of needs is being able to use an MPI-parallel library (Hypre) from a Fortran coarray program. Since the Intel and gfortran coarray implementations are built using MPI I think this is most likely doable. However the NAG coarray implementation – the only one I find is truly usable – does something different and I have serious doubts whether it is doable with NAG.