On 08/30/2012 02:25 PM, tho...@antispam.ham wrote:
> That must be it, though if I understand the issue properly, it
> might be more appropriate to call it a design decision rather
> than a bug. The use of _commit apparently allows the data to be
> seen by other processes, but the penalty is performance. Without
> _commit, the performance is great, but presumably other processes
> might not see what the writing process thinks has been written.
Well, it is not a correctness bug but a quality of implementation bug.
The chance is much higher that one writes a lot of data than that one
wants to access a file (or its meta data) from the outside ... (Or from
the inside: "stat" also returns the wrong result from within the
process, which has been fixed for INQUIRE(unit=...,SIZE=...) by using
Fortran's knowledge about the file.)
Additionally, the user can still explicitly call _commit or fstat, if
needed.
> But does it really affect both 32- and 64-bit MinGW? The snippet
> from the bug report could be interpreted as referring to just
> 32-bit Windows:
>
> #ifdef _WIN32
> _commit (s->fd);
> #endif
>
> or is "WIN32" simply shorthand for any modern Windows system (those
> not built on top of DOS like Windows 3.1), either 32- or 64-bit?
My understanding is that _WIN32 is set by both 32 and 64 bit Windows.
>> The best way is to either upgrade to GCC 4.6.1, GCC 4.7.1 or the current
>> developer version 4.8 (or to downgrade to GCC 4.5.x).
>>
>> See
http://gcc.gnu.org/wiki/GFortranBinaries for some options you have.
>
> I had been using the TDM build, because they have a convenient
> installer that makes life easy. However, TDM seems to be stuck on
> version 4.6.1.
I once tried to reach them, but without success.
> Meanwhile,
equation.com has builds for 4.6.3 and
> 4.7.1, both 32- and 64-bit, as well as a weekly snapshot of 4.8.
> However, the "use at your own risk" statement had given me pause,
> and
equation.com calls it a "variant" of GCC with the parallel
> processing support in the library replaced with something else,
> so I had some concerns over compatibility with my library that had
> been built with TDM-GCC 4.6.1.
Regarding the own risk part: The problem is that they do note state
which changes they did. I know that for some
equation.com version, a
Polyhedron test case failed while it worked with the unmodified MinGW
(or was it MinGW64?) version. I do not recall whether the problem was an
internal compiler error or wrong code (I think it was the former), but
without knowing what they did, one cannot do anything to solve the problem.
Regarding the thread/OpenMP performance: I think MinGW64 comes with a
newly written pthread library which is much faster than the old one.
Though, I don't know in which MinGW64 version nor whether it is enabled
by default or not.
> I recompiled using 4.8, and what took 550 seconds to write using
> the 4.6.1 executable now took only 20 seconds using the 4.8
> executable. Just as fast as the CVF 6.6c executable.
Good!
> I didn't see any links to the older 4.5.x builds. Is there an
> archive somewhere not mentioned on the above-mentioned web page?
No idea. The official GCC policy is to not create binaries but only the
source code and leave the compilation to users or to vendors. Thus, it
depends on the latter whether they offer older versions or not. For
MinGW (32bit), I see 4.5.2, 4.5.2 and 4.7.0 at
http://sourceforge.net/projects/mingw/files/MinGW/Base/gcc/Version4/
I haven't checked the MinGW64 versions.
Note that 4.5 is also not officially supported any more. Usually, old
GCC versions are supported for two years such that there is the latest
version (currently 4.7.1), and it predecessor (4.6.3) plus the actively
developed version, which is usually but not always rather stable (4.8,
will be released around April 2013).
After a .0 release the branch is supposed to see only minor changes,
especially regression fixes, thus, newer .x releases should be more
stable than the .0 release.
In general, newer 4.y releases generate faster code and support more
features; in terms of stability, it is probably the same - some bugs are
found and get removed, but some new regressions creep in. Of course, if
you use new features, using a newer version makes sense as those need a
few versions to mature.
For an overview about the new features, see
http://gcc.gnu.org/wiki/GFortran#news
> And are there the handy "installer" executables for other builds
> that aren't TDM or
equation.com? Or is installation really nothing
> more involved than copying (or unzipping) the files to the right
> directories and then adding the path to the binaries to the
> environment?
Actually, I do not know how the different versions are packed. I have
most experience with the Linux version and there unpacking the files
into a directory is essentially enough. On Linux, for convenience I also
add the directory with the binaries to the PATH and, for running
dynamically linked files, the library directory to LD_LIBRARY_PATH. I
don't know what's the Windows equivalent for the latter. (At link time,
the compiler should be able to find the libraries without further help.)
> Is it generally a good idea to rebuild libraries from scratch when
> a new version of the compiler is released?
That depends. The run-time library of GCC is backward compatible since
4.3, i.e. older programs work with newer run-time libraries - and in
many cases also reverse, but that also depends on the features you use.
(In terms of performance, it might make sense to recompile.)
What so far always changed with a new compiler version was the format of
the .mod file. Some new feature always required some change which wasn't
backward compatible.
Additionally, the .mod version number got occasionally bumped to force
recompilation when the ABI changed; I think since 4.1, the only ABI that
changed (and will change again) is the one for polymorphic data structures.
Thus, if you don't use modules, you don't have to recompile; if you do,
you may; and if you use polymorphism, you should - not only because the
ABI might have changed, but also because new features are implemented
and bugs got fixed.
Upcoming for 4.8 is an ABI change to support FINAL subroutines; probably
for 4.9 the heart of the ABI will change: The array descriptor - at that
point, also the ABI of the library will be changed. (The descriptor
change is required for several reasons, one is TS29113 but also some
special Fortran 95 cases aren't representable with the current descriptor.)
Tobias