This is the mail archive of the fortran@gcc.gnu.org mailing list for the GNU Fortran project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: [patch,libgfortran] PR48298 DTIO implementation for Internal Units


Dear Jerry,

I have tried the patch. It does indeed bootstrap and regtest OK. The
only nit, from looking through the patch, is:

s/dtio_12.f90/dtio_14.f90/

OK for trunk. Thanks for a phenomenal effort to get DTIO up to full speed.

Paul

On 22 September 2016 at 05:24, Jerry DeLisle <jvdelisle@charter.net> wrote:
> On 09/20/2016 09:50 AM, Jerry DeLisle wrote:
>> With some tweaking, I have shaved about a second off of my previous results with
>> Manfred's test case. I basically extended the newunit stash in the original
>> patch to include the entire unit structure, saving on memory allocations.  I
>> need to regression test this still and if it passes I will ping the list for
>> approval.
>>
>> I think this is close enough for now. Later when I have more time I would like
>> to have a look at the fbuf.c stuff. The fbuf was added to speed up execution on
>> files by reducing file seeks encountered when doing a lot of formatted I/O.
>>
>
> Please see attached revised patch. Regression tested OK, test case included in
> patch.
>
> OK for trunk? If no further input I will commit this weekend.
>
> Regards,
>
> Jerry
>
> 2016-09-21  Jerry DeLisle  <jvdelisle@gcc.gnu.org>
>
>         PR fortran/48298
>         * gfortran.h (gfc_dt): Add *udtio.
>         * ioparm.def: Add bit IOPARM_dt_f2003 to align with library use of bit
>         25. Add IOPARM_dt_dtio bit to common flags.
>         * resolve.c (resolve_transfer): Set dt->udtio to expression.
>         * io.c (gfc_match_inquire): Adjust error message for internal
>         unit KIND.
>         * libgfortran.h: Adjust defines for GFC_INTERNAL_UNIT4,
>         GFC_INTERNAL_UNIT, and GFC_INVALID_UNIT.
>         * trans-io.c (build_dt): Set common_unit to reflect the KIND of
>         the internal unit. Set mask bit for presence of dt->udtio.
>
> 2016-09-21  Jerry DeLisle  <jvdelisle@gcc.gnu.org>
>
>         PR fortran/48298
>         * io/inquire.c (inquire_via_unit): Adjust error check for the
>         two possible internal unit KINDs.
>         * io/io.h: Adjust defines for is_internal_unit and
>         is_char4_unit. (gfc_unit): Add internal unit data to structure.
>         (get_internal_unit): Change declaration to set_internal_unit.
>         (free_internal_unit): Change name to stash_internal_unit_number.
>         (get_unique_unit_number): Adjust parameter argument.
>         Define IOPARM_DT_HAS_UDTIO. (gfc_saved_unit): New structure.
>         * io/list_read.c (next_char_internal): Use is_char4_unit.
>         * io/open.c (st_open): Adjust call to get_unique_unit_number.
>         * io/transfer.c (write_block): Use is_char4_unit.
>         (data_transfer_init): Update check for unit numbers.
>         (st_read_done): Free the various allocated memories used for the
>         internal units and stash the negative unit number and pointer to unit
>         structure to allow reuse. (st_write_done): Likewise stash the freed
>         unit.
>         * io/unit.c: Create a fixed size buffer of 16 gfc_saved_unit's to use
>         as a stack to save newunit unit numbers and unit structure for reuse.
>         (get_external_unit): Change name to get_gfc_unit to better
>         reflect what it does. (find_unit): Change call to get_gfc_unit.
>         (find_or_create_unit): Likewise. (get_internal_unit): Change
>         name to set_internal_unit. Move internal unit from the dtp
>         structure to the gfc_unit structure so that it can be passed to
>         child I/O statements through the UNIT.
>         (free_internal_unit): Change name to stash_internal_unit_number.
>         Push the common.unit number onto the newunit stack, saving it
>         for possible reuse later. (get_unit): Set the internal unit
>         KIND. Use get_unique_unit_number to get a negative unit number
>         for the internal unit. Use get_gfc_unit to get the unit structure
>         and use set_internal_unit to initialize it.
>         (init_units): Initialize the newunit stack.
>         (get_unique_unit_number): Check the stack for an available unit
>         number and use it. If none there get the next most negative
>         number. (close_units): Free any unit structures pointed to from the save
>         stack.
>



-- 
The difference between genius and stupidity is; genius has its limits.

Albert Einstein


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]