Contact US

Log In

Come Join Us!

Are you a
Computer / IT professional?
Join Tek-Tips Forums!
  • Talk With Other Members
  • Be Notified Of Responses
    To Your Posts
  • Keyword Search
  • One-Click Access To Your
    Favorite Forums
  • Automated Signatures
    On Your Posts
  • Best Of All, It's Free!

*Tek-Tips's functionality depends on members receiving e-mail. By joining you are opting in to receive e-mail.

Posting Guidelines

Promoting, selling, recruiting, coursework and thesis posting is forbidden.

Students Click Here

Problem with llapack and DGELS

Problem with llapack and DGELS

Problem with llapack and DGELS

Hi. I don't know what is causing this. I have written two different codes, and I wanted to use a subroutine I wrote, in both codes. The thing is that this subroutine calls DGELS to do some computations. But in one code it works fine, and in the other gives a wrong result. I don't really know what could be causing this, I have tried almost everything. I thought that maybe some array was ill defined or something, but the subroutine should be doing all the calculations internally, with the arrays defined inside the subroutine. Moreover, I have checked that the matrix and vectors I define to call dgels are just equally defined in both programs just before calling DGELS.

Both programs should be performing exactly the same task. I call DGELS this way:

CALL DGELS( 'N',2*totang,maxcol,1,A,2*totang,BB,maxcol,work,lwork,info)

The two subroutines are exactly equal, and I think there shouldn't be any issue with the modules I am using. However, when I print the vector BB in both programs, they give different results:

In one program it gives the correct array:


But the other gives something totally wrong:


But both, the matrix A, and the vector BB that I provide to DGELS are exactly the same when I print them before calling DGELS in both programs.

Any idea of what could be going on with this?

RE: Problem with llapack and DGELS

I have found that if I delete one subroutine in the program that is working wrong, then DGELS gives the correct result. Even if I don't call this subroutine (which is a big code which I have inserted inside my code to call), the problem occurs. The thing is that I actually need to call this subroutine at some point, any ideas on what could be originating this problem? it is very crazy that even if I don't call this subroutine I have the problem. I have compiled the code with gfortran and with ifort, and the same problem occurs with both compillers.

I don't understand how this two subroutines are interacting, and in particular how is it that LAPACK is interacting with this subroutine, being supposed to work as independent calls. This subroutines are called on different parts of the program in a very independent way, and I think I'm not sharing anything relevant in the modules that could be interfering. Actually, the subroutine that causes the problem (the big code that wasn't written by me) doesn't have any share modules with the subroutine I call where DGELS is called.

RE: Problem with llapack and DGELS

Ok. I have just solved the issue. There was a function call that had the same name as an internal function of llapack.

Red Flag This Post

Please let us know here why this post is inappropriate. Reasons such as off-topic, duplicates, flames, illegal, vulgar, or students posting their homework.

Red Flag Submitted

Thank you for helping keep Tek-Tips Forums free from inappropriate posts.
The Tek-Tips staff will check this out and take appropriate action.

Reply To This Thread

Posting in the Tek-Tips forums is a member-only feature.

Click Here to join Tek-Tips and talk with other members! Already a Member? Login

Close Box

Join Tek-Tips® Today!

Join your peers on the Internet's largest technical computer professional community.
It's easy to join and it's free.

Here's Why Members Love Tek-Tips Forums:

Register now while it's still free!

Already a member? Close this window and log in.

Join Us             Close