Skip to content

Commit

Permalink
IOSS: Fix some minor issues
Browse files Browse the repository at this point in the history
  • Loading branch information
gdsjaar committed Mar 5, 2024
1 parent 7990635 commit b7daf3c
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 10 deletions.
2 changes: 1 addition & 1 deletion packages/seacas/libraries/ioss/src/Ioss_Map.C
Original file line number Diff line number Diff line change
Expand Up @@ -360,7 +360,7 @@ void Ioss::Map::set_default(size_t count, size_t offset)
IOSS_FUNC_ENTER(m_);
m_map.resize(count + 1);
std::iota(m_map.begin() + 1, m_map.end(), 1 + offset);
m_offset = -1 * offset;
m_offset = -1 * int64_t(offset);
set_is_sequential(true);
}

Expand Down
2 changes: 1 addition & 1 deletion packages/seacas/libraries/ioss/src/Ioss_Utils.h
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ namespace Ioss {
// We have been relying on the assumption that calling `.data()` on an empty vector
// will return `nullptr`. However, according to cppreference (based on the standard):
//
// `If size() is ​0​, data() may or may not return a null pointer.`
// `If size() is 0, data() may or may not return a null pointer.`
//
// We don't have any systems on which we have found that (yet?), but this is proactive
// in removing our use of `.data()` on potentially empty vectors...
Expand Down
9 changes: 1 addition & 8 deletions packages/seacas/libraries/ioss/src/exodus/Ioex_DatabaseIO.C
Original file line number Diff line number Diff line change
Expand Up @@ -713,13 +713,7 @@ namespace Ioex {
// Assume that if it exists on 1 processor, it exists on
// all... Sync value among processors since could have a
// corrupt step on only a single database.

// TODO? -- use gather instead so know what ranks have `last_time`
// larger than the minimum. Can then output a warning saying which
// ranks have "corrupt" steps.
std::vector<double> last_times;
util().gather(last_time, last_times);
last_time = *std::min_element(last_times.begin(), last_times.end());
last_time = util().global_minmax(last_time, Ioss::ParallelUtils::DO_MIN);
}

// Only add states that are less than or equal to the
Expand Down Expand Up @@ -1035,7 +1029,6 @@ namespace Ioex {
// Ioss stores as 64-bit, read as 32-bit and copy over...
Ioss::IntVector tmp_map(entity_map.size());
error = ex_get_id_map(get_file_pointer(), entity_type, Data(tmp_map));
std::iota(tmp_map.begin(), tmp_map.end(), 1);
if (error >= 0) {
entity_map.set_map(Data(tmp_map), tmp_map.size(), 0, true);
}
Expand Down

0 comments on commit b7daf3c

Please sign in to comment.