Skip to content

Commit

Permalink
Flesh out sitename detection; change isPPC variable to isATS2 to bett…
Browse files Browse the repository at this point in the history
…er capture machine-to-machine differences in omp+gcc
  • Loading branch information
Kendra Phyllis Long - 308640 committed Aug 30, 2022
1 parent b264e86 commit 4379057
Show file tree
Hide file tree
Showing 5 changed files with 23 additions and 20 deletions.
10 changes: 9 additions & 1 deletion config/platform_checks.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -59,6 +59,15 @@ function(dbs_set_sitename)
elseif(${SITENAME} MATCHES "tt")
set(SITENAME "Trinitite")
set(SITENAME_FAMILY "ATS-1")
elseif(${SITENAME} MATCHES "cn")
set(SITENAME "Darwin")
set(SITENAME_FAMILY "None")
elseif(${SITENAME} MATCHES "sierra")
set(SITENAME "Sierra")
set(SITENAME_FAMILY "ATS-2")
elseif(${SITENAME} MATCHES "rzansel")
set(SITENAME "RZAnsel")
set(SITENAME_FAMILY "ATS-2")
endif()
set(SITENAME
${SITENAME}
Expand All @@ -73,7 +82,6 @@ message("
Platform Checks...
")
dbs_set_sitename()

# ------------------------------------------------------------------------------------------------ #
# Determine System Type and System Names
#
Expand Down
17 changes: 8 additions & 9 deletions src/c4/bin/xthi.cc
Original file line number Diff line number Diff line change
Expand Up @@ -20,21 +20,20 @@ int main(int argc, char *argv[]) {
std::string const hostname = rtt_dsxx::draco_gethostname();
unsigned const num_cpus = omp_get_num_procs();

#if defined(__GNUC__) && __GNUC__ == 8 && __GNUC_MINOR__ == 3 && __GNUC_PATCHLEVEL__ == 1
// gcc-8.3.1 complains about normal syntax. power9 and x86_64 have different requirements.
#ifdef draco_isPPC
// KPL: See https://gcc.gnu.org/gcc-9/porting_to.html#ompdatasharing for info on the following
// version-specific gcc macro.
#if defined(__GNUC__) && __GNUC__ < 9
// gcc-8.X complains about normal syntax. ATS-2 requires different code from all the other
// machines - these systems must handle const strings differently.
#ifdef draco_isATS2
// rzansel/sierra
#pragma omp parallel default(none) shared(hostname, std::cout)
#else
// ccs-net with gcc-8.3.1 (RHEL 8)
// e.g. ccs-net with gcc-8.3.1 (RHEL 8) / darwin p9 with gcc-8.3.0
#pragma omp parallel default(none) shared(std::cout)
#endif

#elif defined(__GNUC__) && __GNUC__ == 8 && __GNUC_MINOR__ == 5 && __GNUC_PATCHLEVEL__ == 0
// ccs-net with gcc-8.5.0 (RHEL 8)
#pragma omp parallel default(none) shared(std::cout)

#else
#else // gcc version >= 9
#pragma omp parallel default(none) shared(num_cpus, hostname, rank, std::cout)
#endif
{
Expand Down
10 changes: 3 additions & 7 deletions src/c4/test/tstOMP.cc
Original file line number Diff line number Diff line change
Expand Up @@ -305,13 +305,9 @@ void MandelbrotDriver(rtt_dsxx::UnitTest &ut) {
}
}

// gcc-8.3.1, 8.4.1 and 8.5.0 complain about the normal syntax since some variables are
// automatically marked as shared.
#if defined(__GNUC__) && __GNUC__ == 8 && __GNUC_MINOR__ == 3 && __GNUC_PATCHLEVEL__ == 1
#pragma omp parallel for ordered schedule(dynamic) default(none) shared(image1)
#elif defined(__GNUC__) && __GNUC__ == 8 && __GNUC_MINOR__ == 4 && __GNUC_PATCHLEVEL__ == 1
#pragma omp parallel for ordered schedule(dynamic) default(none) shared(image1)
#elif defined(__GNUC__) && __GNUC__ == 8 && __GNUC_MINOR__ == 5 && __GNUC_PATCHLEVEL__ == 0
// gcc-8.X complains about the normal syntax since some variables are automatically marked as
// shared.
#if defined(__GNUC__) && __GNUC__ < 9
#pragma omp parallel for ordered schedule(dynamic) default(none) shared(image1)
#else
#pragma omp parallel for ordered schedule(dynamic) default(none) \
Expand Down
4 changes: 2 additions & 2 deletions src/ds++/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -93,8 +93,8 @@ cmake_host_system_information(RESULT HAVE_HARDWARE_SSE2 QUERY HAS_SSE2)
cmake_host_system_information(RESULT HAVE_HARDWARE_SSE_FP QUERY HAS_SSE_FP)
cmake_host_system_information(RESULT HAVE_HARDWARE_SSE_MMX QUERY HAS_SSE_MMX)

if(COMPILED_OS_PLATFORM MATCHES "ppc")
set(draco_isPPC 1)
if(${SITENAME_FAMILY} MATCHES "ATS-2")
set(draco_isATS2 1)
endif()

# Create ds++/config.h
Expand Down
2 changes: 1 addition & 1 deletion src/ds++/config.h.in
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,7 @@
#cmakedefine draco_isPGI
#cmakedefine draco_isKNL
#cmakedefine draco_is64bit
#cmakedefine draco_isPPC
#cmakedefine draco_isATS2
#cmakedefine DRACO_UNAME @DRACO_UNAME@
#cmakedefine HAVE_CUDA @HAVE_CUDA@
#cmakedefine USE_CUDA @USE_CUDA@
Expand Down

0 comments on commit 4379057

Please sign in to comment.