Skip to content
Snippets Groups Projects
  1. Oct 10, 2022
  2. Jan 03, 2022
  3. Jan 04, 2021
  4. Feb 18, 2020
    • Thomas König's avatar
      Use au->lock exclusively for locking in async I/O. · 3fe19105
      Thomas König authored
      2020-02-18  Thomas Koenig  <tkoenig@gcc.gnu.org>
      
      	PR fortran/93599
      	* io/async.c (destroy_adv_cond): Do not destroy lock.
      	(async_io): Make sure au->lock is locked for finishing of thread.
      	Do not lock/unlock around signalling emptysignal. Unlock au->lock
      	before return.
      	(init_adv_cond): Do not initialize lock.
      	(enqueue_transfer): Unlock after signal.
      	(enqueue_done_id): Likewise.
      	(enqueue_done): Likewise.
      	(enqueue_close): Likewise.
      	(enqueue_data_transfer): Likewise.
      	(async_wait_id): Do not lock/unlock around signalling au->work.
      	(async_wait): Unlock after signal.
      	* io/async.h (SIGNAL): Add comment about needed au->lock.
      	Remove locking/unlocking of advcond->lock.
      	(WAIT_SIGNAL_MUTEX): Add comment. Remove locking/unlocking of
      	advcond->lock.  Unlock mutex only at the end.  Loop on
      	__ghread_cond_wait returning zero.
      	(REVOKE_SIGNAL): Add comment. Remove locking/unlocking of
      	advcond->lock.
      	(struct adv_cond): Remove mutex from struct.
      
      asdf
      3fe19105
  5. Jan 01, 2020
  6. Jan 01, 2019
  7. Sep 05, 2018
  8. Aug 23, 2018
  9. Aug 22, 2018
    • Thomas Koenig's avatar
      gfortran.texi: Mention that asynchronous I/O does not work on systems which lack condition... · 2532f0f5
      Thomas Koenig authored
      2018-08-22  Thomas Koenig  <tkoenig@gcc.gnu.org>
      
      	* gfortran.texi: Mention that asynchronous I/O does
      	not work on systems which lack condition variables, such
      	as AIX.
      
      2018-08-22  Thomas Koenig  <tkoenig@gcc.gnu.org>
      
      	* async.h: Set ASYNC_IO to zero if _AIX is defined.
      	(struct adv_cond): If ASYNC_IO is zero, the struct has no members.
      	(async_unit): If ASYNC_IO is zero, remove unneeded members.
      
      From-SVN: r263788
      2532f0f5
  10. Aug 21, 2018
    • Nicolas Koenig's avatar
      re PR fortran/25829 ([F03] Asynchronous IO support) · 2b4c9065
      Nicolas Koenig authored
      
      2018-08-21  Nicolas Koenig  <koenigni@gcc.gnu.org>
      	Thomas Koenig <tkoenig@gcc.gnu.org>
      
      	PR fortran/25829
      	* gfortran.texi: Add description of asynchronous I/O.
      	* trans-decl.c (gfc_finish_var_decl): Treat asynchronous variables
      	as volatile.
      	* trans-io.c (gfc_build_io_library_fndecls): Rename st_wait to
      	st_wait_async and change argument spec from ".X" to ".w".
      	(gfc_trans_wait): Pass ID argument via reference.
      
      2018-08-21  Nicolas Koenig  <koenigni@gcc.gnu.org>
      	Thomas Koenig <tkoenig@gcc.gnu.org>
      
      	PR fortran/25829
      	* gfortran.dg/f2003_inquire_1.f03: Add write statement.
      	* gfortran.dg/f2003_io_1.f03: Add wait statement.
      
      2018-08-21  Nicolas Koenig  <koenigni@gcc.gnu.org>
      	Thomas Koenig <tkoenig@gcc.gnu.org>
      
      	PR fortran/25829
      	* Makefile.am: Add async.c to gfor_io_src.
      	Add async.h to gfor_io_headers.
      	* Makefile.in: Regenerated.
      	* gfortran.map: Add _gfortran_st_wait_async.
      	* io/async.c: New file.
      	* io/async.h: New file.
      	* io/close.c: Include async.h.
      	(st_close): Call async_wait for an asynchronous unit.
      	* io/file_pos.c (st_backspace): Likewise.
      	(st_endfile): Likewise.
      	(st_rewind): Likewise.
      	(st_flush): Likewise.
      	* io/inquire.c: Add handling for asynchronous PENDING
      	and ID arguments.
      	* io/io.h (st_parameter_dt): Add async bit.
      	(st_parameter_wait): Correct.
      	(gfc_unit): Add au pointer.
      	(st_wait_async): Add prototype.
      	(transfer_array_inner): Likewise.
      	(st_write_done_worker): Likewise.
      	* io/open.c: Include async.h.
      	(new_unit): Initialize asynchronous unit.
      	* io/transfer.c (async_opt): New struct.
      	(wrap_scalar_transfer): New function.
      	(transfer_integer): Call wrap_scalar_transfer to do the work.
      	(transfer_real): Likewise.
      	(transfer_real_write): Likewise.
      	(transfer_character): Likewise.
      	(transfer_character_wide): Likewise.
      	(transfer_complex): Likewise.
      	(transfer_array_inner): New function.
      	(transfer_array): Call transfer_array_inner.
      	(transfer_derived): Call wrap_scalar_transfer.
      	(data_transfer_init): Check for asynchronous I/O.
      	Perform a wait operation on any pending asynchronous I/O
      	if the data transfer is synchronous. Copy PDT and enqueue
      	thread for data transfer.
      	(st_read_done_worker): New function.
      	(st_read_done): Enqueue transfer or call st_read_done_worker.
      	(st_write_done_worker): New function.
      	(st_write_done): Enqueue transfer or call st_read_done_worker.
      	(st_wait): Document as no-op for compatibility reasons.
      	(st_wait_async): New function.
      	* io/unit.c (insert_unit): Use macros LOCK, UNLOCK and TRYLOCK;
      	add NOTE where necessary.
      	(get_gfc_unit): Likewise.
      	(init_units): Likewise.
      	(close_unit_1): Likewise. Call async_close if asynchronous.
      	(close_unit): Use macros LOCK and UNLOCK.
      	(finish_last_advance_record): Likewise.
      	(newunit_alloc): Likewise.
      	* io/unix.c (find_file): Likewise.
      	(flush_all_units_1): Likewise.
      	(flush_all_units): Likewise.
      	* libgfortran.h (generate_error_common): Add prototype.
      	* runtime/error.c: Include io.h and async.h.
      	(generate_error_common): New function.
      
      2018-08-21  Nicolas Koenig  <koenigni@gcc.gnu.org>
      	Thomas Koenig <tkoenig@gcc.gnu.org>
      
      	PR fortran/25829
      	* testsuite/libgomp.fortran/async_io_1.f90: New test.
      	* testsuite/libgomp.fortran/async_io_2.f90: New test.
      	* testsuite/libgomp.fortran/async_io_3.f90: New test.
      	* testsuite/libgomp.fortran/async_io_4.f90: New test.
      	* testsuite/libgomp.fortran/async_io_5.f90: New test.
      	* testsuite/libgomp.fortran/async_io_6.f90: New test.
      	* testsuite/libgomp.fortran/async_io_7.f90: New test.
      
      
      Co-Authored-By: default avatarThomas Koenig <tkoenig@gcc.gnu.org>
      
      From-SVN: r263750
      2b4c9065
  11. Jul 31, 2018
    • Andre Vieira's avatar
      Reverting 'AsyncI/O patch committed' as it is breaking bare-metal builds. · 1d4a51cf
      Andre Vieira authored
      2018-07-31  Andre Vieira  <andre.simoesdiasvieira@arm.com>
      
      	Revert 'AsyncI/O patch committed'
      	2018-07-25  Nicolas Koenig  <koenigni@gcc.gnu.org>
      		Thomas Koenig <tkoenig@gcc.gnu.org>
      
      	PR fortran/25829
      	* gfortran.texi: Add description of asynchronous I/O.
      	* trans-decl.c (gfc_finish_var_decl): Treat asynchronous variables
      	as volatile.
      	* trans-io.c (gfc_build_io_library_fndecls): Rename st_wait to
      	st_wait_async and change argument spec from ".X" to ".w".
      	(gfc_trans_wait): Pass ID argument via reference.
      
      2018-07-31  Andre Vieira  <andre.simoesdiasvieira@arm.com>
      
      	Revert 'AsyncI/O patch committed'
      	2018-07-25  Nicolas Koenig  <koenigni@gcc.gnu.org>
      		Thomas Koenig <tkoenig@gcc.gnu.org>
      
      	PR fortran/25829
      	* gfortran.dg/f2003_inquire_1.f03: Add write statement.
      	* gfortran.dg/f2003_io_1.f03: Add wait statement.
      
      2018-07-31  Andre Vieira  <andre.simoesdiasvieira@arm.com>
      
      	Revert 'AsyncI/O patch committed'
      	2018-07-25  Nicolas Koenig  <koenigni@gcc.gnu.org>
      		Thomas Koenig <tkoenig@gcc.gnu.org>
      
      	PR fortran/25829
      	* Makefile.am: Add async.c to gfor_io_src.
      	Add async.h to gfor_io_headers.
      	* Makefile.in: Regenerated.
      	* gfortran.map: Add _gfortran_st_wait_async.
      	* io/async.c: New file.
      	* io/async.h: New file.
      	* io/close.c: Include async.h.
      	(st_close): Call async_wait for an asynchronous unit.
      	* io/file_pos.c (st_backspace): Likewise.
      	(st_endfile): Likewise.
      	(st_rewind): Likewise.
      	(st_flush): Likewise.
      	* io/inquire.c: Add handling for asynchronous PENDING
      	and ID arguments.
      	* io/io.h (st_parameter_dt): Add async bit.
      	(st_parameter_wait): Correct.
      	(gfc_unit): Add au pointer.
      	(st_wait_async): Add prototype.
      	(transfer_array_inner): Likewise.
      	(st_write_done_worker): Likewise.
      	* io/open.c: Include async.h.
      	(new_unit): Initialize asynchronous unit.
      	* io/transfer.c (async_opt): New struct.
      	(wrap_scalar_transfer): New function.
      	(transfer_integer): Call wrap_scalar_transfer to do the work.
      	(transfer_real): Likewise.
      	(transfer_real_write): Likewise.
      	(transfer_character): Likewise.
      	(transfer_character_wide): Likewise.
      	(transfer_complex): Likewise.
      	(transfer_array_inner): New function.
      	(transfer_array): Call transfer_array_inner.
      	(transfer_derived): Call wrap_scalar_transfer.
      	(data_transfer_init): Check for asynchronous I/O.
      	Perform a wait operation on any pending asynchronous I/O
      	if the data transfer is synchronous. Copy PDT and enqueue
      	thread for data transfer.
      	(st_read_done_worker): New function.
      	(st_read_done): Enqueue transfer or call st_read_done_worker.
      	(st_write_done_worker): New function.
      	(st_write_done): Enqueue transfer or call st_read_done_worker.
      	(st_wait): Document as no-op for compatibility reasons.
      	(st_wait_async): New function.
      	* io/unit.c (insert_unit): Use macros LOCK, UNLOCK and TRYLOCK;
      	add NOTE where necessary.
      	(get_gfc_unit): Likewise.
      	(init_units): Likewise.
      	(close_unit_1): Likewise. Call async_close if asynchronous.
      	(close_unit): Use macros LOCK and UNLOCK.
      	(finish_last_advance_record): Likewise.
      	(newunit_alloc): Likewise.
      	* io/unix.c (find_file): Likewise.
      	(flush_all_units_1): Likewise.
      	(flush_all_units): Likewise.
      	* libgfortran.h (generate_error_common): Add prototype.
      	* runtime/error.c: Include io.h and async.h.
      	(generate_error_common): New function.
      
      2018-07-31  Andre Vieira  <andre.simoesdiasvieira@arm.com>
      
      	Revert 'AsyncI/O patch committed'.
      	2018-07-25  Nicolas Koenig  <koenigni@gcc.gnu.org>
      		Thomas Koenig <tkoenig@gcc.gnu.org>
      
      	PR fortran/25829
      	* testsuite/libgomp.fortran/async_io_1.f90: New test.
      	* testsuite/libgomp.fortran/async_io_2.f90: New test.
      	* testsuite/libgomp.fortran/async_io_3.f90: New test.
      	* testsuite/libgomp.fortran/async_io_4.f90: New test.
      	* testsuite/libgomp.fortran/async_io_5.f90: New test.
      	* testsuite/libgomp.fortran/async_io_6.f90: New test.
      	* testsuite/libgomp.fortran/async_io_7.f90: New test.
      
      From-SVN: r263082
      1d4a51cf
  12. Jul 25, 2018
    • Nicolas Koenig's avatar
      re PR fortran/25829 ([F03] Asynchronous IO support) · b1f45884
      Nicolas Koenig authored
      
      2018-07-25  Nicolas Koenig  <koenigni@gcc.gnu.org>
      	Thomas Koenig <tkoenig@gcc.gnu.org>
      
      	PR fortran/25829
      	* gfortran.texi: Add description of asynchronous I/O.
      	* trans-decl.c (gfc_finish_var_decl): Treat asynchronous variables
      	as volatile.
      	* trans-io.c (gfc_build_io_library_fndecls): Rename st_wait to
      	st_wait_async and change argument spec from ".X" to ".w".
      	(gfc_trans_wait): Pass ID argument via reference.
      
      2018-07-25  Nicolas Koenig  <koenigni@gcc.gnu.org>
      	Thomas Koenig <tkoenig@gcc.gnu.org>
      
      	PR fortran/25829
      	* gfortran.dg/f2003_inquire_1.f03: Add write statement.
      	* gfortran.dg/f2003_io_1.f03: Add wait statement.
      
      2018-07-25  Nicolas Koenig  <koenigni@gcc.gnu.org>
      	Thomas Koenig <tkoenig@gcc.gnu.org>
      
      	PR fortran/25829
      	* Makefile.am: Add async.c to gfor_io_src.
      	Add async.h to gfor_io_headers.
      	* Makefile.in: Regenerated.
      	* gfortran.map: Add _gfortran_st_wait_async.
      	* io/async.c: New file.
      	* io/async.h: New file.
      	* io/close.c: Include async.h.
      	(st_close): Call async_wait for an asynchronous unit.
      	* io/file_pos.c (st_backspace): Likewise.
      	(st_endfile): Likewise.
      	(st_rewind): Likewise.
      	(st_flush): Likewise.
      	* io/inquire.c: Add handling for asynchronous PENDING
      	and ID arguments.
      	* io/io.h (st_parameter_dt): Add async bit.
      	(st_parameter_wait): Correct.
      	(gfc_unit): Add au pointer.
      	(st_wait_async): Add prototype.
      	(transfer_array_inner): Likewise.
      	(st_write_done_worker): Likewise.
      	* io/open.c: Include async.h.
      	(new_unit): Initialize asynchronous unit.
      	* io/transfer.c (async_opt): New struct.
      	(wrap_scalar_transfer): New function.
      	(transfer_integer): Call wrap_scalar_transfer to do the work.
      	(transfer_real): Likewise.
      	(transfer_real_write): Likewise.
      	(transfer_character): Likewise.
      	(transfer_character_wide): Likewise.
      	(transfer_complex): Likewise.
      	(transfer_array_inner): New function.
      	(transfer_array): Call transfer_array_inner.
      	(transfer_derived): Call wrap_scalar_transfer.
      	(data_transfer_init): Check for asynchronous I/O.
      	Perform a wait operation on any pending asynchronous I/O
      	if the data transfer is synchronous. Copy PDT and enqueue
      	thread for data transfer.
      	(st_read_done_worker): New function.
      	(st_read_done): Enqueue transfer or call st_read_done_worker.
      	(st_write_done_worker): New function.
      	(st_write_done): Enqueue transfer or call st_read_done_worker.
      	(st_wait): Document as no-op for compatibility reasons.
      	(st_wait_async): New function.
      	* io/unit.c (insert_unit): Use macros LOCK, UNLOCK and TRYLOCK;
      	add NOTE where necessary.
      	(get_gfc_unit): Likewise.
      	(init_units): Likewise.
      	(close_unit_1): Likewise. Call async_close if asynchronous.
      	(close_unit): Use macros LOCK and UNLOCK.
      	(finish_last_advance_record): Likewise.
      	(newunit_alloc): Likewise.
      	* io/unix.c (find_file): Likewise.
      	(flush_all_units_1): Likewise.
      	(flush_all_units): Likewise.
      	* libgfortran.h (generate_error_common): Add prototype.
      	* runtime/error.c: Include io.h and async.h.
      	(generate_error_common): New function.
      
      2018-07-25  Nicolas Koenig  <koenigni@gcc.gnu.org>
      	Thomas Koenig <tkoenig@gcc.gnu.org>
      
      	PR fortran/25829
      	* testsuite/libgomp.fortran/async_io_1.f90: New test.
      	* testsuite/libgomp.fortran/async_io_2.f90: New test.
      	* testsuite/libgomp.fortran/async_io_3.f90: New test.
      	* testsuite/libgomp.fortran/async_io_4.f90: New test.
      	* testsuite/libgomp.fortran/async_io_5.f90: New test.
      	* testsuite/libgomp.fortran/async_io_6.f90: New test.
      	* testsuite/libgomp.fortran/async_io_7.f90: New test.
      
      
      Co-Authored-By: default avatarThomas Koenig <tkoenig@gcc.gnu.org>
      
      From-SVN: r262978
      b1f45884
Loading