Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

needless rebuilding of variables #72

Closed
wd15 opened this issue Sep 19, 2014 · 1 comment
Closed

needless rebuilding of variables #72

wd15 opened this issue Sep 19, 2014 · 1 comment
Labels

Comments

@wd15
Copy link
Contributor

wd15 commented Sep 19, 2014

There are places in _buildMatrix where we are recreating variables everytime we call _buildMatrix.
Creating variables is relatively expensive due to the

  • shape calculating using the op,
  • getUnit() (although it shouldn't be)
  • building C strings (for small problems)

I think we are recreating these variables due to our caching issues. It seems that we should be able to
keep the variable object but just explicitly tell it not to cache. For example in diffusionTerm.py we have

coeff = self._getGeomCoeff(mesh)
minusCoeff = -coeff

and then later on we say

del minusCoeff
del coeffs

It seems like for those situations we should be declaring as self.coeff the first time through but then saying
self.coeff.dontCache() after declaration and then there is no need to delete. If we are running
--cache mode on then we probably want to keep self.coeff anyway and not delete it.

Imported from trac ticket #80, created by wd15 on 07-25-2006 at 16:37, last modified: 07-27-2006 at 11:33

@wd15
Copy link
Contributor Author

wd15 commented Sep 19, 2014

Ran a number of examples and checked if _getUnaryOp() and _getBinaryOp() are called after the first time step. Seems like the only place it was happening was in DiffusionTerm and FixedValue. These
classes now heep a copy of the variable but call dontCachMe().

Trac comment by wd15 on 07-27-2006 at 11:33

@wd15 wd15 closed this as completed Sep 19, 2014
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants