Skip to content

Commit 98319b0

Browse files
committed
Fix saving to disk with reduced metadata.
1 parent 2324a8e commit 98319b0

File tree

1 file changed

+6
-2
lines changed

1 file changed

+6
-2
lines changed

dccrg.hpp

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1358,7 +1358,7 @@ template <
13581358
if (ret_val != MPI_SUCCESS) {
13591359
std::cerr << __FILE__ << ":" << __LINE__
13601360
<< " Process " << this->rank
1361-
<< " Couldn't write cell list to file " << name
1361+
<< " Couldn't write number of cells to file " << name
13621362
<< ": " << Error_String()(ret_val)
13631363
<< std::endl;
13641364
return false;
@@ -1577,7 +1577,11 @@ template <
15771577
// calculate where local cell list will begin in output file
15781578
uint64_t cell_list_start = (uint64_t) offset;
15791579
for (size_t i = 0; i < (size_t) this->rank; i++) {
1580-
cell_list_start += all_number_of_cells[i] * 2 * sizeof(uint64_t);
1580+
if (write_cell_ids and write_data_offsets) {
1581+
cell_list_start += all_number_of_cells[i] * 2 * sizeof(uint64_t);
1582+
} else if (write_cell_ids or write_data_offsets) {
1583+
cell_list_start += all_number_of_cells[i] * sizeof(uint64_t);
1584+
}
15811585
}
15821586

15831587
// write cell + data displacement list

0 commit comments

Comments
 (0)