Skip to content

Commit

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

* trilinos-develop:
  ATDM/cee-rhel6: gnu-7.2.0_openmpi-4.0.2 -> gnu-7.2.0_openmpi-4.0.3 (ATDV-353)
  Sacado:  The dreaded "const-lambda-capture" gcc compiler bug strikes again!
  tpetra:  fixed two picky compiler errors (signed vs unsigned)
  Sacado:  Add specializations for ScalarValue, Value for const types.
  Sacado:  rework mat-vec and advection performance tests.
  Sacado:  Fix performance bug with hierarchical-dfad enabled.
  Fixed typo
  tpetra:  Adding a test that doesn't use row-based matrix distribution
  • Loading branch information
Jenkins Pipeline committed May 21, 2020
2 parents 557c5ec + 1aaaa05 commit cd0d4eb
Show file tree
Hide file tree
Showing 39 changed files with 5,905 additions and 37 deletions.
2 changes: 1 addition & 1 deletion cmake/std/atdm/cee-rhel6/all_supported_builds.sh
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ export ATDM_CONFIG_CTEST_S_BUILD_NAME_PREFIX=Trilinos-atdm-
export ATDM_CONFIG_ALL_SUPPORTED_BUILDS=(
#cee-rhel6_clang-9.0.1_openmpi-4.0.3_serial_static_dbg # SPARC has installs with this build
cee-rhel6_clang-9.0.1_openmpi-4.0.3_serial_static_opt # SPARC CI build
cee-rhel6_gnu-7.2.0_openmpi-4.0.2_serial_shared_opt # SPARC CI build
cee-rhel6_gnu-7.2.0_openmpi-4.0.3_serial_shared_opt # SPARC CI build
cee-rhel6_intel-18.0.2_mpich2-3.2_openmp_static_opt # SPARC CI build
cee-rhel6_intel-19.0.3_intelmpi-2018.4_serial_static_opt # SPARC Nightly bulid
)
Expand Down
8 changes: 4 additions & 4 deletions cmake/std/atdm/cee-rhel6/custom_builds.sh
Original file line number Diff line number Diff line change
Expand Up @@ -20,13 +20,13 @@ if atdm_match_any_buildname_keyword \
# correct matching of of defaults

elif atdm_match_any_buildname_keyword \
gnu-7.2.0-openmpi-4.0.2 \
gnu-7.2.0_openmpi-4.0.2 \
gnu-7.2.0-openmpi-4.0.3 \
gnu-7.2.0_openmpi-4.0.3 \
gnu-7.2.0 \
gnu-7 \
gnu \
; then
export ATDM_CONFIG_COMPILER=GNU-7.2.0_OPENMPI-4.0.2
export ATDM_CONFIG_COMPILER=GNU-7.2.0_OPENMPI-4.0.3
# List default "gnu"* build last of all the 'gnu' builds for correct
# matching of defaults

Expand Down Expand Up @@ -57,7 +57,7 @@ else
echo "*** Supported compilers include:"
echo "***"
echo "**** clang-9.0.1-openmpi-4.0.3 (default, default clang)"
echo "**** gnu-7.2.0-openmpi-4.0.2 (default gnu)"
echo "**** gnu-7.2.0-openmpi-4.0.3 (default gnu)"
echo "**** intel-18.0.2-mpich2-3.2"
echo "**** intel-19.0.3-intelmpi-2018.4 (default intel)"
echo "***"
Expand Down
10 changes: 5 additions & 5 deletions cmake/std/atdm/cee-rhel6/custom_builds_unit_tests.sh
Original file line number Diff line number Diff line change
Expand Up @@ -42,23 +42,23 @@ testAll() {

ATDM_CONFIG_BUILD_NAME=before_gnu-7.2.0-openmpi-4.0.3-after
. ${ATDM_CONFIG_SCRIPT_DIR}/utils/set_build_options.sh
${_ASSERT_EQUALS_} ${ATDM_CONFIG_COMPILER} GNU-7.2.0_OPENMPI-4.0.2
${_ASSERT_EQUALS_} ${ATDM_CONFIG_COMPILER} GNU-7.2.0_OPENMPI-4.0.3

ATDM_CONFIG_BUILD_NAME=before_gnu-7.2.0_openmpi-4.0.3-after
. ${ATDM_CONFIG_SCRIPT_DIR}/utils/set_build_options.sh
${_ASSERT_EQUALS_} ${ATDM_CONFIG_COMPILER} GNU-7.2.0_OPENMPI-4.0.2
${_ASSERT_EQUALS_} ${ATDM_CONFIG_COMPILER} GNU-7.2.0_OPENMPI-4.0.3

ATDM_CONFIG_BUILD_NAME=before_gnu-7.2.0-after
. ${ATDM_CONFIG_SCRIPT_DIR}/utils/set_build_options.sh
${_ASSERT_EQUALS_} ${ATDM_CONFIG_COMPILER} GNU-7.2.0_OPENMPI-4.0.2
${_ASSERT_EQUALS_} ${ATDM_CONFIG_COMPILER} GNU-7.2.0_OPENMPI-4.0.3

ATDM_CONFIG_BUILD_NAME=before_gnu-7-after
. ${ATDM_CONFIG_SCRIPT_DIR}/utils/set_build_options.sh
${_ASSERT_EQUALS_} ${ATDM_CONFIG_COMPILER} GNU-7.2.0_OPENMPI-4.0.2
${_ASSERT_EQUALS_} ${ATDM_CONFIG_COMPILER} GNU-7.2.0_OPENMPI-4.0.3

ATDM_CONFIG_BUILD_NAME=before_gnu-after
. ${ATDM_CONFIG_SCRIPT_DIR}/utils/set_build_options.sh
${_ASSERT_EQUALS_} ${ATDM_CONFIG_COMPILER} GNU-7.2.0_OPENMPI-4.0.2
${_ASSERT_EQUALS_} ${ATDM_CONFIG_COMPILER} GNU-7.2.0_OPENMPI-4.0.3

# Check that 'gnus' does not match 'gnu'! (Shows true keyword matching is
# working)
Expand Down
4 changes: 2 additions & 2 deletions cmake/std/atdm/cee-rhel6/environment.sh
Original file line number Diff line number Diff line change
Expand Up @@ -71,8 +71,8 @@ if [[ "$ATDM_CONFIG_COMPILER" == "CLANG-9.0.1_OPENMPI-4.0.3" ]]; then
fi
export ATDM_CONFIG_MKL_ROOT=${CBLAS_ROOT}

elif [[ "$ATDM_CONFIG_COMPILER" == "GNU-7.2.0_OPENMPI-4.0.2" ]] ; then
module load sparc-dev/gcc-7.2.0_openmpi-4.0.2
elif [[ "$ATDM_CONFIG_COMPILER" == "GNU-7.2.0_OPENMPI-4.0.3" ]] ; then
module load sparc-dev/gcc-7.2.0_openmpi-4.0.3
unset OMP_NUM_THREADS # SPARC module sets these and we must unset!
unset OMP_PROC_BIND
unset OMP_PLACES
Expand Down
14 changes: 12 additions & 2 deletions packages/sacado/src/Sacado_Fad_ViewStorage.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -56,6 +56,14 @@ namespace Sacado {

namespace Fad {

#ifndef SACADO_FAD_DERIV_LOOP
#if defined(SACADO_VIEW_CUDA_HIERARCHICAL_DFAD) && !defined(SACADO_DISABLE_CUDA_IN_KOKKOS) && defined(__CUDA_ARCH__)
#define SACADO_FAD_DERIV_LOOP(I,SZ) for (int I=threadIdx.x; I<SZ; I+=blockDim.x)
#else
#define SACADO_FAD_DERIV_LOOP(I,SZ) for (int I=0; I<SZ; ++I)
#endif
#endif

/*!
* \brief Derivative array storage class that is a view into a contiguous
* memory allocation. It does not provide proper value semantics and
Expand Down Expand Up @@ -110,10 +118,12 @@ namespace Sacado {
if (this != &x) {
*val_ = *x.val_;
if (stride_one)
for (int i=0; i<sz_.value; ++i)
//for (int i=0; i<sz_.value; ++i)
SACADO_FAD_DERIV_LOOP(i,sz_.value)
dx_[i] = x.dx_[i];
else
for (int i=0; i<sz_.value; ++i)
//for (int i=0; i<sz_.value; ++i)
SACADO_FAD_DERIV_LOOP(i,sz_.value)
dx_[i*stride_.value] = x.dx_[i*x.stride_.value];
}
return *this;
Expand Down
18 changes: 18 additions & 0 deletions packages/sacado/src/Sacado_Traits.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -365,6 +365,15 @@ namespace Sacado {
static const T& eval(const T& x) { return x; }
};

//! Specialization of Value for const types
template <typename T> struct Value<const T> {
typedef typename ValueType<T>::type value_type;
KOKKOS_INLINE_FUNCTION
static const value_type& eval(const T& x) {
return Value<T>::eval(x);
}
};

//! Base template specification for %ScalarValue
/*!
* The %ScalarValue functor returns the base scalar value of an AD type,
Expand All @@ -375,6 +384,15 @@ namespace Sacado {
static const T& eval(const T& x) { return x; }
};

//! Specialization of ScalarValue for const types
template <typename T> struct ScalarValue<const T> {
typedef typename ScalarType<T>::type scalar_type;
KOKKOS_INLINE_FUNCTION
static const scalar_type& eval(const T& x) {
return ScalarValue<T>::eval(x);
}
};

//! Base template specification for marking constants
template <typename T> struct MarkConstant {
KOKKOS_INLINE_FUNCTION
Expand Down
14 changes: 12 additions & 2 deletions packages/sacado/src/new_design/Sacado_Fad_Exp_ViewStorage.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,14 @@ namespace Sacado {
namespace Fad {
namespace Exp {

#ifndef SACADO_FAD_DERIV_LOOP
#if defined(SACADO_VIEW_CUDA_HIERARCHICAL_DFAD) && !defined(SACADO_DISABLE_CUDA_IN_KOKKOS) && defined(__CUDA_ARCH__)
#define SACADO_FAD_DERIV_LOOP(I,SZ) for (int I=threadIdx.x; I<SZ; I+=blockDim.x)
#else
#define SACADO_FAD_DERIV_LOOP(I,SZ) for (int I=0; I<SZ; ++I)
#endif
#endif

// Class representing a pointer to ViewFad so that &ViewFad is supported
template <typename T, unsigned sl, unsigned ss, typename U>
class ViewFadPtr;
Expand Down Expand Up @@ -118,10 +126,12 @@ namespace Sacado {
reinterpret_cast<const volatile char&>(x)))) {
*val_ = *x.val_;
if (stride_one)
for (int i=0; i<sz_.value; ++i)
//for (int i=0; i<sz_.value; ++i)
SACADO_FAD_DERIV_LOOP(i,sz_.value)
dx_[i] = x.dx_[i];
else
for (int i=0; i<sz_.value; ++i)
//for (int i=0; i<sz_.value; ++i)
SACADO_FAD_DERIV_LOOP(i,sz_.value)
dx_[i*stride_.value] = x.dx_[i*x.stride_.value];
}
return *this;
Expand Down
47 changes: 26 additions & 21 deletions packages/sacado/test/performance/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -76,29 +76,34 @@ ENDIF()

IF (Sacado_ENABLE_TeuchosCore AND Sacado_ENABLE_KokkosCore)

TRIBITS_ADD_EXECUTABLE(
fad_kokkos_view
SOURCES fad_kokkos_view.cpp
COMM serial mpi
)

# These tests do not compile with gcc 4.7.x because it doesn't properly
# support lambdas. See github issue #854
IF(NOT ((CMAKE_CXX_COMPILER_ID STREQUAL "GNU") AND (CMAKE_CXX_COMPILER_VERSION VERSION_LESS "4.8")))
TRIBITS_ADD_EXECUTABLE(
fad_kokkos_hierarchical
SOURCES fad_kokkos_hierarchical.cpp
COMM serial mpi
)

# TRIBITS_ADD_EXECUTABLE(
# fad_kokkos_mat_vec_perf
# SOURCES fad_kokkos_mat_vec_perf.cpp
# COMM serial mpi
# )
ENDIF()
# Disable these tests as they have been replaced by mat_vec, advection* below

# TRIBITS_ADD_EXECUTABLE(
# fad_kokkos_view
# SOURCES fad_kokkos_view.cpp
# COMM serial mpi
# )

# # These tests do not compile with gcc 4.7.x because it doesn't properly
# # support lambdas. See github issue #854
# IF(NOT ((CMAKE_CXX_COMPILER_ID STREQUAL "GNU") AND (CMAKE_CXX_COMPILER_VERSION VERSION_LESS "4.8")))
# TRIBITS_ADD_EXECUTABLE(
# fad_kokkos_hierarchical
# SOURCES fad_kokkos_hierarchical.cpp
# COMM serial mpi
# )

# TRIBITS_ADD_EXECUTABLE(
# fad_kokkos_mat_vec_perf
# SOURCES fad_kokkos_mat_vec_perf.cpp
# COMM serial mpi
# )
# ENDIF()

ENDIF()

ADD_SUBDIRECTORY(fenl_assembly)
ADD_SUBDIRECTORY(fenl_assembly_view)
ADD_SUBDIRECTORY(mat_vec)
ADD_SUBDIRECTORY(advection)
ADD_SUBDIRECTORY(advection_const_basis)
22 changes: 22 additions & 0 deletions packages/sacado/test/performance/advection/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
ASSERT_DEFINED(PACKAGE_SOURCE_DIR CMAKE_CURRENT_SOURCE_DIR)

INCLUDE_DIRECTORIES(REQUIRED_DURING_INSTALLATION_TESTING ${CMAKE_CURRENT_SOURCE_DIR})
INCLUDE_DIRECTORIES(${CMAKE_CURRENT_BINARY_DIR})

IF (Sacado_ENABLE_KokkosCore AND Sacado_ENABLE_TeuchosCore)

IF(NOT ((CMAKE_CXX_COMPILER_ID STREQUAL "GNU") AND (CMAKE_CXX_COMPILER_VERSION VERSION_LESS "4.8")))

TRIBITS_ADD_EXECUTABLE(
FadAdvectionHierarchicalTest
SOURCES common.hpp
advection.hpp advection.cpp
advection_hierarchical.hpp advection_hierarchical.cpp
advection_hierarchical_dfad.hpp advection_hierarchical_dfad.cpp
driver.cpp
COMM serial mpi
)

ENDIF()

ENDIF()
Loading

0 comments on commit cd0d4eb

Please sign in to comment.