Skip to content

Commit

Permalink
Merge pull request #106 from LLNL/bugfix/develop/debug-mpi-off-builds
Browse files Browse the repository at this point in the history
Fixing Debug & MPI-Off builds
  • Loading branch information
mdavis36 authored Jan 25, 2022
2 parents 8ea6def + c1e8af0 commit 3d2f073
Show file tree
Hide file tree
Showing 65 changed files with 490 additions and 588 deletions.
2 changes: 1 addition & 1 deletion cmake/spheral/SpheralAddLibs.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -121,7 +121,7 @@ function(spheral_add_pybind11_library package_name)

# Set the r-path of the C++ lib such that it is independent of the build dir when installed
set_target_properties(${MODULE_NAME} PROPERTIES
INSTALL_RPATH "${CMAKE_INSTALL_PREFIX}/lib;${boost_DIR}/lib;${python_DIR}/lib"
INSTALL_RPATH "${CMAKE_INSTALL_PREFIX}/lib;${boost_DIR}/lib;${python_DIR}/lib"
)

endfunction()
2 changes: 1 addition & 1 deletion cmake/tpl/hdf5.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ if(${lib_name}_BUILD)
URL ${HDF5_URL}
URL_HASH "MD5=${HDF5_MD5}"
DOWNLOAD_DIR ${CACHE_DIR}
CONFIGURE_COMMAND env CC=${CMAKE_C_COMPILER} CXX=${CMAKE_CXX_COMPILER} CFLAGS=-fPIC CXXFLAGS=-fPIC FCFLAGS=-fPIC ${HDF5_PREFIX}/src/hdf5/configure --prefix=${${lib_name}_DIR}
CONFIGURE_COMMAND env CC=${CMAKE_C_COMPILER} CXX=${CMAKE_CXX_COMPILER} CFLAGS=-fPIC CXXFLAGS=-fPIC FCFLAGS=-fPIC ${HDF5_PREFIX}/src/hdf5/configure --prefix=${${lib_name}_DIR} --enable-shared=no
BUILD_COMMAND make
INSTALL_COMMAND make install

Expand Down
26 changes: 26 additions & 0 deletions scripts/lc-builds/blueos_gcc8.3.1-debug-mpi-python.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
#!/usr/bin/env bash

SCRIPT_PATH=${0%/*}
. "$SCRIPT_PATH/utils/parse-args.sh"

# Inherit build directory name from script name
BUILD_SUFFIX="lc_$(TMP=${BASH_SOURCE##*/}; echo ${TMP%.*})"

rm -rf ${BUILD_SUFFIX} 2>/dev/null
mkdir -p ${BUILD_SUFFIX}/install
mkdir -p ${BUILD_SUFFIX}/build && cd ${BUILD_SUFFIX}/build

module load cmake/3.14.5
module load gcc/8.3.1

cmake \
../.. \
-DCMAKE_BUILD_TYPE=Debug \
-DCMAKE_CXX_COMPILER=/usr/tce/packages/gcc/gcc-8.3.1/bin/g++ \
-C ${HOST_CONFIGS_DIR}/lc-builds/blueos/gcc8.3.1_tpl.cmake \
-DBLT_CXX_STD=c++14 \
-DENABLE_OPENMP=On \
-DENABLE_MPI=On \
-DCMAKE_INSTALL_PREFIX=$INSTALL_DIR \
"$@" \
#-DSPHERAL_TPL_DIR=/usr/workspace/wsrzd/davis291/SPHERAL/blueos_Spheral_gcc8_noMPI/install/tpl \
26 changes: 26 additions & 0 deletions scripts/lc-builds/blueos_gcc8.3.1-debug-seq-python.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
#!/usr/bin/env bash

SCRIPT_PATH=${0%/*}
. "$SCRIPT_PATH/utils/parse-args.sh"

# Inherit build directory name from script name
BUILD_SUFFIX="lc_$(TMP=${BASH_SOURCE##*/}; echo ${TMP%.*})"

rm -rf ${BUILD_SUFFIX} 2>/dev/null
mkdir -p ${BUILD_SUFFIX}/install
mkdir -p ${BUILD_SUFFIX}/build && cd ${BUILD_SUFFIX}/build

module load cmake/3.14.5
module load gcc/8.3.1

cmake \
../.. \
-DCMAKE_BUILD_TYPE=Debug \
-DCMAKE_CXX_COMPILER=/usr/tce/packages/gcc/gcc-8.3.1/bin/g++ \
-C ${HOST_CONFIGS_DIR}/lc-builds/blueos/gcc8.3.1_tpl.cmake \
-DBLT_CXX_STD=c++14 \
-DENABLE_OPENMP=On \
-DENABLE_MPI=Off \
-DCMAKE_INSTALL_PREFIX=$INSTALL_DIR \
"$@" \
#-DSPHERAL_TPL_DIR=/usr/workspace/wsrzd/davis291/SPHERAL/blueos_Spheral_gcc8_noMPI/install/tpl \
27 changes: 27 additions & 0 deletions scripts/lc-builds/blueos_gcc8.3.1-release-mpi-cxx.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
#!/usr/bin/env bash

SCRIPT_PATH=${0%/*}
. "$SCRIPT_PATH/utils/parse-args.sh"

# Inherit build directory name from script name
BUILD_SUFFIX="lc_$(TMP=${BASH_SOURCE##*/}; echo ${TMP%.*})"

rm -rf ${BUILD_SUFFIX} 2>/dev/null
mkdir -p ${BUILD_SUFFIX}/install
mkdir -p ${BUILD_SUFFIX}/build && cd ${BUILD_SUFFIX}/build

module load cmake/3.14.5
module load gcc/8.3.1

cmake \
../.. \
-DCMAKE_BUILD_TYPE=Release \
-DCMAKE_CXX_COMPILER=/usr/tce/packages/gcc/gcc-8.3.1/bin/g++ \
-C ${HOST_CONFIGS_DIR}/lc-builds/blueos/gcc8.3.1_tpl.cmake \
-DBLT_CXX_STD=c++14 \
-DENABLE_OPENMP=On \
-DENABLE_MPI=On \
-DCMAKE_INSTALL_PREFIX=$INSTALL_DIR \
-DENABLE_STATIC_CXXONLY=On \
"$@" \
#-DSPHERAL_TPL_DIR=/usr/workspace/wsrzd/davis291/SPHERAL/blueos_Spheral_gcc8_noMPI/install/tpl \
26 changes: 26 additions & 0 deletions scripts/lc-builds/blueos_gcc8.3.1-release-mpi-python.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
#!/usr/bin/env bash

SCRIPT_PATH=${0%/*}
. "$SCRIPT_PATH/utils/parse-args.sh"

# Inherit build directory name from script name
BUILD_SUFFIX="lc_$(TMP=${BASH_SOURCE##*/}; echo ${TMP%.*})"

rm -rf ${BUILD_SUFFIX} 2>/dev/null
mkdir -p ${BUILD_SUFFIX}/install
mkdir -p ${BUILD_SUFFIX}/build && cd ${BUILD_SUFFIX}/build

module load cmake/3.14.5
module load gcc/8.3.1

cmake \
../.. \
-DCMAKE_BUILD_TYPE=Release \
-DCMAKE_CXX_COMPILER=/usr/tce/packages/gcc/gcc-8.3.1/bin/g++ \
-C ${HOST_CONFIGS_DIR}/lc-builds/blueos/gcc8.3.1_tpl.cmake \
-DBLT_CXX_STD=c++14 \
-DENABLE_OPENMP=On \
-DENABLE_MPI=On \
-DCMAKE_INSTALL_PREFIX=$INSTALL_DIR \
"$@" \
#-DSPHERAL_TPL_DIR=/usr/workspace/wsrzd/davis291/SPHERAL/blueos_Spheral_gcc8_noMPI/install/tpl \
26 changes: 26 additions & 0 deletions scripts/lc-builds/blueos_gcc8.3.1-release-seq-cxx.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
#!/usr/bin/env bash

SCRIPT_PATH=${0%/*}
. "$SCRIPT_PATH/utils/parse-args.sh"

# Inherit build directory name from script name
BUILD_SUFFIX="lc_$(TMP=${BASH_SOURCE##*/}; echo ${TMP%.*})"

rm -rf ${BUILD_SUFFIX} 2>/dev/null
mkdir -p ${BUILD_SUFFIX}/install
mkdir -p ${BUILD_SUFFIX}/build && cd ${BUILD_SUFFIX}/build

module load cmake/3.14.5
module load gcc/8.3.1

cmake \
../.. \
-DCMAKE_BUILD_TYPE=Release \
-DCMAKE_CXX_COMPILER=/usr/tce/packages/gcc/gcc-8.3.1/bin/g++ \
-C ${HOST_CONFIGS_DIR}/lc-builds/blueos/gcc8.3.1_tpl.cmake \
-DENABLE_OPENMP=On \
-DENABLE_MPI=Off \
-DCMAKE_INSTALL_PREFIX=$INSTALL_DIR \
-DENABLE_STATIC_CXXONLY=On \
"$@" \
#-DSPHERAL_TPL_DIR=/usr/workspace/wsrzd/davis291/SPHERAL/blueos_Spheral_gcc8_noMPI/install/tpl \
26 changes: 26 additions & 0 deletions scripts/lc-builds/blueos_gcc8.3.1-release-seq-python.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
#!/usr/bin/env bash

SCRIPT_PATH=${0%/*}
. "$SCRIPT_PATH/utils/parse-args.sh"

# Inherit build directory name from script name
BUILD_SUFFIX="lc_$(TMP=${BASH_SOURCE##*/}; echo ${TMP%.*})"

rm -rf ${BUILD_SUFFIX} 2>/dev/null
mkdir -p ${BUILD_SUFFIX}/install
mkdir -p ${BUILD_SUFFIX}/build && cd ${BUILD_SUFFIX}/build

module load cmake/3.14.5
module load gcc/8.3.1

cmake \
../.. \
-DCMAKE_BUILD_TYPE=Release \
-DCMAKE_CXX_COMPILER=/usr/tce/packages/gcc/gcc-8.3.1/bin/g++ \
-C ${HOST_CONFIGS_DIR}/lc-builds/blueos/gcc8.3.1_tpl.cmake \
-DBLT_CXX_STD=c++14 \
-DENABLE_OPENMP=On \
-DENABLE_MPI=Off \
-DCMAKE_INSTALL_PREFIX=$INSTALL_DIR \
"$@" \
#-DSPHERAL_TPL_DIR=/usr/workspace/wsrzd/davis291/SPHERAL/blueos_Spheral_gcc8_noMPI/install/tpl \
27 changes: 27 additions & 0 deletions scripts/lc-builds/blueos_xl2021.03.11-release-seq-cxx.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
#!/usr/bin/env bash

SCRIPT_PATH=${0%/*}
. "$SCRIPT_PATH/utils/parse-args.sh"

# Inherit build directory name from script name
BUILD_SUFFIX="lc_$(TMP=${BASH_SOURCE##*/}; echo ${TMP%.*})"

rm -rf ${BUILD_SUFFIX} 2>/dev/null
mkdir -p ${BUILD_SUFFIX}/install
mkdir -p ${BUILD_SUFFIX}/build && cd ${BUILD_SUFFIX}/build

module load cmake/3.14.5
module load xl/2021.03.11

cmake \
${SRC_DIR} \
-DCMAKE_BUILD_TYPE=Release \
-DCMAKE_CXX_COMPILER=/usr/tce/packages/xl/xl-2021.03.11/bin/xlc++ \
-DCMAKE_Fortran_COMPILER=/usr/tce/packages/xl/xl-2021.03.11/bin/xlf \
-DENABLE_OPENMP=Off \
-DENABLE_MPI=Off \
-DENABLE_ANEOS=Off \
-DCMAKE_INSTALL_PREFIX=$INSTALL_DIR \
-DENABLE_STATIC_CXXONLY=On \
$CMAKE_ARGS \
#-C ${HOST_CONFIGS_DIR}/lc-builds/toss3/gcc8.3.1_tpl.cmake \
1 change: 1 addition & 0 deletions scripts/lc-builds/toss3_gcc8.3.1-debug-mpi-python.sh
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@ cmake \
-DCMAKE_BUILD_TYPE=Debug \
-DCMAKE_CXX_COMPILER=/usr/tce/packages/gcc/gcc-8.3.1/bin/g++ \
-C ${HOST_CONFIGS_DIR}/lc-builds/toss3/gcc8.3.1_tpl.cmake \
-DBLT_CXX_STD=c++14 \
-DENABLE_OPENMP=On \
-DENABLE_MPI=On \
-DCMAKE_INSTALL_PREFIX=$INSTALL_DIR \
Expand Down
1 change: 1 addition & 0 deletions scripts/lc-builds/toss3_gcc8.3.1-release-seq-python.sh
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@ cmake \
-DCMAKE_BUILD_TYPE=Release \
-DCMAKE_CXX_COMPILER=/usr/tce/packages/gcc/gcc-8.3.1/bin/g++ \
-C ${HOST_CONFIGS_DIR}/lc-builds/toss3/gcc8.3.1_tpl.cmake \
-DBLT_CXX_STD=c++14 \
-DENABLE_OPENMP=On \
-DENABLE_MPI=Off \
-DCMAKE_INSTALL_PREFIX=$INSTALL_DIR \
Expand Down
7 changes: 0 additions & 7 deletions src/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -45,18 +45,11 @@ list(APPEND _packages

if(NOT ENABLE_CXXONLY)
list(APPEND _packages
PythonMPIInterfaces
SimulationControl
Pybind11Wraps
)
endif()

if(NOT ENABLE_MPI)
list(REMOVE_ITEM _packages
Distributed
)
endif()

foreach(_package ${_packages})
add_subdirectory(${_package})
endforeach()
Expand Down
26 changes: 0 additions & 26 deletions src/DataOutput/RestartRegistrar.cc
Original file line number Diff line number Diff line change
Expand Up @@ -41,27 +41,6 @@ struct CompareWeakPtr: public std::binary_function<std::weak_ptr<T>, std::weak_p
}
};

//------------------------------------------------------------------------------
// Get the instance.
//------------------------------------------------------------------------------
RestartRegistrar&
RestartRegistrar::
instance() {
return *RestartRegistrar::instancePtr();
}

//------------------------------------------------------------------------------
// Get the instance (pointer).
//------------------------------------------------------------------------------
RestartRegistrar*
RestartRegistrar::
instancePtr() {
if (mInstancePtr == 0) mInstancePtr = new RestartRegistrar;
CHECK(mInstancePtr != 0);
mInstancePtr->removeExpiredPointers();
return mInstancePtr;
}

//------------------------------------------------------------------------------
// Register a RestartHandle.
//------------------------------------------------------------------------------
Expand Down Expand Up @@ -235,8 +214,3 @@ RestartRegistrar::
}

}

//------------------------------------------------------------------------------
// Initialize the static instance pointer.
//-----------------------------------------------------------------------------
Spheral::RestartRegistrar* Spheral::RestartRegistrar::mInstancePtr = 0;
4 changes: 0 additions & 4 deletions src/DataOutput/RestartRegistrar.hh
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,6 @@ public:

// Get the instance.
static RestartRegistrar& instance();
static RestartRegistrar* instancePtr();

// Methods for registering a RestartHandle.
void registerRestartHandle(std::shared_ptr<RestartHandle> restartHandlePtr,
Expand Down Expand Up @@ -68,9 +67,6 @@ private:
typedef PriorityContainer::const_iterator const_priority_iterator;
typedef PriorityContainer::iterator priority_iterator;

// The one and only instance.
static RestartRegistrar* mInstancePtr;

// The list of RestartHandles and their priorities.
RestartHandleContainer mRestartHandles;
PriorityContainer mPriorities;
Expand Down
11 changes: 11 additions & 0 deletions src/DataOutput/RestartRegistrarInline.hh
Original file line number Diff line number Diff line change
@@ -1,5 +1,16 @@
namespace Spheral {

//------------------------------------------------------------------------------
// Get the instance.
//------------------------------------------------------------------------------
inline
RestartRegistrar&
RestartRegistrar::
instance() {
static RestartRegistrar theInstance;
return theInstance;
}

//------------------------------------------------------------------------------
// The non-const iterators.
//------------------------------------------------------------------------------
Expand Down
25 changes: 0 additions & 25 deletions src/Distributed/BoundingVolumeDistributedBoundary.cc
Original file line number Diff line number Diff line change
Expand Up @@ -37,31 +37,6 @@ using std::abs;

namespace Spheral {

// Static initialization of singleton instance.
template <typename Dimension>
BoundingVolumeDistributedBoundary<Dimension>*
BoundingVolumeDistributedBoundary<Dimension>::mInstance = 0;

//------------------------------------------------------------------------------
// Singleton instance method.
//------------------------------------------------------------------------------
template<typename Dimension>
BoundingVolumeDistributedBoundary<Dimension>&
BoundingVolumeDistributedBoundary<Dimension>::
instance() {
if (mInstance == 0) {
mInstance = new BoundingVolumeDistributedBoundary();
} // end if
return *mInstance;
}

template<typename Dimension>
BoundingVolumeDistributedBoundary<Dimension>*
BoundingVolumeDistributedBoundary<Dimension>::
instancePtr() {
return &(instance());
}

//------------------------------------------------------------------------------
// Constructor.
//------------------------------------------------------------------------------
Expand Down
6 changes: 2 additions & 4 deletions src/Distributed/BoundingVolumeDistributedBoundary.hh
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,6 @@ public:

// This method returns the singleton instance of the object.
static BoundingVolumeDistributedBoundary& instance();
static BoundingVolumeDistributedBoundary* instancePtr();

// Destructor.
virtual ~BoundingVolumeDistributedBoundary();
Expand All @@ -50,9 +49,6 @@ public:

private:
//--------------------------- Private Interface ---------------------------//
// Singleton instance pointer.
static BoundingVolumeDistributedBoundary* mInstance;

// Disabled methods.
BoundingVolumeDistributedBoundary();
BoundingVolumeDistributedBoundary(const BoundingVolumeDistributedBoundary&);
Expand All @@ -68,6 +64,8 @@ private:

}

#include "BoundingVolumeDistributedBoundaryInline.hh"

#else

// Forward declaration.
Expand Down
15 changes: 15 additions & 0 deletions src/Distributed/BoundingVolumeDistributedBoundaryInline.hh
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
namespace Spheral {

//------------------------------------------------------------------------------
// Singleton instance method.
//------------------------------------------------------------------------------
template<typename Dimension>
inline
BoundingVolumeDistributedBoundary<Dimension>&
BoundingVolumeDistributedBoundary<Dimension>::
instance() {
static BoundingVolumeDistributedBoundary<Dimension> theInstance;
return theInstance;
}

}
Loading

0 comments on commit 3d2f073

Please sign in to comment.