Home > Archive > Fortran > August 2005 > NLEQ1 and open source Fortran
You are viewing an archived Text-only version of the thread.
To view this thread in it's original format and/or if you want to reply to
this thread please [click here]
| Author |
NLEQ1 and open source Fortran
|
|
| rlopneg 2005-08-25, 6:59 pm |
| Hello I've been having some troubles trying to solve al large scale
nonlinear system using nleq1. When I compile it using Intel's Fortran
Compiler everything works properly, but since I'm trying not to use
comercial software I tried compiling my program using GNU's (gcc)
GFortran. When doing this I get the solver stops due to singular matrix
problems. I've checked that the SMALL and EPMACH values are the right
ones for my machine, and I'm using the files downloaded right from
http://www.zib.de/Numerik/numsoft/CodeLib/codes/nleq1/. And besides
that, the solver works fine with Intel's fortran...
Does any body know how to correct this, or why it works on comercial
fortran compilers and not with open source compilers??
thanks,
Rodrigo
| |
| Steven G. Kargl 2005-08-25, 6:59 pm |
| In article <1125006008.443282.66730@g14g2000cwa.googlegroups.com>,
"rlopneg" <soyrush@gmail.com> writes:
> Hello I've been having some troubles trying to solve al large scale
> nonlinear system using nleq1. When I compile it using Intel's Fortran
> Compiler everything works properly, but since I'm trying not to use
> comercial software I tried compiling my program using GNU's (gcc)
> GFortran. When doing this I get the solver stops due to singular matrix
> problems. I've checked that the SMALL and EPMACH values are the right
> ones for my machine, and I'm using the files downloaded right from
> http://www.zib.de/Numerik/numsoft/CodeLib/codes/nleq1/. And besides
> that, the solver works fine with Intel's fortran...
>
Which version of gfortran are you using (ie gfortran --version)?
What OS and where did you get your binary? What compiler flags
are you using?
> Does any body know how to correct this, or why it works on comercial
> fortran compilers and not with open source compilers??
Commercial compilers, and Intel in particular, have hundreds of man-hours
(man-years?) of paid development. Gfortran has been around for about
2 years with a very small group of unpaid, volunteer developers. Bugs
are being fixed as quickly as time permits. You may have hit a bug,
but without seeing the code and what you consider to be the correct
results, it is hard to make suggestions.
--
Steve
http://troutmask.apl.washington.edu/~kargl/
| |
| Madhusudan Singh 2005-08-26, 3:56 am |
| rlopneg wrote:
> Hello I've been having some troubles trying to solve al large scale
> nonlinear system using nleq1. When I compile it using Intel's Fortran
> Compiler everything works properly, but since I'm trying not to use
> comercial software I tried compiling my program using GNU's (gcc)
> GFortran. When doing this I get the solver stops due to singular matrix
> problems. I've checked that the SMALL and EPMACH values are the right
> ones for my machine, and I'm using the files downloaded right from
> http://www.zib.de/Numerik/numsoft/CodeLib/codes/nleq1/. And besides
> that, the solver works fine with Intel's fortran...
>
> Does any body know how to correct this, or why it works on comercial
> fortran compilers and not with open source compilers??
>
> thanks,
> Rodrigo
Have you tried g95 ? It is known to be more complete than gfortran.
Further, are you sure there is no problem in your code ? It could simply be
that the default options with ifc are a lot more forgiving (like automatic
initialization with some compilers) ?
I used to work with large Monte Carlo code that would often run with Intel
IFC but choke with Sun f95 with segmentation faults. The issue is often not
so much commercial vs. open source, but the default behavior of the
compilers in question.
| |
| Steve Kargl 2005-08-26, 3:56 am |
| Madhusudan Singh wrote:
> rlopneg wrote:
>
>
>
> Have you tried g95 ? It is known to be more complete than gfortran.
>
This has nothing to do with the completeness of gfortran versus
g95. The OP clearly states that gfortran can compile the code.
Indeed, g95's use of an ancient version of the gcc backend may
indicate that gfortran is a better choice.
BTW, if you use complex data types with g95, I suggest that you
should carefully read the g95 source code. The last time I checked,
there were a few bugs lurking.
--
steve
| |
| Bart Vandewoestyne 2005-08-26, 7:57 am |
| On 2005-08-26, Steve Kargl <kargls@comcast.net> wrote:
>
> BTW, if you use complex data types with g95, I suggest that you
> should carefully read the g95 source code. The last time I checked,
> there were a few bugs lurking.
Did you sent what you have spotted to Andy (main g95 developer) then?
Regards,
Bart
--
"Share what you know. Learn what you don't."
| |
| Steve Kargl 2005-08-26, 6:59 pm |
| Bart Vandewoestyne wrote:
> On 2005-08-26, Steve Kargl <kargls@comcast.net> wrote:
>
>
>
> Did you sent what you have spotted to Andy (main g95 developer) then?
>
> Regards,
> Bart
>
nope.
--
steve
| |
| awgreynolds@earthlink.net 2005-08-26, 6:59 pm |
| g95 uses the GCC 4.01 backend. Is this ancient?
BTW, g95 has been compiling and running properly my real-life
engineering application for months. I have yet to get gfortran to even
compile it.
Al
Steve Kargl wrote:
> Madhusudan Singh wrote:
>
> This has nothing to do with the completeness of gfortran versus
> g95. The OP clearly states that gfortran can compile the code.
> Indeed, g95's use of an ancient version of the gcc backend may
> indicate that gfortran is a better choice.
>
> BTW, if you use complex data types with g95, I suggest that you
> should carefully read the g95 source code. The last time I checked,
> there were a few bugs lurking.
>
> --
> steve
| |
| Steve Kargl 2005-08-26, 6:59 pm |
| awgreynolds@earthlink.net wrote:
> g95 uses the GCC 4.01 backend. Is this ancient?
Yes, it is.
> BTW, g95 has been compiling and running properly my real-life
> engineering application for months. I have yet to get gfortran to even
> compile it.
gfortran has been compiling my real-world codes for the last year.
Have you filed bug reports that detail your problems with gfortran?
--
steve
| |
|
|
| Steve Kargl 2005-08-26, 6:59 pm |
| Lynn McGuire wrote:
>
>
> Uh, the current release of GCC is 4.0.1 !
> http://www.gnu.org/software/gcc/gcc.html
>
Yes, I know. I'm also aware of the changes in
the gcc code base in going from 4.0.1 to what
will become 4.0.2. :-O
--
steve
| |
| awgreynolds@earthlink.net 2005-08-26, 6:59 pm |
|
Steve Kargl wrote:
> Have you filed bug reports that detail your problems with gfortran?
>
> --
> steve
No. Mostly because there are things on their published TODO list that
I do in my code, so I didn't see the point in spending the time.
Al
| |
| Rodrigo López Negrete 2005-08-26, 6:59 pm |
| > Which version of gfortran are you using (ie gfortran --version)?
> What OS and where did you get your binary? What compiler flags
> are you using?
$ gfortran --version returns:
GNU Fortran 95 (GCC 4.0.0 20050406 (Red Hat 4.0.0-0.41.fc3))
Copyright (C) 2005 Free Software Foundation, Inc.
GNU Fortran comes with NO WARRANTY, to the extent permitted by law.
You may redistribute copies of GNU Fortran
under the terms of the GNU General Public License.
For more information about these matters, see the file named COPYING
As you can see, I'm using Fedora Core 3 linux, the binaries I got from
the fedora upgrades repositories, and I've been using -O -c flags when
compiling...
I hope this helps, I'm actually pretty new to fortran, so maybe I'm
using the wrong flags or missing some.
Thanks to all,
Rodrigo
| |
| Rodrigo López Negrete 2005-08-26, 6:59 pm |
| Sorry, forgot to answer this:
> Commercial compilers, and Intel in particular, have hundreds of man-hours
> (man-years?) of paid development. Gfortran has been around for about
> 2 years with a very small group of unpaid, volunteer developers. Bugs
> are being fixed as quickly as time permits. You may have hit a bug,
> but without seeing the code and what you consider to be the correct
> results, it is hard to make suggestions.
I've got a couple of proven solutions to my problem, so I know what to
consider 'a correct solution'. Also, Intel's Fortran (ifort) returns
that 'correct solution', but since I'm trying to use only open source
codes/programs, I'm trying to use Gfortran...
>From another message:
> This has nothing to do with the completeness of gfortran versus
> g95. The OP clearly states that gfortran can compile the code.
> Indeed, g95's use of an ancient version of the gcc backend may
> indicate that gfortran is a better choice.
Yes, this is true. I can compile and run the program using Gfortran.
The problem is ifort does returns a correct solution and Gfortran can't
do it. NLEQ1 returns 'Iteration terminates due to singular jacobian
matrix'.
--
Rodrigo L=F3pez Negrete
http://muon.blogdns.org/~rush/
| |
| Kevin G. Rhoads 2005-08-26, 6:59 pm |
| After following the link and taking a quick perusal of both the readme and
some of the code, I note this release is from 1992, and APPEARS to be pure F77.
In 1992 F90 compilers were still rare, so the use of F77 style coding is unsurprising.
This indicates that OpenWatcom (which used to be commercial, but is now open source)
may be a possibility. Unfortunately, the Linuxification of OpenWatcom is not finished.
| |
| Rodrigo López Negrete 2005-08-28, 3:56 am |
| Well yes, NLEQ1 is written for f77, but the rest of my code is for
f95... most people i've asked told me this should not cause any
troubles since fortran 95 could compile fortran 77 code....
| |
| feenberg@gmail.com 2005-08-28, 7:57 am |
| rlopneg wrote:
> Hello I've been having some troubles trying to solve al large scale
> nonlinear system using nleq1. When I compile it using Intel's Fortran
> Compiler everything works properly, but since I'm trying not to use
> comercial software I tried compiling my program using GNU's (gcc)
> GFortran. When doing this I get the solver stops due to singular matrix
> problems. I've checked that the SMALL and EPMACH values are the right
> ones for my machine, and I'm using the files downloaded right from
> http://www.zib.de/Numerik/numsoft/CodeLib/codes/nleq1/. And besides
> that, the solver works fine with Intel's fortran...
>
> Does any body know how to correct this, or why it works on comercial
> fortran compilers and not with open source compilers??
>
> thanks,
> Rodrigo
Does g95 fail only on large problems, or on all problems? If the
latter, do your testing on the smallest problem you can make up.
You are lucky to have access to both compilers at the same time.
Instrument the program with a number of print statements for
intermediate results, and run with both compliters, then locate where
g95 goes wrong in the output. Instrument some more till you find the
problem and either file a bug report or fix the source.
Daniel Feenberg
NBER
feenberg is at nber dotte org
| |
| N. Shamsundar 2005-08-29, 7:01 pm |
| rlopneg wrote:
> Hello I've been having some troubles trying to solve al large scale
> nonlinear system using nleq1. When I compile it using Intel's Fortran
> Compiler everything works properly, but since I'm trying not to use
> comercial software I tried compiling my program using GNU's (gcc)
> GFortran. When doing this I get the solver stops due to singular matrix
> problems. I've checked that the SMALL and EPMACH values are the right
> ones for my machine, and I'm using the files downloaded right from
> http://www.zib.de/Numerik/numsoft/CodeLib/codes/nleq1/. And besides
> that, the solver works fine with Intel's fortran...
>
> Does any body know how to correct this, or why it works on comercial
> fortran compilers and not with open source compilers??
>
> thanks,
> Rodrigo
>
I have used NLEQ1 and other CodeLib packages for a number of years using
a number of different compilers on different platforms and operating
systems. These are high quality, robust, portable codes, but some
preparatory work is required to call them from your code. Most older F77
codes assume that storage is static; many assume that by default storage
is set to zero prior to execution.
My hunch is that your errors have more to do with how you call and pass
parameters -- especially two- or higher-dimensional arrays -- to NLEQ1
than with which compiler you use.
N. Shamsundar
University of Houston
| |
| Steven G. Kargl 2005-08-29, 7:01 pm |
| In article <1125079100.503410.132770@g49g2000cwa.googlegroups.com>,
"Rodrigo López Negrete" <soyrush@gmail.com> writes:
>
> $ gfortran --version returns:
>
> GNU Fortran 95 (GCC 4.0.0 20050406 (Red Hat 4.0.0-0.41.fc3))
> Copyright (C) 2005 Free Software Foundation, Inc.
>
I don't use RH, so I can't advise on an upgrade path.
However, at a minimum you probably want to update to
4.0.1 and if you build your own binaries I'd recommend
either the gcc-4_0-branch cvs branch or mainline.
Someone else mentioned intialization of uninitialized
variables. Gfortran will not initialize variables to
zero (ifort may do this for you).
--
Steve
http://troutmask.apl.washington.edu/~kargl/
|
|
|
|
|