Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Ci update, bugfixes #68

Merged
merged 19 commits into from
Feb 12, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
19 commits
Select commit Hold shift + click to select a range
8496d41
Update run command to newest recommended flags
Matthew-Whitlock Apr 26, 2022
d254da2
Merge from main repo (#5)
Matthew-Whitlock Apr 26, 2022
a6904cd
Merge branch 'master' of https://github.com/epizon-project/Fenix into…
Matthew-Whitlock Apr 26, 2022
b17cd44
Merge changes from main repo
Matthew-Whitlock Apr 26, 2022
750aeac
Update instructions to latest ULFM/OpenMPI recommended version
Matthew-Whitlock Apr 26, 2022
553d1a6
Repair files from revert
Matthew-Whitlock Apr 26, 2022
4465643
Fix recovery bugs for poorly-timed failures
Matthew-Whitlock May 31, 2022
eb10cca
Fix recovery rank placement issues
Matthew-Whitlock May 31, 2022
49ad6fa
Improve promises about error reporting
Matthew-Whitlock May 31, 2022
efe476c
Fix a bug related to inconsistent state during commit_barrier
Matthew-Whitlock Oct 25, 2022
d7472e2
Implement Github actions for testing
Matthew-Whitlock Feb 14, 2023
43452ed
Test Bugfixes + don't try to pass MPI_Datatype between ranks
Matthew-Whitlock Feb 20, 2023
347aaa0
Implement MPI system include fix
Matthew-Whitlock Mar 21, 2023
d6e33e3
Improved system include fixes, removed reference to (in this branch) …
Matthew-Whitlock Apr 17, 2023
428f603
Merge branch 'ci_update' of github.com:matthew-whitlock/fenix into ci…
Matthew-Whitlock Apr 17, 2023
087f57e
Update install directions, another cmake variable naming convention fix
Matthew-Whitlock Apr 17, 2023
490ce70
Merge remote-tracking branch 'upstream/master' into ci_update
Matthew-Whitlock Apr 17, 2023
81e7370
Revert to BUILD_TESTING; make inc fix optionally transitive
Matthew-Whitlock May 8, 2023
bdb409e
Update README.md
Matthew-Whitlock Oct 12, 2023
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
29 changes: 29 additions & 0 deletions .github/Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
#Built for testing, not designed for application use.

FROM ubuntu:20.04
#="open-mpi/ompi" for github.com/open-mpi/ompi
ARG OPENMPI_REPO="open-mpi/ompi"
#="tags" or ="heads", for tag or branch name
ARG OPENMPI_VERS_PREFIX="tags"
#="v5.0.0rc10" or ="v5.0.x", ie tag name or branch name.
ARG OPENMPI_VERS="v5.0.0rc10"
run echo Using https://github.com/${OPENMPI_REPO}/git/refs/${OPENMPI_VERS_PREFIX}/${OPENMPI_VERS}

RUN apt-get update && DEBIAN_FRONTEND=noninteractive apt-get install -y build-essential python3 m4 autoconf automake libtool flex git zlib1g-dev

#Add files listing latest commit for this branch/tag, which invalidates the clone
#when a change has been pushed.
ADD https://api.github.com/repos/${OPENMPI_REPO}/git/refs/${OPENMPI_VERS_PREFIX}/${OPENMPI_VERS} commit_info
RUN git clone --recursive --branch ${OPENMPI_VERS} --depth 1 https://github.com/${OPENMPI_REPO}.git ompi_src && \
mkdir ompi_build ompi_install && cd ompi_src && export AUTOMAKE_JOBS=8 && ./autogen.pl && cd ../ompi_build && ../ompi_src/configure --prefix=/ompi_install --disable-man-pages --with-ft=ulfm && make install -j8 && cd ..


#New build stage, tosses out src/build trees from openmpi
FROM ubuntu:20.04
RUN apt-get update && DEBIAN_FRONTEND=noninteractive apt-get install -y build-essential cmake ssh zlib1g-dev
COPY . ./fenix_src
COPY --from=0 ompi_install/ /ompi_install/
ENV PATH="$PATH:/ompi_install/bin"
RUN mkdir fenix_build fenix_install && cd fenix_build && cmake ../fenix_src -DCMAKE_BUILD_TYPE=Release -DCMAKE_C_COMPILER=/ompi_install/bin/mpicc \
-DFENIX_EXAMPLES=ON -DFENIX_TESTS=ON -DCMAKE_INSTALL_PREFIX=../fenix_install -DMPIEXEC_PREFLAGS="--allow-run-as-root;--map-by;:OVERSUBSCRIBE" && make install -j8
CMD ["sh", "-c", "cd fenix_build && ctest --verbose --timeout 60"]
81 changes: 81 additions & 0 deletions .github/docker-compose.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,81 @@
version: "3.9"

x-fenix: &fenix
build: &fenix-build
context: ./
dockerfile: .github/Dockerfile
args:
OPENMPI_REPO: open-mpi/ompi
OPENMPI_VERS_PREFIX: tags
OPENMPI_VERS: v5.0.0rc10
#Caches should be manually scoped, or they'll conflict.
x-bake:
cache-from:
- type=gha,scope=default
cache-to:
- type=gha,scope=default,mode=max

services:
#fenix_ompi_5rc10:
# <<: *fenix
# image: "fenix:ompi_5rc10"
# build:
# <<: *fenix-build
# x-bake:
# cache-from:
# - type=gha,scope=ompi_5rc10
# cache-to:
# - type=gha,scope=ompi_5rc10,mode=max

fenix_ompi_5:
<<: *fenix
image: "fenix:ompi_5"
build:
<<: *fenix-build
args:
- OPENMPI_VERS_PREFIX=heads
- OPENMPI_VERS=v5.0.x
x-bake:
cache-from:
- type=gha,scope=ompi_5
cache-to:
- type=gha,scope=ompi_5,mode=max

fenix_ompi_main:
<<: *fenix
image: "fenix:ompi_main"
build:
<<: *fenix-build
args:
- OPENMPI_VERS_PREFIX=heads
- OPENMPI_VERS=main
x-bake:
cache-from:
- type=gha,scope=ompi_main
cache-to:
- type=gha,scope=ompi_main,mode=max

fenix_icldisco_latest:
<<: *fenix
image: "fenix:icldisco_latest"
build:
<<: *fenix-build
args:
- OPENMPI_REPO=icldisco/ompi
- OPENMPI_VERS_PREFIX=heads
- OPENMPI_VERS=ulfm/latest
x-bake:
cache-from:
- type=gha,scope=icldisco_latest
cache-to:
- type=gha,scope=icldisco_latest,mode=max

#fenix_icldisco_experimental:
# <<: *fenix
# image: fenix/icldisco
# build:
# <<: *fenix-build
# args:
# - OPENMPI_REPO=icldisco/ompi
# - OPENMPI_VERS_PREFIX=heads
# - OPENMPI_VERS=ulfm/experimental
31 changes: 31 additions & 0 deletions .github/workflows/ci_checks.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
name: Build & Test

on:
push:
pull_request_target:
types:
- opened
- synchronized
- edited

jobs:
test:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: docker/setup-buildx-action@v2
- name: Build
uses: docker/bake-action@master
with:
files: |
.github/docker-compose.yml
load: true
- name: Test open-mpi v5.0.x
if: success() || failure()
run: docker run fenix:ompi_5
- name: Test open-mpi main
if: success() || failure()
run: docker run fenix:ompi_main
- name: Test icldisco latest
if: success() || failure()
run: docker run fenix:icldisco_latest
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,8 @@ examples/05_subset_create/subset_create
examples/06_subset_createv/subset_createv
test/request_tracking/fenix_request_tracking_test
test/request_tracking/fenix_request_tracking_test_nofenix
build/
install/

# Other
*~
Expand Down
62 changes: 0 additions & 62 deletions .travis.yml

This file was deleted.

116 changes: 37 additions & 79 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -8,108 +8,66 @@
# directory.
#

cmake_minimum_required(VERSION 3.0.2)
cmake_minimum_required(VERSION 3.10.2)

project(Fenix C)
# The version number.
set(FENIX_VERSION_MAJOR 1)
set(FENIX_VERSION_MINOR 0)

option(BUILD_EXAMPLES "Builds example programs from the examples directory" OFF)
option(BUILD_TESTING "Builds tests and test modes of files" ON)
option(BUILD_EXAMPLES "Builds example programs from the examples directory" OFF)
option(BUILD_TESTING "Builds tests and test modes of files" ON)


# Set empty string for shared linking (we use static library only at this moment)
set(CMAKE_SHARED_LIBRARY_LINK_C_FLAGS)
#Solves an issue with some system environments putting their MPI headers before
#the headers CMake includes. Forces non-system MPI headers when incorrect headers
#detected in include path.
option(FENIX_SYSTEM_INC_FIX "Attempts to force overriding any system MPI headers" ON)
option(FENIX_PROPAGATE_INC_FIX "Attempt overriding system MPI headers in linking projects" ON)

set(CMAKE_ARCHIVE_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}/lib)
set(CMAKE_LIBRARY_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}/lib)
find_package(MPI REQUIRED)

#set(CMAKE_BUILD_TYPE Release)
set(CMAKE_BUILD_TYPE Debug)
#set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -Wall -O0 -ggdb")
if(${FENIX_SYSTEM_INC_FIX})
include(cmake/systemMPIOverride.cmake)
endif()

#ENABLE_TESTING
set(CMAKE_MODULE_PATH ${CMAKE_MODULE_PATH} ${CMAKE_CURRENT_SOURCE_DIR})
#include(testref/TestAgainstReference)

configure_file(
${CMAKE_CURRENT_SOURCE_DIR}/include/fenix-config.h.in
${CMAKE_CURRENT_BINARY_DIR}/include/fenix-config.h @ONLY
)
add_subdirectory(src)


#Check for MPICC definition, if not try to find MPI
if(NOT "a$ENV{MPICC}" STREQUAL "a")
#set(CMAKE_C_COMPILER ${MPI_C_COMPILER} CACHE STRING "The compiler CMake should use - often set to mpicc" FORCE)
set(MPI_C_COMPILER $ENV{MPICC})
set(CMAKE_C_COMPILER ${MPI_C_COMPILER})

message("[fenix] MPICC has been passed: $ENV{MPICC}")
else()
message("[fenix] MPICC was not passed, searching for MPI")
find_package(MPI REQUIRED)
if(${MPI_C_FOUND})
message("[fenix] Found MPICC: ${MPI_C_COMPILER}")
else()
message( FATAL_ERROR "[fenix] MPI not found :( Aborting!")
endif()
include(CTest)
list(APPEND MPIEXEC_PREFLAGS "--with-ft;mpi")

if(BUILD_EXAMPLES)
add_subdirectory(examples)
endif()

#Helper function for linking with MPI only if needed
function(linkMPI TOLINK)
#We only want to try to find MPI outrselves if it wasn't provided in MPICC by user
if("a$ENV{MPICC}" STREQUAL "a")
#find_package(MPI REQUIRED)
target_link_libraries(${TOLINK} MPI::MPI_C)
endif()
endfunction(linkMPI)
if(BUILD_TESTING)
add_subdirectory(test)
endif()



configure_file(
${CMAKE_CURRENT_SOURCE_DIR}/include/fenix-config.h.in
${CMAKE_CURRENT_BINARY_DIR}/include/fenix-config.h @ONLY
)
configure_file(
${CMAKE_CURRENT_SOURCE_DIR}/cmake/systemMPIOverride.cmake
${CMAKE_CURRENT_BINARY_DIR}/cmake/systemMPIOverride.cmake COPYONLY
)

add_subdirectory(src)

include(CMakePackageConfigHelpers)
configure_package_config_file(fenixConfig.cmake.in
${CMAKE_CURRENT_BINARY_DIR}/fenixConfig.cmake
configure_package_config_file(cmake/fenixConfig.cmake.in
${CMAKE_CURRENT_BINARY_DIR}/cmake/fenixConfig.cmake
INSTALL_DESTINATION cmake)
write_basic_package_version_file(${CMAKE_CURRENT_BINARY_DIR}/fenixConfigVersion.cmake
write_basic_package_version_file(${CMAKE_CURRENT_BINARY_DIR}/cmake/fenixConfigVersion.cmake
VERSION "${FENIX_VERSION_MAJOR}.${FENIX_VERSION_MINOR}"
COMPATIBILITY SameMajorVersion)
install(
FILES
${CMAKE_CURRENT_BINARY_DIR}/fenixConfig.cmake
${CMAKE_CURRENT_BINARY_DIR}/fenixConfigVersion.cmake
${CMAKE_CURRENT_BINARY_DIR}/cmake/fenixConfig.cmake
${CMAKE_CURRENT_BINARY_DIR}/cmake/systemMPIOverride.cmake
DESTINATION cmake
)


include(CTest)

if(BUILD_EXAMPLES)
add_subdirectory(examples/01_hello_world/fenix)
add_subdirectory(examples/01_hello_world/mpi)
add_subdirectory(examples/02_send_recv/fenix)
add_subdirectory(examples/02_send_recv/mpi)
add_subdirectory(examples/03_reduce/fenix)
#add_subdirectory(examples/03_reduce/mpi)
add_subdirectory(examples/04_Isend_Irecv/fenix)
add_subdirectory(examples/04_Isend_Irecv/mpi)
add_subdirectory(examples/05_subset_create)
add_subdirectory(examples/06_subset_createv)

elseif(BUILD_TESTING)
#Some examples are useful tests as well.
add_subdirectory(examples/01_hello_world/fenix)
add_subdirectory(examples/02_send_recv/fenix)
add_subdirectory(examples/03_reduce/fenix)
add_subdirectory(examples/05_subset_create)
add_subdirectory(examples/06_subset_createv)
endif()

if(BUILD_TESTING)
add_subdirectory(test/subset_internal)
add_subdirectory(test/subset_merging)
add_subdirectory(test/request_tracking)
add_subdirectory(test/request_cancelled)
add_subdirectory(test/no_jump)
add_subdirectory(test/issend)
endif()
17 changes: 8 additions & 9 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -17,17 +17,16 @@
These instructions assume you are in your home directory.

1. Checkout Fenix sources
* For example: ` git clone <address of this repo> `
* For example: ` git clone <address of this repo> && cd Fenix`
2. Create a build directory.
* For example: ` mkdir -p ~/build/fenix/ && cd ~/build/fenix/ `
3. Specify the MPI C compiler to use. [Open MPI 5+](https://github.com/open-mpi/ompi/tree/v5.0.x) is the required version.
* To manually indicate which compiler `cmake` should use, set the `MPICC` variable to point to it.
* For example: ` export MPICC=~/install/mpi-ulfm/bin/mpicc `
* If the `MPICC` environment variable is not there, `cmake` will try to guess where the MPI implementation is. To help, make sure you include the installation directory of MPI in your `PATH`.
* For example: ` export PATH=~/install/mpi-ulfm/bin:$PATH `
4. Run ` cmake <Fenix source directory> ` and ` make `
* For example: ` cmake ~/Fenix && make `
5. For best compatibility with other cmake projects, run ` make install ` and add the install directory to your CMAKE\_PREFIX\_PATH
* Check out the CMake documentation for the best information on how to do this, but in general:
* Set the CC environment variable to the correct `mpicc`,
* Invoke cmake with `-DCMAKE_C_COMPILER=mpicc`,
* Add the mpi install directory to CMAKE_PREFIX_PATH.
* If you experience segmentation faults during simple MPI function calls, this is often caused by accidentally building against multiple versions of MPI. See the FENIX_SYSTEM_INC_FIX CMake option for a potential fix.
4. Run ` cmake ../ -DCMAKE_INSTALL_PREFIX=... && make install`
5. Optionally, add the install prefix to your CMAKE\_PREFIX\_PATHS environment variable, to enable `find_package(fenix)` in your other projects.


<pre>
Expand Down
Loading