Skip to content

Commit

Permalink
Adding openmp optional
Browse files Browse the repository at this point in the history
  • Loading branch information
gvegayon committed Jan 31, 2024
1 parent 5cf626e commit fbe8525
Show file tree
Hide file tree
Showing 17 changed files with 11 additions and 22 deletions.
4 changes: 2 additions & 2 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ jobs:
- name: Check
run: |
docker run --rm -i -v ${PWD}:/home/tests -w /home/tests ${cntr} \
make all-examples
OPENMP=-fopenmp make all-examples
test-macos:
runs-on: macos-latest

Expand All @@ -50,7 +50,7 @@ jobs:

- name: Check
run: |
cd tests && make main.o && ./main.o
cd tests && OPENMP=-fopenmp make main.o && ./main.o
# cd tests && make 01c.o && valgrind --leak-check=full ./01c.o
2 changes: 1 addition & 1 deletion examples/Makefile
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
VPATH = ../include/epiworld
CPPFLAGS= -std=c++11 -Wall -pedantic -g -O2 -ftree-vectorize # -fopenmp
CPPFLAGS= -std=c++11 -Wall -pedantic -g -O2 -ftree-vectorize $(OPENMP)
GPP=g++
# icpx take a look at ~/.profile
# # /opt/intel/oneapi/setvars.sh
Expand Down
1 change: 0 additions & 1 deletion tests/00-cloning-model-saves/README.md

This file was deleted.

1 change: 0 additions & 1 deletion tests/00-lfmcmc-saves/README.md

This file was deleted.

1 change: 0 additions & 1 deletion tests/01-queue-saves/README.md

This file was deleted.

1 change: 0 additions & 1 deletion tests/01-sample-saves/README.md

This file was deleted.

1 change: 0 additions & 1 deletion tests/01-sir-saves/README.md

This file was deleted.

1 change: 0 additions & 1 deletion tests/01-sirconnected-saves/README.md

This file was deleted.

1 change: 0 additions & 1 deletion tests/01b-sir-saves/README.md

This file was deleted.

1 change: 0 additions & 1 deletion tests/01c-sir-saves/README.md

This file was deleted.

1 change: 0 additions & 1 deletion tests/02-reproducible-sir-saves/README.md

This file was deleted.

1 change: 0 additions & 1 deletion tests/02-reproducible-sirconn-saves/README.md

This file was deleted.

1 change: 0 additions & 1 deletion tests/03-sis-saves/README.md

This file was deleted.

1 change: 0 additions & 1 deletion tests/04-initial-dist-saves/README.md

This file was deleted.

10 changes: 5 additions & 5 deletions tests/Makefile
Original file line number Diff line number Diff line change
@@ -1,20 +1,20 @@
all: main.o

main.o: main.cpp clean
g++ -std=c++14 -Wunused -Wall -Wextra -Wnull-dereference -fdelete-null-pointer-checks -O2 -fopenmp -g -pedantic main.cpp -o main.o
g++ -std=c++14 -Wunused -Wall -Wextra -Wnull-dereference -fdelete-null-pointer-checks -O2 $(OPENMP) -g -pedantic main.cpp -o main.o

main.a: main.cpp clean
clang++ -std=c++14 -Wall -Wextra -fopenmp -Wpedantic -O2 main.cpp -o main.a
clang++ -std=c++14 -Wall -Wextra $(OPENMP) -Wpedantic -O2 main.cpp -o main.a

# Compile 02-reproducible-sirconn.cpp
02-reproducible-sirconn.o: 02-reproducible-sirconn.cpp
g++ -std=c++14 -Wall -Wextra -O2 -g -fopenmp -pedantic 02-reproducible-sirconn.cpp -o 02-reproducible-sirconn.o
g++ -std=c++14 -Wall -Wextra -O2 -g $(OPENMP) -pedantic 02-reproducible-sirconn.cpp -o 02-reproducible-sirconn.o

02.o: 02-reproducible.cpp
g++ -std=c++14 -Wall -Wextra -O2 -g -fopenmp -pedantic 02-reproducible.cpp -o 02.o
g++ -std=c++14 -Wall -Wextra -O2 -g $(OPENMP) -pedantic 02-reproducible.cpp -o 02.o

01c.o: 01c-sir.cpp
g++ -std=c++14 -Wall -Wextra -O2 -g -fopenmp -pedantic 01c-sir.cpp -o 01c.o
g++ -std=c++14 -Wall -Wextra -O2 -g $(OPENMP) -pedantic 01c-sir.cpp -o 01c.o

# Check coverage using the main.o target
coverage: main.o
Expand Down
1 change: 0 additions & 1 deletion tests/main-saves/README.md

This file was deleted.

4 changes: 3 additions & 1 deletion tests/tests.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,9 @@
#include <iostream>
#include <type_traits>
#include <exception>
#include <omp.h>
#if defined(_OPENMP)
#include <omp.h>
#endif
#include "../include/epiworld/epiworld.hpp"

template<typename T>
Expand Down

0 comments on commit fbe8525

Please sign in to comment.