Re: [PATCH] Character length cleanup for Coarray Fortran library

2018-02-22 Thread Janne Blomqvist
On Thu, Feb 22, 2018 at 11:46 AM, Janne Blomqvist
 wrote:
> On Thu, Feb 22, 2018 at 2:36 AM, Damian Rouson
>  wrote:
>> Hi Janne,
>>
>> To be more specific, the new OpenCoarrays test failures after applying the
>> patch are the following ones:
>>
>>  image_fail_test_1 (Timeout)
>>  image_fail_and_sync_test_2 (Timeout)
>>  image_fail_and_sync_test_3 (Timeout)
>>  image_fail_and_get_test_1 (Timeout)
>>
>> There are four.  I was mistaken when I wrote that there are three.
>>
>> Damian
>>
>> On February 21, 2018 at 12:56:05 PM, Janne Blomqvist
>> (blomqvist.ja...@gmail.com) wrote:
>>
>> On Wed, Feb 21, 2018 at 10:18 PM, Damian Rouson
>>  wrote:
>>>
>>>
>>>
>>>
>>> On February 21, 2018 at 11:35:47 AM, Janne Blomqvist
>>> (blomqvist.ja...@gmail.com(mailto:blomqvist.ja...@gmail.com)) wrote:
>>>
 PING

 Is anybody planning to work on this on the opencoarrays side? Or do
 you prefer that this is just committed and you can sort it out on your
 own schedule?
>>>
>>> Hi Janne,
>>>
>>> The trunk didn’t build for me the first time I tried soon after your
>>> initial email and it took me until yesterday to find time to try again. Once
>>> I succeeded, the patch created three new test failures. I’m wondering if
>>> Andre’s recent patch (r257813) helped reduce the number. All new failures
>>> involve the failed-images features developed by Alessandro and Andre, both
>>> of whom now have new employment or contracts that prevent making significant
>>> contributions to OpenCoarrays (although I hope that will change and am
>>> working with Alessandro’s organization to attempt to get some of his time
>>> allocated to gfortran/OpenCoarrays development).
>>>
>>> I think the most sustainable path forward is for me to assist any
>>> interested gfortran developer in building OpenCoarrays on your local system
>>> and running the test suite. At least that eliminates the reliance on
>>> OpenCoarrays developers to run the tests every time a patch impacts
>>> OpenCoarrays. If we can work together on building OpenCoarrays on your
>>> system, we can also look together at the requisite changes to see if we can
>>> eliminate the failures.
>>>
>>> Oxford University Ph.D. student Daniel Garza visit Sourcery Institute
>>> March 17 - June 2 to integrate the building of OpenCoarrays into the GCC
>>> build system so I hope this will all be easier sooner.
>>
>> Ok, I'll see if I find the time to get opencoarrays built.
>>
>>
>>
>> --
>> Janne Blomqvist
>
> Hi,
>
> I managed to build and test OpenCoarrays. I committed a slightly
> enlarged patch (I needed to fix STOP and ERROR STOP in libgfortran as
> well to make everything consistent) as r257894. I'll shortly send out
> the pull request with the corresponding changes needed in
> OpenCoarrays.

OpenCoarrays pull request:
https://github.com/sourceryinstitute/OpenCoarrays/pull/508



-- 
Janne Blomqvist


Re: [PATCH] Character length cleanup for Coarray Fortran library

2018-02-22 Thread Janne Blomqvist
On Thu, Feb 22, 2018 at 2:36 AM, Damian Rouson
 wrote:
> Hi Janne,
>
> To be more specific, the new OpenCoarrays test failures after applying the
> patch are the following ones:
>
>  image_fail_test_1 (Timeout)
>  image_fail_and_sync_test_2 (Timeout)
>  image_fail_and_sync_test_3 (Timeout)
>  image_fail_and_get_test_1 (Timeout)
>
> There are four.  I was mistaken when I wrote that there are three.
>
> Damian
>
> On February 21, 2018 at 12:56:05 PM, Janne Blomqvist
> (blomqvist.ja...@gmail.com) wrote:
>
> On Wed, Feb 21, 2018 at 10:18 PM, Damian Rouson
>  wrote:
>>
>>
>>
>>
>> On February 21, 2018 at 11:35:47 AM, Janne Blomqvist
>> (blomqvist.ja...@gmail.com(mailto:blomqvist.ja...@gmail.com)) wrote:
>>
>>> PING
>>>
>>> Is anybody planning to work on this on the opencoarrays side? Or do
>>> you prefer that this is just committed and you can sort it out on your
>>> own schedule?
>>
>> Hi Janne,
>>
>> The trunk didn’t build for me the first time I tried soon after your
>> initial email and it took me until yesterday to find time to try again. Once
>> I succeeded, the patch created three new test failures. I’m wondering if
>> Andre’s recent patch (r257813) helped reduce the number. All new failures
>> involve the failed-images features developed by Alessandro and Andre, both
>> of whom now have new employment or contracts that prevent making significant
>> contributions to OpenCoarrays (although I hope that will change and am
>> working with Alessandro’s organization to attempt to get some of his time
>> allocated to gfortran/OpenCoarrays development).
>>
>> I think the most sustainable path forward is for me to assist any
>> interested gfortran developer in building OpenCoarrays on your local system
>> and running the test suite. At least that eliminates the reliance on
>> OpenCoarrays developers to run the tests every time a patch impacts
>> OpenCoarrays. If we can work together on building OpenCoarrays on your
>> system, we can also look together at the requisite changes to see if we can
>> eliminate the failures.
>>
>> Oxford University Ph.D. student Daniel Garza visit Sourcery Institute
>> March 17 - June 2 to integrate the building of OpenCoarrays into the GCC
>> build system so I hope this will all be easier sooner.
>
> Ok, I'll see if I find the time to get opencoarrays built.
>
>
>
> --
> Janne Blomqvist

Hi,

I managed to build and test OpenCoarrays. I committed a slightly
enlarged patch (I needed to fix STOP and ERROR STOP in libgfortran as
well to make everything consistent) as r257894. I'll shortly send out
the pull request with the corresponding changes needed in
OpenCoarrays.

-- 
Janne Blomqvist


Re: [PATCH] Character length cleanup for Coarray Fortran library

2018-02-21 Thread Damian Rouson
Hi Janne,

To be more specific, the new OpenCoarrays test failures after applying the 
patch are the following ones:

 image_fail_test_1 (Timeout)
 image_fail_and_sync_test_2 (Timeout)
 image_fail_and_sync_test_3 (Timeout)
 image_fail_and_get_test_1 (Timeout)

There are four.  I was mistaken when I wrote that there are three.

Damian

On February 21, 2018 at 12:56:05 PM, Janne Blomqvist 
(blomqvist.ja...@gmail.com) wrote:

On Wed, Feb 21, 2018 at 10:18 PM, Damian Rouson  
 wrote:  
>  
>  
>  
>  
> On February 21, 2018 at 11:35:47 AM, Janne Blomqvist 
> (blomqvist.ja...@gmail.com(mailto:blomqvist.ja...@gmail.com)) wrote:  
>  
>> PING  
>>  
>> Is anybody planning to work on this on the opencoarrays side? Or do  
>> you prefer that this is just committed and you can sort it out on your  
>> own schedule?  
>  
> Hi Janne,  
>  
> The trunk didn’t build for me the first time I tried soon after your initial 
> email and it took me until yesterday to find time to try again. Once I 
> succeeded, the patch created three new test failures. I’m wondering if 
> Andre’s recent patch (r257813) helped reduce the number. All new failures 
> involve the failed-images features developed by Alessandro and Andre, both of 
> whom now have new employment or contracts that prevent making significant 
> contributions to OpenCoarrays (although I hope that will change and am 
> working with Alessandro’s organization to attempt to get some of his time 
> allocated to gfortran/OpenCoarrays development).  
>  
> I think the most sustainable path forward is for me to assist any interested 
> gfortran developer in building OpenCoarrays on your local system and running 
> the test suite. At least that eliminates the reliance on OpenCoarrays 
> developers to run the tests every time a patch impacts OpenCoarrays. If we 
> can work together on building OpenCoarrays on your system, we can also look 
> together at the requisite changes to see if we can eliminate the failures.  
>  
> Oxford University Ph.D. student Daniel Garza visit Sourcery Institute March 
> 17 - June 2 to integrate the building of OpenCoarrays into the GCC build 
> system so I hope this will all be easier sooner.  

Ok, I'll see if I find the time to get opencoarrays built.  



--  
Janne Blomqvist  


Re: [PATCH] Character length cleanup for Coarray Fortran library

2018-02-21 Thread Izaak Beekman
Reach out to Damian or me if you encounter any frustration. You should be
all set with a recent version of CMake and MPICH or OpenMPI installed. It
should look something like:

git clone https://github.com/sourceryinstitute/OpenCoarrays
cd OpenCoarrays
mkdir build
cd build
export FC=/path/to/gfortran/build/bin/gfortran
export CC=/path/to/gcc/build/bin/gcc
cmake ..
make -j
make check

Thanks,
Zaak

On Wed, Feb 21, 2018 at 3:56 PM Janne Blomqvist 
wrote:

> On Wed, Feb 21, 2018 at 10:18 PM, Damian Rouson
>  wrote:
> >
> >
> >
> >
> > On February 21, 2018 at 11:35:47 AM, Janne Blomqvist (
> blomqvist.ja...@gmail.com(mailto:blomqvist.ja...@gmail.com)) wrote:
> >
> >> PING
> >>
> >> Is anybody planning to work on this on the opencoarrays side? Or do
> >> you prefer that this is just committed and you can sort it out on your
> >> own schedule?
> >
> > Hi Janne,
> >
> > The trunk didn’t build for me the first time I tried soon after your
> initial email and it took me until yesterday to find time to try again.
> Once I succeeded, the patch created three new test failures.  I’m wondering
> if Andre’s recent patch (r257813) helped reduce the number.  All new
> failures involve the failed-images features developed by Alessandro and
> Andre, both of whom now have new employment or contracts that prevent
> making significant contributions to OpenCoarrays (although I hope that will
> change and am working with Alessandro’s organization to attempt to get some
> of his time allocated to gfortran/OpenCoarrays development).
> >
> > I think the most sustainable path forward is for me to assist any
> interested gfortran developer in building OpenCoarrays on your local system
> and running the test suite.  At least that eliminates the reliance on
> OpenCoarrays developers to run the tests every time a patch impacts
> OpenCoarrays.  If we can work together on building OpenCoarrays on your
> system, we can also look together at the requisite changes to see if we can
> eliminate the failures.
> >
> > Oxford University Ph.D. student Daniel Garza visit Sourcery Institute
> March 17 - June 2 to integrate the building of OpenCoarrays into the GCC
> build system so I hope this will all be easier sooner.
>
> Ok, I'll see if I find the time to get opencoarrays built.
>
>
>
> --
> Janne Blomqvist
>


Re: [PATCH] Character length cleanup for Coarray Fortran library

2018-02-21 Thread Janne Blomqvist
On Wed, Feb 21, 2018 at 10:18 PM, Damian Rouson
 wrote:
>
>
>
>
> On February 21, 2018 at 11:35:47 AM, Janne Blomqvist 
> (blomqvist.ja...@gmail.com(mailto:blomqvist.ja...@gmail.com)) wrote:
>
>> PING
>>
>> Is anybody planning to work on this on the opencoarrays side? Or do
>> you prefer that this is just committed and you can sort it out on your
>> own schedule?
>
> Hi Janne,
>
> The trunk didn’t build for me the first time I tried soon after your initial 
> email and it took me until yesterday to find time to try again.  Once I 
> succeeded, the patch created three new test failures.  I’m wondering if 
> Andre’s recent patch (r257813) helped reduce the number.  All new failures 
> involve the failed-images features developed by Alessandro and Andre, both of 
> whom now have new employment or contracts that prevent making significant 
> contributions to OpenCoarrays (although I hope that will change and am 
> working with Alessandro’s organization to attempt to get some of his time 
> allocated to gfortran/OpenCoarrays development).
>
> I think the most sustainable path forward is for me to assist any interested 
> gfortran developer in building OpenCoarrays on your local system and running 
> the test suite.  At least that eliminates the reliance on OpenCoarrays 
> developers to run the tests every time a patch impacts OpenCoarrays.  If we 
> can work together on building OpenCoarrays on your system, we can also look 
> together at the requisite changes to see if we can eliminate the failures.
>
> Oxford University Ph.D. student Daniel Garza visit Sourcery Institute March 
> 17 - June 2 to integrate the building of OpenCoarrays into the GCC build 
> system so I hope this will all be easier sooner.

Ok, I'll see if I find the time to get opencoarrays built.



-- 
Janne Blomqvist


Re: [PATCH] Character length cleanup for Coarray Fortran library

2018-02-21 Thread Janne Blomqvist
PING

Is anybody planning to work on this on the opencoarrays side? Or do
you prefer that this is just committed and you can sort it out on your
 own schedule?

On Sat, Feb 10, 2018 at 11:20 PM, Janne Blomqvist
 wrote:
> On Sat, Feb 10, 2018 at 9:34 PM, Damian Rouson
>  wrote:
>>
>> I’ll try applying the patch and testing it.
>
> As such, I'm sure that will fail as the patch changes the coarray API
> and thus needs corresponding changes on the OpenCoarrays side as well.
>
>>  I have about a 50% success rate with getting patches to apply cleanly.  Is 
>> this available on an svn or git branch that I can just checkout rather than 
>> attempting to apply the patch?  I find that process to be much more reliable.
>>
>> Going forward, please submit OpenCoarrays questions or issues via our issues 
>> page:
>>
>> https://github.com/sourceryinstitute/OpenCoarrays/issues
>
> Ok, I just filed https://github.com/sourceryinstitute/OpenCoarrays/issues/497
>
>> Most OpenCoarrays contributors don’t monitor the gfortran mailing list 
>> closely so we’re unlikely to see emails to the list in a timely manner.
>>
>> Also, when making changes that impact OpenCoarrays, please build 
>> OpenCoarrays and run our test suite.  We recently made several changes to 
>> our installation documentation and installer script based on feedback 
>> received from Steve Kargl.  One result is a set of instructions written by 
>> Zaak with GCC developers as an intended audience:
>>
>> https://github.com/sourceryinstitute/OpenCoarrays/blob/master/INSTALL
>>
>> Several other installation changes inspired by Steve’s feedback are listed 
>> here:
>>
>> https://github.com/sourceryinstitute/OpenCoarrays/issues/478
>>
>> and these will make it into a release shortly, but are already all available 
>> via git clone. I’m looking forward to hosting Oxford University Ph.D. 
>> student Daniel Garza, from March 17 to June 2, to work on finishing the 
>> integration of OpenCoarrays into the GCC autotools scripts so that 
>> OpenCoarrays will be built anytime gfortran is built so hopefully it will be 
>> even easier for everyone to build and test with OpenCoarrays soon.
>
> Thanks; I should look into building opencoarrays at some point. For
> this patch I was hoping that someone familiar with the OpenCoarrays
> code base could do the equivalent fix there and test it, as it rather
> mechanical and simple.
>
>
> --
> Janne Blomqvist



-- 
Janne Blomqvist


Re: [PATCH] Character length cleanup for Coarray Fortran library

2018-02-21 Thread Damian Rouson
 



On February 21, 2018 at 11:35:47 AM, Janne Blomqvist 
(blomqvist.ja...@gmail.com(mailto:blomqvist.ja...@gmail.com)) wrote:

> PING  
>  
> Is anybody planning to work on this on the opencoarrays side? Or do  
> you prefer that this is just committed and you can sort it out on your  
> own schedule?  

Hi Janne,

The trunk didn’t build for me the first time I tried soon after your initial 
email and it took me until yesterday to find time to try again.  Once I 
succeeded, the patch created three new test failures.  I’m wondering if Andre’s 
recent patch (r257813) helped reduce the number.  All new failures involve the 
failed-images features developed by Alessandro and Andre, both of whom now have 
new employment or contracts that prevent making significant contributions to 
OpenCoarrays (although I hope that will change and am working with Alessandro’s 
organization to attempt to get some of his time allocated to 
gfortran/OpenCoarrays development).

I think the most sustainable path forward is for me to assist any interested 
gfortran developer in building OpenCoarrays on your local system and running 
the test suite.  At least that eliminates the reliance on OpenCoarrays 
developers to run the tests every time a patch impacts OpenCoarrays.  If we can 
work together on building OpenCoarrays on your system, we can also look 
together at the requisite changes to see if we can eliminate the failures.

Oxford University Ph.D. student Daniel Garza visit Sourcery Institute March 17 
- June 2 to integrate the building of OpenCoarrays into the GCC build system so 
I hope this will all be easier sooner.

Damian 




Re: [PATCH] Character length cleanup for Coarray Fortran library

2018-02-10 Thread Janne Blomqvist
On Sat, Feb 10, 2018 at 9:34 PM, Damian Rouson
 wrote:
>
> I’ll try applying the patch and testing it.

As such, I'm sure that will fail as the patch changes the coarray API
and thus needs corresponding changes on the OpenCoarrays side as well.

>  I have about a 50% success rate with getting patches to apply cleanly.  Is 
> this available on an svn or git branch that I can just checkout rather than 
> attempting to apply the patch?  I find that process to be much more reliable.
>
> Going forward, please submit OpenCoarrays questions or issues via our issues 
> page:
>
> https://github.com/sourceryinstitute/OpenCoarrays/issues

Ok, I just filed https://github.com/sourceryinstitute/OpenCoarrays/issues/497

> Most OpenCoarrays contributors don’t monitor the gfortran mailing list 
> closely so we’re unlikely to see emails to the list in a timely manner.
>
> Also, when making changes that impact OpenCoarrays, please build OpenCoarrays 
> and run our test suite.  We recently made several changes to our installation 
> documentation and installer script based on feedback received from Steve 
> Kargl.  One result is a set of instructions written by Zaak with GCC 
> developers as an intended audience:
>
> https://github.com/sourceryinstitute/OpenCoarrays/blob/master/INSTALL
>
> Several other installation changes inspired by Steve’s feedback are listed 
> here:
>
> https://github.com/sourceryinstitute/OpenCoarrays/issues/478
>
> and these will make it into a release shortly, but are already all available 
> via git clone. I’m looking forward to hosting Oxford University Ph.D. student 
> Daniel Garza, from March 17 to June 2, to work on finishing the integration 
> of OpenCoarrays into the GCC autotools scripts so that OpenCoarrays will be 
> built anytime gfortran is built so hopefully it will be even easier for 
> everyone to build and test with OpenCoarrays soon.

Thanks; I should look into building opencoarrays at some point. For
this patch I was hoping that someone familiar with the OpenCoarrays
code base could do the equivalent fix there and test it, as it rather
mechanical and simple.


-- 
Janne Blomqvist


Re: [PATCH] Character length cleanup for Coarray Fortran library

2018-02-10 Thread Damian Rouson
 
I’ll try applying the patch and testing it.  I have about a 50% success rate 
with getting patches to apply cleanly.  Is this available on an svn or git 
branch that I can just checkout rather than attempting to apply the patch?  I 
find that process to be much more reliable. 

Going forward, please submit OpenCoarrays questions or issues via our issues 
page:

https://github.com/sourceryinstitute/OpenCoarrays/issues  

Most OpenCoarrays contributors don’t monitor the gfortran mailing list closely 
so we’re unlikely to see emails to the list in a timely manner.  

Also, when making changes that impact OpenCoarrays, please build OpenCoarrays 
and run our test suite.  We recently made several changes to our installation 
documentation and installer script based on feedback received from Steve Kargl. 
 One result is a set of instructions written by Zaak with GCC developers as an 
intended audience:  

https://github.com/sourceryinstitute/OpenCoarrays/blob/master/INSTALL  

Several other installation changes inspired by Steve’s feedback are listed 
here:  

https://github.com/sourceryinstitute/OpenCoarrays/issues/478  

and these will make it into a release shortly, but are already all available 
via git clone. I’m looking forward to hosting Oxford University Ph.D. student 
Daniel Garza, from March 17 to June 2, to work on finishing the integration of 
OpenCoarrays into the GCC autotools scripts so that OpenCoarrays will be built 
anytime gfortran is built so hopefully it will be even easier for everyone to 
build and test with OpenCoarrays soon.  

Damian 


On February 9, 2018 at 8:11:07 AM, Janne Blomqvist 
(blomqvist.ja...@gmail.com(mailto:blomqvist.ja...@gmail.com)) wrote:

> Following the change to use size_t for Fortran character lengths (PR
> 78534), this patch modifies the Coarray ABI in a similar way. The
> single-image implementation that is included in libgfortran is
> updated, but this needs corresponding work in the OpenCoarray library
> as well for multi-image support. Damian, can you look into that?
>  
> Regtested on x86_64-pc-linux-gnu, Ok for trunk?
>  
> gcc/fortran/ChangeLog:
>  
> 2018-02-09 Janne Blomqvist  
>  
> * gfortran.texi: Update Coarray API description.
> * trans-decl.c (gfc_build_builtin_function_decls): Use size_t for
> character lengths, int for exit codes.
> (generate_coarray_sym_init): Use size_t for character length.
> * trans-intrinsic.c (conv_co_collective): Likewise.
> * trans-stmt.c (gfc_trans_lock_unlock): Likewise.
> (gfc_trans_event_post_wait): Likewise.
> (gfc_trans_sync): Likewise.
>  
> libgfortran/ChangeLog:
>  
> 2018-02-09 Janne Blomqvist  
>  
> * caf/libcaf.h: Remove stdint.h include.
> (_gfortran_caf_register): Use size_t for character length.
> (_gfortran_caf_deregister): Likewise.
> (_gfortran_caf_sync_all): Likewise.
> (_gfortran_caf_sync_memory): Likewise.
> (_gfortran_caf_sync_images): Likewise.
> (_gfortran_caf_stop_numeric): Use int for exit code.
> (_gfortran_caf_stop_str): Use size_t for character length.
> (_gfortran_caf_error_stop_str): Likewise.
> (_gfortran_caf_error_stop): Use int for exit code.
> (_gfortran_caf_co_broadcast): Use size_t for character length.
> (_gfortran_caf_co_sum): Likewise.
> (_gfortran_caf_co_min): Likewise.
> (_gfortran_caf_co_max): Likewise.
> (_gfortran_caf_co_reduce): Likewise.
> (_gfortran_caf_lock): Likewise.
> (_gfortran_caf_unlock): Likewise.
> (_gfortran_caf_event_post): Likewise.
> (_gfortran_caf_event_wait): Likewise.
> * caf/mpi.c (_gfortran_caf_register): Update implementation to
> match prototype.
> (_gfortran_caf_deregister): Likewise.
> (_gfortran_caf_sync_all): Likewise.
> (_gfortran_caf_sync_images): Likewise.
> (_gfortran_caf_error_stop_str): Likewise.
> (_gfortran_caf_error_stop): Likewise.
> * caf/single.c (caf_internal_error): Likewise.
> (_gfortran_caf_register): Likewise.
> (_gfortran_caf_deregister): Likewise.
> (_gfortran_caf_sync_all): Likewise.
> (_gfortran_caf_sync_memory): Likewise.
> (_gfortran_caf_sync_images): Likewise.
> (_gfortran_caf_stop_numeric): Likewise.
> (_gfortran_caf_stop_str): Likewise.
> (_gfortran_caf_error_stop_str): Likewise.
> (_gfortran_caf_error_stop): Likewise.
> (_gfortran_caf_co_broadcast): Likewise.
> (_gfortran_caf_co_sum): Likewise.
> (_gfortran_caf_co_min): Likewise.
> (_gfortran_caf_co_max): Likewise.
> (_gfortran_caf_co_reduce): Likewise.
> (_gfortran_caf_event_post): Likewise.
> (_gfortran_caf_event_wait): Likewise.
> (_gfortran_caf_lock): Likewise.
> (_gfortran_caf_unlock): Likewise.
> ---
> gcc/fortran/gfortran.texi | 32 -
> gcc/fortran/trans-decl.c | 38 +++---
> gcc/fortran/trans-intrinsic.c | 4 ++--
> gcc/fortran/trans-stmt.c | 12 +-
> libgfortran/caf/libcaf.h | 37 ++---
> libgfortran/caf/mpi.c | 28 +++---
> libgfortran/caf/single.c | 55 ++-
> 7 files changed, 103 insertions(+), 103 deletions(-)
>  
> diff --git 

Re: [PATCH] Character length cleanup for Coarray Fortran library

2018-02-09 Thread Steve Kargl
On Fri, Feb 09, 2018 at 06:10:46PM +0200, Janne Blomqvist wrote:
> Following the change to use size_t for Fortran character lengths (PR
> 78534), this patch modifies the Coarray ABI in a similar way. The
> single-image implementation that is included in libgfortran is
> updated, but this needs corresponding work in the OpenCoarray library
> as well for multi-image support. Damian, can you look into that?
> 
> Regtested on x86_64-pc-linux-gnu, Ok for trunk?
> 

Janne, I've scanned the patch and it appears to a
fairly straight foward mechanical s/int/size_t
(and similar for nodes).  OK to commit (although
you may want to wait for a response from Damain
or Izaak Beekman).

As this breaks an ABI and we've broken it for 8.0,
I think this should go into trunk.  You may need
to ping Jakub or Richard for final approval.

-- 
Steve


[PATCH] Character length cleanup for Coarray Fortran library

2018-02-09 Thread Janne Blomqvist
Following the change to use size_t for Fortran character lengths (PR
78534), this patch modifies the Coarray ABI in a similar way. The
single-image implementation that is included in libgfortran is
updated, but this needs corresponding work in the OpenCoarray library
as well for multi-image support. Damian, can you look into that?

Regtested on x86_64-pc-linux-gnu, Ok for trunk?

gcc/fortran/ChangeLog:

2018-02-09  Janne Blomqvist  

* gfortran.texi: Update Coarray API description.
* trans-decl.c (gfc_build_builtin_function_decls): Use size_t for
character lengths, int for exit codes.
(generate_coarray_sym_init): Use size_t for character length.
* trans-intrinsic.c (conv_co_collective): Likewise.
* trans-stmt.c (gfc_trans_lock_unlock): Likewise.
(gfc_trans_event_post_wait): Likewise.
(gfc_trans_sync): Likewise.

libgfortran/ChangeLog:

2018-02-09  Janne Blomqvist  

* caf/libcaf.h: Remove stdint.h include.
(_gfortran_caf_register): Use size_t for character length.
(_gfortran_caf_deregister): Likewise.
(_gfortran_caf_sync_all): Likewise.
(_gfortran_caf_sync_memory): Likewise.
(_gfortran_caf_sync_images): Likewise.
(_gfortran_caf_stop_numeric): Use int for exit code.
(_gfortran_caf_stop_str): Use size_t for character length.
(_gfortran_caf_error_stop_str): Likewise.
(_gfortran_caf_error_stop): Use int for exit code.
(_gfortran_caf_co_broadcast): Use size_t for character length.
(_gfortran_caf_co_sum): Likewise.
(_gfortran_caf_co_min): Likewise.
(_gfortran_caf_co_max): Likewise.
(_gfortran_caf_co_reduce): Likewise.
(_gfortran_caf_lock): Likewise.
(_gfortran_caf_unlock): Likewise.
(_gfortran_caf_event_post): Likewise.
(_gfortran_caf_event_wait): Likewise.
* caf/mpi.c (_gfortran_caf_register): Update implementation to
match prototype.
(_gfortran_caf_deregister): Likewise.
(_gfortran_caf_sync_all): Likewise.
(_gfortran_caf_sync_images): Likewise.
(_gfortran_caf_error_stop_str): Likewise.
(_gfortran_caf_error_stop): Likewise.
* caf/single.c (caf_internal_error): Likewise.
(_gfortran_caf_register): Likewise.
(_gfortran_caf_deregister): Likewise.
(_gfortran_caf_sync_all): Likewise.
(_gfortran_caf_sync_memory): Likewise.
(_gfortran_caf_sync_images): Likewise.
(_gfortran_caf_stop_numeric): Likewise.
(_gfortran_caf_stop_str): Likewise.
(_gfortran_caf_error_stop_str): Likewise.
(_gfortran_caf_error_stop): Likewise.
(_gfortran_caf_co_broadcast): Likewise.
(_gfortran_caf_co_sum): Likewise.
(_gfortran_caf_co_min): Likewise.
(_gfortran_caf_co_max): Likewise.
(_gfortran_caf_co_reduce): Likewise.
(_gfortran_caf_event_post): Likewise.
(_gfortran_caf_event_wait): Likewise.
(_gfortran_caf_lock): Likewise.
(_gfortran_caf_unlock): Likewise.
---
 gcc/fortran/gfortran.texi | 32 -
 gcc/fortran/trans-decl.c  | 38 +++---
 gcc/fortran/trans-intrinsic.c |  4 ++--
 gcc/fortran/trans-stmt.c  | 12 +-
 libgfortran/caf/libcaf.h  | 37 ++---
 libgfortran/caf/mpi.c | 28 +++---
 libgfortran/caf/single.c  | 55 ++-
 7 files changed, 103 insertions(+), 103 deletions(-)

diff --git a/gcc/fortran/gfortran.texi b/gcc/fortran/gfortran.texi
index 1124669..7c09bc4 100644
--- a/gcc/fortran/gfortran.texi
+++ b/gcc/fortran/gfortran.texi
@@ -4458,7 +4458,7 @@ NULL.
 
 @item @emph{Syntax}:
 @code{void caf_register (size_t size, caf_register_t type, caf_token_t *token,
-gfc_descriptor_t *desc, int *stat, char *errmsg, int errmsg_len)}
+gfc_descriptor_t *desc, int *stat, char *errmsg, size_t errmsg_len)}
 
 @item @emph{Arguments}:
 @multitable @columnfractions .15 .70
@@ -4510,7 +4510,7 @@ during a call to @code{_gfortran_caf_register}.
 
 @item @emph{Syntax}:
 @code{void caf_deregister (caf_token_t *token, caf_deregister_t type,
-int *stat, char *errmsg, int errmsg_len)}
+int *stat, char *errmsg, size_t errmsg_len)}
 
 @item @emph{Arguments}:
 @multitable @columnfractions .15 .70
@@ -4936,7 +4936,7 @@ which has already been locked by the same image is an 
error.
 
 @item @emph{Syntax}:
 @code{void _gfortran_caf_lock (caf_token_t token, size_t index, int 
image_index,
-int *aquired_lock, int *stat, char *errmsg, int errmsg_len)}
+int *aquired_lock, int *stat, char *errmsg, size_t errmsg_len)}
 
 @item @emph{Arguments}:
 @multitable @columnfractions .15 .70
@@ -4971,7 +4971,7 @@ which is unlocked or has been locked by a different image 
is an error.
 
 @item @emph{Syntax}:
 @code{void _gfortran_caf_unlock (caf_token_t token, size_t