Skip to content

Commit af02d56

Browse files
author
Christian Ponte
committed
Version 2
-Improve AVX implementations -Improve base implementations to allow for autovectorization -Improve CMake project organisation -Add support for RAW files -Improve documentation -Move automated tests from Travis to Github Actions -Improve tests -Add single-threaded benchmarks -Move from C++14 to C++17
1 parent 3e509c4 commit af02d56

File tree

92 files changed

+60764
-4183
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

92 files changed

+60764
-4183
lines changed

.github/scripts/build_and_test.sh

+72
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,72 @@
1+
#!/usr/bin/env bash
2+
set -xe
3+
4+
# Load env vars
5+
source ./.github/vars/$(echo ${GH_MATRIX_CC} | cut -d'+' -f1).sh
6+
source ./.github/vars/$(echo ${GH_MATRIX_CC} | cut -d'+' -f2).sh
7+
8+
# Declare configurations
9+
declare -A cmake_config=(\
10+
["icelake-server"]="\
11+
512,popcnt-512,512,\
12+
64,,64,"\
13+
["cascadelake"]="\
14+
512,harley-seal-512,,\
15+
512,lookup-512,,\
16+
512,cpu-256,,\
17+
512,harley-seal-256,,\
18+
512,lookup-original-256,,\
19+
512,lookup-256,,\
20+
512,popcnt-movdq-64,,\
21+
512,popcnt-unrolled-errata-64,,\
22+
,,256,if-mask\
23+
64,,64,"\
24+
["haswell"]="\
25+
256,cpu-256,,\
26+
256,harley-seal-256,,\
27+
256,lookup-256,,\
28+
256,lookup-original-256,,\
29+
256,popcnt-movdq-64,,\
30+
256,popcnt-unrolled-errata-64,,\
31+
64,,64,")
32+
declare -A sde_arch_flag=(\
33+
["icelake-server"]="-icx"\
34+
["cascadelake"]="-clx"\
35+
["haswell"]="-hsw")
36+
src_dir=$(pwd)
37+
38+
# Build loop
39+
mkdir build/
40+
cd build/
41+
for arch in ${!cmake_config[@]}; do
42+
for config in $(echo ${cmake_config[${arch}]}); do
43+
# Split config into vars
44+
gt_width=$(echo ${config} | cut -d',' -f1)
45+
popcnt_impl=$(echo ${config} | cut -d',' -f2)
46+
mi_width=$(echo ${config} | cut -d',' -f3)
47+
mi_impl=$(echo ${config} | cut -d',' -f4)
48+
# Compose CMake command
49+
cmake_args="-DCMAKE_BUILD_TYPE=RelWithDebInfo"
50+
if [ ! -z "$gt_width" ]; then
51+
cmake_args+=" -DGT_OP_WIDTH=${gt_width}"
52+
fi
53+
if [ ! -z "$popcnt_impl" ]; then
54+
cmake_args+=" -DPOPCNT_IMPL=${popcnt_impl}"
55+
fi
56+
if [ ! -z "$mi_width" ]; then
57+
cmake_args+=" -DMI_OP_WIDTH=${mi_width}"
58+
fi
59+
if [ ! -z "$mi_impl" ]; then
60+
cmake_args+=" -DMI_IMPL=${mi_impl}"
61+
fi
62+
# Build
63+
CFLAGS="${CFLAGS} -march=${arch} -mtune=${arch}" CXXFLAGS="${CFLAGS}" \
64+
cmake ${cmake_args} ${src_dir}
65+
make all
66+
# Test
67+
sde64 ${sde_arch_flag[${arch}]} -- \
68+
env CTEST_OUTPUT_ON_FAILURE=1 make test
69+
# Clean
70+
rm -rf *
71+
done
72+
done

.github/scripts/prep.sh

+26
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
#!/usr/bin/env bash
2+
set -xe
3+
4+
# Load env vars
5+
source ./.github/vars/$(echo ${GH_MATRIX_CC} | cut -d'+' -f1).sh
6+
source ./.github/vars/$(echo ${GH_MATRIX_CC} | cut -d'+' -f2).sh
7+
8+
# Install deps
9+
sudo apt-get -o Acquire::ForceIPv4=true update -qq 1>/dev/null
10+
sudo apt-get -o Acquire::ForceIPv4=true upgrade -qq 1>/dev/null
11+
sudo apt-get -o Acquire::ForceIPv4=true install \
12+
${COMPILER_PACKAGES} ${MPI_PACKAGES} -qq 1>/dev/null
13+
14+
# Install Intel SDE
15+
INTEL_SDE_URL="https://software.intel.com/content/dam/develop/external/\
16+
us/en/documents/downloads/sde-external-8.69.1-2021-07-18-lin.tar.bz2"
17+
INTEL_SDE_TARFILE=$(echo ${INTEL_SDE_URL} | rev | cut -d '/' -f 1 | rev)
18+
wget -q --user-agent="Mozilla/5.0 (Windows NT 10.0; WOW64) AppleWebKit/537.36 \
19+
(KHTML, like Gecko) Chrome/51.0.2704.103 Safari/537.36" ${INTEL_SDE_URL}
20+
mkdir intel_sde/
21+
tar -xf ${INTEL_SDE_TARFILE} --strip-components=1 -C intel_sde/
22+
echo "$(pwd)/intel_sde" >> $GITHUB_PATH
23+
24+
# Post install actions
25+
bash -c "${CC_POST_INSTALL}"
26+
bash -c "${MPI_POST_INSTALL}"

.github/vars/clang.sh

+5
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
export COMPILER_PACKAGES="clang-12 cmake"
2+
export CC=clang-12
3+
export CXX=clang++-12
4+
export CFLAGS="-O3 -ffast-math -Wall"
5+
export CXXFLAGS="${CFLAGS}"

.github/vars/gcc.sh

+5
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
export COMPILER_PACKAGES="gcc-10 g++-10 cmake"
2+
export CC=gcc-10
3+
export CXX=g++-10
4+
export CFLAGS="-O3 -ffast-math -Wall"
5+
export CXXFLAGS="${CFLAGS}"

.github/vars/intel.sh

+29
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
1+
export COMPILER_PACKAGES="intel-basekit intel-hpckit cmake"
2+
export CC=icc
3+
export CXX=icpc
4+
export CFLAGS="-O3 -fp-model=fast -Wall"
5+
export CXXFLAGS="${CFLAGS}"
6+
7+
# Add Intel repo
8+
APT_FILE=/etc/apt/sources.list.d/oneAPI.list
9+
if [ ! -f ${APT_FILE} ]; then
10+
wget -q "https://apt.repos.intel.com/intel-gpg-keys/\
11+
GPG-PUB-KEY-INTEL-SW-PRODUCTS.PUB"
12+
sudo apt-key add GPG-PUB-KEY-INTEL-SW-PRODUCTS.PUB
13+
rm GPG-PUB-KEY-INTEL-SW-PRODUCTS.PUB
14+
echo "deb https://apt.repos.intel.com/oneapi all main" | sudo tee \
15+
${APT_FILE}
16+
fi
17+
18+
# Load vars
19+
SETVARS_SH=/opt/intel/oneapi/setvars.sh
20+
if [ -f ${SETVARS_SH} ]; then
21+
{
22+
source ${SETVARS_SH}
23+
} 2>/dev/null
24+
fi
25+
# Also load vars after sucessfully installing the packages
26+
export CC_POST_INSTALL="\
27+
{\
28+
source '${SETVARS_SH}';\
29+
} 2>/dev/null"

.github/vars/intelmpi.sh

+16
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
export MPI_PACKAGES="intel-oneapi-mpi intel-oneapi-mpi-devel"
2+
export I_MPI_CC=${CC}
3+
export I_MPI_CXX=${CXX}
4+
export MPICC=mpiicc
5+
export MPICXX=mpiicpc
6+
7+
# Add Intel repo
8+
APT_FILE=/etc/apt/sources.list.d/oneAPI.list
9+
if [ ! -f ${APT_FILE} ]; then
10+
wget -q "https://apt.repos.intel.com/intel-gpg-keys/\
11+
GPG-PUB-KEY-INTEL-SW-PRODUCTS.PUB"
12+
sudo apt-key add GPG-PUB-KEY-INTEL-SW-PRODUCTS.PUB
13+
rm GPG-PUB-KEY-INTEL-SW-PRODUCTS.PUB
14+
echo "deb https://apt.repos.intel.com/oneapi all main" | sudo tee \
15+
${APT_FILE}
16+
fi

.github/vars/mpich.sh

+5
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
export MPI_PACKAGES="mpich libmpich12 libmpich-dev"
2+
export MPICH_CC=${CC}
3+
export MPICH_CXX=${CXX}
4+
export MPICC=mpicc
5+
export MPICXX=mpicxx

.github/vars/openmpi.sh

+12
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
export MPI_PACKAGES="openmpi-bin libopenmpi3 libopenmpi-dev"
2+
export OMPI_CC=${CC}
3+
export OMPI_CXX=${CXX}
4+
export MPICC=mpicc
5+
export MPICXX=mpic++
6+
7+
# Fix openmpi complaining about not having enough slots
8+
OPENMPI_HOSTFILE=/etc/openmpi/openmpi-default-hostfile
9+
export MPI_POST_INSTALL="\
10+
if [ -z '$(cat ${OPENMPI_HOSTFILE} | grep -v -E '^#')' ]; then\
11+
echo \"localhost slots=32\" | sudo tee -a ${OPENMPI_HOSTFILE};\
12+
fi"

.github/workflows/ctest.yml

+25
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
name: CTest
2+
on:
3+
push:
4+
branches:
5+
- main
6+
- dev
7+
jobs:
8+
linux:
9+
runs-on: ubuntu-20.04
10+
strategy:
11+
matrix:
12+
cc: [gcc+openmpi, intel+intelmpi, clang+mpich]
13+
env:
14+
GH_MATRIX_CC: ${{ matrix.cc }}
15+
steps:
16+
- name: Display configuration
17+
run: |
18+
printenv
19+
lscpu
20+
- name: Checkout
21+
uses: actions/checkout@v1
22+
- name: Install dependencies
23+
run: ./.github/scripts/prep.sh
24+
- name: Build and test
25+
run: ./.github/scripts/build_and_test.sh

.readthedocs.yml

100755100644
File mode changed.

.travis.yml

-43
This file was deleted.

CMakeLists.txt

+2-18
Original file line numberDiff line numberDiff line change
@@ -1,25 +1,9 @@
1-
# This file is part of Fiuncho.
2-
# Copyright (C) 2019 by Christian Ponte
3-
#
4-
# Fiuncho is free software: you can redistribute it and/or modify
5-
# it under the terms of the GNU General Public License as published by
6-
# the Free Software Foundation, either version 3 of the License, or
7-
# (at your option) any later version.
8-
#
9-
# Fiuncho is distributed in the hope that it will be useful,
10-
# but WITHOUT ANY WARRANTY; without even the implied warranty of
11-
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12-
# GNU General Public License for more details.
13-
#
14-
# You should have received a copy of the GNU General Public License
15-
# along with Fiuncho. If not, see <http://www.gnu.org/licenses/>.
16-
171
############################### CMake variables ###############################
182

193
cmake_minimum_required(VERSION 3.11)
204
cmake_policy(SET CMP0074 NEW)
21-
project(Fiuncho VERSION 1 LANGUAGES CXX)
22-
set(CMAKE_CXX_STANDARD 14)
5+
project(Fiuncho VERSION 2 LANGUAGES CXX)
6+
set(CMAKE_CXX_STANDARD 17)
237
set(CMAKE_RUNTIME_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}/)
248
set(CMAKE_STATIC_LIBRARY_PREFIX "")
259
set(CMAKE_MODULE_PATH ${PROJECT_SOURCE_DIR}/cmake ${CMAKE_MODULE_PATH})

LICENSE.md

+38-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
### GNU GENERAL PUBLIC LICENSE
1+
## GNU GENERAL PUBLIC LICENSE
22

33
Version 3, 29 June 2007
44

@@ -673,3 +673,40 @@ library, you may consider it more useful to permit linking proprietary
673673
applications with the library. If this is what you want to do, use the
674674
GNU Lesser General Public License instead of this License. But first,
675675
please read <https://www.gnu.org/licenses/why-not-lgpl.html>.
676+
677+
## THIRD PARTY SOFTWARE NOTICES
678+
679+
Fiuncho contains third-party code governed by the license(s) indicated below:
680+
681+
### sse-popcount (https://github.com/WojciechMula/sse-popcount/)
682+
683+
Copyright (c) 2008-2016, Wojciech Muła
684+
685+
Copyright (c) 2016, Kim Walisch
686+
687+
Copyright (c) 2016, Dan Luu
688+
689+
All rights reserved.
690+
691+
Redistribution and use in source and binary forms, with or without
692+
modification, are permitted provided that the following conditions are
693+
met:
694+
695+
1. Redistributions of source code must retain the above copyright
696+
notice, this list of conditions and the following disclaimer.
697+
698+
2. Redistributions in binary form must reproduce the above copyright
699+
notice, this list of conditions and the following disclaimer in the
700+
documentation and/or other materials provided with the distribution.
701+
702+
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS
703+
IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED
704+
TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A
705+
PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
706+
HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
707+
SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED
708+
TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
709+
PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
710+
LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
711+
NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
712+
SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.

README.md

+11-6
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,19 @@
11
# Fiuncho
22

3-
![](https://img.shields.io/badge/C++-14-blue.svg?style=flat&logo=c%2B%2B)
3+
![](https://img.shields.io/badge/C++-17-blue.svg?style=flat&logo=c%2B%2B)
44
![](https://img.shields.io/github/license/UDC-GAC/fiuncho?color=blue)
5-
[![Build Status](https://travis-ci.com/UDC-GAC/fiuncho.svg?branch=main)](https://travis-ci.com/UDC-GAC/fiuncho)
6-
[![Documentation Status](https://readthedocs.org/projects/fiuncho/badge/?version=latest)](https://fiuncho.readthedocs.io/en/latest/?badge=latest)
5+
[![CTest](https://github.com/UDC-GAC/fiuncho/actions/workflows/ctest.yml/badge.svg)](https://github.com/UDC-GAC/fiuncho/actions/workflows/ctest.yml)
6+
[![Documentation Status](https://readthedocs.org/projects/fiuncho/badge/)](https://fiuncho.readthedocs.io/en/latest/)
77

88
Fiuncho is an epistasis detection program, implementing an exhaustive search of
9-
epistasis interactions of any given size. Fiuncho offers multiple implementations,
10-
featuring AVX Intrinsics from different AVX extension sets, to support a wide
11-
variety of CPUs.
9+
epistasis interactions of any given size. Fiuncho uses a
10+
[SPMD](https://en.wikipedia.org/wiki/SPMD) (Single Program, Multiple Data)
11+
approach to accelerate the computation, exploiting the multiple cores available
12+
to a processor, or the multiple processors available in a cluster environment.
13+
Furthermore, Fiuncho takes advantage of the
14+
[SIMD](https://en.wikipedia.org/wiki/SIMD) (Single Instruction, Multiple Data)
15+
vector operations available to each CPU core, offering multiple *AVX*
16+
implementations to support a wide variety of *x86_64* processors.
1217

1318
## Documentation
1419

app/CMakeLists.txt

-15
Original file line numberDiff line numberDiff line change
@@ -1,18 +1,3 @@
1-
# This file is part of Fiuncho.
2-
#
3-
# Fiuncho is free software: you can redistribute it and/or modify
4-
# it under the terms of the GNU General Public License as published by
5-
# the Free Software Foundation, either version 3 of the License, or
6-
# (at your option) any later version.
7-
#
8-
# Fiuncho is distributed in the hope that it will be useful,
9-
# but WITHOUT ANY WARRANTY; without even the implied warranty of
10-
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
11-
# GNU General Public License for more details.
12-
#
13-
# You should have received a copy of the GNU General Public License
14-
# along with Fiuncho. If not, see <http://www.gnu.org/licenses/>.
15-
161
################################# Dependencies #################################
172

183
include(FetchContent)

0 commit comments

Comments
 (0)