Quantcast
Channel: Fortran
Viewing all articles
Browse latest Browse all 3108

Duplication of a list structure (with chain of pointers) from one coarray image to another.

$
0
0

I am wondering if there is any elegant solution to the following problem. How can one duplicate a list structure from one coarray image to another?

PROGRAM P
IMPLICIT NONE
TYPE T_NODE
    ! Some data.
    TYPE(T_NODE),POINTER :: NEXT => NULL()
END TYPE T_NODE
TYPE T_CONTAINER
    TYPE(T_NODE),POINTER :: ROOT => NULL()
END TYPE T_CONTAINER
TYPE(T_CONTAINER) :: C[*]
IF (THIS_IMAGE()==2) THEN
    ! Initialize C with multiple linked nodes. Trivial.
END IF
SYNC ALL
IF (THIS_IMAGE()==1) THEN
    ! Create a copy of C[2] into local C. Not that trivial!
END IF
END PROGRAM P

 


Viewing all articles
Browse latest Browse all 3108

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>