From 9126bf22f8631e49e5df5cd797e8c2212d4993b4 Mon Sep 17 00:00:00 2001 From: romerojosh Date: Wed, 15 Jul 2026 07:26:16 +0000 Subject: [PATCH 1/2] Remove forced O1 optimization cap for host code compilation. Signed-off-by: romerojosh --- CMakeLists.txt | 13 ++++++------- 1 file changed, 6 insertions(+), 7 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 7d90f6c..8759421 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -35,13 +35,6 @@ endif() string(REPLACE "compilers/bin/nvc++" "cmake" NVHPC_CMAKE_DIR ${NVHPC_CXX_BIN}) set(CMAKE_PREFIX_PATH ${NVHPC_CMAKE_DIR}) -# Limit optimization levels of CPU code compilation -set(CMAKE_CXX_FLAGS_RELEASE "-O1 -DNDEBUG") -set(CMAKE_CXX_FLAGS_RELWITHDEBINFO "-O1 -g -DNDEBUG") -set(CMAKE_Fortran_FLAGS_RELEASE "-O1 -DNDEBUG") -# Note: Removing "-g" flag from Fortran RelWithDebInfo to enable mixed compilation with cc100 and older compute capabilities -set(CMAKE_Fortran_FLAGS_RELWITHDEBINFO "-O1 -DNDEBUG") - if (CUDECOMP_BUILD_FORTRAN) set(LANGS CXX CUDA Fortran) else() @@ -50,6 +43,12 @@ endif() project(cudecomp LANGUAGES ${LANGS}) +if (CUDECOMP_BUILD_FORTRAN) + # Remove debug information to enable mixed Fortran compilation with cc100 and older compute capabilities. + string(REGEX REPLACE "(^| )-g(opt)?($| )" "\\3" CMAKE_Fortran_FLAGS_RELWITHDEBINFO + "${CMAKE_Fortran_FLAGS_RELWITHDEBINFO}") +endif() + # Set up CUDA compute capabilities by CUDA version. Users can override defaults with CUDECOMP_CUDA_CC_LIST if (NOT CUDECOMP_CUDA_CC_LIST) if (${CMAKE_CUDA_COMPILER_VERSION} VERSION_GREATER_EQUAL 13.0) From 4f8fa05a3ff39df313aeda9960673155028a1b07 Mon Sep 17 00:00:00 2001 From: Josh Romero Date: Wed, 15 Jul 2026 00:47:21 -0700 Subject: [PATCH 2/2] Fix incorrect MPI_Bcast sizing. Signed-off-by: Josh Romero --- src/autotune.cc | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/autotune.cc b/src/autotune.cc index 6a3d495..1ad6615 100644 --- a/src/autotune.cc +++ b/src/autotune.cc @@ -588,7 +588,7 @@ void autotuneTransposeBackend(cudecompHandle_t handle, cudecompGridDesc_t grid_d // Set handle to best option (broadcast from rank 0 for consistency) CHECK_MPI(MPI_Bcast(&comm_backend_best, sizeof(cudecompTransposeCommBackend_t), MPI_CHAR, 0, handle->mpi_comm)); - CHECK_MPI(MPI_Bcast(pdims_best, 2 * sizeof(int), MPI_INT, 0, handle->mpi_comm)); + CHECK_MPI(MPI_Bcast(pdims_best, 2, MPI_INT, 0, handle->mpi_comm)); grid_desc->config.transpose_comm_backend = comm_backend_best; grid_desc->config.pdims[0] = pdims_best[0]; @@ -966,7 +966,7 @@ void autotuneHaloBackend(cudecompHandle_t handle, cudecompGridDesc_t grid_desc, // Set handle to best option (broadcast from rank 0 for consistency) CHECK_MPI(MPI_Bcast(&comm_backend_best, sizeof(cudecompHaloCommBackend_t), MPI_CHAR, 0, handle->mpi_comm)); - CHECK_MPI(MPI_Bcast(pdims_best, 2 * sizeof(int), MPI_INT, 0, handle->mpi_comm)); + CHECK_MPI(MPI_Bcast(pdims_best, 2, MPI_INT, 0, handle->mpi_comm)); grid_desc->config.halo_comm_backend = comm_backend_best; grid_desc->config.pdims[0] = pdims_best[0];