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

Ct int solver #189

Merged
merged 24 commits into from
Aug 13, 2020
Merged

Ct int solver #189

merged 24 commits into from
Aug 13, 2020

Conversation

gbalduzz
Copy link
Contributor

@gbalduzz gbalduzz commented Apr 5, 2020

With this PR, the CT-INT solver will finally be usable.
This PR includes:

  • The solver itself.
  • several statistic and no-change tests. This is the bulk of the line count.
  • changes to the const-ness and minor interface changes to other solvers' walker and accumulator.
  • added template parameter for the accumulator scalar type
  • measurements and sweeps-per-measurement can be initialized with a vector to have a different number at each iteration. Input files with a scalar parameter are still supported.

@gbalduzz
Copy link
Contributor Author

gbalduzz commented Apr 5, 2020

retest this please.

@gbalduzz
Copy link
Contributor Author

gbalduzz commented Apr 5, 2020

retest this, please.

@gbalduzz
Copy link
Contributor Author

gbalduzz commented Apr 7, 2020

retest this, please

@gbalduzz
Copy link
Contributor Author

fixed weight initialization in 2d6f92c

@gbalduzz
Copy link
Contributor Author

Test pass, only failure is the distributed G4 test.

Copy link
Contributor

@PDoakORNL PDoakORNL left a comment

Choose a reason for hiding this comment

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

Outside of the semantics of CudaStream and MagmaQueue this looks good. I will also do some testing with it on non summit systems while I wait for your responses and changes.

include/dca/linalg/util/cuda_stream.hpp Outdated Show resolved Hide resolved

namespace dca {
namespace linalg {
namespace util {
// dca::linalg::util::

class MagmaQueue {
class MagmaQueue : public linalg::util::CudaStream {
Copy link
Contributor

Choose a reason for hiding this comment

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

I think a MagmaQueue has a CudaStream I don't think it is a CudaStream.

Copy link
Contributor Author

@gbalduzz gbalduzz Aug 12, 2020

Choose a reason for hiding this comment

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

We could argue if a MagmaQueue is a CudaStream with extra resources. But according to the Liskov Substitution Principle, inheritance is appropriate: everywhere you can use a CudaStream you can also use a MagmaQueue. I set the destructor of the base class to virtual for safety reasons.

Copy link
Contributor

Choose a reason for hiding this comment

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

I think its pretty clear a CudaStream is a resource a MagmaQueue owns or has a reference to. When Magma is build on top of AMD's libraries it clearly won't have a CudaStream or be a cudastream. I don't like to see inheritance used as a way to get simplified access to class members.

Choose a reason for hiding this comment

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

AMD HIP tries to follow CUDA. I think there is still "HIP stream" that works like a cuda stream.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

you just need to change the implementation of CudaStream (and possibly rename it), this is completely orthogonal from the decision of using composition vs inheritance.
The inheritance has no access to the private members, but it exposes the interface, which I want, and has a well defined downcast that I also need. Of course it could be implemented as composition, but then I need to forward the methods, and use a getter to the stream in the rest of the code. While we don't need runtime polymorphism, I am pretty sure this is a well defined inheritance, and the added 64 bits of storage for the (unused) vtable pointer is a non issue.

include/dca/linalg/util/magma_queue.hpp Outdated Show resolved Hide resolved
misc/wiki/Parameters.md Show resolved Hide resolved
@gbalduzz
Copy link
Contributor Author

I still don't understand the crusade against inheritance to represent a simple instance of subtyping, especially given our PR backlog, but I fixed and merged @PDoakORNL PR removing inheritance.

@PDoakORNL PDoakORNL merged commit c3e0fb6 into CompFUSE:master Aug 13, 2020
@gbalduzz gbalduzz deleted the ct_int-solver branch August 21, 2020 16:22
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants