Skip to content
This repository has been archived by the owner on Jan 19, 2019. It is now read-only.

Fix deserialization order to match serialization #14

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
18 changes: 12 additions & 6 deletions io-mpi.c
Original file line number Diff line number Diff line change
Expand Up @@ -204,13 +204,19 @@ void io_read_checkpoint() {
}
MPI_File_close(&fh);

// Load Data
for (i = 0; i < my_partitions[cur_part].lp_count; i++, all_lp_i++) {
b += io_lp_deserialize(g_tw_lp[all_lp_i], b);
int lp_type_index = g_tw_lp_typemap(g_tw_lp[all_lp_i]->gid);
((deserialize_f)g_io_lp_types[lp_type_index].deserialize)(g_tw_lp[all_lp_i]->cur_state, b, g_tw_lp[all_lp_i]);
b += model_sizes[all_lp_i];

// Load LPs
int c;
for (c = 0; c < g_tw_nlp; c++) {
if (g_tw_lp[c]->kp->id == cur_part) {
b += io_lp_deserialize(g_tw_lp[c], b);
int lp_type_index = g_tw_lp_typemap(g_tw_lp[c]->gid);
((deserialize_f)g_io_lp_types[lp_type_index].deserialize)(g_tw_lp[c]->cur_state, b, g_tw_lp[c]);
b += model_sizes[all_lp_i];
all_lp_i++;
}
}

assert(my_partitions[cur_part].ev_count <= g_io_free_events.size);
for (i = 0; i < my_partitions[cur_part].ev_count; i++) {
// SEND THESE EVENTS
Expand Down