Skip to content

Commit

Permalink
Merge 'trilinos/Trilinos:develop' (b7e9fc1) into 'tcad-charon/Trilino…
Browse files Browse the repository at this point in the history
…s:develop' (d850978).

* trilinos-develop:
  Automatic snapshot commit from seacas at 500c3cef0
  Tpetra: Fixes for Distributor timings
  Tacho - fix external example for openmp and serial build
  Tpetra: Distributor timers now controlled by config-option, not code modification
  • Loading branch information
Jenkins Pipeline committed Mar 31, 2020
2 parents d850978 + b7e9fc1 commit a4157fa
Show file tree
Hide file tree
Showing 35 changed files with 759 additions and 763 deletions.
26 changes: 21 additions & 5 deletions packages/seacas/applications/nem_spread/el_exoII_io.C
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
* Copyright (C) 2009-2017 National Technology & Engineering Solutions of
* Copyright (C) 2009-2017, 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.
*
Expand Down Expand Up @@ -956,10 +956,10 @@ void NemSpread<T, INT>::read_coord(int exoid, int max_name_length)
* output databases.
*/
{
int sequential = 1;
bool sequential = true;
for (size_t i = 0; i < globals.Num_Node; i++) {
if ((size_t)global_node_ids[i] != i + 1) {
sequential = 0;
sequential = false;
break;
}
}
Expand All @@ -974,12 +974,12 @@ void NemSpread<T, INT>::read_coord(int exoid, int max_name_length)
" All global ids must be greater than 0. The map will be ignored.\n"
"---------------------------------------------------------------------\n",
i + 1, global_node_ids[i]);
sequential = 1; // Map is invalid, ignore it.
sequential = true; // Map is invalid, ignore it.
break;
}
}

if (sequential == 0) {
if (!sequential) {
for (int iproc = Proc_Info[4]; iproc < Proc_Info[4] + Proc_Info[5]; iproc++) {

size_t itotal_nodes = globals.Num_Internal_Nodes[iproc] + globals.Num_Border_Nodes[iproc] +
Expand Down Expand Up @@ -1483,6 +1483,22 @@ template <typename T, typename INT> void NemSpread<T, INT>::read_elem_blk(int ex
break;
}
}

// Check that map is valid 1 <= global_node_id[*]
// If not, output a warning and disable the map.
for (size_t i = 0; i < globals.Num_Elem; i++) {
if (global_ids[i] <= 0) {
fmt::print(stderr,
"---------------------------------------------------------------------\n"
"ERROR: Local element {:n} has a global id of {:n} which is invalid.\n"
" All global ids must be greater than 0. The map will be ignored.\n"
"---------------------------------------------------------------------\n",
i + 1, global_ids[i]);
sequential = true; // Map is invalid, ignore it.
break;
}
}

if (!sequential) {
for (int iproc = Proc_Info[4]; iproc < Proc_Info[4] + Proc_Info[5]; iproc++) {

Expand Down
4 changes: 2 additions & 2 deletions packages/seacas/libraries/exodus/src/ex_get_var_time.c
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
* Copyright (c) 2005-2017 National Technology & Engineering Solutions
* Copyright (c) 2005-2017, 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.
*
Expand Down Expand Up @@ -158,7 +158,7 @@ int ex_get_var_time(int exoid, ex_entity_type var_type, int var_index, int64_t i
}

/* allocate space for stat array */
if (!(stat_vals = malloc(num_obj * sizeof(int)))) {
if (!(stat_vals = calloc(num_obj, sizeof(int)))) {
snprintf(errmsg, MAX_ERR_LENGTH,
"ERROR: failed to allocate memory for %s status array for file id %d",
ex_name_of_object(var_type), exoid);
Expand Down
5 changes: 3 additions & 2 deletions packages/seacas/libraries/exodus/src/ex_put_variable_names.c
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
* Copyright (c) 2005-2017 National Technology & Engineering Solutions
* Copyright (c) 2005-2017, 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.
*
Expand Down Expand Up @@ -151,7 +151,8 @@ error = ex_put_variable_names (exoid, EX_NODAL, num_nod_vars, var_names);

int ex_put_variable_names(int exoid, ex_entity_type obj_type, int num_vars, char *var_names[])
{
int varid, status;
int varid = 0;
int status = 0;
char errmsg[MAX_ERR_LENGTH];

EX_FUNC_ENTER();
Expand Down
59 changes: 0 additions & 59 deletions packages/seacas/libraries/exodus/src/herrin-552-str-1.out

This file was deleted.

18 changes: 6 additions & 12 deletions packages/seacas/libraries/exodus/test/testwt-localization.C
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
* Copyright (c) 2005-2017 National Technology & Engineering Solutions
* Copyright (c) 2005-2017, 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.
*
Expand Down Expand Up @@ -44,12 +44,6 @@
#include "exodusII.h"
#include "exodusII_int.h"

#if __cplusplus > 199711L
#define TOPTR(x) x.data()
#else
#define TOPTR(x) (x.empty() ? nullptr : &x[0])
#endif

#define STRINGIFY(x) #x
#define TOSTRING(x) STRINGIFY(x)
#define EXCHECK(funcall) \
Expand Down Expand Up @@ -165,7 +159,7 @@ int main()
z[i + num_nodes / 2] = 1.0;
}

EXCHECK(ex_put_coord(exoid, TOPTR(x), TOPTR(y), TOPTR(z)));
EXCHECK(ex_put_coord(exoid, x.data(), y.data(), z.data()));

const char *coord_names[3];
coord_names[0] = "xcoor";
Expand Down Expand Up @@ -200,7 +194,7 @@ int main()
block_names[1] = "block_20";
block_names[2] = "block_30";

EXCHECK(ex_put_block_params(exoid, num_elem_blk, TOPTR(blocks)));
EXCHECK(ex_put_block_params(exoid, num_elem_blk, blocks.data()));

/* Write element block names */
for (int i = 0; i < num_elem_blk; i++) {
Expand Down Expand Up @@ -288,14 +282,14 @@ int main()
}

EXCHECK(
ex_put_var(exoid, whole_time_step, EX_GLOBAL, 1, 1, num_glo_vars, TOPTR(glob_var_vals)));
ex_put_var(exoid, whole_time_step, EX_GLOBAL, 1, 1, num_glo_vars, glob_var_vals.data()));

// write nodal variables
for (int k = 1; k <= num_nod_vars; k++) {
for (int j = 0; j < num_nodes; j++) {
nodal_var_vals[j] = (double)k + ((double)(j + 1) * time_value);
}
EXCHECK(ex_put_var(exoid, whole_time_step, EX_NODAL, k, 1, num_nodes, TOPTR(nodal_var_vals)));
EXCHECK(ex_put_var(exoid, whole_time_step, EX_NODAL, k, 1, num_nodes, nodal_var_vals.data()));
}

// write element variables
Expand All @@ -305,7 +299,7 @@ int main()
elem_var_vals[m] = (double)(k + 1) + (double)(j + 2) + ((double)(m + 1) * time_value);
}
EXCHECK(ex_put_var(exoid, whole_time_step, EX_ELEM_BLOCK, k, blocks[j].id,
blocks[j].num_entry, TOPTR(elem_var_vals)));
blocks[j].num_entry, elem_var_vals.data()));
}
}

Expand Down
6 changes: 3 additions & 3 deletions packages/seacas/libraries/exodus/test/testwt-results.c
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
* Copyright (c) 2005-2017 National Technology & Engineering Solutions
* Copyright (c) 2005-2017, 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.
*
Expand Down Expand Up @@ -93,8 +93,8 @@ int main(int argc, char **argv)
num_node_sets = 0;
num_side_sets = 0;

error = ex_put_init(exoid, title, num_dim, num_nodes, num_elem, num_elem_blk, num_node_sets,
num_side_sets);
ex_put_init(exoid, title, num_dim, num_nodes, num_elem, num_elem_blk, num_node_sets,
num_side_sets);

/* write element block parameters */
for (i = 0; i < 10; i++) {
Expand Down
40 changes: 20 additions & 20 deletions packages/seacas/libraries/ioss/src/Ioss_DatabaseIO.C
Original file line number Diff line number Diff line change
Expand Up @@ -327,16 +327,16 @@ namespace Ioss {
Ioss::FileInfo path{filename};
Ioss::FileInfo bb_file{get_dwPath() + path.tailname()};
if (bb_file.exists() && !bb_file.is_writable()) {
// already existing file which has been closed If we can't
// already existing file which has been closed If we can't
// write to the file on the BB, then it is a file which is
// being staged by datawarp system over to the permanent
// filesystem. Wait until staging has finished... stage wait
// returns 0 = success, -ENOENT or -errno
#if defined SEACAS_HAVE_DATAWARP
#if IOSS_DEBUG_OUTPUT
if (myProcessor == 0) {
fmt::print(stderr, "DW: dw_wait_file_stage({});\n", bb_file.filename());
}
fmt::print(stderr, "DW: dw_wait_file_stage({});\n", bb_file.filename());
}
#endif
int dwret = dw_wait_file_stage(bb_file.filename().c_str());
if (dwret < 0) {
Expand Down Expand Up @@ -365,25 +365,25 @@ namespace Ioss {
if (using_dw()) {
if (!using_parallel_io() || (using_parallel_io() && myProcessor == 0)) {
#if defined SEACAS_HAVE_DATAWARP
int complete=0, pending=0, deferred=0, failed=0;
dw_query_file_stage(get_dwname().c_str(), &complete, &pending, &deferred, &failed);
int complete = 0, pending = 0, deferred = 0, failed = 0;
dw_query_file_stage(get_dwname().c_str(), &complete, &pending, &deferred, &failed);
#if IOSS_DEBUG_OUTPUT
auto initial = std::chrono::high_resolution_clock::now();
fmt::print(stderr, "Query: {}, {}, {}, {}\n", complete, pending, deferred, failed);
fmt::print(stderr, "Query: {}, {}, {}, {}\n", complete, pending, deferred, failed);
#endif
if (pending > 0) {
int dwret = dw_wait_file_stage(get_dwname().c_str());
if (dwret < 0) {
std::ostringstream errmsg;
fmt::print(errmsg, "ERROR: failed waiting for file stage `{}`: {}\n", get_dwname(),
std::strerror(-dwret));
IOSS_ERROR(errmsg);
}
if (pending > 0) {
int dwret = dw_wait_file_stage(get_dwname().c_str());
if (dwret < 0) {
std::ostringstream errmsg;
fmt::print(errmsg, "ERROR: failed waiting for file stage `{}`: {}\n", get_dwname(),
std::strerror(-dwret));
IOSS_ERROR(errmsg);
}
#if IOSS_DEBUG_OUTPUT
dw_query_file_stage(get_dwname().c_str(), &complete, &pending, &deferred, &failed);
fmt::print(stderr, "Query: {}, {}, {}, {}\n", complete, pending, deferred, failed);
dw_query_file_stage(get_dwname().c_str(), &complete, &pending, &deferred, &failed);
fmt::print(stderr, "Query: {}, {}, {}, {}\n", complete, pending, deferred, failed);
#endif
}
}

#if IOSS_DEBUG_OUTPUT
fmt::print(stderr, "\nDW: BEGIN dw_stage_file_out({}, {}, DW_STAGE_IMMEDIATE);\n",
Expand All @@ -393,7 +393,7 @@ namespace Ioss {
dw_stage_file_out(get_dwname().c_str(), get_pfsname().c_str(), DW_STAGE_IMMEDIATE);

#if IOSS_DEBUG_OUTPUT
auto time_now = std::chrono::high_resolution_clock::now();
auto time_now = std::chrono::high_resolution_clock::now();
std::chrono::duration<double> diff = time_now - initial;
fmt::print(stderr, "\nDW: END dw_stage_file_out({})\n", diff.count());
#endif
Expand Down Expand Up @@ -964,7 +964,7 @@ namespace Ioss {
IOSS_ERROR(errmsg);
}

result = MPI_Waitall(req_cnt, TOPTR(request), TOPTR(status));
result = MPI_Waitall(req_cnt, request.data(), status.data());

if (result != MPI_SUCCESS) {
fmt::print(stderr, "ERROR: MPI_Waitall error on processor {} in {}", util().parallel_rank(),
Expand Down Expand Up @@ -1026,7 +1026,7 @@ namespace Ioss {
}

std::vector<unsigned> out_data(element_blocks.size() * bits_size);
MPI_Allreduce((void *)TOPTR(data), TOPTR(out_data), static_cast<int>(data.size()),
MPI_Allreduce((void *)data.data(), out_data.data(), static_cast<int>(data.size()),
MPI_UNSIGNED, MPI_BOR, util().communicator());

offset = 0;
Expand Down
Loading

0 comments on commit a4157fa

Please sign in to comment.