bugGNU Octave - Bugs: bug #40562, Consider using...

 
 

bug #40562: Consider using PRINTF_EXPONENT_DIGITS on MinGW

Submitter:  Rik <rik5>
Submitted:  Wed 13 Nov 2013 04:34:09 AM UTC
 
Category:  Libraries Severity:  3 - Normal
Priority:  5 - Normal Item Group:  Feature Request
Status:  Wont Fix Assigned to:  None
Originator Name:  Open/Closed:  * Closed
Release:  * dev Operating System:  * Microsoft Windows
Fixed Release:  None Planned Release:  None
* Mandatory Fields

Add a New Comment (Rich Markup)
   

Comment Type & Canned Response:
       

 

Thu 24 Nov 2016 09:53:23 PM UTC, comment #3: 

This bug seems out of date.  I'm going to close it.

Rik <rik5>
Project Administrator
Wed 23 Nov 2016 10:02:47 PM UTC, comment #2: 

Is this issue still relevant with the Octave version 4.2.0? Or can it be closed now?

When I do "assert (3+2*eps, 3, eps)" (this is one of the mentioned tests that needed fixing) then I get

  • on linux (Ubuntu 14.04) the error message "Abs err 4.4409e-16 exceeds..."
  • on Windows (official w32 installer) also the very same error message "Abs err 4.4409e-16 exceeds..."

So both error text string have 2-digit exponents by default, no 3-digit exponent on Windows any more.

Hartmut <hardy>
Wed 13 Nov 2013 03:27:33 PM UTC, comment #1: 

FYI, run natively on a Win 8 machine at work (3.7.7+ dev versio of Nov 11):

>> x = rand (1e6, 1);
>> fid = fopen ("tst.txt", "wt");
>> tic; fprintf (fid, "%g\n", x); toc
Elapsed time is 4.25564 seconds.
>> fclose (fid)
ans = 0
>> x = rand (1e6, 1);
>> fid = fopen ("tst.txt", "wt");
>> tic; fprintf (fid, "%g\n", x); toc
Elapsed time is 4.28983 seconds.
>> fclose (fid)
ans = 0
>> x = rand (1e6, 1);
>> fid = fopen ("tst.txt", "wt");
>> tic; fprintf (fid, "%g\n", x); toc
Elapsed time is 4.24964 seconds.
>> fclose (fid)
ans = 0
>> x = rand (1e6, 1);
>> fid = fopen ("tst.txt", "wt");
>> tic; fprintf (fid, "%g\n", x); toc
Elapsed time is 4.24863 seconds.
>> fclose (fid)
ans = 0
>>
>> setenv ("PRINTF_EXPONENT_DIGITS", "2")
>> x = rand (1e6, 1);
>> fid = fopen ("tst.txt", "wt");
>> tic; fprintf (fid, "%g\n", x); toc
Elapsed time is 4.42566 seconds.
>> fclose (fid)
ans = 0
>> x = rand (1e6, 1);
>> fid = fopen ("tst.txt", "wt");
>> tic; fprintf (fid, "%g\n", x); toc
Elapsed time is 4.40966 seconds.
>> fclose (fid)
ans = 0
>> x = rand (1e6, 1);
>> fid = fopen ("tst.txt", "wt");
>> tic; fprintf (fid, "%g\n", x); toc
Elapsed time is 4.4936 seconds.
>> fclose (fid)
ans = 0
>> x = rand (1e6, 1);
>> fid = fopen ("tst.txt", "wt");
>> tic; fprintf (fid, "%g\n", x); toc
Elapsed time is 4.4866 seconds.
>> fclose (fid)
ans = 0
>>

so this environment setting doesn't seem to make much difference. At first looks it's indeed about 5 % slower.

After resetting it with

>> setenv ("PRINTF_EXPONENT_DIGITS", "")

the execution times didn't go down to ~4.27 secs as before, however. Octave needed to restart to get the original times from before this setting.

Philip Nienhuis <philipnienhuis>
Project Member
Wed 13 Nov 2013 04:34:09 AM UTC, original submission:  

I worked around the problem of failing tests on MinGW because of 3-digit exponents here (http://hg.savannah.gnu.org/hgweb/octave/rev/6a381b9ae055).

However, I went on to investigate whether PRINTF_EXPONENT_DIGITS carries a performance penalty as claimed.  I found something like a 5% penalty, not a 300-400% penalty, so this might be a worthwhile option to turn on.

I used

x = rand (1e6, 1);
fid = fopen ("tst.txt", "wt");
tic; fprintf (fid, "%g\n", x); toc
fclose (fid)

Then I did the same test after using

setenv ("PRINTF_EXPONENT_DIGITS", "2")

I was running in a virtual machine and the timing precision on MinGW isn't great, but the measured difference was small (~5%) with three runs for each scenario.

Rik <rik5>
Project Administrator

 

(Note: upload size limit is set to 16384 kB, after insertion of the required escape characters.)

Attach Files:
   
   
Comment:
   

No files currently attached

 

Depends on the following items: None found

Items that depend on this one: None found

 

Carbon-Copy List
  • -email is unavailable- added by hardy (Posted a comment)
  • -email is unavailable- added by rik5 (Submitted the item)
  •  

    There are 0 votes so far. Votes easily highlight which items people would like to see resolved in priority, independently of the priority of the item set by tracker managers.

    Only project members can vote.

     

     

     

     

    Follow 2 latest changes.

    Date Changed by Updated Field Previous Value => Replaced by
    2016-11-24 rik5 StatusNone Wont Fix
        Open/ClosedOpen Closed

    Back to the top


    Powered by Savane 3.9