From 60368dd89af55c6d5bf0636e4c721bf85f2e5a9a Mon Sep 17 00:00:00 2001 From: Greg Sjaardema Date: Wed, 25 Oct 2023 13:28:55 -0600 Subject: [PATCH] Pull changes back from sierra snapshot --- packages/seacas/Jamfile | 4 ++++ packages/seacas/applications/epu/epu.C | 9 +++++++++ packages/seacas/applications/exodiff/exodiff.C | 7 +++++++ packages/seacas/applications/slice/SL_Decompose.C | 14 ++++++++++++-- packages/seacas/libraries/ioss/src/Ioss_Region.h | 8 ++++++++ .../seacas/libraries/ioss/src/cgns/Iocgns_Utils.h | 1 - .../src/unit_tests/UnitTestIotmTextMeshFixture.h | 2 -- 7 files changed, 40 insertions(+), 5 deletions(-) diff --git a/packages/seacas/Jamfile b/packages/seacas/Jamfile index 2ad19374a4..23dc6d5766 100644 --- a/packages/seacas/Jamfile +++ b/packages/seacas/Jamfile @@ -1390,6 +1390,7 @@ lib aprepro_lib exodus /tpl/netcdf-c//netcdf : EXODUS_SUPPORT + FMT_SUPPORT [ ifdevbuild # Any parameters within this 'ifdevbuild' block apply to development # builds only and will not be present for user builds. @@ -1402,6 +1403,7 @@ lib aprepro_lib ] : : EXODUS_SUPPORT + FMT_SUPPORT [ ifdevbuild # Any parameters within this 'ifdevbuild' block apply to development # builds only and will not be present for user builds. @@ -1472,6 +1474,7 @@ exe aprepro : $(seacas-root)/applications/aprepro/aprepro.C aprepro_lib + suplib_cpp : $(seacas-root)/applications/aprepro $(seacas-root)/applications/aprepro @utility-exec-tag @@ -1499,6 +1502,7 @@ exe slice : $(seacas-root)/applications/slice/Slice.C $(seacas-root)/applications/slice/SL_SystemInterface.C + $(seacas-root)/applications/slice/SL_Decompose.C suplib_cpp suplib_c ioinit diff --git a/packages/seacas/applications/epu/epu.C b/packages/seacas/applications/epu/epu.C index db5fcb83b9..23bfb8245d 100644 --- a/packages/seacas/applications/epu/epu.C +++ b/packages/seacas/applications/epu/epu.C @@ -1776,11 +1776,20 @@ namespace { copy_string(qaRecord[num_qa_records].qa_record[0][1], qainfo[2], MAX_STR_LENGTH + 1); // Version time_t date_time = std::time(nullptr); +#if defined __NVCC__ + auto *lt = std::localtime(&date_time); + buffer = fmt::format("{:%Y/%m/%d}", *lt); +#else auto const lt = fmt::localtime(date_time); buffer = fmt::format("{:%Y/%m/%d}", lt); +#endif copy_string(qaRecord[num_qa_records].qa_record[0][2], buffer, MAX_STR_LENGTH + 1); +#if defined __NVCC__ + buffer = fmt::format("{:%H:%M:%S}", *lt); +#else buffer = fmt::format("{:%H:%M:%S}", lt); +#endif copy_string(qaRecord[num_qa_records].qa_record[0][3], buffer, MAX_STR_LENGTH + 1); error = ex_put_qa(id_out, num_qa_records + 1, qaRecord[0].qa_record); diff --git a/packages/seacas/applications/exodiff/exodiff.C b/packages/seacas/applications/exodiff/exodiff.C index 417c0fc03d..6398c0d50f 100644 --- a/packages/seacas/applications/exodiff/exodiff.C +++ b/packages/seacas/applications/exodiff/exodiff.C @@ -57,8 +57,15 @@ struct TimeInterp std::string Date() { time_t calendar_time = time(nullptr); +#if defined __NVCC__ + char tbuf[32]; + struct tm *local_time = localtime(&calendar_time); + strftime(tbuf, 32, "%Y/%m/%d %H:%M:%S %Z", local_time); + std::string time_string(tbuf); +#else auto const local_time = fmt::localtime(calendar_time); auto time_string = fmt::format("{:%Y/%m/%d %H:%M:%S %Z}", local_time); +#endif return time_string; } diff --git a/packages/seacas/applications/slice/SL_Decompose.C b/packages/seacas/applications/slice/SL_Decompose.C index 5bddf0a749..786c592e72 100644 --- a/packages/seacas/applications/slice/SL_Decompose.C +++ b/packages/seacas/applications/slice/SL_Decompose.C @@ -21,7 +21,9 @@ #include #include +#if !defined __NVCC__ #include +#endif #include #include #include @@ -923,11 +925,19 @@ void output_decomposition_statistics(const std::vector &elem_to_proc, int p std::string stars(star_cnt, '*'); std::string format = "\tProcessor {:{}}, work = {:{}} ({:.2f})\t{}\n"; if (elem_per_rank[i] == max_work) { - fmt::print(fg(fmt::color::red), format, i, proc_width, fmt::group_digits(elem_per_rank[i]), + fmt::print( +#if !defined __NVCC__ + fg(fmt::color::red), +#endif + format, i, proc_width, fmt::group_digits(elem_per_rank[i]), work_width, (double)elem_per_rank[i] / avg_work, stars); } else if (elem_per_rank[i] == min_work) { - fmt::print(fg(fmt::color::green), format, i, proc_width, + fmt::print( +#if !defined __NVCC__ + fg(fmt::color::green), +#endif + format, i, proc_width, fmt::group_digits(elem_per_rank[i]), work_width, elem_per_rank[i] / avg_work, stars); } diff --git a/packages/seacas/libraries/ioss/src/Ioss_Region.h b/packages/seacas/libraries/ioss/src/Ioss_Region.h index 5d94933e8e..7b63763ad1 100644 --- a/packages/seacas/libraries/ioss/src/Ioss_Region.h +++ b/packages/seacas/libraries/ioss/src/Ioss_Region.h @@ -18,7 +18,9 @@ #include // for State #include // for size_t, nullptr #include // for int64_t +#if !defined BUILT_IN_SIERRA #include +#endif #include // for less #include // for ostream #include // for map, map<>::value_compare @@ -427,11 +429,17 @@ namespace Ioss { if (found && field.get_role() != role) { std::ostringstream errmsg; +#if defined BUILT_IN_SIERRA + errmsg << "ERROR: Field " << field.get_name() << " with role " << field.role_string() + << " on entity " << entity->name() << " does not match previously found role " + << Ioss::Field::role_string(role) << ".\n", +#else fmt::print(errmsg, "ERROR: Field {} with role {} on entity {} does not match previously found " "role {}.\n", field.get_name(), field.role_string(), entity->name(), Ioss::Field::role_string(role)); +#endif IOSS_ERROR(errmsg); } diff --git a/packages/seacas/libraries/ioss/src/cgns/Iocgns_Utils.h b/packages/seacas/libraries/ioss/src/cgns/Iocgns_Utils.h index fa3affb691..950b16e298 100644 --- a/packages/seacas/libraries/ioss/src/cgns/Iocgns_Utils.h +++ b/packages/seacas/libraries/ioss/src/cgns/Iocgns_Utils.h @@ -19,7 +19,6 @@ #include #include #include -#include #include #include diff --git a/packages/seacas/libraries/ioss/src/unit_tests/UnitTestIotmTextMeshFixture.h b/packages/seacas/libraries/ioss/src/unit_tests/UnitTestIotmTextMeshFixture.h index 9c56768205..df7958985d 100644 --- a/packages/seacas/libraries/ioss/src/unit_tests/UnitTestIotmTextMeshFixture.h +++ b/packages/seacas/libraries/ioss/src/unit_tests/UnitTestIotmTextMeshFixture.h @@ -36,8 +36,6 @@ #include #include -#include - #include #include #include