From 1c4aac80c38eb22e23a46f89227662fd02a7dc69 Mon Sep 17 00:00:00 2001 From: jpekkila Date: Wed, 19 Aug 2020 11:36:23 +0000 Subject: [PATCH 1/6] Autobuild gets stuck due to interactive dialog when installing some package, a potential fix. --- bitbucket-pipelines.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/bitbucket-pipelines.yml b/bitbucket-pipelines.yml index 6fbb638..c5b7b54 100644 --- a/bitbucket-pipelines.yml +++ b/bitbucket-pipelines.yml @@ -20,6 +20,7 @@ pipelines: scheduled: - step: script: # Modify the commands below to build your repository. + - DEBIAN_FRONTEND=noninteractive - mkdir -p build && cd build - apt-get update - apt-get install -y apt-transport-https ca-certificates gnupg software-properties-common wget From 3f85240d9c3cff370a1f84a7d2212fe09e40c98b Mon Sep 17 00:00:00 2001 From: jpekkila Date: Wed, 19 Aug 2020 11:44:37 +0000 Subject: [PATCH 2/6] Try #2 --- bitbucket-pipelines.yml | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/bitbucket-pipelines.yml b/bitbucket-pipelines.yml index c5b7b54..9303ec1 100644 --- a/bitbucket-pipelines.yml +++ b/bitbucket-pipelines.yml @@ -20,7 +20,8 @@ pipelines: scheduled: - step: script: # Modify the commands below to build your repository. - - DEBIAN_FRONTEND=noninteractive + - ARG DEBIAN_FRONTEND=noninteractive + - ENV TZ=Europe/Helsinki - mkdir -p build && cd build - apt-get update - apt-get install -y apt-transport-https ca-certificates gnupg software-properties-common wget From e32e824a85f1fc9adc85963cf4fb617b4b819518 Mon Sep 17 00:00:00 2001 From: jpekkila Date: Wed, 19 Aug 2020 11:50:06 +0000 Subject: [PATCH 3/6] Try #3 --- bitbucket-pipelines.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/bitbucket-pipelines.yml b/bitbucket-pipelines.yml index 9303ec1..10af031 100644 --- a/bitbucket-pipelines.yml +++ b/bitbucket-pipelines.yml @@ -20,8 +20,8 @@ pipelines: scheduled: - step: script: # Modify the commands below to build your repository. - - ARG DEBIAN_FRONTEND=noninteractive - - ENV TZ=Europe/Helsinki + - export DEBIAN_FRONTEND=noninteractive + - ln -fs /usr/share/zoneinfo/Europe/Helsinki /etc/localtime - mkdir -p build && cd build - apt-get update - apt-get install -y apt-transport-https ca-certificates gnupg software-properties-common wget From 03c01730210a0f29842eadf53b89e6747c1e7b0d Mon Sep 17 00:00:00 2001 From: jpekkila Date: Wed, 19 Aug 2020 12:07:56 +0000 Subject: [PATCH 4/6] Try #4 --- bitbucket-pipelines.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/bitbucket-pipelines.yml b/bitbucket-pipelines.yml index 10af031..3fae17d 100644 --- a/bitbucket-pipelines.yml +++ b/bitbucket-pipelines.yml @@ -3,7 +3,7 @@ # Only use spaces to indent your .yml configuration. # ----- # You can specify a custom docker image from Docker Hub as your build environment. -image: nvidia/cuda +image: nvidia/cuda:11.0-devel-ubuntu20.04 # JP notes: # 1) We need a sufficiently recent GPU to run the code (needs to support CUDA 10 + NVIDIA drivers 418) @@ -26,7 +26,7 @@ pipelines: - apt-get update - apt-get install -y apt-transport-https ca-certificates gnupg software-properties-common wget - wget -O - https://apt.kitware.com/keys/kitware-archive-latest.asc 2>/dev/null | gpg --dearmor - | tee /etc/apt/trusted.gpg.d/kitware.gpg >/dev/null - - apt-add-repository 'deb https://apt.kitware.com/ubuntu/ bionic main' + - apt-add-repository 'deb https://apt.kitware.com/ubuntu/ focal main' - apt-get update - apt-get install -y cmake flex bison openmpi-bin libopenmpi-dev gfortran - cmake -DDSL_MODULE_DIR="acc/mhd_solver" -DBUILD_STANDALONE=ON -DBUILD_UTILS=ON -DBUILD_RT_VISUALIZATION=OFF -DBUILD_SAMPLES=ON -DDOUBLE_PRECISION=OFF -DMULTIGPU_ENABLED=ON -DMPI_ENABLED=OFF .. # Single precision From 46cfa9cd37869ccbe343093691dab21c43434529 Mon Sep 17 00:00:00 2001 From: jpekkila Date: Wed, 19 Aug 2020 15:50:16 +0300 Subject: [PATCH 5/6] Now using MPI C bindings instead of the (deprecated?) C++ bindings due to compilation issues on some machines (error: cast between incompatible function types, ompi_mpi_cxx_op_intercept) --- CMakeLists.txt | 4 ++-- samples/bwtest/CMakeLists.txt | 2 +- src/core/CMakeLists.txt | 2 +- 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 64259fc..d9bc7be 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -91,8 +91,8 @@ include_directories(${CMAKE_BINARY_DIR}) # DSL headers include_directories(${CMAKE_CUDA_TOOLKIT_INCLUDE_DIRECTORIES}) # CUDA headers if (MPI_ENABLED) - find_package(MPI REQUIRED) - include_directories(${MPI_CXX_INCLUDE_DIRS}) + find_package(MPI REQUIRED COMPONENTS C) + include_directories(${MPI_C_INCLUDE_DIRS}) endif() ## Subdirectories diff --git a/samples/bwtest/CMakeLists.txt b/samples/bwtest/CMakeLists.txt index 229e7e2..27434ef 100644 --- a/samples/bwtest/CMakeLists.txt +++ b/samples/bwtest/CMakeLists.txt @@ -1,6 +1,6 @@ cmake_minimum_required(VERSION 3.17) # Required for moder CUDA::cudart linking -find_package(MPI) +find_package(MPI COMPONENTS C) find_package(OpenMP) find_package(CUDAToolkit) diff --git a/src/core/CMakeLists.txt b/src/core/CMakeLists.txt index 9e2a556..801ba1e 100644 --- a/src/core/CMakeLists.txt +++ b/src/core/CMakeLists.txt @@ -9,7 +9,7 @@ if (MPI_ENABLED) #find_package(MPI REQUIRED) #find_package(OpenMP) #target_link_libraries(astaroth_core MPI::MPI_CXX OpenMP::OpenMP_CXX) - target_link_libraries(astaroth_core MPI::MPI_CXX) + target_link_libraries(astaroth_core MPI::MPI_C) endif() if (MULTIGPU_ENABLED) From 6e5f0726b7a52bb035be10736519ff04aca06a6d Mon Sep 17 00:00:00 2001 From: jpekkila Date: Wed, 19 Aug 2020 16:05:28 +0300 Subject: [PATCH 6/6] Needed one more flag to force MPI to use the C interface --- CMakeLists.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index d9bc7be..e63349a 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -11,7 +11,7 @@ project(astaroth C CXX CUDA) set(CMAKE_RUNTIME_OUTPUT_DIRECTORY ${PROJECT_BINARY_DIR}) ## Project-wide compilation flags -set(COMMON_FLAGS "-mavx -Wall -Wextra -Werror -Wdouble-promotion -Wfloat-conversion -Wshadow") +set(COMMON_FLAGS "-mavx -DOMPI_SKIP_MPICXX -Wall -Wextra -Werror -Wdouble-promotion -Wfloat-conversion -Wshadow") # -DOMPI_SKIP_MPICXX is to force OpenMPI to use the C interface set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} ${COMMON_FLAGS}") set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} ${COMMON_FLAGS}") set(CMAKE_C_STANDARD 11)