Skip to content

Commit

Permalink
Merge Pull Request #7733 from gsjaardema/Trilinos/seacas-snapshot-jul…
Browse files Browse the repository at this point in the history
…y2020

Automatically Merged using Trilinos Pull Request AutoTester
PR Title: Seacas snapshot july2020
PR Author: gsjaardema
  • Loading branch information
trilinos-autotester authored Jul 27, 2020
2 parents fabb424 + 0a4d17b commit fc041fc
Show file tree
Hide file tree
Showing 13 changed files with 127 additions and 83 deletions.
12 changes: 12 additions & 0 deletions packages/seacas/applications/aprepro/aprepro.C
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,8 @@ int main(int argc, char *argv[])

bool quiet = false;

int exit_status = EXIT_SUCCESS;

// Parse all options...
for (int ai = 1; ai < argc; ++ai) {
std::string arg = argv[ai];
Expand Down Expand Up @@ -66,6 +68,14 @@ int main(int argc, char *argv[])
aprepro.ap_options.interactive = true;
try {
aprepro.parse_stream(std::cin, "standard input");

if (aprepro.ap_options.errors_fatal && aprepro.get_error_count() > 0) {
exit_status = EXIT_FAILURE;
}
if ((aprepro.ap_options.errors_and_warnings_fatal) &&
(aprepro.get_error_count() + aprepro.get_warning_count() > 0)) {
exit_status = EXIT_FAILURE;
}
}
catch (std::exception &e) {
std::cerr << "Aprepro terminated due to exception: " << e.what() << '\n';
Expand Down Expand Up @@ -116,6 +126,7 @@ int main(int argc, char *argv[])
}
}
else {
exit_status = EXIT_FAILURE;
std::cerr << "There were " << aprepro.get_error_count() << " errors and "
<< aprepro.get_warning_count() << " warnings."
<< "\n";
Expand All @@ -142,4 +153,5 @@ int main(int argc, char *argv[])
if (aprepro.ap_options.debugging || aprepro.ap_options.dumpvars) {
aprepro.dumpsym("variable", false);
}
return exit_status;
}
4 changes: 2 additions & 2 deletions packages/seacas/applications/epu/EP_Version.h
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,8 @@

static char const *qainfo[] = {
"epu -- E Pluribus Unum",
"2020/04/20",
"4.31",
"2020/06/17",
"4.32",
};

#endif // SEACAS_Version_h
9 changes: 6 additions & 3 deletions packages/seacas/applications/epu/epu.C
Original file line number Diff line number Diff line change
Expand Up @@ -723,9 +723,13 @@ int epu(SystemInterface &interFace, int start_part, int part_count, int cycle, T
// must check for zero length blocks
get_element_blocks(part_count, local_mesh, global, blocks, glob_blocks);

bool map_element_ids = interFace.map_element_ids();
if (interFace.subcycle() >= 0) {
map_element_ids = false;
}
std::vector<INT> global_element_map(global.elementCount);
build_reverse_element_map(local_element_to_global, local_mesh, blocks, glob_blocks, &global,
part_count, global_element_map, interFace.map_element_ids());
part_count, global_element_map, map_element_ids);

//
// NOTE: Node set/side set information can be different for each processor
Expand Down Expand Up @@ -1765,8 +1769,7 @@ namespace {
for (int b = 0; b < global_num_blocks; b++) {

if (debug_level & 4) {
fmt::print(stderr,
"\nOutput element block info for...\n"
fmt::print("\nOutput element block info for...\n"
"Block {}, Id = {}, Name = '{}', Elements = {:12n}, Nodes/element = {}, "
"Attributes = {}\n"
"B{}:\t",
Expand Down
6 changes: 3 additions & 3 deletions packages/seacas/applications/slice/SL_Version.h
Original file line number Diff line number Diff line change
@@ -1,15 +1,15 @@
// Copyright(C) 1999-2020 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.
//
//
// See packages/seacas/LICENSE for details
#ifndef SEACAS_Version_h
#define SEACAS_Version_h

static char const *qainfo[] = {
"slice",
"2020/04/21",
"0.9.93",
"2020/06/10",
"0.9.94",
};

#endif // SEACAS_Version_h
2 changes: 1 addition & 1 deletion packages/seacas/applications/slice/Slice.C
Original file line number Diff line number Diff line change
Expand Up @@ -1409,7 +1409,7 @@ namespace {
}
// Output histogram..
fmt::print(stderr, "Processor count per node histogram:\n");
for (size_t i = 0; i < proc_histo.size(); i++) {
for (size_t i = 1; i < proc_histo.size(); i++) {
if (proc_histo[i] > 0) {
fmt::print(stderr, "\tNodes on {:2n} processors = {:12n}\t({:2})%\n", i, proc_histo[i],
(proc_histo[i] * 100 + node_count / 2) / node_count);
Expand Down
2 changes: 1 addition & 1 deletion packages/seacas/libraries/aprepro_lib/apr_aprepro.cc
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@

namespace {
const unsigned int HASHSIZE = 5939;
const char * version_string = "5.16 (2020/06/09)";
const char * version_string = "5.17 (2020/07/27)";

void output_copyright();

Expand Down
3 changes: 3 additions & 0 deletions packages/seacas/libraries/ioss/src/Ioss_CodeTypes.h
Original file line number Diff line number Diff line change
Expand Up @@ -58,6 +58,9 @@ inline const std::string IOSS_SYM_TENSOR() { return std::string("sym_tensor_33")
(void)(x); \
} while (0)

#ifndef MPI_COMM_SELF
#define MPI_COMM_SELF 0
#endif
#ifndef MPI_COMM_WORLD
#define MPI_COMM_WORLD 0
using MPI_Comm = int;
Expand Down
8 changes: 5 additions & 3 deletions packages/seacas/libraries/ioss/src/Ioss_DatabaseIO.C
Original file line number Diff line number Diff line change
Expand Up @@ -74,8 +74,8 @@ namespace {
if (max_hash != min_hash) {
const std::string &ge_name = ge->name();
fmt::print(Ioss::WARNING(),
"Parallel inconsistency detected for {} field '{}' on entity '{}'\n",
in_out == 0 ? "writing" : "reading", field_name, ge_name);
"[{}] Parallel inconsistency detected for {} field '{}' on entity '{}'. (Hash: {} {} {})\n",
in_out == 0 ? "writing" : "reading", util.parallel_rank(), field_name, ge_name, hash_code, min_hash, max_hash);
return false;
}
return true;
Expand Down Expand Up @@ -131,7 +131,9 @@ namespace {
namespace Ioss {
DatabaseIO::DatabaseIO(Region *region, std::string filename, DatabaseUsage db_usage,
MPI_Comm communicator, const PropertyManager &props)
: properties(props), DBFilename(std::move(filename)), dbUsage(db_usage), util_(communicator),
: properties(props), DBFilename(std::move(filename)), dbUsage(db_usage),
util_(db_usage == WRITE_HISTORY || db_usage == WRITE_HEARTBEAT ? MPI_COMM_SELF
: communicator),
region_(region), isInput(is_input_event(db_usage)),
singleProcOnly(db_usage == WRITE_HISTORY || db_usage == WRITE_HEARTBEAT ||
SerializeIO::isEnabled())
Expand Down
60 changes: 31 additions & 29 deletions packages/seacas/libraries/ioss/src/exodus/Ioex_BaseDatabaseIO.C
Original file line number Diff line number Diff line change
Expand Up @@ -216,7 +216,7 @@ namespace Ioex {

void BaseDatabaseIO::set_int_byte_size_api(Ioss::DataSize size) const
{
if (exodusFilePtr > 0) {
if (m_exodusFilePtr > 0) {
int old_status = ex_int64_status(get_file_pointer());
if (size == 8) {
ex_set_int64_status(get_file_pointer(), EX_ALL_INT64_API | old_status);
Expand All @@ -226,7 +226,7 @@ namespace Ioex {
if ((old_status & EX_ALL_INT64_API) != 0) {
old_status &= ~EX_ALL_INT64_API;
assert(!(old_status & EX_ALL_INT64_API));
ex_set_int64_status(exodusFilePtr, old_status);
ex_set_int64_status(m_exodusFilePtr, old_status);
}
}
}
Expand Down Expand Up @@ -276,7 +276,7 @@ namespace Ioex {
{
// Returns the file_pointer used to access the file on disk.
// Checks that the file is open and if not, opens it first.
if (exodusFilePtr < 0) {
if (m_exodusFilePtr < 0) {
bool write_message = true;
bool abort_if_error = true;
if (is_input()) {
Expand All @@ -288,24 +288,24 @@ namespace Ioex {
}

if (!m_groupName.empty()) {
ex_get_group_id(exodusFilePtr, m_groupName.c_str(), &exodusFilePtr);
ex_get_group_id(m_exodusFilePtr, m_groupName.c_str(), &m_exodusFilePtr);
}
}
assert(exodusFilePtr >= 0);
assert(m_exodusFilePtr >= 0);
fileExists = true;
return exodusFilePtr;
return m_exodusFilePtr;
}

int BaseDatabaseIO::free_file_pointer() const
{
if (exodusFilePtr != -1) {
if (m_exodusFilePtr != -1) {
bool do_timer = false;
if (isParallel) {
Ioss::Utils::check_set_bool_property(properties, "IOSS_TIME_FILE_OPEN_CLOSE", do_timer);
}
double t_begin = (do_timer ? Ioss::Utils::timer() : 0);

ex_close(exodusFilePtr);
ex_close(m_exodusFilePtr);
closeDW();
if (do_timer && isParallel) {
double t_end = Ioss::Utils::timer();
Expand All @@ -315,9 +315,9 @@ namespace Ioex {
}
}
}
exodusFilePtr = -1;
m_exodusFilePtr = -1;

return exodusFilePtr;
return m_exodusFilePtr;
}

bool BaseDatabaseIO::ok__(bool write_message, std::string *error_msg, int *bad_count) const
Expand Down Expand Up @@ -349,35 +349,35 @@ namespace Ioex {
bool overwrite = false;
is_ok = handle_output_file(write_message, error_msg, bad_count, overwrite, abort_if_error);
// Close all open files...
if (exodusFilePtr >= 0) {
ex_close(exodusFilePtr);
exodusFilePtr = -1;
if (m_exodusFilePtr >= 0) {
ex_close(m_exodusFilePtr);
m_exodusFilePtr = -1;
}
}
return is_ok;
}

void BaseDatabaseIO::finalize_file_open() const
{
assert(exodusFilePtr >= 0);
assert(m_exodusFilePtr >= 0);
// Check byte-size of integers stored on the database...
if ((ex_int64_status(exodusFilePtr) & EX_ALL_INT64_DB) != 0) {
if ((ex_int64_status(m_exodusFilePtr) & EX_ALL_INT64_DB) != 0) {
if (myProcessor == 0) {
fmt::print(Ioss::OUTPUT(),
"IOSS: Input database contains 8-byte integers. Setting Ioss to use "
"8-byte integers.\n");
}
ex_set_int64_status(exodusFilePtr, EX_ALL_INT64_API);
ex_set_int64_status(m_exodusFilePtr, EX_ALL_INT64_API);
set_int_byte_size_api(Ioss::USE_INT64_API);
}

// Check for maximum name length used on the input file.
int max_name_length = ex_inquire_int(exodusFilePtr, EX_INQ_DB_MAX_USED_NAME_LENGTH);
int max_name_length = ex_inquire_int(m_exodusFilePtr, EX_INQ_DB_MAX_USED_NAME_LENGTH);
if (max_name_length > maximumNameLength) {
maximumNameLength = max_name_length;
}

ex_set_max_name_length(exodusFilePtr, maximumNameLength);
ex_set_max_name_length(m_exodusFilePtr, maximumNameLength);
}

bool BaseDatabaseIO::open_group__(const std::string &group_name)
Expand All @@ -388,9 +388,9 @@ namespace Ioex {
int exoid = get_file_pointer();

m_groupName = group_name;
ex_get_group_id(exoid, m_groupName.c_str(), &exodusFilePtr);
ex_get_group_id(exoid, m_groupName.c_str(), &m_exodusFilePtr);

if (exodusFilePtr < 0) {
if (m_exodusFilePtr < 0) {
std::ostringstream errmsg;
fmt::print(errmsg, "ERROR: Could not open group named '{}' in file '{}'.\n", m_groupName,
get_filename());
Expand Down Expand Up @@ -427,7 +427,7 @@ namespace Ioex {
IOSS_ERROR(errmsg);
}
else {
exodusFilePtr = exoid;
m_exodusFilePtr = exoid;
success = true;
}
}
Expand Down Expand Up @@ -630,7 +630,7 @@ namespace Ioex {

if (nblob > 0) {
std::vector<ex_blob> blobs(nblob);
int max_name_length = ex_inquire_int(exodusFilePtr, EX_INQ_DB_MAX_USED_NAME_LENGTH);
int max_name_length = ex_inquire_int(m_exodusFilePtr, EX_INQ_DB_MAX_USED_NAME_LENGTH);
for (auto &bl : blobs) {
bl.name = new char[max_name_length + 1];
}
Expand Down Expand Up @@ -2380,13 +2380,15 @@ namespace Ioex {
}
m_groupCount[EX_ELEM_BLOCK] = element_blocks.size();

// Set "global_entity_count" property on all blocks.
// Used to skip output on "globally" empty blocks.
Ioss::Int64Vector global_counts(element_counts.size());
util().global_count(element_counts, global_counts);
size_t idx = 0;
for (auto &element_block : element_blocks) {
element_block->property_add(Ioss::Property("global_entity_count", global_counts[idx++]));
if (isParallel) {
// Set "global_entity_count" property on all blocks.
// Used to skip output on "globally" empty blocks.
Ioss::Int64Vector global_counts(element_counts.size());
util().global_count(element_counts, global_counts);
size_t idx = 0;
for (auto &element_block : element_blocks) {
element_block->property_add(Ioss::Property("global_entity_count", global_counts[idx++]));
}
}
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -265,7 +265,10 @@ namespace Ioex {

// Private member data...
protected:
mutable int exodusFilePtr{-1};
mutable int m_exodusFilePtr{-1};
// If using links to file-per-state, the file pointer for "base" file.
mutable int m_exodusBasePtr{-1};

mutable std::string m_groupName;

mutable EntityIdSet ids_;
Expand Down
Loading

0 comments on commit fc041fc

Please sign in to comment.