[patch, fortran] Asynchronous I/O, take 3

Rainer Orth ro@CeBiTec.Uni-Bielefeld.DE
Tue Jul 3 14:24:00 GMT 2018


Hi Thomas,

> the attached patch is the third take on Nicolas' and my patch
> for implementing asynchronous I/O.  Some parts have been reworked, and
> several bugs which caused either incorrect I/O or hangs have been
> fixed in the process.
>
> I have to say that getting out these bugs has been much harder
> than Nicolas and I originally thought, and that this has cost more
> working hours than any other patch I have been involved in.
>
> This has been regression-tested on x86_64-pc-linux-gnu. The new test
> cases have also been tested in a tight loop with
>
> n=1; while ./a.out; do echo -n $n " " ; n=$((n+1)); done
>
> or (for async_io_3.f90, which is supposed to fail)
>
> while true ; do ./a.out > /dev/null 2>&1 ;  echo -n $n " " ; n=$((n+1));
> done
>
> and the test cases also come up clean with valgrind --tool=drd
> (which is a _very_ strict tool which, after this experience, I
> wholeheartedly recommend for doing pthreads debugging).
>
> The interface remains as before - link in pthread to get asynchronous
> I/O, which matches what ifort does.

another test run on i386-pc-solaris2.11 is underway.  However, may
(all?) gfortran tests now SEGV.  One example is

Program received signal SIGSEGV: Segmentation fault - invalid memory reference.

Backtrace for this error:
Segmentation Fault

Thread 2 received signal SIGSEGV, Segmentation fault.
[Switching to Thread 1 (LWP 1)]
0xfe1b1f03 in pthread_mutex_unlock () from /lib/libc.so.1
(gdb) where
#0  0xfe1b1f03 in pthread_mutex_unlock () from /lib/libc.so.1
#1  0xfe5d1b7c in __gthread_mutex_unlock (__mutex=0x18)
    at ../libgcc/gthr-default.h:778
#2  _gfortran_st_rewind (fpp=0xfeffda9c)
    at /vol/gcc/src/hg/trunk/solaris/libgfortran/io/file_pos.c:486
#3  0x0805110f in MAIN__ ()
    at /vol/gcc/src/hg/trunk/solaris/gcc/testsuite/gfortran.dg/backslash_2.f90:6  

Obviously __mutex above hasn't been properly initialized.

> 2018-07-02  Nicolas Koenig  <koenigni@gcc.gnu.org>
>         Thomas Koenig <tkoenig@gcc.gnu.org>
>
>         PR fortran/25829
>         * testsuite/libgfomp.fortran/async_io_1.f90: New test.
>         * testsuite/libgfomp.fortran/async_io_2.f90: New test.
>         * testsuite/libgfomp.fortran/async_io_3.f90: New test.

You seem to have a special fondness for libgfomp ;-)

	Rainer

-- 
-----------------------------------------------------------------------------
Rainer Orth, Center for Biotechnology, Bielefeld University



More information about the Gcc-patches mailing list