Skip to content

Commit

Permalink
Merge pull request #4706 from camelto2/RotatedSPOs_timers
Browse files Browse the repository at this point in the history
apply_rotation timer
  • Loading branch information
markdewing authored Aug 23, 2023
2 parents a897a99 + c6a2db3 commit e875bbd
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 3 deletions.
17 changes: 14 additions & 3 deletions src/QMCWaveFunctions/RotatedSPOs.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,12 @@
namespace qmcplusplus
{
RotatedSPOs::RotatedSPOs(const std::string& my_name, std::unique_ptr<SPOSet>&& spos)
: SPOSet(my_name), OptimizableObject(my_name), Phi(std::move(spos)), nel_major_(0), params_supplied(false)
: SPOSet(my_name),
OptimizableObject(my_name),
Phi(std::move(spos)),
nel_major_(0),
params_supplied(false),
apply_rotation_timer_(createGlobalTimer("RotatedSPOs::apply_rotation", timer_level_fine))
{
OrbitalSetSize = Phi->getOrbitalSetSize();
}
Expand Down Expand Up @@ -408,7 +413,10 @@ void RotatedSPOs::apply_rotation(const std::vector<RealType>& param, bool use_st
Finally, apply unitary matrix to orbs.
*/
exponentiate_antisym_matrix(rot_mat);
Phi->applyRotation(rot_mat, use_stored_copy);
{
ScopedTimer local(apply_rotation_timer_);
Phi->applyRotation(rot_mat, use_stored_copy);
}
}

void RotatedSPOs::applyDeltaRotation(const std::vector<RealType>& delta_param,
Expand All @@ -419,7 +427,10 @@ void RotatedSPOs::applyDeltaRotation(const std::vector<RealType>& delta_param,
ValueMatrix new_rot_mat(nmo, nmo);
constructDeltaRotation(delta_param, old_param, m_act_rot_inds, m_full_rot_inds, new_param, new_rot_mat);

Phi->applyRotation(new_rot_mat, true);
{
ScopedTimer local(apply_rotation_timer_);
Phi->applyRotation(new_rot_mat, true);
}
}

void RotatedSPOs::constructDeltaRotation(const std::vector<RealType>& delta_param,
Expand Down
3 changes: 3 additions & 0 deletions src/QMCWaveFunctions/RotatedSPOs.h
Original file line number Diff line number Diff line change
Expand Up @@ -437,6 +437,9 @@ class RotatedSPOs : public SPOSet, public OptimizableObject
/// Full set of rotation matrix parameters for use in global rotation method
opt_variables_type myVarsFull;

/// timer for apply_rotation
NewTimer& apply_rotation_timer_;

/// List of previously applied parameters
std::vector<std::vector<RealType>> history_params_;

Expand Down

0 comments on commit e875bbd

Please sign in to comment.