Community
cancel
Showing results for 
Search instead for 
Did you mean: 
Highlighted
Beginner
2 Views

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
Highlighted
Retired Employee
2 Views

If the main program is not in

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?

--
Steve (aka "Doctor Fortran") - https://stevelionel.com/drfortran
0 Kudos