Skip to content

Commit

Permalink
Updated what we're writing out
Browse files Browse the repository at this point in the history
  • Loading branch information
DavidPoliakoff committed Aug 17, 2020
1 parent 3e63690 commit 9b6e289
Show file tree
Hide file tree
Showing 4 changed files with 528 additions and 16 deletions.
5 changes: 5 additions & 0 deletions debugging/checkpointing/checkpointing.proto
Original file line number Diff line number Diff line change
Expand Up @@ -7,3 +7,8 @@ message View {
required int64 size = 2;
required bytes data = 3;
};

message CoreDump {
required int64 num_allocations = 1;
repeated View views = 2;
};
21 changes: 12 additions & 9 deletions debugging/checkpointing/kp_kernel_logger.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -97,22 +97,25 @@ void dump_checkpoint(int signo){
size_sum += alloc.second.instances.size();
}
out << size_sum;
kokkos_checkpointing::CoreDump dump;
dump.set_num_allocations(size_sum);
for(auto& variable_handle: allocations){
auto& alloc_list = variable_handle.second;
for(auto& alloc: alloc_list.instances){
kokkos_checkpointing::View v;
v.set_size(alloc.how_much);
v.set_name(alloc.who);
v.set_data(alloc.canonical, alloc.how_much);
bool success = v.SerializeToOstream(&out);
if(!success){
std::cout << "Error serializing a View named "<<alloc.who<<std::endl;
exit(1);
}
kokkos_checkpointing::View* v = dump.add_views();
v->set_size(alloc.how_much);
v->set_name(alloc.who);
v->set_data(alloc.canonical, alloc.how_much);
//bool success = v.SerializeToOstream(&out);
//out << alloc.who << " "<< alloc.how_much;
//out.write((char*)alloc.canonical,alloc.how_much);
}
}
bool success = dump.SerializeToOstream(&out);
if(!success){
std::cout << "Failed to write checkpoint"<<std::endl;
}

std::cout <<"Finished writing on rank "<<rank_string<<std::endl;
out.close();
}
Expand Down
279 changes: 273 additions & 6 deletions debugging/checkpointing/protocols/checkpointing.pb.cc

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading

0 comments on commit 9b6e289

Please sign in to comment.