Skip to content

Commit

Permalink
Fix issue #117 with OpenMP memory leaks
Browse files Browse the repository at this point in the history
  • Loading branch information
buzmakov committed Feb 19, 2020
1 parent 43181c1 commit 6c92450
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 5 deletions.
2 changes: 1 addition & 1 deletion Makefile
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
all: core modules
OPENMP_MODE ?= 0
OPENMP_MODE ?= omp

core:
cd build; OPENMP_MODE=$(OPENMP_MODE) make srw
Expand Down
15 changes: 11 additions & 4 deletions build/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,8 @@ TMP_DIR = $(ORIGDIR)/tmp
SRC_DIR = $(ORIGDIR)/sources
PYTHON_TOMO = $(BIN_DIR)/python

OPENMP_MODE ?= 0
#OPENMP_MODE = omp #uncoment here for openmp with fftw2 (crashed on maxwell)
#OPENMP_MODE ?= 0
OPENMP_MODE ?= omp #uncoment here for openmp with fftw2

.PHONY: all srw

Expand All @@ -24,10 +24,17 @@ clean:
srw:
mkdir -p $(TMP_DIR)
mkdir -p $(BUILD_DIR)/sources

# SRW commit. Switch from FFTW-2.1.5 to FFTW-3.3.8 (for 64-bit versions)
wget --no-check-certificate -nc -O $(SRC_DIR)/srw.zip https://github.com/ochubar/SRW/archive/5d3d4cff1e64f6c6587a5731fb94efdb4612c06e.zip; echo 'Done'
#wget --no-check-certificate -nc -O $(SRC_DIR)/srw.zip https://github.com/ochubar/SRW/archive/5d3d4cff1e64f6c6587a5731fb94efdb4612c06e.zip; echo 'Done'
#unzip -o $(SRC_DIR)/srw.zip -d $(TMP_DIR)/
#mv $(TMP_DIR)/SRW-5d3d4cff1e64f6c6587a5731fb94efdb4612c06e $(TMP_DIR)/SRW

# SY commit to fix OpenMP crashing
wget --no-check-certificate -nc -O $(SRC_DIR)/srw.zip https://github.com/SergeyYakubov/SRW/archive/openmp_memoryfix.zip; echo 'Done'
unzip -o $(SRC_DIR)/srw.zip -d $(TMP_DIR)/
mv $(TMP_DIR)/SRW-5d3d4cff1e64f6c6587a5731fb94efdb4612c06e $(TMP_DIR)/SRW
mv $(TMP_DIR)/SRW-openmp_memoryfix $(TMP_DIR)/SRW

patch $(TMP_DIR)/SRW/cpp/py/Makefile py3.patch
cd $(TMP_DIR)/SRW; MODE=$(OPENMP_MODE) make all;
mkdir -p $(BUILD_DIR)/lib
Expand Down

0 comments on commit 6c92450

Please sign in to comment.