Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

different times to do the same thing.

Status
Not open for further replies.

rfcruz

Programmer
Dec 11, 2007
3
PT
Hi,

I'm working in a finite element code but my skills are really limited, since i'm an civil engineer.

My first task was to change the equation solver. I've changed everything, excluding the Factorization, that stills the same subroutine. Comparing the new and the old version, the new version it's quicker in everything except, and obviously, the time to do the Factorization, it's the same.

But if i'm calculating a very complex model, with huge vectors, the Factorization time it's much longer (5x longer) in the new version. Really strange, hn?

The used memory is the same, so I assume that the problem is in the "structure" of the program... Can anybody help me with this?

Thanks in advance, rfcruz
 
1) How are you passing the data across?
2) Are you getting an exponential pattern? If so, look for places where you are copying the vectors.
 
1)through the arguments of the subroutine.

2)I don't think so.. In simple cases, it's taking the same time. And i'm not copying the vector. I this subroutine i'm only working with two vectors. The bigger one, represents a matrix that I want to factorize (turn it into a triangular matrix). The second one is a pointer vector, so I can work with the first one. I'm running across a changing the coefficients of my vector several times till I can get it triangular, but the vector are equals in both of the versions, so I can't understand why it's taking more time. And the final results are the same... Can the problem be outside of the subroutine?
 
Code is obviously too long to post. Assume the code is as follows:

Initialization - same for both
Factorization - same for both
Solve - different
Pritn results - same for both

Are you saying that the factorization in the new method takes longer with the old code than with the new code?
 
yes, that's what i want to say.

i think it's more like:

initialization - different
assembling - different (this is where I construct the big vector, it's quite quicker, but the vector is equal in both versions)
Factorization - same for both
Solve - different
print results - same for both

In assembling and solving It's really quicker in the new version. I was expecting to have the same time in the factorization, because the arguments are the same and the subroutine is equal, but in complex problems, is much slower.
And I checked the memory in use, with the task manager, and is the same in both versions.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top