User-defined material SLOW analysis

Forum for OpenSees users to post questions, comments, etc. on the use of the OpenSees interpreter, OpenSees.exe

Moderators: silvia, selimgunay, Moderators

Post Reply
Pablongo
Posts: 15
Joined: Tue Oct 11, 2011 7:42 pm
Location: Georgia Tech

User-defined material SLOW analysis

Post by Pablongo »

I am running nonlinear time history analysis with a model that includes a user-defined material, compiled in C++. Compared to the same model using only elements from the OpenSees library, the analysis is substantially slower. Is this typical? Any tips to improve this problem?
kostast88
Posts: 49
Joined: Tue Jan 31, 2012 1:20 pm
Location: University of Patras

Re: User-defined material SLOW analysis

Post by kostast88 »

I've used a user defined element,and the analysis became slow (20% of original speed) when I added a bunch of calculations in the element itself.A trick I used to speed it up was to alter some existing methods (eg corrdinate transformation) to do there some of the calculations,without having to overwrite variables again and again.Things went faster,but again...slower than the original.

So the impression I got,is that it really depends on the amount of calculations you do.And dynamic memmory allocation perhaps.But I don't know much about the second.
fmk
Site Admin
Posts: 5884
Joined: Fri Jun 11, 2004 2:33 pm
Location: UC Berkeley
Contact:

Re: User-defined material SLOW analysis

Post by fmk »

i never looked to see if there was any slowdown associated with the .dll approach. it could be due to a number of reasons:
1) a penalty due to invoking the methods in a .dll: a somewhat easy fix, you need to build the .exe with your code included.
2) make sure you are building the release version of the .dll and not a debug version
3) your code is slow. other than time sent in the solver, the next big hog of time for fiber based models is in the material. you may need to rewrite your
code if 1) and 2) above do not solve your problem.
Pablongo
Posts: 15
Joined: Tue Oct 11, 2011 7:42 pm
Location: Georgia Tech

Re: User-defined material SLOW analysis

Post by Pablongo »

1) is not the problem, the .exe was built with the code. I need to check 2) I didn't write the code, a colleague did.
Thank you for the response, Frank.
Pablongo
Posts: 15
Joined: Tue Oct 11, 2011 7:42 pm
Location: Georgia Tech

Re: User-defined material SLOW analysis

Post by Pablongo »

Frank, turns out #2 was the issue. We built the release version and now the analysis runs at normal Opensees speed. Thanks for your help!
Post Reply