Skip to content

Commit

Permalink
NEM_SPREAD: Fix problem with last refactor
Browse files Browse the repository at this point in the history
  • Loading branch information
gdsjaar committed Feb 28, 2024
1 parent 7d5e7b0 commit 642a184
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 9 deletions.
2 changes: 1 addition & 1 deletion packages/seacas/applications/nem_spread/nem_spread.h
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
#include "rf_io_const.h"

#define UTIL_NAME "nem_spread"
#define VER_STR "7.03 (2023/07/28)"
#define VER_STR "7.04 (2024/02/28)"

extern void check_exodus_error(int, const char *);
extern double second();
Expand Down
22 changes: 14 additions & 8 deletions packages/seacas/applications/nem_spread/pe_write_parExo_info.C
Original file line number Diff line number Diff line change
Expand Up @@ -618,12 +618,13 @@ void NemSpread<T, INT>::write_parExo_data(int mesh_exoid, int max_name_length, i
* The Nemesis node maps are lists of internal, border and external
* FEM node numbers. These are output as local node numbers.
*/
std::vector<INT> nem_node_mapi(globals.Num_Internal_Nodes[iproc], 1);
std::vector<INT> nem_node_mapb(globals.Num_Border_Nodes[iproc], 1);
std::vector<INT> nem_node_mape(globals.Num_External_Nodes[iproc], 1);
INT *nem_node_mapi = (INT *)array_alloc(__FILE__, __LINE__, 1, itotal_nodes, sizeof(INT));
INT *nem_node_mapb = nem_node_mapi + globals.Num_Internal_Nodes[iproc];
INT *nem_node_mape = nem_node_mapb + globals.Num_Border_Nodes[iproc];
std::iota(nem_node_mapi, nem_node_mapi + itotal_nodes, (INT)1);

if (ex_put_processor_node_maps(mesh_exoid, Data(nem_node_mapi), Data(nem_node_mapb),
Data(nem_node_mape), proc_for) < 0) {
if (ex_put_processor_node_maps(mesh_exoid, nem_node_mapi, nem_node_mapb, nem_node_mape,
proc_for) < 0) {
fmt::print(stderr, "[{}]: ERROR, could not write Nemesis nodal number map!\n", __func__);
check_exodus_error(ex_close(mesh_exoid), "ex_close");
ex_close(mesh_exoid);
Expand Down Expand Up @@ -656,9 +657,7 @@ void NemSpread<T, INT>::write_parExo_data(int mesh_exoid, int max_name_length, i
PIO_Time_Array[11] = (second() - tt1);
total_out_time += PIO_Time_Array[11];

nem_node_mapi.clear();
nem_node_mapb.clear();
nem_node_mape.clear();
safe_free((void **)&nem_node_mapi);

PIO_Time_Array[13] = 0.0;
PIO_Time_Array[14] = 0.0;
Expand Down Expand Up @@ -1518,6 +1517,13 @@ namespace {
/* Sort the 'global' array via the index array 'tmp_index' */
gds_iqsort(global, Data(tmp_index), gsize);

#if 0
for (size_t i2 = 0; i2 < gsize; i2++) {
INT gval = global[tmp_index[i2]] + p01;
fmt::print(stderr, "GLOBAL: {} {} {}\n", i2, tmp_index[i2], gval);
}
#endif

size_t i3 = 0;
if (index != nullptr) {
for (size_t i2 = 0; i2 < gsize; i2++) {
Expand Down

0 comments on commit 642a184

Please sign in to comment.