Intel® Fortran Compiler
Build applications that can scale for the future with optimized code designed for Intel® Xeon® and compatible processors.
Announcements
FPGA community forums and blogs on community.intel.com are migrating to the new Altera Community and are read-only. For urgent support needs during this transition, please visit the FPGA Design Resources page or contact an Altera Authorized Distributor.
29285 Discussions

Advance in Coarray Fortran (PGAS) Programming

Michael_S_17
New Contributor I
535 Views

Hi everybody,
this is to share information about our Coarray Fortran experiences so far. Hope you'll enjoy it :-)

Task-based Parallel Software Development using Simple Serial Fortran Syntax

Context: In our preparation to achieve a required degree of (dynamic) load balancing and scalability for upcoming many-core computers, we already obtain major advancing with Coarray Fortran (PGAS). Our successful setup, a Multiple Program Multiple Data (MPMD)-like programming style, seems to be rather uncommon with Fortran's Single Program Multiple Data (SPMD) coarray extension. Nevertheless, we make excellent experiences in extending an existing serial Fortran 95 object-based framework with coarrays.

Parallel Programming using Simple Serial Fortran Syntax: The possibility to encapsulate access to the coarray syntax completely is due to the fact that coarrays are only a minimalistic extension to the Fortran base language. To understand, let us face the fact that parallel programming is cumbersome, error-prone, and thereby does scare away most programers.
To avoid coding errors in our coarray programming, we soon started to encapsulate access to the required coarray syntax and functionality into object-based wrapper objects. (Our setup is F95 object-based/ADT). Thus, the parallel logic code can be written without coarrays or, in other words, the encapsulation enables us to do object-based parallel programming with simple serial Fortran syntax.
With that, the main coding does not feel much like parallel programming any more, but merely like ordinary object-based programming with the introduction of new ways of how the various objects can interact with each other. (That is through our coarray wrapper objects and because the (parallel) program logic code of the various main objects gets executed simultaneously, but asynchronously, in purely local memory on the distinct images).
We are not aware of any easier way to do parallel software development. The programming isn't any different from serial programming, at least in terms of writing the program logic code.

Turning Fortran 2008 into an APGAS language: We use a fork/join-like programming style, to hide Coarray Fortran's underlying SPMD model in favor of an extremely flexible MPMD-like programming with Fortran 2008 coarrays. Moreover, scalability and load balancing may require a more sophisticated parallel logic. Our serial syntax approach (see above) does not rely on further language features and makes it easy for the programer to develop sophisticated parallel logic code. Thus,

  • it already allows us to extend the PGAS-model with powerful APGAS-like features, in particular to designate distinct images to different tasks (task-based parallel programming)
  • build-in methods for synchronizations are rarely required any more, because more powerful synchronization methods can easily be implemented by the programer himself using simple serial Fortran syntax (that way, the synchronization methods are coded as being between objects rather than being between images)
  • also, some main feature of the proposed Coarray TS (Fortran 2015), namely grouping images into teams, can already be implemented using Fortran 2008 coarrays
  • it already allows us to add parallelism dynamically to a program (from outside the code), which might be a good first stride to achieve unlimited scalability in our future work
  • we can easily achieve an overlap of communication and computation in our (initializing) task synchronizations (this simply requires non-blocking writes).


Conclusion and Future Work: The use of simple serial Fortran syntax for the parallel logic code, together with the MPMD-like programming, makes advanced parallel software development for upcoming many-core computers feasible. The objective is to achieve scalability and dynamic load balancing through an asynchronous task-based parallel programming by means of an ISO standard. From our current view, Fortran 2008 can easily be extendend by the programer himself, to already meet important requirements of what is called an APGAS (or High Productivity Computing Systems) programming language. Others may argue. It is our aim to build a small sample program to show the simple techniques in practice.

cheers
Michael

0 Kudos
0 Replies
Reply