From 71c898c7f9a706864066bd22bfae92a24a618dde Mon Sep 17 00:00:00 2001 From: "Kelly (KT) Thompson" Date: Wed, 15 Sep 2021 09:35:08 -0600 Subject: [PATCH 1/5] Add CUDA flags to draco_info report + Fix a bug in the `draco_info` report that removed leading slashes for compiler paths. + Also wrap the fully qualified path to `mpirun` + Move some names to "prior contributors" section of the author list. + Minor clean-up in cdi files. --- src/cdi/test/tCDI.cc | 9 ++-- src/cdi_ipcress/test/cdi_ipcress_test.hh | 52 ++++++++---------------- src/diagnostics/draco_info.cc | 33 ++++++++++++--- src/diagnostics/draco_info.hh | 30 ++++++++------ src/ds++/Release.cc | 6 +-- src/ds++/config.h.in | 8 +++- src/parser/Abstract_Class_Parser.i.hh | 2 +- src/parser/Contextual_Parse_Functor.hh | 6 +-- 8 files changed, 78 insertions(+), 68 deletions(-) diff --git a/src/cdi/test/tCDI.cc b/src/cdi/test/tCDI.cc index 9a4b14417f..32d2585a8a 100644 --- a/src/cdi/test/tCDI.cc +++ b/src/cdi/test/tCDI.cc @@ -4,7 +4,7 @@ * \author Thomas M. Evans * \date Tue Oct 9 15:52:01 2001 * \brief CDI test executable. - * \note Copyright (C) 2016-2020 Triad National Security, LLC., All rights reserved. */ + * \note Copyright (C) 2010-2021 Triad National Security, LLC., All rights reserved. */ //------------------------------------------------------------------------------------------------// #include "DummyEoS.hh" @@ -1036,10 +1036,9 @@ void test_mgopacity_collapse(rtt_dsxx::UnitTest &ut) { double const opacity_ross_only = CDI::collapseMultigroupOpacitiesRosseland(bounds, mgOpacities, rosseland_only_spectrum); - std::vector emission_group_cdf_ref(bounds.size() - 1); - emission_group_cdf_ref[0] = 0.019244301636310527; - emission_group_cdf_ref[1] = 0.29196935332821244; - emission_group_cdf_ref[2] = 0.30090440514265909; + std::vector emission_group_cdf_ref = {0.019244301636310527, 0.29196935332821244, + 0.30090440514265909}; + Check(emission_group_cdf_ref.size() == 3 && bounds.size() == 4); double const opacity_pl_ref(0.30090440514265909); double const opacity_pl_recip_ref(8.80345577340399); double const opacity_ross_ref(0.0778314764921229); diff --git a/src/cdi_ipcress/test/cdi_ipcress_test.hh b/src/cdi_ipcress/test/cdi_ipcress_test.hh index e6a3baabce..9c6f950160 100644 --- a/src/cdi_ipcress/test/cdi_ipcress_test.hh +++ b/src/cdi_ipcress/test/cdi_ipcress_test.hh @@ -4,8 +4,7 @@ * \author Thomas M. Evans * \date Fri Oct 12 15:36:36 2001 * \brief cdi_ipcress test function headers. - * \note Copyright (C) 2016-2020 Triad National Security, LLC. - * All rights reserved. */ + * \note Copyright (C) 2011-2021 Triad National Security, LLC., All rights reserved. */ //------------------------------------------------------------------------------------------------// #ifndef rtt_cdi_ipcress_test_hh @@ -58,9 +57,8 @@ void testTemperatureGridAccessor(rtt_dsxx::ScalarUnitTest &ut, opacityClassType // Read the temperature grid from the IPCRESS file. std::vector temps = spOpacity->getTemperatureGrid(); - // Verify that the size of the temperature grid looks right. If it is the - // right size then compare the temperature grid data to the data specified - // when we created the IPCRESS file using TOPS. + // Verify that the size of the temperature grid looks right. If it is the right size then compare + // the temperature grid data to the data specified when we created the IPCRESS file using TOPS. if (temps.size() == spOpacity->getNumTemperatures() && temps.size() == 3) { ostringstream message; message << "The number of temperature points found in the data\n\t" @@ -69,10 +67,8 @@ void testTemperatureGridAccessor(rtt_dsxx::ScalarUnitTest &ut, opacityClassType ut.passes(message.str()); // The grid specified by TOPS has 3 temperature points. - std::vector temps_ref(temps.size()); - temps_ref[0] = 0.1; - temps_ref[1] = 1.0; - temps_ref[2] = 10.0; + std::vector temps_ref = {0.1, 1.0, 10.0}; + Check(temps.size() == 3); // Compare the grids. if (rtt_dsxx::soft_equiv(temps, temps_ref)) @@ -105,15 +101,12 @@ void testDensityGridAccessor(rtt_dsxx::ScalarUnitTest &ut, opacityClassType cons if (density.size() == 3 && density.size() == spOpacity->getNumDensities()) { ostringstream message; message << "The number of density points found in the data\n\t" - << "grid matches the number returned by the\n\t" - << "getNumDensities() accessor."; + << "grid matches the number returned by the\n\tgetNumDensities() accessor."; ut.passes(message.str()); // The grid specified by TOPS has 3 density points - std::vector density_ref(density.size()); - density_ref[0] = 0.1; - density_ref[1] = 0.5; - density_ref[2] = 1.0; + std::vector density_ref = {0.1, 0.5, 1.0}; + Check(density.size() == 3); // Compare the grids. if (rtt_dsxx::soft_equiv(density, density_ref)) @@ -125,8 +118,7 @@ void testDensityGridAccessor(rtt_dsxx::ScalarUnitTest &ut, opacityClassType cons message << "The number of density points found in the data\n\t" << "grid does not match the number returned by the\n\t" << "getNumDensities() accessor. \n" - << "Did not test the results returned by\n\t" - << "getDensityGrid()."; + << "Did not test the results returned by\n\tgetDensityGrid()."; ut.failure(message.str()); } } @@ -139,9 +131,9 @@ void testEnergyBoundaryAccessor(rtt_dsxx::ScalarUnitTest &ut, opacityClassType c // Read the grid from the IPCRESS file. std::vector ebounds = spOpacity->getGroupBoundaries(); - // Verify that the size of the group boundary grid looks right. If - // it is the right size then compare the energy groups grid data to - // the data specified when we created the IPCRESS file using TOPS. + // Verify that the size of the group boundary grid looks right. If it is the right size then + // compare the energy groups grid data to the data specified when we created the IPCRESS file + // using TOPS. if (ebounds.size() == 13 && ebounds.size() == spOpacity->getNumGroupBoundaries()) { ostringstream message; message << "The number of energy boundary points found in the data\n\t" @@ -150,20 +142,9 @@ void testEnergyBoundaryAccessor(rtt_dsxx::ScalarUnitTest &ut, opacityClassType c ut.passes(message.str()); // The grid specified by TOPS has 13 energy boundaries. - std::vector ebounds_ref(ebounds.size()); - ebounds_ref[0] = 0.01; - ebounds_ref[1] = 0.03; - ebounds_ref[2] = 0.07; - ebounds_ref[3] = 0.1; - ebounds_ref[4] = 0.3; - ebounds_ref[5] = 0.7; - ebounds_ref[6] = 1.0; - ebounds_ref[7] = 3.0; - ebounds_ref[8] = 7.0; - ebounds_ref[9] = 10.0; - ebounds_ref[10] = 30.0; - ebounds_ref[11] = 70.0; - ebounds_ref[12] = 100.0; + std::vector ebounds_ref = {0.01, 0.03, 0.07, 0.1, 0.3, 0.7, 1.0, + 3.0, 7.0, 10.0, 30.0, 70.0, 100.0}; + Check(ebounds.size() == 13); // Compare the grids. if (rtt_dsxx::soft_equiv(ebounds, ebounds_ref)) @@ -175,8 +156,7 @@ void testEnergyBoundaryAccessor(rtt_dsxx::ScalarUnitTest &ut, opacityClassType c message << "The number of energy boundary points found in the data\n\t" << "grid does not match the number returned by the\n\t" << "get NumGroupBoundaries() accessor. \n" - << "Did not test the results returned by\n\t" - << "getGroupBoundaries()."; + << "Did not test the results returned by\n\tgetGroupBoundaries()."; ut.failure(message.str()); } } diff --git a/src/diagnostics/draco_info.cc b/src/diagnostics/draco_info.cc index 6a567e9102..fee06f015b 100644 --- a/src/diagnostics/draco_info.cc +++ b/src/diagnostics/draco_info.cc @@ -4,7 +4,7 @@ * \author Kelly Thompson * \date Wednesday, Nov 07, 2012, 18:49 pm * \brief Small executable that prints the version and copyright strings. - * \note Copyright (C) 2016-2020 Triad National Security, LLC., All rights reserved. */ + * \note Copyright (C) 2012-2021 Triad National Security, LLC., All rights reserved. */ //------------------------------------------------------------------------------------------------// #include "draco_info.hh" @@ -28,7 +28,7 @@ DracoInfo::DracoInfo() build_type(rtt_dsxx::string_toupper(CBT)), library_type("static"), system_type("Unknown"), site_name("Unknown"), mpirun_cmd(""), diagnostics_level("disabled"), cxx(CMAKE_CXX_COMPILER), cxx_flags(CMAKE_CXX_FLAGS), cc(CMAKE_C_COMPILER), cc_flags(CMAKE_C_FLAGS), fc("none"), - fc_flags("none") { + fc_flags("none"), cuda_compiler("none"), cuda_flags("none") { #ifdef DRACO_SHARED_LIBS library_type = "Shared"; #endif @@ -78,12 +78,23 @@ DracoInfo::DracoInfo() else if (build_type == std::string("DEBUG")) fc_flags += CMAKE_Fortran_FLAGS_DEBUG; #endif +#if defined(__NVCC__) + cuda_compiler = CMAKE_CUDA_COMPILER; + cuda_flags = CMAKE_CUDA_FLAGS; + if (build_type == std::string("RELEASE")) + cuda_flags += CMAKE_CUDA_FLAGS_RELEASE; + else if (build_type == std::string("DEBUG")) + cuda_flags += CMAKE_CUDA_FLAGS_DEBUG; +#endif } //------------------------------------------------------------------------------------------------// void print_text_with_word_wrap(std::string const &longstring, size_t const indent_column, size_t const max_width, std::ostringstream &msg, std::string const &delimiters = " ") { + // Preserve leading slash + if (longstring[0] == '/') + msg << "/"; std::vector const tokens = rtt_dsxx::tokenize(longstring, delimiters); std::string const delimiter(delimiters.substr(0, 1)); size_t i(indent_column); @@ -130,6 +141,8 @@ std::string DracoInfo::fullReport() const { // Build Information //------------------ + size_t constexpr max_width(100); + size_t const hanging_indent(std::string(" CXX Compiler : ").length()); infoMessage << "Build information:" << "\n Build type : " << build_type @@ -139,8 +152,10 @@ std::string DracoInfo::fullReport() const { << "\n CUDA support : " << (cuda ? "enabled" : "disabled") << "\n MPI support : " << (mpi ? "enabled" : "disabled (c4 scalar mode)"); - if (mpi) - infoMessage << "\n mpirun cmd : " << mpirun_cmd; + if (mpi) { + infoMessage << "\n mpirun cmd : "; + print_text_with_word_wrap(mpirun_cmd, hanging_indent, max_width, infoMessage, "/"); + } infoMessage << "\n OpenMP support : " << (openmp ? "enabled" : "disabled") << "\n Design-by-Contract: " << DBC << ", features = "; @@ -151,8 +166,6 @@ std::string DracoInfo::fullReport() const { << "\n Diagnostics Timing: " << (diagnostics_timing ? "enabled" : "disabled"); // Compilers and Flags - size_t const max_width(100); - size_t const hanging_indent(std::string(" CXX Compiler : ").length()); infoMessage << "\n CXX Compiler : "; print_text_with_word_wrap(cxx, hanging_indent, max_width, infoMessage, "/"); infoMessage << "\n CXX_FLAGS : "; @@ -161,10 +174,18 @@ std::string DracoInfo::fullReport() const { print_text_with_word_wrap(cc, hanging_indent, max_width, infoMessage, "/"); infoMessage << "\n C_FLAGS : "; print_text_with_word_wrap(cc_flags, hanging_indent, max_width, infoMessage); +#ifdef CMAKE_Fortran_COMPILER infoMessage << "\n Fortran Compiler : "; print_text_with_word_wrap(fc, hanging_indent, max_width, infoMessage, "/"); infoMessage << "\n Fortran_FLAGS : "; print_text_with_word_wrap(fc_flags, hanging_indent, max_width, infoMessage); +#endif + if (cuda) { + infoMessage << "\n Cuda Compiler : "; + print_text_with_word_wrap(cuda_compiler, hanging_indent, max_width, infoMessage, "/"); + infoMessage << "\n CUDA_FLAGS : "; + print_text_with_word_wrap(cuda_flags, hanging_indent, max_width, infoMessage); + } infoMessage << "\n" << endl; diff --git a/src/diagnostics/draco_info.hh b/src/diagnostics/draco_info.hh index a496bd650d..1210fd25f9 100644 --- a/src/diagnostics/draco_info.hh +++ b/src/diagnostics/draco_info.hh @@ -4,7 +4,7 @@ * \author Kelly Thompson * \date Wednesday, Nov 07, 2012, 18:49 pm * \brief Small executable that prints the version and copyright strings. - * \note Copyright (C) 2016-2020 Triad National Security, LLC., All rights reserved. */ + * \note Copyright (C) 2014-2021 Triad National Security, LLC., All rights reserved. */ //------------------------------------------------------------------------------------------------// #ifndef rtt_diagnostics_draco_info_hh @@ -22,17 +22,19 @@ namespace rtt_diagnostics { * \brief Store and present basic information about the current draco build. * * The constructed string will take this form: + * * \verbatim -Draco-6_25_20181114, build date 2018/11/14;build type: Debug;DBC: 7; DRACO_DIAGNOSTICS: 0 - -CCS-2 Draco Team: Kelly G. Thompson, Kent G. Budge, Ryan T. Wollaeger, James S. Warsa, - Alex R. Long, Kendra P. Keady, Jae H. Chang, Matt A. Cleveland, Andrew T. Till, Tim Kelley, - and Kris C. Garrett. +Draco-7_11_20210915, build date 2021 Sep 15, build type: Debug, DBC: 7, DRACO_DIAGNOSTICS: 0 -Prior Contributers: Jeff D. Densmore, Gabriel M. Rockefeller, Allan B. Wollaber, Rob B. Lowrie, - Lori A. Pritchett-Sheats, Paul W. Talbot, and Katherine J. Wang. +CCS-2 Draco Team: Kelly G. Thompson, Kent G. Budge, Matt A. Cleveland, Ryan T. Wollaeger, + Ben R. Ryan, Alex R. Long, Kendra P. Long, James S. Warsa, Jae H. Chang, Andrew T. Till, + and David A. Dixon. -Copyright (C) 2016-2020 Triad National Security, LLC. (LA-CC-16-016) +Prior Contributors: Gabriel M. Rockefeller, Allan B. Wollaber, Tim Kelley, Rob B. Lowrie, + Paul W. Talbot, Katherine J. Wang, Seth D. Cook, Ondrej Certik, Peter Ahrens, + Massimiliano Rosa, Todd J. Urbatsch, Daniel Holladay, Jeff D. Densmore, Howard Pritchard, + Jeff Furnish, John McGhee, Kris C. Garrett, Mike Buksas, Nick Myers, Paul Henning, + Randy Roberts, Seth Johnson, Todd Adams, Tom Evans, and Lori Pritchett-Sheats. For information, send e-mail to draco@lanl.gov. @@ -43,18 +45,18 @@ Build information: Site name : ccscs3 CUDA support : disabled MPI support : enabled - mpirun cmd : /scratch/.../bin/mpiexec -n -bind-to none + mpirun cmd : /ccs/opt/.../bin/mpiexec -n -bind-to none OpenMP support : enabled Design-by-Contract: 7, features = Insist, Require, Check, Ensure Diagnostics : 0 Diagnostics Timing: disabled CXX Compiler : /scratch/vendors/spack.20180425/opt/spack/linux-rhel7-x86_64/gcc-4.8.5/ gcc-8.1.0-3c5hjkqndywdp3w2l5vts62xlllrsbtq/bin/g++ - CXX_FLAGS : -Wcast-align -Wpointer-arith -Wall -pedantic -Wno-expansion-to-defined + CXX_FLAGS : -Wcast-align -Wpointer-arith -Wall -pedantic -Wno-expansion-to-defined -Wnarrowing -march=native -fopenmp -Werror C Compiler : /scratch/vendors/spack.20180425/opt/spack/linux-rhel7-x86_64/gcc-4.8.5/ gcc-8.1.0-3c5hjkqndywdp3w2l5vts62xlllrsbtq/bin/gcc - C_FLAGS : -Wcast-align -Wpointer-arith -Wall -pedantic -Wno-expansion-to-defined + C_FLAGS : -Wcast-align -Wpointer-arith -Wall -pedantic -Wno-expansion-to-defined -Wnarrowing -march=native -fopenmp -Werror Fortran Compiler : /scratch/vendors/spack.20180425/opt/spack/linux-rhel7-x86_64/gcc-4.8.5/ gcc-8.1.0-3c5hjkqndywdp3w2l5vts62xlllrsbtq/bin/gfortran @@ -79,7 +81,7 @@ public: * build parameters. */ std::string fullReport() const; - //! Version and Copyright only + //! Version and (C) std::string briefReport() const; //! Version only @@ -108,6 +110,8 @@ private: std::string cc_flags; std::string fc; std::string fc_flags; + std::string cuda_compiler; //! < full path to the cuda compiler (if any) + std::string cuda_flags; //!< Compiler flags for cuda }; } // end namespace rtt_diagnostics diff --git a/src/ds++/Release.cc b/src/ds++/Release.cc index 7913a08afc..5283ce2058 100644 --- a/src/ds++/Release.cc +++ b/src/ds++/Release.cc @@ -107,21 +107,20 @@ const std::string author_list(bool const use_doxygen_formatting) { current_developers.insert(fomdev(2927, "Alex R. Long")); current_developers.insert(fomdev(1565, "Kendra P. Long")); current_developers.insert(fomdev(1270, "James S. Warsa")); - current_developers.insert(fomdev(904, "Tim Kelley")); current_developers.insert(fomdev(353, "Jae H. Chang")); current_developers.insert(fomdev(127, "Andrew T. Till")); - current_developers.insert(fomdev(91, "Ondrej Certik")); current_developers.insert(fomdev(15, "David A. Dixon")); - current_developers.insert(fomdev(4, "Howard Pritchard")); mmdevs prior_developers; prior_developers.insert(fomdev(3628, "Gabriel M. Rockefeller")); prior_developers.insert(fomdev(1738, "Allan B. Wollaber")); + prior_developers.insert(fomdev(904, "Tim Kelley")); prior_developers.insert(fomdev(407, "Rob B. Lowrie")); prior_developers.insert(fomdev(282, "Paul W. Talbot")); prior_developers.insert(fomdev(184, "Katherine J. Wang")); prior_developers.insert(fomdev(98, "Seth D. Cook")); + prior_developers.insert(fomdev(91, "Ondrej Certik")); prior_developers.insert(fomdev(65, "Peter Ahrens")); // Previous authors with no current LOC attribution (less than 10): @@ -129,6 +128,7 @@ const std::string author_list(bool const use_doxygen_formatting) { prior_developers.insert(fomdev(7, "Todd J. Urbatsch")); prior_developers.insert(fomdev(6, "Daniel Holladay")); prior_developers.insert(fomdev(5, "Jeff D. Densmore")); + prior_developers.insert(fomdev(4, "Howard Pritchard")); prior_developers.insert(fomdev(1, "Jeff Furnish")); prior_developers.insert(fomdev(1, "John McGhee")); prior_developers.insert(fomdev(1, "Kris C. Garrett")); diff --git a/src/ds++/config.h.in b/src/ds++/config.h.in index ca520d5d14..d5937b151e 100644 --- a/src/ds++/config.h.in +++ b/src/ds++/config.h.in @@ -2,7 +2,7 @@ /*! * \file config.h * \brief CPP defines necessary for the ds++ package. - * \note Copyright (C) 2016-2020 Triad National Security, LLC., All rights reserved. */ + * \note Copyright (C) 2010-2021 Triad National Security, LLC., All rights reserved. */ /*------------------------------------------------------------------------------------------------*/ #ifndef rtt_dsxx_config_h @@ -251,6 +251,12 @@ #cmakedefine CMAKE_Fortran_FLAGS_RELEASE "@CMAKE_Fortran_FLAGS_RELEASE@" #cmakedefine CMAKE_Fortran_FLAGS_RELWITHDEBINFO "@CMAKE_Fortran_FLAGS_RELWITHDEBINFO@" #cmakedefine CMAKE_Fortran_FLAGS_MINSIZEREL "@CMAKE_Fortran_FLAGS_MINSIZEREL@" +#cmakedefine CMAKE_CUDA_COMPILER "@CMAKE_CUDA_COMPILER@" +#cmakedefine CMAKE_CUDA_FLAGS "@CMAKE_CUDA_FLAGS@" +#cmakedefine CMAKE_CUDA_FLAGS_DEBUG "@CMAKE_CUDA_FLAGS_DEBUG@" +#cmakedefine CMAKE_CUDA_FLAGS_RELEASE "@CMAKE_CUDA_FLAGS_RELEASE@" +#cmakedefine CMAKE_CUDA_FLAGS_RELWITHDEBINFO "@CMAKE_CUDA_FLAGS_RELWITHDEBINFO@" +#cmakedefine CMAKE_CUDA_FLAGS_MINSIZEREL "@CMAKE_CUDA_FLAGS_MINSIZEREL@" #cmakedefine CMAKE_BUILD_TYPE "@CMAKE_BUILD_TYPE@" #cmakedefine CMAKE_COMPILER_IS_GNUCXX @CMAKE_COMPILER_IS_GNUCXX@ diff --git a/src/parser/Abstract_Class_Parser.i.hh b/src/parser/Abstract_Class_Parser.i.hh index 3e1c5fb715..91ab4a3066 100644 --- a/src/parser/Abstract_Class_Parser.i.hh +++ b/src/parser/Abstract_Class_Parser.i.hh @@ -36,7 +36,7 @@ public: // DATA - //! The tabe of raw strings + //! The table of raw strings std::vector data; }; diff --git a/src/parser/Contextual_Parse_Functor.hh b/src/parser/Contextual_Parse_Functor.hh index 3c649b15b3..7c652174c3 100644 --- a/src/parser/Contextual_Parse_Functor.hh +++ b/src/parser/Contextual_Parse_Functor.hh @@ -4,7 +4,7 @@ * \author Kent Budge * \date Thu Jul 17 14:08:42 2008 * \brief Member definitions of class Abstract_Class_Parser - * \note Copyright (C) 2010-2021 Triad National Security, LLC., All rights reserved. */ + * \note Copyright (C) 2021 Triad National Security, LLC., All rights reserved. */ //------------------------------------------------------------------------------------------------// #ifndef parser_Contextual_Parse_Functor_hh @@ -18,9 +18,9 @@ namespace rtt_parser { /*! * \brief Closure class for wrapping context-dependent parse functions * - * This template class is used to bind a get_context() function to a parse function requiring a + * This template class is used to bind a \c get_context() function to a parse function requiring a * context argument, so that the function can be called with the usual two parameters (Token_Stream - * and int) from an Abstract_Class_Parse_Table. + * and \c int) from an \c Abstract_Class_Parse_Table. * * See test/tstAbstract_Class_Contextual_Parser.cc for an example of how it is used. */ From cd6a639f4ea80175179477b98d5a6a1bafcae46d Mon Sep 17 00:00:00 2001 From: "Kelly (KT) Thompson" Date: Wed, 15 Sep 2021 09:47:16 -0600 Subject: [PATCH 2/5] Ignore copyright checks for some info files. --- environment/git/pre-commit-copyright | 2 +- tools/check_style.sh | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/environment/git/pre-commit-copyright b/environment/git/pre-commit-copyright index d2cbc1a526..f54d8a8584 100755 --- a/environment/git/pre-commit-copyright +++ b/environment/git/pre-commit-copyright @@ -28,7 +28,7 @@ debugprint "running pre-commit-copyright" # file types to parse. FILE_EXTS=".c .cc .cmake .h .hh .in .f90 .F90 .f .F .py .sh .txt" #FILE_ENDINGS_INCLUDE="_f.h _f77.h _f90.h" -FILE_ENDINGS_EXCLUDE="ChangeLog Release.cc check_style.sh imc_info.cc" +FILE_ENDINGS_EXCLUDE="ChangeLog Release.cc Release.hh check_style.sh info.cc" export FILE_EXTS FILE_ENDINGS_EXCLUDE ################################################################## diff --git a/tools/check_style.sh b/tools/check_style.sh index 45f73fe501..58483eef08 100755 --- a/tools/check_style.sh +++ b/tools/check_style.sh @@ -408,7 +408,7 @@ patchfile_cb=$(mktemp "/tmp/$USER/copyright_block.patch.XXXXXXXX") # file types to parse. FILE_EXTS=".c .cc .cmake .h .hh .in .f90 .F90 .f .F .py .txt" #FILE_ENDINGS_INCLUDE="_f.h _f77.h _f90.h" -FILE_ENDINGS_EXCLUDE="ChangeLog Release.cc check_style.sh" +FILE_ENDINGS_EXCLUDE="ChangeLog Release.cc Release.hh info.cc check_style.sh" export FILE_EXTS FILE_ENDINGS_EXCLUDE # Loop over all modified files. Create one patch containing all changes to these files From e7281cc4bf897a96b39004b603456df2913c80c0 Mon Sep 17 00:00:00 2001 From: "Kelly (KT) Thompson" Date: Wed, 15 Sep 2021 13:10:40 -0600 Subject: [PATCH 3/5] Fix logic for printing cuda_flags. --- src/diagnostics/draco_info.cc | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/src/diagnostics/draco_info.cc b/src/diagnostics/draco_info.cc index fee06f015b..ec3e9b2983 100644 --- a/src/diagnostics/draco_info.cc +++ b/src/diagnostics/draco_info.cc @@ -78,14 +78,14 @@ DracoInfo::DracoInfo() else if (build_type == std::string("DEBUG")) fc_flags += CMAKE_Fortran_FLAGS_DEBUG; #endif -#if defined(__NVCC__) - cuda_compiler = CMAKE_CUDA_COMPILER; - cuda_flags = CMAKE_CUDA_FLAGS; - if (build_type == std::string("RELEASE")) - cuda_flags += CMAKE_CUDA_FLAGS_RELEASE; - else if (build_type == std::string("DEBUG")) - cuda_flags += CMAKE_CUDA_FLAGS_DEBUG; -#endif + if(cuda) { + cuda_compiler = CMAKE_CUDA_COMPILER; + cuda_flags = CMAKE_CUDA_FLAGS; + if (build_type == std::string("RELEASE")) + cuda_flags += CMAKE_CUDA_FLAGS_RELEASE; + else if (build_type == std::string("DEBUG")) + cuda_flags += CMAKE_CUDA_FLAGS_DEBUG; + } } //------------------------------------------------------------------------------------------------// From 2af330cc855cb134b19c6c9867746b6962c69105 Mon Sep 17 00:00:00 2001 From: "Kelly (KT) Thompson" Date: Wed, 15 Sep 2021 13:14:14 -0600 Subject: [PATCH 4/5] Fix style issues. --- src/diagnostics/draco_info.cc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/diagnostics/draco_info.cc b/src/diagnostics/draco_info.cc index ec3e9b2983..488e5d7538 100644 --- a/src/diagnostics/draco_info.cc +++ b/src/diagnostics/draco_info.cc @@ -78,7 +78,7 @@ DracoInfo::DracoInfo() else if (build_type == std::string("DEBUG")) fc_flags += CMAKE_Fortran_FLAGS_DEBUG; #endif - if(cuda) { + if (cuda) { cuda_compiler = CMAKE_CUDA_COMPILER; cuda_flags = CMAKE_CUDA_FLAGS; if (build_type == std::string("RELEASE")) From c58faeefe86a16238d197d7f097c8b46d38a3baf Mon Sep 17 00:00:00 2001 From: "Kelly (KT) Thompson" Date: Wed, 15 Sep 2021 13:19:23 -0600 Subject: [PATCH 5/5] One more logic fix. --- src/diagnostics/draco_info.cc | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/src/diagnostics/draco_info.cc b/src/diagnostics/draco_info.cc index 488e5d7538..10d71d96c1 100644 --- a/src/diagnostics/draco_info.cc +++ b/src/diagnostics/draco_info.cc @@ -78,14 +78,14 @@ DracoInfo::DracoInfo() else if (build_type == std::string("DEBUG")) fc_flags += CMAKE_Fortran_FLAGS_DEBUG; #endif - if (cuda) { - cuda_compiler = CMAKE_CUDA_COMPILER; - cuda_flags = CMAKE_CUDA_FLAGS; - if (build_type == std::string("RELEASE")) - cuda_flags += CMAKE_CUDA_FLAGS_RELEASE; - else if (build_type == std::string("DEBUG")) - cuda_flags += CMAKE_CUDA_FLAGS_DEBUG; - } +#ifdef CMAKE_CUDA_COMPILER + cuda_compiler = CMAKE_CUDA_COMPILER; + cuda_flags = CMAKE_CUDA_FLAGS; + if (build_type == std::string("RELEASE")) + cuda_flags += CMAKE_CUDA_FLAGS_RELEASE; + else if (build_type == std::string("DEBUG")) + cuda_flags += CMAKE_CUDA_FLAGS_DEBUG; +#endif } //------------------------------------------------------------------------------------------------//