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

[PL] remove mutable member variables in Parameter classes #2337

Merged
merged 2 commits into from
Jan 31, 2019

Conversation

norihiro-w
Copy link
Collaborator

as suggested in #2325

@endJunction
Copy link
Member

This looks good. Though I tested it and it has some overhead now due to copy the vector resulting in 5% or so performance drop. Easily fixable (for most cases) by introducing an operator()(t, pos, index), s.t. the resulting call is some_parameter(t, pos, 0) instead of the mostly used some_parameter(t, pos)[0]. Not this PR anyway.

I didn't look into the reasons for the few failing ctests.

@norihiro-w
Copy link
Collaborator Author

norihiro-w commented Jan 31, 2019

@endJunction In current codes, there are some cases using a returned value of Parameter::operator() like

        _intrinsic_permeability_tensor =
            Eigen::Map<Eigen::Matrix<double,
                                     Eigen::Dynamic,
                                     Eigen::Dynamic,
                                     Eigen::RowMajor> const>(
                _permeability_parameter(t, pos).data(), _dimension, _dimension);

In this example, I guess the returned vector of _permeability_parameter() is dead after defining _intrinsic_permeability_tensor . How do you think?

UPDATE: It seems the problem happened because of auto& v = param(t,pos)[0];. I fixed related part in the process assemblies.

SpatialPosition const& pos) const override
{
auto const& tup = (*_parameter)(t, pos);
auto const scaling = _curve.getValue(t);

auto const num_comp = _parameter->getNumberOfComponents();
std::vector<T> cache(num_comp);
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

May be this change makes a little slow down in the performance. I checked the maximum Total Test time (real) in the building history:
This PR: 494 s
PR #2334: 464.40 s
PR #2338: 457.47 s

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The numbers are not very reliable because of changing load while tests run.

Copy link
Member

@wenqing wenqing left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good except a little slow down in performance.

@TomFischer TomFischer merged commit b910d25 into ufz:master Jan 31, 2019
@norihiro-w norihiro-w deleted the rm-mutable-Parameter branch January 31, 2019 13:46
@ogsbot
Copy link
Member

ogsbot commented Jun 19, 2020

OpenGeoSys development has been moved to GitLab.

See this pull request on GitLab.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants