Skip to content

Commit

Permalink
#48: fixup after vt branch rebase
Browse files Browse the repository at this point in the history
  • Loading branch information
nmm0 committed Jun 8, 2023
1 parent 7731779 commit f21d12f
Show file tree
Hide file tree
Showing 7 changed files with 18 additions and 28 deletions.
2 changes: 1 addition & 1 deletion src/resilience/AutomaticCheckpoint.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -118,7 +118,7 @@ namespace KokkosResilience
//Figure out how we should be handling this
bool recover_region = false, checkpoint_region = false;

if(last_region.iter() != regions.end() && last_region.label() == label) {
if (last_region && last_region.label() == label) {
active_region = last_region;
} else {
auto info = regions.insert({std::string(label), std::unordered_set<Registration>()});
Expand Down
6 changes: 3 additions & 3 deletions src/resilience/backend/veloc/VelocBackend.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -80,7 +80,7 @@ namespace KokkosResilience
VeloCMemoryBackend::VeloCMemoryBackend(ContextBase& ctx)
: AutomaticBackendBase(ctx) {
const auto &vconf = m_context.config()["backends"]["veloc"]["config"].as< std::string >();
veloc_client = veloc::get_client(ctx.m_pid, vconf);
veloc_client = veloc::get_client(static_cast< unsigned int >( ctx.m_pid ), vconf);
}

VeloCMemoryBackend::~VeloCMemoryBackend()
Expand Down Expand Up @@ -157,7 +157,7 @@ namespace KokkosResilience
VeloCMemoryBackend::reset()
{
const auto &vconf = m_context.config()["backends"]["veloc"]["config"].as< std::string >();
veloc_client = veloc::get_client(m_context.m_pid, vconf);
veloc_client = veloc::get_client(static_cast< unsigned int >( m_context.m_pid ), vconf);

m_latest_version.clear();
}
Expand All @@ -175,7 +175,7 @@ namespace KokkosResilience
VeloCFileBackend::VeloCFileBackend(ContextBase& ctx)
: AutomaticBackendBase(ctx) {
const auto &vconf = m_context.config()["backends"]["veloc"]["config"].as< std::string >();
veloc_client = veloc::get_client( m_context.m_pid, vconf);
veloc_client = veloc::get_client( static_cast< unsigned int >( m_context.m_pid ), vconf );
}

VeloCFileBackend::~VeloCFileBackend()
Expand Down
6 changes: 0 additions & 6 deletions src/resilience/context/ContextBase.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -169,12 +169,6 @@ namespace KokkosResilience
operator bool() const {
return (m_members != nullptr);
}

auto iter() { return m_map_iterator; }

private:

map_iterator m_map_iterator;
};

//Create Registration and register to implementation
Expand Down
18 changes: 10 additions & 8 deletions src/resilience/context/MPIContext.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -56,17 +56,19 @@ static int comm_rank(MPI_Comm &comm){
}

class MPIContext : public ContextBase {
public:
explicit MPIContext(MPI_Comm comm, const std::string& cfg)
: ContextBase(cfg, comm_rank(comm)), m_comm(comm) {}
public:
explicit MPIContext(MPI_Comm comm, const Config &cfg)
: ContextBase(cfg, comm_rank(comm)), m_comm(comm) {}
explicit MPIContext(MPI_Comm comm, const std::string &cfg)
: ContextBase(cfg, comm_rank(comm)), m_comm(comm) {}

MPIContext(const MPIContext &) = delete;
MPIContext(MPIContext &&) noexcept = default;
MPIContext(const MPIContext &) = delete;
MPIContext(MPIContext &&) noexcept = default;

MPIContext &operator=(const MPIContext &) = delete;
MPIContext &operator=(MPIContext &&) noexcept = default;
MPIContext &operator=(const MPIContext &) = delete;
MPIContext &operator=(MPIContext &&) noexcept = default;

virtual ~MPIContext() {
virtual ~MPIContext() {
#ifdef KR_ENABLE_TRACING
int rank = -1;
MPI_Comm_rank(m_comm, &rank);
Expand Down
3 changes: 0 additions & 3 deletions src/resilience/registration/Magistrate.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -125,7 +125,4 @@ namespace KokkosResilience {
};
}


#endif

#endif // INC_RESILIENCE_MAGISTRATE_HPP
3 changes: 0 additions & 3 deletions src/resilience/registration/Registration.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -72,9 +72,6 @@ namespace KokkosResilience
Registration custom_registration(serializer_t&& s_fun, deserializer_t&& d_fun, const std::string label);

struct Registration : public std::shared_ptr<Detail::RegistrationBase> {
using serializer_t = typename Detail::RegistrationBase::serializer_t;
using deserializer_t = typename Detail::RegistrationBase::deserializer_t;

template<typename RegType>
Registration(std::shared_ptr<RegType> base)
: std::shared_ptr<Detail::RegistrationBase>(std::move(base)) {}
Expand Down
8 changes: 4 additions & 4 deletions tests/TestVelocMemoryBackend.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -40,10 +40,10 @@
*/
#include "TestCommon.hpp"

#include <resilience/veloc/VelocBackend.hpp>
#include <resilience/backend/veloc/VelocBackend.hpp>
#include <resilience/AutomaticCheckpoint.hpp>
#include <resilience/context/MPIContext.hpp>
#include <resilience/filesystem/Filesystem.hpp>
#include <resilience/backend/filesystem/Filesystem.hpp>

#include <string>

Expand All @@ -59,7 +59,7 @@ class TestVelocMemoryBackend : public ::testing::Test
template< typename Layout, typename Context >
static void test_layout( Context &ctx, std::size_t dimx, std::size_t dimy )
{
ctx.backend().reset();
ctx.reset();
using memory_space = typename exec_space::memory_space;
using view_type = KokkosResilience::View< double **, Layout, memory_space >;

Expand Down Expand Up @@ -139,7 +139,7 @@ TYPED_TEST( TestVelocMemoryBackend, veloc_mem )
KokkosResilience::Config cfg;
cfg["backend"].set( "veloc"s );
cfg["backends"]["veloc"]["config"].set( KR_TEST_DATADIR "/veloc_test.cfg" );
KokkosResilience::MPIContext< KokkosResilience::VeloCMemoryBackend > ctx( MPI_COMM_WORLD, cfg );
KokkosResilience::MPIContext ctx( MPI_COMM_WORLD, cfg );

for ( std::size_t dimx = 1; dimx < 5; ++dimx )
{
Expand Down

0 comments on commit f21d12f

Please sign in to comment.