Skip to content

Commit

Permalink
IOSS: Fix reserved identifiers abc__ -> abc_nl
Browse files Browse the repository at this point in the history
  • Loading branch information
gsjaardema committed Nov 10, 2023
1 parent 5d5e811 commit 5f00f46
Show file tree
Hide file tree
Showing 46 changed files with 505 additions and 508 deletions.
20 changes: 10 additions & 10 deletions packages/seacas/libraries/ioss/src/Ioss_DatabaseIO.C
Original file line number Diff line number Diff line change
Expand Up @@ -509,7 +509,7 @@ namespace Ioss {
}
}

/** \brief This function gets called inside closeDatabase__(), which checks if Cray Datawarp (DW)
/** \brief This function gets called inside closeDatabase_nl(), which checks if Cray Datawarp (DW)
* is in use, if so, we want to call a stageout before actual close of this file.
*/
void DatabaseIO::close_dw() const
Expand Down Expand Up @@ -569,9 +569,9 @@ namespace Ioss {
}
}

void DatabaseIO::openDatabase__() const { open_dw(get_filename()); }
void DatabaseIO::openDatabase_nl() const { open_dw(get_filename()); }

void DatabaseIO::closeDatabase__() const { close_dw(); }
void DatabaseIO::closeDatabase_nl() const { close_dw(); }

IfDatabaseExistsBehavior DatabaseIO::open_create_behavior() const
{
Expand Down Expand Up @@ -666,12 +666,12 @@ namespace Ioss {
if (m_timeStateInOut) {
m_stateStart = std::chrono::steady_clock::now();
}
return begin_state__(state, time);
return begin_state_nl(state, time);
}
bool DatabaseIO::end_state(int state, double time)
{
IOSS_FUNC_ENTER(m_);
bool res = end_state__(state, time);
bool res = end_state_nl(state, time);
if (m_timeStateInOut) {
auto finish = std::chrono::steady_clock::now();
log_time(m_stateStart, finish, state, time, is_input(), singleProcOnly, util_);
Expand All @@ -681,9 +681,9 @@ namespace Ioss {
}

// Default versions do nothing...
bool DatabaseIO::begin_state__(int /* state */, double /* time */) { return true; }
bool DatabaseIO::begin_state_nl(int /* state */, double /* time */) { return true; }

bool DatabaseIO::end_state__(int /* state */, double /* time */) { return true; }
bool DatabaseIO::end_state_nl(int /* state */, double /* time */) { return true; }

void DatabaseIO::handle_groups()
{
Expand Down Expand Up @@ -973,8 +973,8 @@ namespace Ioss {
assert(!sideTopology.empty());
}

void DatabaseIO::get_block_adjacencies__(const Ioss::ElementBlock *eb,
std::vector<std::string> &block_adjacency) const
void DatabaseIO::get_block_adjacencies_nl(const Ioss::ElementBlock *eb,
std::vector<std::string> &block_adjacency) const
{
if (!blockAdjacenciesCalculated) {
compute_block_adjacencies();
Expand Down Expand Up @@ -1040,7 +1040,7 @@ namespace Ioss {
std::vector<std::vector<int>> inv_con(nodeCount);

{
Ioss::SerializeIO serializeIO__(this);
Ioss::SerializeIO serializeIO_(this);
int blk_position = -1;
for (Ioss::ElementBlock *eb : element_blocks) {
if (eb->property_exists("original_block_order")) {
Expand Down
71 changes: 36 additions & 35 deletions packages/seacas/libraries/ioss/src/Ioss_DatabaseIO.h
Original file line number Diff line number Diff line change
Expand Up @@ -82,7 +82,7 @@ namespace Ioss {
int *bad_count = nullptr) const
{
IOSS_FUNC_ENTER(m_);
return ok__(write_message, error_message, bad_count);
return ok_nl(write_message, error_message, bad_count);
}

// Check capabilities of input/output database... Returns an
Expand All @@ -103,13 +103,13 @@ namespace Ioss {
int64_t node_global_to_local(int64_t global, bool must_exist) const
{
IOSS_FUNC_ENTER(m_);
return node_global_to_local__(global, must_exist);
return node_global_to_local_nl(global, must_exist);
}

int64_t element_global_to_local(int64_t global) const
{
IOSS_FUNC_ENTER(m_);
return element_global_to_local__(global);
return element_global_to_local_nl(global);
}

/** If there is a single block of nodes in the model, then it is
Expand All @@ -126,7 +126,7 @@ namespace Ioss {
void release_memory()
{
IOSS_FUNC_ENTER(m_);
release_memory__();
release_memory_nl();
}

// Do anything that might be needed to the database prior to it
Expand Down Expand Up @@ -228,21 +228,21 @@ namespace Ioss {
{
IOSS_FUNC_ENTER(m_);
progress(__func__);
openDatabase__();
openDatabase_nl();
}

void closeDatabase() const
{
IOSS_FUNC_ENTER(m_);
progress(__func__);
closeDatabase__();
closeDatabase_nl();
}

void flush_database() const
{
IOSS_FUNC_ENTER(m_);
progress(__func__);
flush_database__();
flush_database_nl();
}

/** \brief If a database type supports groups and if the database
Expand All @@ -259,7 +259,7 @@ namespace Ioss {
bool open_group(const std::string &group_name)
{
IOSS_FUNC_ENTER(m_);
return open_group__(group_name);
return open_group_nl(group_name);
}

/** \brief If a database type supports groups, create the specified
Expand All @@ -275,7 +275,7 @@ namespace Ioss {
bool create_subgroup(const std::string &group_name)
{
IOSS_FUNC_ENTER(m_);
return create_subgroup__(group_name);
return create_subgroup_nl(group_name);
}

/** \brief Set the database to the given State.
Expand All @@ -296,7 +296,7 @@ namespace Ioss {
{
IOSS_FUNC_ENTER(m_);
progress(__func__);
return begin__(state);
return begin_nl(state);
}

/** \brief Return the database to STATE_CLOSED.
Expand All @@ -313,7 +313,7 @@ namespace Ioss {
{
IOSS_FUNC_ENTER(m_);
progress(__func__);
return end__(state);
return end_nl(state);
}

bool begin_state(int state, double time);
Expand All @@ -324,14 +324,14 @@ namespace Ioss {
{
IOSS_FUNC_ENTER(m_);
progress("Begin read_meta_data()");
read_meta_data__();
read_meta_data_nl();
progress("End read_meta_data()");
}

void get_step_times()
{
IOSS_FUNC_ENTER(m_);
return get_step_times__();
return get_step_times_nl();
}

virtual bool internal_edges_available() const { return false; }
Expand Down Expand Up @@ -479,12 +479,12 @@ namespace Ioss {
void get_block_adjacencies(const Ioss::ElementBlock *eb,
std::vector<std::string> &block_adjacency) const
{
return get_block_adjacencies__(eb, block_adjacency);
return get_block_adjacencies_nl(eb, block_adjacency);
}
void compute_block_membership(Ioss::SideBlock *efblock,
std::vector<std::string> &block_membership) const
{
return compute_block_membership__(efblock, block_membership);
return compute_block_membership_nl(efblock, block_membership);
}

AxisAlignedBoundingBox get_bounding_box(const Ioss::NodeBlock *nb) const;
Expand Down Expand Up @@ -725,55 +725,56 @@ namespace Ioss {

mutable std::vector<std::vector<bool>> blockAdjacency;

virtual void openDatabase__() const;
virtual void closeDatabase__() const;
virtual void flush_database__() const {}
virtual void openDatabase_nl() const;
virtual void closeDatabase_nl() const;
virtual void flush_database_nl() const {}

private:
virtual bool ok__(bool /* write_message */, std::string * /* error_message */,
int *bad_count) const
virtual bool ok_nl(bool /* write_message */, std::string * /* error_message */,
int *bad_count) const
{
if (bad_count != nullptr) {
*bad_count = 0;
}
return dbState != Ioss::STATE_INVALID;
}

virtual int64_t node_global_to_local__(int64_t global, bool must_exist) const
virtual int64_t node_global_to_local_nl(int64_t global, bool must_exist) const
{
return nodeMap.global_to_local(global, must_exist);
}

virtual int64_t element_global_to_local__(int64_t global) const
virtual int64_t element_global_to_local_nl(int64_t global) const
{
return elemMap.global_to_local(global);
}

virtual void release_memory__()
virtual void release_memory_nl()
{
nodeMap.release_memory();
edgeMap.release_memory();
faceMap.release_memory();
elemMap.release_memory();
}

virtual bool open_group__(const std::string & /* group_name */) { return false; }
virtual bool create_subgroup__(const std::string & /* group_name */) { return false; }
virtual bool open_group_nl(const std::string & /* group_name */) { return false; }
virtual bool create_subgroup_nl(const std::string & /* group_name */) { return false; }

virtual bool begin__(Ioss::State state) = 0;
virtual bool end__(Ioss::State state) = 0;
virtual bool begin_nl(Ioss::State state) = 0;
virtual bool end_nl(Ioss::State state) = 0;

virtual void read_meta_data__() = 0;
virtual void get_step_times__() {}
virtual void read_meta_data_nl() = 0;
virtual void get_step_times_nl() {}

virtual bool begin_state__(int state, double time);
virtual bool end_state__(int state, double time);
virtual bool begin_state_nl(int state, double time);
virtual bool end_state_nl(int state, double time);

void get_block_adjacencies__(const Ioss::ElementBlock *eb,
std::vector<std::string> &block_adjacency) const;
void get_block_adjacencies_nl(const Ioss::ElementBlock *eb,
std::vector<std::string> &block_adjacency) const;

virtual void compute_block_membership__(Ioss::SideBlock * /* efblock */,
std::vector<std::string> & /* block_membership */) const
virtual void
compute_block_membership_nl(Ioss::SideBlock * /* efblock */,
std::vector<std::string> & /* block_membership */) const
{
}

Expand Down
8 changes: 4 additions & 4 deletions packages/seacas/libraries/ioss/src/Ioss_IOFactory.C
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// Copyright(C) 1999-2021 National Technology & Engineering Solutions
// Copyright(C) 1999-2021, 2023 National Technology & Engineering Solutions
// of Sandia, LLC (NTESS). Under the terms of Contract DE-NA0003525 with
// NTESS, the U.S. Government retains certain rights in this software.
//
Expand Down Expand Up @@ -27,7 +27,7 @@ namespace {
std::mutex m_;
#endif

int describe__(Ioss::IOFactoryMap *registry, Ioss::NameList *names)
int describe_nl(Ioss::IOFactoryMap *registry, Ioss::NameList *names)
{
int count = 0;
Ioss::IOFactoryMap::const_iterator I;
Expand Down Expand Up @@ -85,7 +85,7 @@ Ioss::DatabaseIO *Ioss::IOFactory::create(const std::string &type, const std::st
std::ostringstream errmsg;
fmt::print(errmsg, "ERROR: The database type '{}' is not supported.\n", type);
Ioss::NameList db_types;
describe__(registry(), &db_types);
describe_nl(registry(), &db_types);
fmt::print(errmsg, "\nSupported database types:\n\t{}\n\n",
fmt::join(db_types.begin(), db_types.end(), " "));
IOSS_ERROR(errmsg);
Expand Down Expand Up @@ -117,7 +117,7 @@ Ioss::DatabaseIO *Ioss::IOFactory::create(const std::string &type, const std::st
int Ioss::IOFactory::describe(NameList *names)
{
IOSS_FUNC_ENTER(m_);
return describe__(registry(), names);
return describe_nl(registry(), names);
}

/** \brief Get the names of database formats known to IOSS.
Expand Down
Loading

0 comments on commit 5f00f46

Please sign in to comment.