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

Launching a Coarray process from within Fortran

David_DiLaura1
New Contributor I
597 Views

Steve (et alia),

Is it possible for a non-Coarray Fortran program to launch a Coarray Fortran?  Can a Coarray Fortran image launch other Coarray Fortran images? I'm imagining using RUNQQ() in both cases.  We are exploring some (perhaps unconventional) ways to parallelize very large sections of engineering code. These ideas arise from the need to very carefully balance work load between Coarray images if full efficiency is to be obtained.

David

0 Kudos
3 Replies
Steven_L_Intel1
Employee
597 Views

You can only launch an entire program - the number of images is determined when the program starts. RUNQQ can be used to start a coarray program. You can't dynamically add images. Keep in mind that with coarrays that they are partitioned at program start based on the number of images.

It is possible to write a coarray program with "worker images" that wait for work to be assigned through the shared variables.

0 Kudos
David_DiLaura1
New Contributor I
597 Views

Steve,

Can you clarify just a bit? Your reply indicates that I can run a non-Coarray fortran program, and that I can then (from within it) use RUNQQ to launch a Coarray program. I would then have the mother program running but waiting for the Coarray images to finish and multiple images of the Coarray program executing. Presumably the "lanucher" will need to communicate to the "launchees" via files -- though the "launchees" could communicate to each other via shared variables.  Or have I misunderstood?

David

0 Kudos
Steven_L_Intel1
Employee
597 Views

Yes, that's exactly right. Well, mostly. There's only one "launchee" - that it ends up running in parallel is not inherently visible to the launching program. It's no different from running an autoparallel or OpenMP program via RUNQQ, though a lot more happens behind the curtain.

You could also communicate through command arguments - typically image 1 would determine what work is to be done and set things up for other images to process, though files also work.

0 Kudos
Reply