Skip to content

Commit cce94f1

Browse files
author
Christian Ponte
committed
Create Fiuncho base project
1 parent 6740822 commit cce94f1

Some content is hidden

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

84 files changed

+4327
-6876
lines changed

.gitignore

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,2 @@
11
.vscode/
2-
build/
2+
build/

.travis.yml

+70
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,70 @@
1+
branches:
2+
only:
3+
- master
4+
- dev
5+
6+
language: cpp
7+
8+
os: linux
9+
10+
dist: bionic
11+
12+
git:
13+
depth: false
14+
15+
before_install:
16+
- sudo apt-get -q update
17+
18+
script:
19+
- mkdir -p build
20+
- cd build
21+
- cmake -D CMAKE_BUILD_TYPE=Release ..
22+
- make fiuncho
23+
24+
deploy:
25+
provider: pages
26+
skip_cleanup: true
27+
github_token: $GITHUB_TOKEN # Set in the settings page
28+
keep_history: true
29+
allow_empty_commit: true
30+
local_dir: build/docs/html
31+
on:
32+
branch: master
33+
34+
# Build matrix
35+
jobs:
36+
include:
37+
# GCC + OpenMPI
38+
- compiler: gcc
39+
install:
40+
- sudo apt-get -y install cmake libopenmpi2 libopenmpi-dev
41+
after_success: skip
42+
# GCC + MPICH
43+
- compiler: gcc
44+
install:
45+
- sudo apt-get -y install cmake libmpich12 libmpich-dev
46+
after_success: skip
47+
# Clang + OpenMPI
48+
- compiler: clang
49+
env:
50+
- OMPI_CC=clang
51+
- OMPI_CXX=clang++
52+
install:
53+
- sudo apt-get -y install cmake libopenmpi2 libopenmpi-dev
54+
after_success: skip
55+
# Clang + MPICH
56+
- compiler: clang
57+
env:
58+
- MPICH_CC=clang
59+
- MPICH_CXX=clang++
60+
install:
61+
- sudo apt-get -y install cmake libmpich12 libmpich-dev
62+
after_success: skip
63+
# Docs build and deploy
64+
- install:
65+
- sudo apt-get -y install cmake python3-sphinx python3-breathe doxygen
66+
script:
67+
- mkdir -p build
68+
- cd build
69+
- cmake -D CMAKE_BUILD_TYPE=Release ..
70+
- make docs

CMakeLists.txt

+61-47
Original file line numberDiff line numberDiff line change
@@ -1,63 +1,77 @@
1-
# MPI3SNP ~ https://github.com/chponte/mpi3snp
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.
213
#
3-
# Copyright 2018 Christian Ponte
4-
#
5-
# Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated
6-
# documentation files (the "Software"), to deal in the Software without restriction, including without limitation the
7-
# rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to
8-
# permit persons to whom the Software is furnished to do so, subject to the following conditions:
9-
#
10-
# The above copyright notice and this permission notice shall be included in all copies or substantial portions of the
11-
# Software.
12-
#
13-
# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE
14-
# WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR
15-
# COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR
16-
# OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
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+
17+
############################### CMake variables ###############################
1718

18-
cmake_minimum_required(VERSION 3.8)
19-
project(MPI3SNP VERSION 1.0)
19+
cmake_minimum_required(VERSION 3.11)
20+
project(Fiuncho VERSION 0.0.1 LANGUAGES CXX)
21+
set(CMAKE_CXX_STANDARD 14)
2022
set(CMAKE_RUNTIME_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}/)
23+
set(CMAKE_MODULE_PATH ${PROJECT_SOURCE_DIR}/cmake ${CMAKE_MODULE_PATH})
2124

22-
find_package(Threads REQUIRED)
23-
find_package(MPI REQUIRED)
24-
include(CheckLanguage)
25-
check_language(CUDA)
25+
############################# Build configuration #############################
2626

27-
if (NOT DEFINED TARGET_ARCH)
28-
if (CMAKE_CUDA_COMPILER)
29-
set(TARGET_ARCH "GPU" CACHE STRING "Select target architecture")
30-
enable_language(CUDA)
31-
else ()
32-
set(TARGET_ARCH "CPU" CACHE STRING "Select target architecture")
33-
endif ()
34-
set_property(CACHE TARGET_ARCH PROPERTY STRINGS "CPU" "GPU")
27+
# Compiler configurations:
28+
# GNU
29+
if (CMAKE_CXX_COMPILER_ID STREQUAL "GNU")
30+
set(CMAKE_CXX_FLAGS_DEBUG
31+
"-DDEBUG -g -fverbose-asm -O1 -march=native -mtune=native -Wall -Wextra\
32+
-Wpedantic")
33+
set(CMAKE_CXX_FLAGS_RELEASE
34+
"-DNDEBUG -Ofast -march=native -mtune=native")
35+
set(CMAKE_CXX_FLAGS_RELWITHDEBINFO
36+
"-DDEBUG -g -fverbose-asm -Ofast -march=native -mtune=native")
37+
# Intel
38+
elseif (CMAKE_CXX_COMPILER_ID STREQUAL "Intel")
39+
set(CMAKE_CXX_FLAGS_DEBUG
40+
"-DDEBUG -g -debug inline-debug-info -O1 -xHost -mtune=native -Wall")
41+
set(CMAKE_CXX_FLAGS_RELEASE
42+
"-DNDEBUG -Ofast -xHost -mtune=native")
43+
set(CMAKE_CXX_FLAGS_RELWITHDEBINFO
44+
"-DDEBUG -g -debug inline-debug-info -Ofast -xHost -mtune=native")
45+
# Clang
46+
elseif (CMAKE_CXX_COMPILER_ID STREQUAL "Clang")
47+
set(CMAKE_CXX_FLAGS_DEBUG
48+
"-DDEBUG -g -fverbose-asm -O1 -march=native -mtune=native -Wall -Wextra\
49+
-Wpedantic")
50+
set(CMAKE_CXX_FLAGS_RELEASE
51+
"-DNDEBUG -Ofast -march=native -mtune=native")
52+
set(CMAKE_CXX_FLAGS_RELWITHDEBINFO
53+
"-DDEBUG -g -fverbose-asm -Ofast -march=native -mtune=native")
54+
else()
55+
message(FATAL_ERROR "Unsupported compiler detected: "
56+
${CMAKE_CXX_COMPILER})
3557
endif()
3658

3759
# Build type configuration
3860
set(DEFAULT_BUILD_TYPE "Release")
3961
if (NOT CMAKE_BUILD_TYPE AND NOT CMAKE_CONFIGURATION_TYPES)
40-
message(STATUS "Setting build type to ${DEFAULT_BUILD_TYPE} as none was specified.")
41-
set(CMAKE_BUILD_TYPE "${DEFAULT_BUILD_TYPE}" CACHE
42-
STRING "Choose the type of build" FORCE)
62+
message(STATUS
63+
"Setting build type to ${DEFAULT_BUILD_TYPE} as none was specified")
64+
set(CMAKE_BUILD_TYPE "${DEFAULT_BUILD_TYPE}"
65+
CACHE STRING "Choose the type of build" FORCE)
4366
# Set the possible values of build type for cmake-gui
44-
set_property(CACHE CMAKE_BUILD_TYPE PROPERTY STRINGS "Debug" "Release")
67+
set_property(CACHE CMAKE_BUILD_TYPE
68+
PROPERTY STRINGS "Debug" "Release" "RelWithDebInfo")
4569
endif ()
4670

47-
set(CMAKE_CXX_STANDARD 14)
48-
set(CMAKE_CXX_FLAGS_DEBUG "-g -O0")
49-
set(CMAKE_CXX_FLAGS_RELEASE "-DNDEBUG -O3")
50-
if (${TARGET_ARCH} STREQUAL "GPU")
51-
enable_language(CUDA)
52-
set(CMAKE_CUDA_STANDARD 11)
53-
set(CMAKE_CUDA_STANDARD_REQUIRED ON)
54-
set(CMAKE_CUDA_FLAGS "-arch=sm_30")
55-
set(CMAKE_CUDA_FLAGS_DEBUG "-g -O0")
56-
set(CMAKE_CUDA_FLAGS_RELEASE "-DNDEBUG -O3")
57-
# set(CUDA_PROPAGATE_HOST_FLAGS OFF)
58-
endif ()
71+
############################# Project directories #############################
5972

60-
# Third party libraries (common to GPU and CPU builds)
61-
add_subdirectory(thirdparty)
73+
# Project documentation
74+
add_subdirectory(docs EXCLUDE_FROM_ALL)
6275
# Project sources
6376
add_subdirectory(src)
77+
add_subdirectory(app)

README.md

+3-66
Original file line numberDiff line numberDiff line change
@@ -1,68 +1,5 @@
1-
# MPI3SNP
1+
# Fiuncho
22

3-
<p>
4-
<a href="https://doi.org/10.1177/1094342019852128" alt="Publication">
5-
<img src="https://img.shields.io/badge/DOI-10.1177%2F1094342019852128-blue"/></a>
6-
</p>
3+
[![Build Status](https://travis-ci.com/chponte/fiuncho.svg?token=Gxpcxy8NqxmoyEPxEuR5&branch=master)](https://travis-ci.com/chponte/fiuncho)
74

8-
## What is MPI3SNP?
9-
10-
MPI3SNP is a parallel software tool dedicated to genome-wide association studies, performing a third-order exhaustive
11-
search. It is targeted to cluster architectures, and mitigates the cubic time complexity inherent to third-order
12-
searches by exploiting the several layers of parallelism present in a supercomputer. CPU and GPU implementations are
13-
offered.
14-
15-
## Building
16-
17-
Support is currently limited to linux distributions only.
18-
19-
### Requirements
20-
21-
* CMake (>3.0 version)
22-
* A C++14 compatible compiler
23-
* MPI library
24-
25-
Optional:
26-
* CUDA
27-
28-
### Compilation
29-
30-
CMake is the project build manager. CMake should be able to determine installed compilers and libraries. If this is
31-
is not the case, please refer to your CMake version's documentation. By default, CMake will check for a CUDA
32-
installation and set the target architecture accordingly. This behaviour can be manually controlled by setting the
33-
`TARGET_ARCH` CMake variable to `CPU` or `GPU`.
34-
35-
Building the sources looks like this:
36-
37-
```commandline
38-
cd MPI3SNP/project/path
39-
mkdir build
40-
cd build/
41-
cmake ..
42-
make -j4
43-
```
44-
45-
## Usage
46-
47-
MPI3SNP takes two files as the input, using the [PLINK/TPED](https://www.cog-genomics.org/plink2/formats#tfam) format,
48-
and writes the results to a third file. All file paths are provided to the program as positional arguments as follows:
49-
50-
```commandline
51-
./MPI3SNP <path/to/tped> <path/to/tfam> <path/to/output>
52-
```
53-
54-
Additional configuration options (specific to either CPU or GPU implementation) are available to the user, and can be
55-
consulted using the `-h` flag.
56-
57-
## Sample files
58-
59-
[Sample files](https://github.com/chponte/mpi3snp/wiki/Sample-files) can be found on MPI3SNP's wiki. These are a syntetic dataset used for performance evaluation, which describe the input file format and can be used for verification/evaluation purposes.
60-
61-
## Troubleshooting
62-
63-
Support is currently limited to linux distributions only. If you are having trouble building/using the application,
64-
please submit a new issue to get help.
65-
66-
## License
67-
68-
This software is licensed under the GPU GPLv3 license. Check the [LICENSE](LICENSE.md) file for details.
5+
## WIP

app/CMakeLists.txt

+20
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
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+
16+
################################### Targets ###################################
17+
18+
add_executable(fiuncho main.cpp)
19+
20+
target_link_libraries(fiuncho PRIVATE fiuncho_lib)

src/main.cpp app/main.cpp

+15-17
Original file line numberDiff line numberDiff line change
@@ -1,20 +1,18 @@
11
/*
2-
* MPI3SNP ~ https://github.com/chponte/mpi3snp
2+
* This file is part of Fiuncho.
33
*
4-
* Copyright 2018 Christian Ponte
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.
58
*
6-
* Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated
7-
* documentation files (the "Software"), to deal in the Software without restriction, including without limitation the
8-
* rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to
9-
* permit persons to whom the Software is furnished to do so, subject to the following conditions:
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.
1013
*
11-
* The above copyright notice and this permission notice shall be included in all copies or substantial portions of the
12-
* Software.
13-
*
14-
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE
15-
* WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR
16-
* COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR
17-
* OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
14+
* You should have received a copy of the GNU General Public License
15+
* along with Fiuncho. If not, see <https://www.gnu.org/licenses/>.
1816
*/
1917

2018
/**
@@ -27,9 +25,9 @@
2725
*/
2826

2927
#include <mpi.h>
30-
#include "IOMpi.h"
31-
#include "Search.h"
32-
#include "Node_information.h"
28+
#include <fiuncho/utils/IOMpi.h>
29+
#include <fiuncho/engine/Search.h>
30+
#include <fiuncho/utils/Node_information.h>
3331

3432
int main(int argc, char **argv) {
3533
MPI_Init(&argc, &argv);
@@ -82,7 +80,7 @@ int main(int argc, char **argv) {
8280

8381
delete search;
8482
// Print runtime statistics to stdout
85-
IOMpi::Instance().cprint<IOMpi::B>(statistics.To_string());
83+
IOMpi::Instance().cprint<IOMpi::B>(statistics.str());
8684
IOMpi::Instance().mprint<IOMpi::B>("Overall time: " + std::to_string(etime - stime) + " seconds\n");
8785

8886
MPI_Finalize();

cmake/FindSphinx.cmake

+14
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
find_program(SPHINX_EXECUTABLE NAMES sphinx-build
2+
HINTS
3+
$ENV{SPHINX_DIR}
4+
PATH_SUFFIXES bin
5+
DOC "Sphinx documentation generator"
6+
)
7+
8+
include(FindPackageHandleStandardArgs)
9+
10+
find_package_handle_standard_args(Sphinx DEFAULT_MSG
11+
SPHINX_EXECUTABLE
12+
)
13+
14+
mark_as_advanced(SPHINX_EXECUTABLE)

0 commit comments

Comments
 (0)