Skip to content

Expose *_caf_init(), *caf_finalize() #204

Closed
@amckinstry

Description

@amckinstry

Hi,

I've been experimenting with running CAF under Python using f2py. Its a bit hacky at the moment (proof of concept time) but I can now compile and run CAF programs under Python3 using f2py3.5, OpenCoarrays 1.6.0 and OpenMPI 1.10.3 on Debian.

So I have a Fortran module:

module caftest
contains
  subroutine bar
    implicit none
    integer:: np, me

    np = num_images()
    me = this_image()
    write (*,*) "I am image ", me, " of ", np
  end subroutine bar
end module

caftest.py:

#!/usr/bin/env python3
# hacky setup code here
caftest.bar()

mpiexec -n 2 ./caftest.py
I am image 1 of 2
I am image 2 of 2

To do this, I've needed to call _gfortran_caf_init() and _gfortran_caf_finalize() from the Python / f2py layer, in order to setup mpi_init, etc. But there is no coarray.h, API exposed, so this was a little .. unorthodox. Can they be exposed?

Regards
Alastair McKinstry

Metadata

Metadata

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions