https://www.betaarchive.com/wiki/index.php?title=Microsoft_KB_Archive/106731&feed=atom&action=history
Microsoft KB Archive/106731 - Revision history
2024-03-28T19:38:16Z
Revision history for this page on the wiki
MediaWiki 1.39.3
https://www.betaarchive.com/wiki/index.php?title=Microsoft_KB_Archive/106731&diff=49901&oldid=prev
3155ffGd: importing KB archive
2020-07-18T15:04:48Z
<p>importing KB archive</p>
<p><b>New page</b></p><div><div id="nsbanner"><br />
<br />
<div id="bannerrow1"><br />
<br />
{|<br />
| Knowledge Base<br />
|<br />
|}<br />
<br />
<br />
</div><br />
<div id="TitleRow"><br />
<br />
= <span id="KB106731"></span>PRB: Large BLOCK DATA Subprogram Compiles Slowly =<br />
<br />
<br />
</div><br />
<br />
</div><br />
<div id="nstext" valign="BOTTOM"><br />
<br />
Article ID: 106731<br />
<br />
Article Last Modified on 12/1/2003<br />
<br />
<br />
-----<br />
<br />
APPLIES TO<br /><br />
<br /><br />
<br />
* Microsoft FORTRAN PowerStation 1.0 Standard Edition<br />
* Microsoft Fortran PowerStation 1.0a for MS-DOS<br />
* Microsoft FORTRAN PowerStation 32<br />
* Microsoft FORTRAN PowerStation 32<br />
<br />
<br />
-----<br />
<br />
<div class="notice_section"><br />
<br />
This article was previously published under Q106731<br />
<br />
</div><br />
<div class="symptoms_section"><br />
<br />
== SYMPTOMS ==<br />
<br />
Compilation of a large BLOCK DATA subprogram can take a very long time using the FORTRAN PowerStation. In tests, a BLOCK DATA subprogram with 32,000 DATA statements took approximately 45 minutes to compile on a 50 megahertz (MHz) 486 machine.<br />
<br />
</div><br />
<div class="cause_section"><br />
<br />
== CAUSE ==<br />
<br />
This slow compilation is caused by initializing a large array in a BLOCK DATA subprogram with several DATA statements. One DATA statement for each array element produces the slowest compile. The array elements must also be initialized in the order that they appear in the array for the slow compilation to occur.<br /><br />
<br /><br />
FORTRAN PowerStation uses the COFF object file format. Because COFF requires that every element of an array be enumerated exactly once, all the data records (which are generated for each DATA statement in the BLOCK DATA) are sorted. The sorting algorithm is least efficient when the records are already sorted and most efficient when they are in reverse order.<br />
<br />
</div><br />
<div class="resolution_section"><br />
<br />
== RESOLUTION ==<br />
<br />
If array elements are initialized in the reverse order that they appear in the array, compilation time will be significantly reduced (for example, reduced from 45 minutes to 3 minutes). Reducing the number of DATA statements by initializing thousands of array elements in a single DATA statement also reduces compile time.<br />
<br />
</div><br />
<div class="moreinformation_section"><br />
<br />
== MORE INFORMATION ==<br />
<br />
The following sample BLOCK DATA subprograms illustrate the problem and one possible resolution:<br />
=== Sample Code #1 ===<br />
<br />
<pre class="codesample">C This sample illustrates the problem by initializing a large array,<br />
C one element at a time, in the order the elements appear in the array.<br />
BLOCK DATA INITME<br />
COMMON /BIGCOM/ ARRAY(40000)<br />
DATA ARRAY(1)/1.5/ <br />
DATA ARRAY(2)/7.4/ <br />
.<br />
. ! 39996 DATA statements go here<br />
.<br />
DATA ARRAY(39999)/0.4/ <br />
DATA ARRAY(40000)/12.0/ <br />
END<br />
</pre><br />
=== Sample Code #2 ===<br />
<br />
<pre class="codesample">C This sample initializes the array elements in reverse order to<br />
C alleviate the problem.<br />
BLOCK DATA INITME<br />
COMMON /BIGCOM/ ARRAY(40000)<br />
DATA ARRAY(40000)/12.0/ <br />
DATA ARRAY(39999)/0.4/ <br />
.<br />
. ! 39996 DATA statements go here<br />
.<br />
DATA ARRAY(2)/7.4/ <br />
DATA ARRAY(1)/1.5/ <br />
END<br />
</pre><br />
<br />
</div><br />
<br /><br />
<br />
Additional query words: 1.00 4.00 hang<br />
<br />
Keywords: kblangfortran KB106731<br />
<br />
<div class="footer"><br />
<br />
<br /><br />
<br />
<br />
-----<br />
<br />
[mailto:TECHNET@MICROSOFT.COM Send feedback to Microsoft]<br />
<br />
<span>© Microsoft Corporation. All rights reserved.</span><br />
<br />
<br />
</div><br />
<br />
</div></div>
3155ffGd