Re: can somebody verify this C program which calls dsaupd_ ? (longish)



H. S. wrote:

> Apparently, _Madhusudan Singh_, on 02/04/05 19:05,typed:
>> H. S. wrote:
>>
>>
>>>(terribly sorry for this long post which includes my two source files,
>>>but I could't find out how put the files online using my Yahoo account)
>>
>>
>> The problem is not with the length of your post but with the relevance to
>> the newsgroup.
>
> Since I was requesting somebody who already has the FORTRAN libraries
> installed and works with them to test if the program does call dsaupd_
> properly without getting info=-9999 as error, I do not see how the post
> is NOT relevant to FORTRAN language newsgroup.

First, FORTRAN refers to the language upto and including f77. This newsgroup
discusses all aspects of Fortran, including FORTRAN.

More importantly, if your libraries compiled correctly, they were fine. The
problem would then lie in the C code. And that is not (please do not use
caps - use * * instead to emphasize) relevant to a Fortran newsgroup.

ARPACK library comes with a very well documented Makefile, which has been
tested by hundreds (if not thousands) of people (including myself). Its
illogical to assume that a untested / not adequately tested C wrapper is
ok, but the Makefiles are not.

It could be true, but it certainly would not be the first thing to suspect.

>
>
>> Please cross-post your question to comp.lang.c instead since your code is
>> in C, not Fortran.
>
> But the code to be tested is the calling of FORTRAN libs and return of
> those libs. As I already made quite clear, I just want to test the
> FORTRAN part, not the C part. So if someone can run the C program

Read above.

> against their ARPACK and BLAS libraries and can reply Yes or No to the
> question whether they get expected values, the experiment is complete. C
> does not come into play (except the compilation part). If the somebody
> does get the expected results correctly, then I have a problem with my
> FORTRAN libs. If not, then there probably is something wrong with the C
> code. The latter is the next topic of discussion, not the current one.

If you used the Makefile included in the library (with the correct settings
in ARmakes.inc - it would not even compile correctly if those settings were
wrong), that is the wrong place to start looking for bugs.

Test what you wrote first (or whatever is the "weakest" in terms of
testing). If that is sanity checked by some means, only then start casting
the net wider. As a scientist, I am sure you can understand what logical
elimination and sound experimental sequence means.

Further, as you partially realized when you made the post (assuming you
tested your C code first), it would be better to first ask if someone was
willing to test the code and only then send it to them off group. Posting a
bunch of non-Fortran code and irritating people is not the most polite or
even conducive way to get them to help you.

To better understand what I wrote, let me cast the choice in C :

If you were writing a piece of code using the GNU C library, and found
unexpected behaviour, would you test your program first (and say consult
someone on comp.lang.c) or start asking people if your glibc is compiled
correctly ? The GNU C library is a widely used and extremely well-tested
piece of code. Its the wrong thing to suspect first.
.



Relevant Pages

  • Re: Matlab Vectorisation Speed - How is it done in c++?
    ... Beating the performance of vectorized Matlab code is very ... Matlab makes calls to optimized C and Fortran libraries ... Use optimization level 3 on numerical code and level 2 on non- ...
    (comp.soft-sys.matlab)
  • Re: Link problem with Compaq Visual Fortran
    ... > | yet one of the source codes is a Fortran program. ... > in Fortran and C run-time libraries (CVF uses both despite the fact ... GCG.lib: error LNK2001: unresolved external symbol ...
    (comp.lang.fortran)
  • NAG on Fortran for finance quants
    ... Malcolm Cohen of NAG has written an article on the advantages of a ... matrix-oriented language like Fortran 2003 for quantitative finance ... promoting Fortran in QF. ... adding NEW procedures ONLY to the F77 and C libraries. ...
    (comp.lang.fortran)
  • Re: C versus FORTRAN90
    ... FORTRAN90 version of these libraries. ... Are there other more subtle benefits for FORTRAN over C? ... If the answer to if f95 heavy, then maybe some sort of cost-benefit analysis of a wholesale switch from f95 to C at your company should be done to convince them otherwise. ...
    (comp.lang.fortran)
  • Re: simple graphics for fortran on windows
    ... Most graphics routines callable directly from high-level ... languages such as Fortran are not simpleto use. ... Routines that plot directly to a physical device (and I would ... I have written libraries to export complicated data ...
    (comp.lang.fortran)