From 43181c1086851b53bc19ebdecd035e2cec982c39 Mon Sep 17 00:00:00 2001 From: Alexey Buzmakov Date: Sun, 16 Feb 2020 16:41:35 +0100 Subject: [PATCH] Fix isuus #117. Kernel crashing on Maxwell. Make OpenMP optional --- Makefile | 5 +++-- README.md | 8 ++++++++ build/Makefile | 5 ++++- requirements.txt | 6 ++---- tests/test_notebooks.py | 6 +++++- 5 files changed, 22 insertions(+), 8 deletions(-) diff --git a/Makefile b/Makefile index 0697a71..8687312 100644 --- a/Makefile +++ b/Makefile @@ -1,7 +1,8 @@ all: core modules +OPENMP_MODE ?= 0 core: - cd build; make srw + cd build; OPENMP_MODE=$(OPENMP_MODE) make srw modules: cp build/lib/srwlpy*.so wpg/srw/ @@ -16,6 +17,6 @@ doc: cd docs; make html test: - pytest --profile-svg + pytest .PHONY: all core modules clean doc test diff --git a/README.md b/README.md index b8cfecb..e2dd76a 100644 --- a/README.md +++ b/README.md @@ -41,6 +41,14 @@ cd WPG make ``` +if you need SRW with OpenMP support (currently crashed on Maxwell in some cases) + + +```bash +cd WPG +OPENMP_MODE=omp make +``` + ## Get Windows binaries WPG contain original SRW binaries for python 3.6 x64 with OpenMP support. diff --git a/build/Makefile b/build/Makefile index 5747c93..459a32b 100644 --- a/build/Makefile +++ b/build/Makefile @@ -5,6 +5,9 @@ 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) + .PHONY: all srw all: srw @@ -26,7 +29,7 @@ srw: unzip -o $(SRC_DIR)/srw.zip -d $(TMP_DIR)/ mv $(TMP_DIR)/SRW-5d3d4cff1e64f6c6587a5731fb94efdb4612c06e $(TMP_DIR)/SRW patch $(TMP_DIR)/SRW/cpp/py/Makefile py3.patch - cd $(TMP_DIR)/SRW; MODE=omp make all; + cd $(TMP_DIR)/SRW; MODE=$(OPENMP_MODE) make all; mkdir -p $(BUILD_DIR)/lib cp $(TMP_DIR)/SRW/cpp/gcc/srwlpy*.so $(BUILD_DIR)/lib/ cp $(TMP_DIR)/SRW/cpp/gcc/srwlpy*.so $(TMP_DIR)/SRW/env/work/srw_python diff --git a/requirements.txt b/requirements.txt index 7d26ab2..a33570f 100644 --- a/requirements.txt +++ b/requirements.txt @@ -2,15 +2,13 @@ #nomkl numpy >= 1.9 scipy -#pyqt matplotlib h5py pytest jupyter -#libgcc mock sphinx -python==3.6.10 -pytest-profiling +python >= 3.6.10 +pytest autopep8 requests \ No newline at end of file diff --git a/tests/test_notebooks.py b/tests/test_notebooks.py index c7272a2..94efd96 100644 --- a/tests/test_notebooks.py +++ b/tests/test_notebooks.py @@ -35,6 +35,10 @@ def _test_notebook(path): assert errors == [] +def test_beamline_s1_simple(): + _test_notebook( + os.path.join('samples', 'beamlines', 'S1_SPB_CRL_simplified', 'S1_SPB_CRL_simplified.ipynb')) + def test_tutoral_intro(): _test_notebook( os.path.join('samples', 'Tutorials', 'Tutorial_intro.ipynb')) @@ -62,4 +66,4 @@ def test_tutoral_3(): def test_tutoral_3_new(): _test_notebook( - os.path.join('samples', 'Tutorials', 'Tutorial_case_3_new.ipynb')) + os.path.join('samples', 'Tutorials', 'Tutorial_case_3_new.ipynb')) \ No newline at end of file