Skip to content

Commit

Permalink
Pull changes back from sierra snapshot
Browse files Browse the repository at this point in the history
  • Loading branch information
gdsjaar committed Oct 25, 2023
1 parent ee488e7 commit 60368dd
Show file tree
Hide file tree
Showing 7 changed files with 40 additions and 5 deletions.
4 changes: 4 additions & 0 deletions packages/seacas/Jamfile
Original file line number Diff line number Diff line change
Expand Up @@ -1390,6 +1390,7 @@ lib aprepro_lib
exodus
/tpl/netcdf-c//netcdf
: <define>EXODUS_SUPPORT
<define>FMT_SUPPORT
[ ifdevbuild
# Any parameters within this 'ifdevbuild' block apply to development
# builds only and will not be present for user builds.
Expand All @@ -1402,6 +1403,7 @@ lib aprepro_lib
]
:
: <define>EXODUS_SUPPORT
<define>FMT_SUPPORT
[ ifdevbuild
# Any parameters within this 'ifdevbuild' block apply to development
# builds only and will not be present for user builds.
Expand Down Expand Up @@ -1472,6 +1474,7 @@ exe aprepro
:
$(seacas-root)/applications/aprepro/aprepro.C
aprepro_lib
suplib_cpp
: <include>$(seacas-root)/applications/aprepro
<include>$(seacas-root)/applications/aprepro
<tag>@utility-exec-tag
Expand Down Expand Up @@ -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
Expand Down
9 changes: 9 additions & 0 deletions packages/seacas/applications/epu/epu.C
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down
7 changes: 7 additions & 0 deletions packages/seacas/applications/exodiff/exodiff.C
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}

Expand Down
14 changes: 12 additions & 2 deletions packages/seacas/applications/slice/SL_Decompose.C
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,9 @@
#include <fstream>

#include <exodusII.h>
#if !defined __NVCC__
#include <fmt/color.h>
#endif
#include <fmt/format.h>
#include <fmt/ostream.h>
#include <init/Ionit_Initializer.h>
Expand Down Expand Up @@ -923,11 +925,19 @@ void output_decomposition_statistics(const std::vector<INT> &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);
}
Expand Down
8 changes: 8 additions & 0 deletions packages/seacas/libraries/ioss/src/Ioss_Region.h
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,9 @@
#include <Ioss_State.h> // for State
#include <cstddef> // for size_t, nullptr
#include <cstdint> // for int64_t
#if !defined BUILT_IN_SIERRA
#include <fmt/ostream.h>
#endif
#include <functional> // for less
#include <iosfwd> // for ostream
#include <map> // for map, map<>::value_compare
Expand Down Expand Up @@ -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);
}

Expand Down
1 change: 0 additions & 1 deletion packages/seacas/libraries/ioss/src/cgns/Iocgns_Utils.h
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,6 @@
#include <Ioss_Utils.h>
#include <cgns/Iocgns_Defines.h>
#include <cgnslib.h>
#include <fmt/format.h>
#include <ostream>
#include <string>

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -36,8 +36,6 @@
#include <string>
#include <unordered_map>

#include <fmt/ostream.h>

#include <memory>
#include <string>
#include <strings.h>
Expand Down

0 comments on commit 60368dd

Please sign in to comment.