Skip to content

Commit

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

* trilinos-develop:
  rol: remove volatile from join in ROL_TpetraMultiVector.hpp
  STK: Snapshot 10-14-22 07:12
  remove dangling #endif
  remove errant #endif
  Drivers: Update to lightsaber
  Tpetra: Remove HAVE_TPETRA_THROW_EFFICIENCY_WARNINGS macros and associated code
  • Loading branch information
Charonops Jenkins Pipeline committed Oct 15, 2022
2 parents 8292665 + 122be6e commit d9299d4
Show file tree
Hide file tree
Showing 33 changed files with 542 additions and 191 deletions.
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
#!/bin/csh
#!/bin/bash

echo
echo "Starting nightly Trilinos development testing on lightsaber: `date`"
Expand All @@ -8,36 +8,36 @@ echo
# TrilinosDriver settings:
#

setenv TDD_PARALLEL_LEVEL 2
export TDD_PARALLEL_LEVEL=2

# Trilinos settings:
#

# Submission mode for the *TrilinosDriver* dashboard
setenv TDD_CTEST_TEST_TYPE Nightly
export TDD_CTEST_TEST_TYPE=Nightly


# Machine specific environment
#

setenv TDD_HTTP_PROXY "http://wwwproxy.sandia.gov:80"
setenv TDD_HTTPS_PROXY "https://wwwproxy.sandia.gov:80"
setenv http_proxy "http://wwwproxy.sandia.gov:80"
setenv https_proxy "https://wwwproxy.sandia.gov:80"
setenv TDD_FORCE_CMAKE_INSTALL 1
setenv TDD_DEBUG_VERBOSE 1
export TDD_HTTP_PROXY="http://wwwproxy.sandia.gov:80"
export TDD_HTTPS_PROXY="https://wwwproxy.sandia.gov:80"
export http_proxy="http://wwwproxy.sandia.gov:80"
export https_proxy="https://wwwproxy.sandia.gov:80"
export TDD_FORCE_CMAKE_INSTALL=1
export TDD_DEBUG_VERBOSE=1

source ~/.cshrc
source ~/.bashrc


# Machine independent cron_driver:
set SCRIPT_DIR `cd "\`dirname \"$0\"\`";pwd`
SCRIPT_DIR=`cd "\`dirname \"$0\"\`";pwd`

# Trilinos source repo
setenv TRILINOS_SOURCE $SCRIPT_DIR/../../../..
export TRILINOS_SOURCE=$SCRIPT_DIR/../../../..

# folder with the machine specific build info
setenv BUILDS_DIR $TRILINOS_SOURCE/cmake/ctest/drivers/$HOSTNAME
export BUILDS_DIR=$TRILINOS_SOURCE/cmake/ctest/drivers/$HOSTNAME



Expand All @@ -47,7 +47,7 @@ setenv BUILDS_DIR $TRILINOS_SOURCE/cmake/ctest/drivers/$HOSTNAME

# ===========================================================================
# GCC family
setenv CTEST_CONFIGURATION "default"
export CTEST_CONFIGURATION="default"
module purge
module load sems-gcc/10.1.0
module load sems-openmpi/4.0.5
Expand All @@ -65,14 +65,14 @@ module load sems-netcdf-c/4.7.3
echo "Configuration = $CTEST_CONFIGURATION"
env

setenv OMP_NUM_THREADS 2
export OMP_NUM_THREADS=2

# Update Avatar
# Update Avatar
(cd /home/nightlyTesting/avatar; git pull --rebase )

# Set variables to work aroun TriBITS problems
#setenv TDD_FORCE_CMAKE_INSTALL 0
setenv TRIBITS_TDD_USE_SYSTEM_CTEST 1
export TRIBITS_TDD_USE_SYSTEM_CTEST=1

# Actually run stuff
ctest -S $BUILDS_DIR/ctest_linux_experimental_mpi_release_avatar_lightsaber.cmake
Expand All @@ -90,7 +90,7 @@ module unload sems-gcc

# ===========================================================================
# OneAPI family
setenv CTEST_CONFIGURATION "default"
export CTEST_CONFIGURATION="default"
module purge
module load sems-gcc/10.1.0
module load oneapi
Expand All @@ -99,11 +99,11 @@ export I_MPI_CXX=dpcpp
echo "Configuration = $CTEST_CONFIGURATION"
env

setenv OMP_NUM_THREADS 1
export OMP_NUM_THREADS=1

# Set variables to work aroun TriBITS problems
#setenv TDD_FORCE_CMAKE_INSTALL 0
setenv TRIBITS_TDD_USE_SYSTEM_CTEST 1
export TRIBITS_TDD_USE_SYSTEM_CTEST=1

# Actually run stuff
ctest -S $BUILDS_DIR/ctest_linux_experimental_mpi_release_sycl_cpu_lightsaber.cmake
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -139,7 +139,7 @@ namespace TPMultiVector {
}

KOKKOS_INLINE_FUNCTION
void join(volatile Real &globalVal, const volatile Real &localVal) const {
void join(Real &globalVal, const Real &localVal) const {
r_->reduce(localVal,globalVal);
}

Expand Down
10 changes: 5 additions & 5 deletions packages/stk/stk_io/stk_io/IossBridge.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -4085,14 +4085,14 @@ const stk::mesh::FieldBase *declare_stk_field_internal(stk::mesh::MetaData &meta
if(elementBlock != nullptr && is_part_io_part(*elementBlock))
parentElementBlock = elementBlock;
}
} else {
parentElementBlock = get_parent_element_block_by_adjacency(bulk, name, parentElementBlock);
}
}
else {
parentElementBlock = get_parent_element_block_by_adjacency(bulk, name, parentElementBlock);
}
}

if(parentElementBlock == nullptr) {
parentElementBlock = get_parent_element_block_by_adjacency(bulk, name, parentElementBlock);
}

return parentElementBlock;
}

Expand Down
34 changes: 26 additions & 8 deletions packages/stk/stk_io/stk_io/ProcessSetsOrBlocks.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,7 @@
#include "stk_mesh/baseImpl/MeshImplUtils.hpp" // for connect_edge_to_el...
#include "stk_topology/topology.hpp" // for topology, topology...
#include "stk_util/diag/StringUtil.hpp" // for case_strcmp
#include "stk_util/environment/RuntimeWarning.hpp"
#include "stk_util/parallel/CommSparse.hpp" // for CommSparse, pack_a...
#include "stk_util/parallel/ParallelComm.hpp" // for CommBuffer
#include "stk_util/util/ReportHandler.hpp" // for ThrowRequireMsg
Expand Down Expand Up @@ -263,10 +264,23 @@ void process_surface_entity(const Ioss::SideSet* sset, stk::mesh::BulkData & bul
if (stk::io::include_entity(block)) {
std::vector<INT> elem_side ;

stk::mesh::Part *sb_part = get_part_for_grouping_entity(*region, meta, block);
if (sb_part == nullptr)
{
sb_part = get_part_for_grouping_entity(*region, meta, sset);
stk::mesh::Part *sbPart = get_part_for_grouping_entity(*region, meta, block);
if (sbPart == nullptr) {
sbPart = get_part_for_grouping_entity(*region, meta, sset);
}

stk::mesh::SideSet *sbSideSet = nullptr;
if(nullptr != sbPart) {
if(sbPart->id() != stkSideSetPart->id())
stk::RuntimeWarning() << "process_surface_entity: sideblock " << sbPart->name() << " with id " << sbPart->id()
<< " does not have the same id as parent sideset "
<< stkSideSetPart->name() << " with id " << stkSideSetPart->id();

const stk::mesh::Part& sbParentPart = stk::mesh::get_sideset_parent(*sbPart);

if(sbParentPart.mesh_meta_data_ordinal() != stkSideSetPart->mesh_meta_data_ordinal()) {
sbSideSet = & bulk.create_sideset(*sbPart);
}
}

stk::mesh::EntityRank elem_rank = stk::topology::ELEMENT_RANK;
Expand All @@ -283,8 +297,8 @@ void process_surface_entity(const Ioss::SideSet* sset, stk::mesh::BulkData & bul
block->get_field_data("element_side", elem_side);
stk::mesh::PartVector add_parts;

if(nullptr != sb_part) {
add_parts.push_back(sb_part);
if(nullptr != sbPart) {
add_parts.push_back(sbPart);
}

// Get topology of the sides being defined to see if they
Expand Down Expand Up @@ -321,8 +335,12 @@ void process_surface_entity(const Ioss::SideSet* sset, stk::mesh::BulkData & bul

ThrowRequireMsg((par_dimen == 1) || (par_dimen == 2), "Invalid value for par_dimen:" << par_dimen);

if(nullptr != stkSideSet) {
stkSideSet->add({elem, side_ordinal});
if(nullptr != sbSideSet) {
sbSideSet->add({elem, side_ordinal});
} else {
if(nullptr != stkSideSet) {
stkSideSet->add({elem, side_ordinal});
}
}

if (par_dimen == 1) {
Expand Down
2 changes: 1 addition & 1 deletion packages/stk/stk_io/stk_io/SidesetTranslator.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -80,7 +80,7 @@ void fill_element_and_side_ids_from_sideset(const stk::mesh::SideSet& sset,
stk::mesh::Entity side = stk::mesh::get_side_entity_for_elem_side_pair_of_rank(bulk_data, element, zero_based_side_ord, sideRank);
if(bulk_data.is_valid(side))
{
const stk::mesh::Bucket &sideBucket = bulk_data.bucket(side);
stk::mesh::Bucket &sideBucket = bulk_data.bucket(side);
bool sideIsSelected = false;

if (sideBucket.bucket_id() == previousBucketId) {
Expand Down
9 changes: 8 additions & 1 deletion packages/stk/stk_math/stk_math/StkPlane.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -89,6 +89,7 @@ class Plane3 {
Real & constant() { return m_constant; }

bool intersects_segment(const std::array<Vec<REAL,3>,2> & segment_nodes, REAL & location) const;
bool intersects_segment(const Vec<REAL,3>& segment_node0, const Vec<REAL,3>& segment_node1, REAL & location) const;

private:
Vec<REAL,3> m_normal;
Expand All @@ -105,7 +106,13 @@ std::ostream& operator<<( std::ostream& out, const Plane3<REAL>& plane )
template<class REAL>
inline bool Plane3<REAL>::intersects_segment(const std::array<Vec<REAL,3>,2> & segment_nodes, REAL & location) const
{
const Real s[2] = { signed_distance(segment_nodes[0]), signed_distance(segment_nodes[1]) };
return intersects_segment(segment_nodes[0], segment_nodes[1], location);
}

template<class REAL>
inline bool Plane3<REAL>::intersects_segment(const Vec<REAL,3>& segment_node0, const Vec<REAL,3>& segment_node1, REAL & location) const
{
const Real s[2] = { signed_distance(segment_node0), signed_distance(segment_node1) };
//
// Above and below the plane
// or One end in plane and the other above the plane
Expand Down
81 changes: 61 additions & 20 deletions packages/stk/stk_mesh/stk_mesh/base/BulkData.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -57,6 +57,7 @@
#include "stk_mesh/baseImpl/Partition.hpp"
#include "stk_topology/topology.hpp" // for topology, etc
#include "stk_util/diag/StringUtil.hpp"
#include "stk_util/environment/RuntimeWarning.hpp"
#include "stk_util/parallel/Parallel.hpp" // for ParallelMachine, etc
#include "stk_util/util/NamedPair.hpp"
#include "stk_util/util/PairIter.hpp" // for PairIter
Expand Down Expand Up @@ -5345,29 +5346,30 @@ void BulkData::internal_propagate_induced_part_changes_to_downward_connected_ent

parts_to_actually_remove.clear();

const bool remote_changes_needed = !( parallel_size() == 1 || !bucket(e_to).shared() );
if (remote_changes_needed)
if(!parts_to_remove_assuming_not_induced_from_other_entities.empty())
{
Bucket *bucket_old = bucket_ptr(e_to);
if ( !m_meshModification.did_any_shared_entity_change_parts() && bucket_old && (bucket_old->shared() || this->in_send_ghost(entity) || this->in_receive_ghost(entity) ))
{
m_meshModification.set_shared_entity_changed_parts();
}

// Don't remove parts until modification_end to avoid losing field data with bucket churn.
mark_entity_and_upward_related_entities_as_modified(e_to);
scratchSpace.clear();
internal_insert_all_parts_induced_from_higher_rank_entities_to_vector(entity,
e_to,
scratchSpace);
internal_fill_parts_to_actually_remove(parts_to_remove_assuming_not_induced_from_other_entities,
scratchSpace,
parts_to_actually_remove);
}
else

if (!parts_to_actually_remove.empty())
{
if(!parts_to_remove_assuming_not_induced_from_other_entities.empty())
const bool remote_changes_needed = !( parallel_size() == 1 || !bucket(e_to).shared() );
if (remote_changes_needed)
{
scratchSpace.clear();
internal_insert_all_parts_induced_from_higher_rank_entities_to_vector(entity,
e_to,
scratchSpace);
internal_fill_parts_to_actually_remove(parts_to_remove_assuming_not_induced_from_other_entities,
scratchSpace,
parts_to_actually_remove);
Bucket *bucket_old = bucket_ptr(e_to);
if (bucket_old && (bucket_old->shared() || this->in_send_ghost(entity) || this->in_receive_ghost(entity) ))
{
m_meshModification.set_shared_entity_changed_parts();
// Don't remove parts until modification_end to avoid losing field data with bucket churn.
parts_to_actually_remove.clear();
mark_entity_and_upward_related_entities_as_modified(e_to);
}
}
}
m_modSummary.track_induced_parts(entity, e_to, addParts, parts_to_actually_remove);
Expand Down Expand Up @@ -6138,9 +6140,48 @@ bool BulkData::does_sideset_exist(const stk::mesh::Part &part) const
return m_sideSetData.does_sideset_exist(part);
}

namespace {
bool part_is_connected_to_shell_block(const BulkData& bulk, const stk::mesh::Part &part)
{
bool connected = false;
const MetaData& meta = bulk.mesh_meta_data();
std::vector<const stk::mesh::Part*> touchingBlocks = meta.get_blocks_touching_surface(&part);

for(const stk::mesh::Part* touchingBlock : touchingBlocks) {
connected |= meta.get_topology(*touchingBlock).is_shell();
}
return connected;
}

void check_sideset_part_constraints(const BulkData& bulk, const stk::mesh::Part &part)
{
const MetaData& meta = bulk.mesh_meta_data();
if(part.primary_entity_rank() != meta.side_rank() && !part_is_connected_to_shell_block(bulk, part))
stk::RuntimeWarning() << "create_sideset: part " << part.name()
<< " has rank " << part.primary_entity_rank();
if((part.id() == stk::mesh::Part::INVALID_ID) && (part.name() != "universal_sideset"))
stk::RuntimeWarning() << "create_sideset: part " << part.name()
<< " has invalid id ";

for(const stk::mesh::Part* subsetPart : part.subsets()) {
if(subsetPart->primary_entity_rank() == meta.side_rank()) {
if(subsetPart->id() != part.id())
stk::RuntimeWarning() << "create_sideset: part " << part.name()
<< " with id " << part.id()
<< "; subset sideblock part " << subsetPart->name()
<< " has different id " << subsetPart->id();
}
}
}
}

SideSet& BulkData::create_sideset(const stk::mesh::Part &part, bool fromInput)
{
return m_sideSetData.create_sideset(part, fromInput);
if(!m_sideSetData.does_sideset_exist(part)) {
check_sideset_part_constraints(*this, part);
}

return m_sideSetData.create_sideset(part, fromInput);
}

const SideSet& BulkData::get_sideset(const stk::mesh::Part &part) const
Expand Down
16 changes: 16 additions & 0 deletions packages/stk/stk_mesh/stk_mesh/base/MetaData.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -571,6 +571,22 @@ class MetaData {
return blockParts;
}

std::vector<const stk::mesh::Part*> get_surfaces_touched_by_block(const stk::mesh::Part* block) const
{
std::vector<const stk::mesh::Part*> surfaceParts;

SurfaceBlockMap::const_iterator iter = m_surfaceToBlock.begin();
for(; iter != m_surfaceToBlock.end(); ++iter) {

if(std::binary_search(iter->second.begin(), iter->second.end(), block->mesh_meta_data_ordinal()))
{
const stk::mesh::Part* part = this->get_parts()[iter->first];
surfaceParts.push_back(part);
}
}
return surfaceParts;
}

size_t count_blocks_touching_surface(const stk::mesh::Part* surface) const
{
size_t numBlocks = 0;
Expand Down
15 changes: 12 additions & 3 deletions packages/stk/stk_mesh/stk_mesh/base/SideSetEntry.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -36,9 +36,9 @@ namespace mesh
ThrowRequireMsg(m_bulk.entity_rank(entry.element) == stk::topology::ELEMENT_RANK,
"ERROR, stk::mesh::SideSet::add only allows element-rank entities.");

bool modified = stk::util::insert_keep_sorted_and_unique(entry, m_data);
m_isModified |= modified;
return modified;
bool modified = stk::util::insert_keep_sorted_and_unique(entry, m_data);
m_isModified |= modified;
return modified;
}

bool SideSet::add(Entity element, ConnectivityOrdinal side)
Expand Down Expand Up @@ -122,5 +122,14 @@ namespace mesh
return m_part;
}

void SideSet::set_accept_all_internal_non_coincident_entries(bool flag)
{
m_acceptAllInternalNonCoincidentEntries = flag;
}

bool SideSet::get_accept_all_internal_non_coincident_entries() const
{
return m_acceptAllInternalNonCoincidentEntries;
}
}
}
Loading

0 comments on commit d9299d4

Please sign in to comment.