Skip to content

Commit

Permalink
Fix isuus #117. Kernel crashing on Maxwell. Make OpenMP optional
Browse files Browse the repository at this point in the history
  • Loading branch information
buzmakov committed Feb 16, 2020
1 parent 6bcf769 commit 43181c1
Show file tree
Hide file tree
Showing 5 changed files with 22 additions and 8 deletions.
5 changes: 3 additions & 2 deletions Makefile
Original file line number Diff line number Diff line change
@@ -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/
Expand All @@ -16,6 +17,6 @@ doc:
cd docs; make html

test:
pytest --profile-svg
pytest

.PHONY: all core modules clean doc test
8 changes: 8 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down
5 changes: 4 additions & 1 deletion build/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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
6 changes: 2 additions & 4 deletions requirements.txt
Original file line number Diff line number Diff line change
Expand Up @@ -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
6 changes: 5 additions & 1 deletion tests/test_notebooks.py
Original file line number Diff line number Diff line change
Expand Up @@ -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'))
Expand Down Expand Up @@ -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'))

0 comments on commit 43181c1

Please sign in to comment.