Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merge trilinos/develop into e3sm-project/develop #103

Merged
merged 10 commits into from
Feb 23, 2024
Merged
6 changes: 3 additions & 3 deletions cmake/SimpleTesting/cmake/ctest-cdash-setup.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -65,14 +65,14 @@ endif()

# Optionally upload the config files
# TODO: Note how this works / what it's doing in CMake-land.
message(">>> Write `configure_command_file`:")
message(">>> Write `configure_command_file` and `genconfig_build_name_file`:")
if(skip_upload_config_files)
message(">>> - SKIPPED")
else()
message(">>> - WRITTEN")
#message(">>> - configure_command_file : ${configure_command_file}")
#message(">>> - CTEST_CONFIGURE_COMMAND: ${CTEST_CONFIGURE_COMMAND}")
file(WRITE ${configure_command_file} ${CTEST_CONFIGURE_COMMAND})
file(WRITE ${genconfig_build_name_file} $ENV{GENCONFIG_BUILD_NAME})

endif()
message(">>>")

Expand Down
1 change: 1 addition & 0 deletions cmake/SimpleTesting/cmake/ctest-common.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -158,6 +158,7 @@ set(CTEST_BUILD_FLAGS "-j${PARALLEL_LEVEL} -k 0")
# * REQUIRES `CTEST_BINARY_DIRECTORY` to be set.
if(NOT skip_upload_config_files)
set(configure_command_file ${CTEST_BINARY_DIRECTORY}/configure_command.txt)
set(genconfig_build_name_file ${CTEST_BINARY_DIRECTORY}/genconfig_build_name.txt)
endif()


Expand Down
11 changes: 9 additions & 2 deletions cmake/SimpleTesting/cmake/ctest-functions.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -82,8 +82,14 @@ macro(submit_upload_config_files)
if( NOT (skip_single_submit AND skip_by_parts_submit) )
message(">>> ctest_upload(FILES ${configure_command_file}")
message(" ${configure_file}")
message(" ${package_enables_file} )")
ctest_upload(FILES ${configure_command_file} ${configure_file} ${package_enables_file})
message(" ${package_enables_file}")
message(" ${genconfig_build_name_file})")

ctest_upload(FILES ${configure_command_file}
${configure_file}
${package_enables_file}
${genconfig_build_name_file})

message(">>> ctest_submit(PARTS upload")
message(" RETRY_COUNT ${ctest_submit_retry_count}")
message(" RETRY_DELAY ${ctest_submit_retry_delay}")
Expand Down Expand Up @@ -127,6 +133,7 @@ macro(print_options_list)
message(">>> subproject_count = ${subproject_count}")
message(">>> dashboard_model = ${dashboard_model}")
message(">>> dashboard_track = ${dashboard_track}")
message(">>> genconfig_build_name_file= ${genconfig_build_name_file}")
message(">>> configure_command_file = ${configure_command_file}")
message(">>> configure_file = ${configure_file}")
message(">>> build_root = ${build_root}")
Expand Down
1 change: 1 addition & 0 deletions packages/framework/pr_tools/PullRequestLinuxDriver.sh
Original file line number Diff line number Diff line change
Expand Up @@ -210,6 +210,7 @@ test_cmd_options=(
--build-dir=${TRILINOS_BUILD_DIR:?}
--ctest-driver=${WORKSPACE:?}/Trilinos/cmake/SimpleTesting/cmake/ctest-driver.cmake
--ctest-drop-site=${TRILINOS_CTEST_DROP_SITE:?}
--dashboard-build-name=${DASHBOARD_BUILD_NAME}
)

if [[ ${on_kokkos_develop} == "1" ]]
Expand Down
8 changes: 8 additions & 0 deletions packages/framework/pr_tools/PullRequestLinuxDriverTest.py
Original file line number Diff line number Diff line change
Expand Up @@ -109,6 +109,13 @@ def parse_args():
help='The Jenkins build number',
required=True)

optional.add_argument('--dashboard-build-name',
dest="dashboard_build_name",
action='store',
default="UNKNOWN",
help='The build name posted by ctest to a dashboard',
required=False)

optional.add_argument('--source-dir',
dest="source_dir",
action='store',
Expand Down Expand Up @@ -280,6 +287,7 @@ def parse_args():
print("| - [O] test-mode : {test_mode}".format(**vars(arguments)))
print("| - [O] workspace-dir : {workspace_dir}".format(**vars(arguments)))
print("| - [O] extra_configure_args : {extra_configure_args}".format(**vars(arguments)))
print("| - [O] dashboard_build_name : {dashboard_build_name}".format(**vars(arguments)))
#print("| - [O] : {}".format(**vars(arguments)))
print("+" + "="*78 + "+")

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,8 @@ class TrilinosPRConfigurationBase(object):
arg_pr_config_file: The config.ini file that specifies the configuration to load.
arg_pr_jenkins_job_name: The Jenkins Job Name.
arg_ccache_enable: Enable ccache.
arg_dashboard_build_name: A shortened genconfig build name
for posting to a testing dashboard.
filename_subprojects: The subprojects file.
working_directory_ctest: Gen. working dir where TFW_testing_single_configure_prototype
is executed from.
Expand Down Expand Up @@ -299,6 +301,14 @@ def arg_pr_genconfig_job_name(self):
"""
return self.args.genconfig_build_name

@property
def arg_dashboard_build_name(self):
"""
The simplified genconfig build name containing only the
special attributes of the full build name.
Default is to use the value in args.dashboard_build_name.
"""
return self.args.dashboard_build_name

@property
def arg_filename_subprojects(self):
Expand Down Expand Up @@ -474,6 +484,8 @@ def pullrequest_build_name(self):
"""
if self.arg_pullrequest_cdash_track == "Pull Request":
output = "PR-{}-test-{}-{}".format(self.arg_pullrequest_number, self.arg_pr_genconfig_job_name, self.arg_jenkins_job_number)
elif self.arg_pullrequest_cdash_track == "Nightly":
output = self.arg_dashboard_build_name
else:
output = self.arg_pr_genconfig_job_name
return output
Expand Down Expand Up @@ -698,6 +710,7 @@ def prepare_test(self):
self.message("--- arg_pr_gen_config_file = {}".format(self.arg_pr_gen_config_file))
self.message("--- arg_pr_jenkins_job_name = {}".format(self.arg_pr_jenkins_job_name))
self.message("--- arg_pr_genconfig_job_name = {}".format(self.arg_pr_genconfig_job_name))
self.message("--- arg_dashboard_build_name = {}".format(self.arg_dashboard_build_name))
self.message("--- arg_pullrequest_number = {}".format(self.arg_pullrequest_number))
self.message("--- arg_pullrequest_cdash_track = {}".format(self.arg_pullrequest_cdash_track))
self.message("--- arg_req_mem_per_core = {}".format(self.arg_req_mem_per_core))
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -212,6 +212,7 @@ def dummy_args(self):
target_branch_name="develop",
pullrequest_build_name="Trilinos-pullrequest-gcc-7.2.0",
genconfig_build_name="rhel7_sems-gnu-7.2.0-openmpi-1.10.1-openmp_release_static_no-kokkos-arch_no-asan_no-complex_no-fpic_mpi_no-pt_no-rdc_no-package-enables",
dashboard_build_name="gnu-7.2.0-openmpi-1.10.1_release_static_openmp",
jenkins_job_number=99,
pullrequest_number='0000',
pullrequest_cdash_track="Pull Request",
Expand Down Expand Up @@ -266,6 +267,12 @@ def dummy_args_non_pr_track(self):
return args


def dummy_args_nightly_track(self):
args = copy.deepcopy(self.dummy_args())
args.pullrequest_cdash_track = "Nightly"
return args


def dummy_args_master_pass(self):
"""
Modify arguments to test a develop->master with a valid
Expand Down Expand Up @@ -357,6 +364,14 @@ def test_TrilinosPRConfigurationBaseBuildNameNonPRTrack(self):
self.assertEqual(build_name, expected_build_name)


def test_TrilinosPRConfigurationBaseBuildNameNightlyTrack(self):
args = self.dummy_args_nightly_track()
pr_config = trilinosprhelpers.TrilinosPRConfigurationBase(args)
build_name = pr_config.pullrequest_build_name
expected_build_name = args.dashboard_build_name
self.assertEqual(build_name, expected_build_name)


def test_TrilinosPRConfigurationBaseDashboardModelPRTrack(self):
args = self.dummy_args()
pr_config = trilinosprhelpers.TrilinosPRConfigurationBase(args)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -155,6 +155,7 @@ def dummy_args(self):
target_branch_name="develop",
pullrequest_build_name="Trilinos-pullrequest-gcc-8.3.0-installation-testing",
genconfig_build_name="rhel7_sems-gnu-8.3.0-openmpi-1.10.1-openmp_release-debug_static_no-kokkos-arch_no-asan_no-complex_no-fpic_mpi_no-pt_no-rdc_trilinos-pr",
dashboard_build_name="gnu-7.2.0-openmpi-1.10.1_release-debug_shared_openmp",
pullrequest_cdash_track="Pull Request",
jenkins_job_number=99,
pullrequest_number='0000',
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -152,6 +152,7 @@ def dummy_args(self):
target_branch_name="develop",
pullrequest_build_name="Trilinos-pullrequest-gcc-7.2.0",
genconfig_build_name="rhel7_sems-gnu-7.2.0-openmpi-1.10.1-openmp_release-debug_shared_no-kokkos-arch_no-asan_no-complex_no-fpic_mpi_no-pt_no-rdc_trilinos-pr",
dashboard_build_name="gnu-7.2.0-openmpi-1.10.1_release-debug_shared_openmp",
pullrequest_cdash_track="Pull Request",
jenkins_job_number=99,
pullrequest_number='0000',
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -67,6 +67,7 @@ def setUp(self):
target_branch_name='real_trash',
pullrequest_build_name='Some_odd_compiler',
genconfig_build_name='Some_odd_compiler_and_options',
dashboard_build_name='UNKNOWN',
pullrequest_number='4242',
jenkins_job_number='2424',
source_dir='UNKNOWN',
Expand Down Expand Up @@ -121,6 +122,7 @@ def setUp(self):
--genconfig-build-name GENCONFIG_BUILD_NAME
--pullrequest-number PULLREQUEST_NUMBER
--jenkins-job-number JENKINS_JOB_NUMBER
[--dashboard-build-name DASHBOARD_BUILD_NAME]
[--source-dir SOURCE_DIR] [--build-dir BUILD_DIR]
[--use-explicit-cachefile] [--ctest-driver CTEST_DRIVER]
[--ctest-drop-site CTEST_DROP_SITE]
Expand Down Expand Up @@ -159,6 +161,8 @@ def setUp(self):
The Jenkins build number

Optional Arguments:
--dashboard-build-name DASHBOARD_BUILD_NAME
The build name posted by ctest to a dashboard
--source-dir SOURCE_DIR
Directory containing the source code to compile/test.
--build-dir BUILD_DIR
Expand Down Expand Up @@ -227,6 +231,7 @@ def setUp(self):
--genconfig-build-name GENCONFIG_BUILD_NAME
--pullrequest-number PULLREQUEST_NUMBER
--jenkins-job-number JENKINS_JOB_NUMBER
[--dashboard-build-name DASHBOARD_BUILD_NAME]
[--source-dir SOURCE_DIR] [--build-dir BUILD_DIR]
[--use-explicit-cachefile] [--ctest-driver CTEST_DRIVER]
[--ctest-drop-site CTEST_DROP_SITE]
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -37,12 +37,12 @@ class HierarchicalOperator : public TpetraOperator<Scalar, LocalOrdinal, GlobalO
const Teuchos::RCP<Teuchos::ParameterList>& params = Teuchos::null);

//! Returns the Tpetra::Map object associated with the domain of this operator.
Teuchos::RCP<const map_type> getDomainMap() const {
const Teuchos::RCP<const map_type> getDomainMap() const {
return toXpetra(op_->getDomainMap());
}

//! Returns the Tpetra::Map object associated with the range of this operator.
Teuchos::RCP<const map_type> getRangeMap() const {
const Teuchos::RCP<const map_type> getRangeMap() const {
return toXpetra(op_->getRangeMap());
}

Expand Down
8 changes: 4 additions & 4 deletions packages/muelu/research/graham/mf_example_01.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -268,10 +268,10 @@ class TridiagonalOperator : public Xpetra::Operator<Scalar, LocalOrdinal, Global
}

//! Returns the Xpetra::Map object associated with the domain of this operator.
Teuchos::RCP<const map_type> getDomainMap() const { return opMap_; }
const Teuchos::RCP<const map_type> getDomainMap() const { return opMap_; }

//! Returns the Xpetra::Map object associated with the range of this operator.
Teuchos::RCP<const map_type> getRangeMap() const { return opMap_; }
const Teuchos::RCP<const map_type> getRangeMap() const { return opMap_; }

//! Indicates whether this operator supports applying the adjoint operator.
bool hasTransposeApply() const { return true; }
Expand Down Expand Up @@ -405,10 +405,10 @@ class MFProlongatorOperator : public Xpetra::Operator<Scalar, LocalOrdinal, Glob
}

//! Returns the Xpetra::Map object associated with the domain of this operator.
Teuchos::RCP<const map_type> getDomainMap() const { return domainMap_; }
const Teuchos::RCP<const map_type> getDomainMap() const { return domainMap_; }

//! Returns the Xpetra::Map object associated with the range of this operator.
Teuchos::RCP<const map_type> getRangeMap() const { return rangeMap_; }
const Teuchos::RCP<const map_type> getRangeMap() const { return rangeMap_; }

//! Indicates whether this operator supports applying the adjoint operator.
bool hasTransposeApply() const { return true; }
Expand Down
7 changes: 5 additions & 2 deletions packages/muelu/src/Utils/MueLu_UtilitiesBase_def.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -200,8 +200,8 @@ UtilitiesBase<Scalar, LocalOrdinal, GlobalOrdinal, Node>::
const CrsMatrixWrap* crsOp = dynamic_cast<const CrsMatrixWrap*>(&A);
if ((crsOp != NULL) && (rowMap->lib() == Xpetra::UseTpetra)) {
using local_vector_type = typename Vector::dual_view_type::t_dev_um;
using execution_space = typename local_vector_type::execution_space;
Kokkos::View<size_t*, execution_space> offsets("offsets", rowMap->getLocalNumElements());
using device_type = typename CrsGraph::device_type;
Kokkos::View<size_t*, device_type> offsets("offsets", rowMap->getLocalNumElements());
crsOp->getCrsGraph()->getLocalDiagOffsets(offsets);
crsOp->getCrsMatrix()->getLocalDiagCopy(*diag, offsets);
} else {
Expand Down Expand Up @@ -1012,6 +1012,9 @@ DetectDirichletRows_kokkos(const Xpetra::Matrix<SC, LO, GO, NO>& A,
Kokkos::deep_copy(boundaryNodes2, boundaryNodes);
return boundaryNodes2;
}
// CAG: No idea why this is needed to avoid "warning: missing return statement at end of non-void function"
Kokkos::View<bool*, memory_space> dummy("dummy", 0);
return dummy;
}

template <class SC, class LO, class GO, class NO>
Expand Down
11 changes: 6 additions & 5 deletions packages/muelu/test/interface/CreateOperator.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -185,11 +185,11 @@ void run_sed(const std::string& pattern, const std::string& baseFile) {
#ifdef __APPLE__
sed_pref = sed_pref + "\"\" ";
#endif

int ret_val = 0;
(void)ret_val; // suppress fscanf return value and unused variable warnings
ret_val = system((sed_pref + pattern + " " + baseFile + ".gold_filtered").c_str());
ret_val = system((sed_pref + pattern + " " + baseFile + ".gold_filtered").c_str());
TEUCHOS_ASSERT_EQUALITY(ret_val, 0);
ret_val = system((sed_pref + pattern + " " + baseFile + ".out_filtered").c_str());
TEUCHOS_ASSERT_EQUALITY(ret_val, 0);
}

bool compare_to_gold(int myRank, const std::string& baseFile) {
Expand All @@ -198,9 +198,10 @@ bool compare_to_gold(int myRank, const std::string& baseFile) {
// Create a copy of outputs
std::string cmd = "cp -f ";
int ret_val = 0;
(void)ret_val; // suppress fscanf return value and unused variable warnings
ret_val = system((cmd + baseFile + ".gold " + baseFile + ".gold_filtered").c_str());
ret_val = system((cmd + baseFile + ".gold " + baseFile + ".gold_filtered").c_str());
TEUCHOS_ASSERT_EQUALITY(ret_val, 0);
ret_val = system((cmd + baseFile + ".out " + baseFile + ".out_filtered").c_str());
TEUCHOS_ASSERT_EQUALITY(ret_val, 0);

// Tpetra produces different eigenvalues in Chebyshev due to using
// std::rand() for generating random vectors, which may be initialized
Expand Down
6 changes: 3 additions & 3 deletions packages/muelu/test/scaling/MatrixLoad.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -290,7 +290,7 @@ void readUserBlks(const std::string& userBlkFileName, const std::string& smoothe
if (mueluList.sublist(smootherOrCoarse + ": params").sublist("subdomain solver parameters").get<std::string>("partitioner: type") == "user") {
FILE* fp;
int retVal;
int nBlks, nRows, nnzs, ch, row, col;
int nBlks, nRows, nnzs, row, col;
int procId = comm->getRank();
double val;

Expand All @@ -301,7 +301,7 @@ void readUserBlks(const std::string& userBlkFileName, const std::string& smoothe
fp = fopen(&userBlkFileName[0], "r");
TEUCHOS_TEST_FOR_EXCEPTION(fp == NULL, std::runtime_error, userBlkFileName + " file not found");

while ((ch = getc(fp) != '\n'))
while ((getc(fp) != '\n'))
; // read first line

retVal = fscanf(fp, "%d %d %d\n", &nBlks, &nRows, &nnzs);
Expand Down Expand Up @@ -367,7 +367,7 @@ void readUserBlks(const std::string& userBlkFileName, const std::string& smoothe
fp = fopen(&userBlkFileName[0], "r");
TEUCHOS_TEST_FOR_EXCEPTION(fp == NULL, std::runtime_error, userBlkFileName + " file not found");

while ((ch = getc(fp) != '\n'))
while ((getc(fp) != '\n'))
;

retVal = fscanf(fp, "%d %d %d\n", &nBlks, &nRows, &nnzs);
Expand Down
Loading