In this paper, we have discussed the design of a Fortran interface to the parallel C++ (pC++) programming language. Our prototype Fortran interface which allows linking pC++ control programs to CM Fortran and Fortran77 subroutines proves to be efficient. Our experiments demonstrate that our portable mix of Fortran and C++ enables programmers to write efficient programs, and, at the same time, utilize both the fast vector and array computation properties of Fortran and the data structure manipulation and encapsulation properties of C++.
One of the shortcomings of our current implementation is that Fortran COMMON blocks cannot be accessed by pC++ control programs. Communication between Fortran subroutines through COMMON blocks is allowed, though potential race-condition may arise because pC++ programming model allows more than one pC++ collection element to be allocated on one processor. In addition, our current compiler cannot generate the wrapper functions required for Fortran subroutines. For the moment, the wrapper functions have to be hand-coded. The CM Fortran compiler layout directive also allows a communication weight to be assigned to an array axis. This feature is not implemented in our current Fortran interface design. We plan to add it in the future.
Efforts are under way to port pC++ and the Fortran interface to Cray T3D. We are studying Cray MPP Fortran specifications and experimenting with different Fortran interface designs for the T3D.