Intel® Fortran Compiler
Build applications that can scale for the future with optimized code designed for Intel® Xeon® and compatible processors.
Welcome to the Intel Community. If you get an answer you like, please mark it as an Accepted Solution to help others. Thank you!

Linking C++ with Fortran Co-arrays


Has anyone tried mixing C++ with Fortran co-arrays. I am trying to do so at the moment however it seems the "this_image()" and "num_images()" routines return a 0 for all cores, The main program is in C++ which calls a Fortran subroutine that contains those statements . There are no compilation errors or run time errors from these routines.

0 Kudos
1 Reply
Black Belt Retired Employee

If the main program is not in Fortran, then there are no calls to the run-time library to set up the coarray environment and also no "launch" code. I don't see documentation of a way to call the init routine yourself, though I know it's possible. May I suggest having the main be in Fortran and calling the C++ "main" as a subroutine?