[PATCH] Implementation of RANDOM_INIT from F2018

Damian Rouson damian@sourceryinstitute.org
Tue Jan 9 02:03:00 GMT 2018


I’ll be glad to test with -fcoarray=lib -lcaf_mpi with two caveats:

1. My turnaround time will probably usually be 48-72 hours for such tests.  
2. I don’t monitor this mailing list very closely so I might miss similar requests unless they are also submitted as issues on the OpenCoarrays GitHub repository.   

For clarification, are you asking for simple execution of the existing tests or do you suspect that the tests might need modification (or new tests) to exercise the -fcoarray=lib option?

Damian
On January 8, 2018 at 4:58:09 PM, Steve Kargl (sgk@troutmask.apl.washington.edu) wrote:

On Sun, Jan 07, 2018 at 06:52:22PM -0800, Steve Kargl wrote:  
>  
> I have zero knowledge about co-arrays and especially zero  
> knowledge about gfortran internals for co-arrays. I'm  
> disinclined to waste another 12 hours trying to get gfortran  
> to emit essentially a call to this_image(). See iresolve.c  
> for details.  
>  

An epiphany came to me last night, which has led to the attach  
patch. This patch should be a complete implementation of  
RANDOM_INIT.  

RANDOM_INIT takes two LOGICAL, INTENT(IN) arguments. To  
avoid library bloat, these arguments are converted/casted to  
LOGICAL(4) in trans-intrinsic.c (conv_intrinsic_random_init).  
It is also in this function, that I set up the hidden argument  
that is needed to hopefully give standard conforming behavior  
when co-arrays are involved. I, however, cannot test -fcoarray=lib  
situation. I would appreciate feedback from a co-array user.  

Boostrapped and regression tested on x86_64-*-freebsd.  
OK to commit?  

2018-01-08 Steven G. Kargl <kargl@gcc.gnu.org>  

* check.c (gfc_check_random_init): New function. Check arguments of  
random_init().  
* gfortran.h (gfc_isym_id): Add GFC_ISYM_RANDOM_INIT.  
* intrinsic.c (add_subroutines): Make random_init() an intrinsic  
subroutine.  
(gfc_check_intrinsic_standard): Check for Fortran 2018.  
* intrinsic.h: Add prototypes for gfc_check_random_init and  
gfc_resolve_random_init.  
* iresolve.c (gfc_resolve_random_init): New function. Add  
_gfortran_random_init to list of subroutines.  
* trans-decl.c: Describe gfor_fndecl_random_init.  
* trans-intrinsic.c (conv_intrinsic_random_init): New function.  
Translate random_init and added hidden argument.  
(gfc_conv_intrinsic_subroutine): Call conv_intrinsic_random_init.  
* trans.h: Declare gfor_fndecl_random_init.  

2018-01-08 Steven G. Kargl <kargl@gcc.gnu.org>  

* gfortran.dg/random_init_1.f90: New test.  
* gfortran.dg/random_init_2.f90: New test.  

2018-01-08 Steven G. Kargl <kargl@gcc.gnu.org>  

* gfortran.map: Add _gfortran_random_init to library map.  
* intrinsics/random.c (random_init): Implemenation of random_init.  

--  
steve  



More information about the Gcc-patches mailing list