DataMuseum.dk

Presents historical artifacts from the history of:

Rational R1000/400 Tapes

This is an automatic "excavation" of a thematic subset of
artifacts from Datamuseum.dk's BitArchive.

See our Wiki for more about Rational R1000/400 Tapes

Excavated with: AutoArchaeologist - Free & Open Source Software.


top - metrics - download
Index: B T

⟦16cec5945⟧ TextFile

    Length: 2944 (0xb80)
    Types: TextFile
    Names: »B«

Derivation

└─⟦180fe333a⟧ Bits:30000405 8mm tape, Rational 1000, SW CATALOG, 10_20_0
└─⟦180fe333a⟧ Bits:30000537 8mm tape, Rational 1000, SW Catalog 10_20_0
    └─⟦5cb1d1d7f⟧ »DATA« 
        └─⟦3b1ee7bd8⟧ 
            └─⟦this⟧ 

TextFile


-- PERFORMANCE MEASUREMENT : function GET timing

with Text_Io;
use Text_Io;
with Remote_Global;
use Remote_Global; -- control optimization
with Iteration; -- obtain stable measurement
with Piwg_Io; -- output results

procedure G000002 is  -- main procedure to execute
    Cpu_Time : Duration; -- CPU time for one feature execution
    Wall_Time : Duration; -- WALL time for one feature execution
    Check_Times : constant := 10; -- inside loop count and check
    Iteration_Count : Integer; -- set and varied by ITERATION package
    Stable : Boolean; -- true when measurement stable
    Scratch_File : File_Type;
    Scratch_String : String (1 .. 20) := "abcdefghijklmnopqrst";
    Scratch_Length : Natural;
    Scratch_Char : Character := 'a';
--

begin
--
--  Build file for "GET" test
--
    Create (Scratch_File, Out_File, "SCRATCH2");
    for Inside_Loop in 1 .. Check_Times loop
        Put_Line (Scratch_File, Scratch_String);
    end loop;
    Close (Scratch_File);
    Open (Scratch_File, In_File, "SCRATCH2");

    Iteration.Start_Control;  -- dummy to bring in pages on some machines

    delay 0.5;  -- wait for stable enviornment on some machines

    Iteration.Initialize (Iteration_Count);

    loop  -- until stable measurement, ITERATION_COUNT increases each time

--
-- Control loop
--
        Iteration.Start_Control;
        for J in 1 .. Iteration_Count loop
            Global := 0;
            for Inside_Loop in 1 .. Check_Times loop
                Global := Global + A_One;
                Remote;
--        GET ( SCRATCH_FILE , SCRATCH_CHAR ) ; -- measured
                for I in 1 .. 20 loop
                    Scratch_String (I) := Scratch_Char;
                end loop;
            end loop;
            Reset (Scratch_File);
        end loop;
        Iteration.Stop_Control (Global, Check_Times);


--
-- Test loop
--
-- establish the time for the GET pocdedure on 20 character strings

        Iteration.Start_Test;
        for J in 1 .. Iteration_Count loop
            Global := 0;
            for Inside_Loop in 1 .. Check_Times loop
                Global := Global + A_One;
                Remote;  
                for I in 1 .. 20 loop
                    Get (Scratch_File, Scratch_Char);
                    Scratch_String (I) := Scratch_Char;
                end loop;
            end loop;
            Reset (Scratch_File);
        end loop;
        Iteration.Stop_Test (Global, Check_Times);
        Iteration.Test_Stable (Iteration_Count, Stable);
        exit when Stable;
    end loop;
--
    Iteration.Feature_Times (Cpu_Time, Wall_Time);

    Close (Scratch_File);
--
-- Printout
--
    Piwg_Io.Piwg_Output
       ("G000002", "Input/Output", Cpu_Time, Wall_Time, Iteration_Count,
        " TEXT_IO.GET called 20 times per line, time measured ",
        " a scratch file is written, then read and reset ",
        " Compare to G000001 for about same number of characters ");

end G000002;