Skip to content

Commit

Permalink
Merge Pull Request #9800 from gsjaardema/Trilinos/seacas-2021-10-11-m…
Browse files Browse the repository at this point in the history
…ingw

Automatically Merged using Trilinos Pull Request AutoTester
PR Title: Automatic snapshot commit from seacas at 1c9b366266
PR Author: gsjaardema
  • Loading branch information
trilinos-autotester authored Oct 12, 2021
2 parents b895d76 + a3e7567 commit 73b5b34
Show file tree
Hide file tree
Showing 73 changed files with 4,180 additions and 4,413 deletions.
44 changes: 23 additions & 21 deletions packages/seacas/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -29,30 +29,32 @@ IF (NOT CMAKE_CXX_STANDARD MATCHES "^${${PROJECT_NAME}_CMAKE_CXX_STANDARDS_ALLOW
ENDIF ()

set(SEACASExodus_ENABLE_STATIC_DEFAULT "OFF")
if (${CMAKE_PROJECT_NAME} STREQUAL "SEACASProj")
if (BUILD_SHARED_LIBS)
set(SEACASExodus_ENABLE_STATIC_DEFAULT "ON")
endif()
endif()
TRIBITS_ADD_OPTION_AND_DEFINE(
SEACASExodus_ENABLE_STATIC
EXODUS_STATIC
"Build static version of Exodus in addition to shared version."
${SEACASExodus_ENABLE_STATIC_DEFAULT}
)

set(SEACASExodus_ENABLE_SHARED_DEFAULT "OFF")
if (${CMAKE_PROJECT_NAME} STREQUAL "SEACASProj")
if (NOT BUILD_SHARED_LIBS)
set(SEACASExodus_ENABLE_SHARED_DEFAULT "ON")

# On windows (and probably other systems), we only want a single
# exodus library and not both static and shared.
if (NOT CMAKE_HOST_SYSTEM_NAME STREQUAL "Windows")
if (${CMAKE_PROJECT_NAME} STREQUAL "SEACASProj")
if (BUILD_SHARED_LIBS)
set(SEACASExodus_ENABLE_STATIC_DEFAULT "ON")
else()
set(SEACASExodus_ENABLE_SHARED_DEFAULT "ON")
endif()
endif()

TRIBITS_ADD_OPTION_AND_DEFINE(
SEACASExodus_ENABLE_STATIC
EXODUS_STATIC
"Build static version of Exodus in addition to shared version."
${SEACASExodus_ENABLE_STATIC_DEFAULT}
)
TRIBITS_ADD_OPTION_AND_DEFINE(
SEACASExodus_ENABLE_SHARED
EXODUS_SHARED
"Build shared version of Exodus in addition to static version."
${SEACASExodus_ENABLE_SHARED_DEFAULT}
)
endif()
TRIBITS_ADD_OPTION_AND_DEFINE(
SEACASExodus_ENABLE_SHARED
EXODUS_SHARED
"Build shared version of Exodus in addition to static version."
${SEACASExodus_ENABLE_SHARED_DEFAULT}
)

TRIBITS_ADD_OPTION_AND_DEFINE(
SEACASIoss_ENABLE_THREADSAFE
Expand Down
16 changes: 7 additions & 9 deletions packages/seacas/applications/aprepro/aprepro.C
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,13 @@
//
// See packages/seacas/LICENSE for details

#include <cstdlib>
#include <cstring>
#include <exception>
#include <fstream>
#include <iostream>
#include <string>
#include <vector>

#include "aprepro.h"

Expand Down Expand Up @@ -61,9 +65,7 @@ int main(int argc, char *argv[])

if (input_files.empty()) {
if (!quiet) {
auto comment = aprepro.getsym("_C_")->value.svar;
std::cout << comment << " Algebraic Preprocessor -- Aprepro, version " << aprepro.version()
<< "\n";
std::cout << aprepro.long_version() << "\n";
}
aprepro.ap_options.interactive = true;
try {
Expand Down Expand Up @@ -110,17 +112,13 @@ int main(int argc, char *argv[])
if (input_files.size() > 1) {
std::ofstream ofile(input_files[1]);
if (!quiet) {
auto comment = aprepro.getsym("_C_")->value.svar;
ofile << comment << " Algebraic Preprocessor (Aprepro) version " << aprepro.version()
<< "\n";
ofile << aprepro.long_version() << "\n";
}
ofile << aprepro.parsing_results().str();
}
else {
if (!quiet) {
auto comment = aprepro.getsym("_C_")->value.svar;
std::cout << comment << " Algebraic Preprocessor (Aprepro) version "
<< aprepro.version() << "\n";
std::cout << aprepro.long_version() << "\n";
}
std::cout << aprepro.parsing_results().str();
}
Expand Down
20 changes: 10 additions & 10 deletions packages/seacas/applications/aprepro/test-array.stderr.gold
Original file line number Diff line number Diff line change
@@ -1,15 +1,15 @@

$ Variable = Value
$ {a (array) rows = 27, cols = 21}
$ {b (array) rows = 3, cols = 2}
$ {c (array) rows = 2, cols = 3}
$ {d (array) rows = 3, cols = 3}
$ {e (array) rows = 2, cols = 2}
$ {_col = 3}
$ {asub_rows = 17}
$ {c (array) rows = 2, cols = 3}
$ {_c = 3}
$ {_r = 2}
$ {a (array) rows = 27, cols = 21}
$ {a_rows = 27}
$ {asub (array) rows = 17, cols = 21}
$ {asub_rows = 17}
$ {b (array) rows = 3, cols = 2}
$ {_therow = 2}
$ {et (array) rows = 2, cols = 2}
$ {_r = 2}
$ {asub (array) rows = 17, cols = 21}
$ {_col = 3}
$ {e (array) rows = 2, cols = 2}
$ {d (array) rows = 3, cols = 3}
$ {et (array) rows = 2, cols = 2}
4 changes: 2 additions & 2 deletions packages/seacas/applications/aprepro/test-dump.gold
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@

$ Variable = Value
$ {svar = "String"} (immutable)
$ Variable = Value
$ {var = 42} (immutable)
$ {svar = "String"} (immutable)
8 changes: 4 additions & 4 deletions packages/seacas/applications/cpup/CP_SystemInterface.C
Original file line number Diff line number Diff line change
Expand Up @@ -6,13 +6,13 @@
* See packages/seacas/LICENSE for details
*/
#include "CP_SystemInterface.h"
#include "CP_Version.h" // for qainfo
#include "GetLongOpt.h" // for GetLongOption, etc
#include "CP_Version.h" // for qainfo
#include "GetLongOpt.h" // for GetLongOption, etc
#include "Ioss_CodeTypes.h"
#include "SL_tokenize.h" // for tokenize
#include <algorithm> // for sort, transform
#include <cctype> // for tolower
#include <copyright.h>
#include <cstddef> // for size_t
#include <cstdlib> // for strtol, abs, exit, strtoul, etc
#include <cstring> // for strchr, strlen
#include <fmt/ostream.h>
Expand All @@ -26,7 +26,7 @@
namespace {
bool is_path_absolute(const std::string &path)
{
#ifdef _WIN32
#ifdef __IOSS_WINDOWS__
return path[0] == '\\' || path[1] == ':';
#else
return path[0] == '/';
Expand Down
1 change: 0 additions & 1 deletion packages/seacas/applications/cpup/CP_SystemInterface.h
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,6 @@
#include <climits> // for INT_MAX
#include <iosfwd> // for ostream
#include <string> // for string
#include <utility> // for pair
#include <vector> // for vector

namespace Cpup {
Expand Down
1 change: 0 additions & 1 deletion packages/seacas/applications/cpup/cpup.C
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@
//
// See packages/seacas/LICENSE for details
#include <cstdlib>
#include <ctime>
#include <exception>
#include <map>
#include <memory>
Expand Down
8 changes: 5 additions & 3 deletions packages/seacas/applications/epu/EP_Internals.C
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
* Copyright(C) 1999-2020 National Technology & Engineering Solutions
* Copyright(C) 1999-, 20212021 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 All @@ -21,7 +21,8 @@
#include <string> // for string, basic_string
#include <vector> // for vector

#ifdef _WIN32
#if defined(WIN32) || defined(__WIN32__) || defined(_WIN32) || defined(_MSC_VER) || \
defined(__MINGW32__) || defined(_WIN64) || defined(__MINGW64__)
#include <Shlwapi.h>
#endif

Expand Down Expand Up @@ -83,7 +84,8 @@ namespace {

bool Excn::is_path_absolute(const std::string &path)
{
#ifdef _WIN32
#if defined(WIN32) || defined(__WIN32__) || defined(_WIN32) || defined(_MSC_VER) || \
defined(__MINGW32__) || defined(_WIN64) || defined(__MINGW64__)
return path[0] == '\\' || path[1] == ':';
#else
return path[0] == '/';
Expand Down
5 changes: 3 additions & 2 deletions packages/seacas/applications/epu/EP_ParallelDisks.C
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
* Copyright(C) 1999-2020 National Technology & Engineering Solutions
* Copyright(C) 1999-2021 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 All @@ -13,7 +13,8 @@
#include <EP_Internals.h>
#include <EP_ParallelDisks.h>

#ifdef _WIN32
#if defined(WIN32) || defined(__WIN32__) || defined(_WIN32) || defined(_MSC_VER) || \
defined(__MINGW32__) || defined(_WIN64) || defined(__MINGW64__)
#include <Shlwapi.h>
#endif

Expand Down
4 changes: 0 additions & 4 deletions packages/seacas/applications/epu/epu.C
Original file line number Diff line number Diff line change
Expand Up @@ -60,9 +60,7 @@ using StringVector = std::vector<std::string>;
#error "Requires exodusII version 4.68 or later"
#endif

#ifndef _WIN32
#include "add_to_log.h"
#endif

// The main program templated to permit float/double transfer.
template <typename T, typename INT>
Expand Down Expand Up @@ -609,12 +607,10 @@ int main(int argc, char *argv[])
}
}

#ifndef _WIN32
time_t end_time = std::time(nullptr);
if (rank == 0) {
add_to_log(argv[0], static_cast<int>(end_time - begin_time));
}
#endif
return (error);
}
catch (std::exception &e) {
Expand Down
4 changes: 2 additions & 2 deletions packages/seacas/applications/exodiff/ED_Version.h
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
#ifndef ED_Version_h
#define ED_Version_h

static std::string version("3.20");
static std::string verdate("2021-09-23");
static std::string version("3.21");
static std::string verdate("2021-10-06");

#endif // ED_Version_h
2 changes: 0 additions & 2 deletions packages/seacas/applications/exodiff/exoII_read.h
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,6 @@
#define EXOII_READ_H

#include "exo_entity.h"
#include "exodusII.h"
#include "netcdf.h"

#include <iostream>
#include <string>
Expand Down
47 changes: 27 additions & 20 deletions packages/seacas/applications/exodiff/exodiff.C
Original file line number Diff line number Diff line change
Expand Up @@ -185,6 +185,12 @@ void output_summary(ExoII_Read<INT> &file1, MinMaxData &mm_time, std::vector<Min
std::vector<MinMaxData> &mm_eb, std::vector<MinMaxData> &mm_fb,
const INT *node_id_map, const INT *elem_id_map);

#if defined(WIN32) || defined(__WIN32__) || defined(_WIN32) || defined(_MSC_VER) || \
defined(__MINGW32__) || defined(_WIN64) || defined(__MINGW64__)
#define __ED_WINDOWS__ 1
#endif

#if !defined(__ED_WINDOWS__)
#include <csignal>
// bit of a hack to get GNU's functions to enable floating point error trapping
#ifdef LINUX
Expand All @@ -197,9 +203,10 @@ void output_summary(ExoII_Read<INT> &file1, MinMaxData &mm_time, std::vector<Min
#endif
#endif

#if !defined(_WIN64) && !defined(WIN32) && !defined(_WINDOWS) && !defined(_MSC_VER)
struct sigaction sigact; // the signal handler & blocked signals

#endif

bool checking_invalid = false;
bool invalid_data = false;
extern "C" {
Expand Down Expand Up @@ -320,15 +327,15 @@ int main(int argc, char *argv[])
checking_invalid = false;
invalid_data = false;

#if !defined(_WIN64) && !defined(WIN32) && !defined(_WINDOWS) && !defined(_MSC_VER)
#if !defined(__ED_WINDOWS__)
sigfillset(&(sigact.sa_mask));
sigact.sa_handler = floating_point_exception_handler;
if (sigaction(SIGFPE, &sigact, nullptr) == -1) {
perror("sigaction failed");
}
#endif

#if defined(LINUX) && defined(GNU)
#if defined(LINUX) && defined(GNU) && !defined(__ED_WINDOWS__)
// for GNU, this seems to be needed to turn on trapping
feenableexcept(FE_DIVBYZERO | FE_OVERFLOW | FE_INVALID);
#endif
Expand Down Expand Up @@ -1221,7 +1228,7 @@ bool summarize_element(ExoII_Read<INT> &file, int step, const std::vector<INT> &
size_t global_elmt_index = 0;
for (size_t b = 0; b < file.Num_Element_Blocks(); ++b) {
Exo_Block<INT> *eblock = file.Get_Element_Block_by_Index(b);
const double * vals = get_validated_variable(eblock, step, vidx, name, &diff_flag);
const double *vals = get_validated_variable(eblock, step, vidx, name, &diff_flag);
if (vals == nullptr) {
global_elmt_index += eblock->Size();
continue;
Expand Down Expand Up @@ -1888,7 +1895,7 @@ bool diff_nodeset(ExoII_Read<INT> &file1, ExoII_Read<INT> &file2, int step1, con

for (size_t b = 0; b < file1.Num_Node_Sets(); ++b) {
Node_Set<INT> *nset1 = file1.Get_Node_Set_by_Index(b);
const double * vals1 = get_validated_variable(nset1, step1, vidx1, name, &diff_flag);
const double *vals1 = get_validated_variable(nset1, step1, vidx1, name, &diff_flag);
if (vals1 == nullptr) {
continue;
}
Expand Down Expand Up @@ -1958,9 +1965,9 @@ bool diff_nodeset(ExoII_Read<INT> &file1, ExoII_Read<INT> &file2, int step1, con
if (!interFace.quiet_flag) {
Node_Set<INT> *nset = file1.Get_Node_Set_by_Id(max_diff.blk);
std::string buf = fmt::format(
" {:<{}} {} diff: {:14.7e} ~ {:14.7e} ={:12.5e} (set {}, node {})", name,
name_length(), interFace.ns_var[e_idx].abrstr(), max_diff.val1, max_diff.val2,
max_diff.diff, max_diff.blk, id_map[nset->Node_Id(max_diff.id) - 1]);
" {:<{}} {} diff: {:14.7e} ~ {:14.7e} ={:12.5e} (set {}, node {})", name,
name_length(), interFace.ns_var[e_idx].abrstr(), max_diff.val1, max_diff.val2,
max_diff.diff, max_diff.blk, id_map[nset->Node_Id(max_diff.id) - 1]);
DIFF_OUT(buf);
}
else {
Expand Down Expand Up @@ -2068,10 +2075,10 @@ bool diff_sideset(ExoII_Read<INT> &file1, ExoII_Read<INT> &file2, int step1, con
if (!interFace.quiet_flag) {
Side_Set<INT> *sset = file1.Get_Side_Set_by_Id(max_diff.blk);
std::string buf = fmt::format(
" {:<{}} {} diff: {:14.7e} ~ {:14.7e} ={:12.5e} (set {}, side {}.{})", name,
name_length(), interFace.ss_var[e_idx].abrstr(), max_diff.val1, max_diff.val2,
max_diff.diff, max_diff.blk, id_map[sset->Side_Id(max_diff.id).first - 1],
(int)sset->Side_Id(max_diff.id).second);
" {:<{}} {} diff: {:14.7e} ~ {:14.7e} ={:12.5e} (set {}, side {}.{})", name,
name_length(), interFace.ss_var[e_idx].abrstr(), max_diff.val1, max_diff.val2,
max_diff.diff, max_diff.blk, id_map[sset->Side_Id(max_diff.id).first - 1],
(int)sset->Side_Id(max_diff.id).second);
DIFF_OUT(buf);
}
else {
Expand Down Expand Up @@ -2254,7 +2261,7 @@ bool diff_edgeblock(ExoII_Read<INT> &file1, ExoII_Read<INT> &file2, int step1, c

for (size_t b = 0; b < file1.Num_Edge_Blocks(); ++b) {
Edge_Block<INT> *eblock1 = file1.Get_Edge_Block_by_Index(b);
const double * vals1 = get_validated_variable(eblock1, step1, vidx1, name, &diff_flag);
const double *vals1 = get_validated_variable(eblock1, step1, vidx1, name, &diff_flag);
if (vals1 == nullptr) {
continue;
}
Expand Down Expand Up @@ -2322,9 +2329,9 @@ bool diff_edgeblock(ExoII_Read<INT> &file1, ExoII_Read<INT> &file2, int step1, c
if (!interFace.quiet_flag) {
Edge_Block<INT> *eblock = file1.Get_Edge_Block_by_Id(max_diff.blk);
std::string buf = fmt::format(
" {:<{}} {} diff: {:14.7e} ~ {:14.7e} ={:12.5e} (edge block {}, edge {})", name,
name_length(), interFace.eb_var[e_idx].abrstr(), max_diff.val1, max_diff.val2,
max_diff.diff, max_diff.blk, eblock->Edge_Index(max_diff.id) + 1);
" {:<{}} {} diff: {:14.7e} ~ {:14.7e} ={:12.5e} (edge block {}, edge {})", name,
name_length(), interFace.eb_var[e_idx].abrstr(), max_diff.val1, max_diff.val2,
max_diff.diff, max_diff.blk, eblock->Edge_Index(max_diff.id) + 1);
DIFF_OUT(buf);
}
else {
Expand Down Expand Up @@ -2363,7 +2370,7 @@ bool diff_faceblock(ExoII_Read<INT> &file1, ExoII_Read<INT> &file2, int step1, c

for (size_t b = 0; b < file1.Num_Face_Blocks(); ++b) {
Face_Block<INT> *fblock1 = file1.Get_Face_Block_by_Index(b);
const double * vals1 = get_validated_variable(fblock1, step1, vidx1, name, &diff_flag);
const double *vals1 = get_validated_variable(fblock1, step1, vidx1, name, &diff_flag);
if (vals1 == nullptr) {
continue;
}
Expand Down Expand Up @@ -2445,7 +2452,7 @@ bool diff_faceblock(ExoII_Read<INT> &file1, ExoII_Read<INT> &file2, int step1, c
}

template <typename INT>
bool diff_element_attributes(ExoII_Read<INT> &file1, ExoII_Read<INT> & file2,
bool diff_element_attributes(ExoII_Read<INT> &file1, ExoII_Read<INT> &file2,
const std::vector<INT> & /*elmt_map*/, const INT *id_map,
Exo_Block<INT> ** /*blocks2*/)
{
Expand Down Expand Up @@ -2686,8 +2693,8 @@ void output_summary(ExoII_Read<INT> &file1, MinMaxData &mm_time, std::vector<Min
if (n > 0) {
fmt::print("\nSIDESET VARIABLES relative 1.e-6 floor 0.0\n");
for (i = 0; i < n; ++i) {
Side_Set<INT> * ssmin = file1.Get_Side_Set_by_Id(mm_ss[i].min_blk);
Side_Set<INT> * ssmax = file1.Get_Side_Set_by_Id(mm_ss[i].max_blk);
Side_Set<INT> *ssmin = file1.Get_Side_Set_by_Id(mm_ss[i].min_blk);
Side_Set<INT> *ssmax = file1.Get_Side_Set_by_Id(mm_ss[i].max_blk);
std::pair<INT, INT> min_side = ssmin->Side_Id(mm_ss[i].min_id);
std::pair<INT, INT> max_side = ssmax->Side_Id(mm_ss[i].max_id);
fmt::print("\t{:<{}} # min: {:15.8g} @ t{},s{},f{}.{}\tmax: {:15.8g} @ t{},s{}"
Expand Down
Loading

0 comments on commit 73b5b34

Please sign in to comment.