Skip to content

Commit 9850304

Browse files
committed
Merge branch 'develop'
2 parents f3bea5e + 281e8eb commit 9850304

File tree

245 files changed

+270163
-6017
lines changed

Some content is hidden

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

245 files changed

+270163
-6017
lines changed

.gitignore

+1
Original file line numberDiff line numberDiff line change
@@ -15,3 +15,4 @@ doc/doxy_build/
1515
deploy_rsa
1616
deploy_doc_to_gh-pages.sh
1717
deploy_rsa.enc
18+
*.bak

.travis.yml

+24-22
Original file line numberDiff line numberDiff line change
@@ -1,70 +1,72 @@
11
language: python
22
python:
3-
- "2.7"
4-
- "3.4"
53
- "3.5"
4+
- "3.6"
65
- "nightly"
76

87
sudo: required
98
dist: trusty
109

1110
matrix:
12-
allow_failures:
13-
# not yet Python 3 compatible
14-
- python: "3.4"
15-
- python: "3.5"
16-
# Python 3.6 "nightly" (upcoming)
17-
- python: "nightly"
11+
allow_failures:
12+
- python: "nightly"
1813

1914
env:
2015
global:
2116
- C_INCLUDE_PATH=/usr/lib/openmpi/include
22-
- DEPLOY_DOCS_FOR_PYTHON: '2.7'
23-
- TRIGGER_DOCKER_FOR_PYTHON: '2.7'
17+
- WITH_CUDA: true
18+
- DEPLOY_DOCS_FOR_PYTHON: '3.5'
19+
- TRIGGER_DOCKER_FOR_PYTHON: '3.5'
20+
- SIMEX_VERBOSE=MPI:PYTHON
2421

2522
addons:
2623
apt:
2724
packages:
2825
- openmpi-bin
2926
- libopenmpi-dev
3027
- wget
31-
- libhdf5-dev # non-MPI but with HL & CPP bindings
28+
- libhdf5-dev
3229
- build-essential
3330
- libbz2-dev
3431
- libfftw3-dev
3532
- liblapack-dev
3633
- cmake
3734
- gfortran
3835
- unzip
39-
- cython
36+
- cython3
4037
- sphinx-common
41-
- python-sphinx
42-
- python-qt4
38+
- python3-sphinx
4339
- libgsl0-dev
40+
- llvm
41+
- nvidia-cuda-dev
42+
- nvidia-profiler
43+
- nvidia-cuda-toolkit
4444

4545
cache:
46-
apt: true
46+
apt: false
4747
directories:
4848
- $HOME/.cache/pip
4949
- $HOME/lib
5050

5151
# install git lfs
5252
# see https://github.com/travis-ci/travis-ci/issues/3634
5353
before_install:
54-
- mkdir -p $HOME/bin
55-
- wget https://github.com/github/git-lfs/releases/download/v1.1.2/git-lfs-linux-amd64-1.1.2.tar.gz
56-
- tar xvfz git-lfs-linux-amd64-1.1.2.tar.gz
57-
- mv git-lfs-1.1.2/git-lfs $HOME/bin/git-lfs
58-
- export PATH=$PATH:$HOME/bin/
59-
- bash $TRAVIS_BUILD_DIR/TravisCI/pyqt.sh
54+
- mkdir -p $HOME/bin
55+
- wget https://github.com/github/git-lfs/releases/download/v1.1.2/git-lfs-linux-amd64-1.1.2.tar.gz
56+
- tar xvfz git-lfs-linux-amd64-1.1.2.tar.gz
57+
- mv git-lfs-1.1.2/git-lfs $HOME/bin/git-lfs
58+
- export PATH=$PATH:$HOME/bin/
59+
#- bash $TRAVIS_BUILD_DIR/TravisCI/pyqt.sh ## only needed for python v<3.5
60+
6061
before_script:
61-
# print interesting versions
6262
- python --version
6363
- python -c "import numpy as np; print( np.__version__ )"
6464
- python -c "import h5py as h5; print( h5.__version__ )"
6565
- ulimit -c unlimited
6666
- mpirun --version
67+
6768
script:
69+
#- wget ftp://ftp.wwpdb.org/pub/pdb/data/structures/divided/pdb/ni/pdb2nip.ent.gz
6870
- bash $TRAVIS_BUILD_DIR/TravisCI/build_and_test_simex.sh && bash $TRAVIS_BUILD_DIR/TravisCI/deploy_docs.sh
6971
after_success:
7072
- bash $TRAVIS_BUILD_DIR/TravisCI/trigger_docker.sh

CMakeLists.txt

+45-34
Original file line numberDiff line numberDiff line change
@@ -19,42 +19,21 @@ option (DEVELOPER_INSTALL "Install modules only, do not install SimEx files" OFF
1919

2020
option (INSTALL_TESTS "Install tests" ON)
2121

22-
2322
# options required for building the py_detector_interface module:
2423
# XCSITPotonDetector
25-
option(GEANT4_ROOT "-DGEANT4_ROOT=<abs path> absolute path to the geant4
26-
installation directory that includes \n
27-
./bin/\n
28-
./include/Geant4/\n
29-
./lib64/Geant4-<ver>/\n
30-
./share/Geant4-<ver>/data/"
31-
)
32-
option(XERCESC_ROOT "-DXERCESC_ROOT=<abs path> absolute path to the xercesc
33-
installation directory that includes\n
34-
./include/xercesc/\n
35-
./lib/"
36-
)
37-
option(XCSIT_ROOT "-DXCSIT_ROOT=<abs path> absolute path to the xcist
38-
installation directory that includes\n
39-
./include/xcsit/
40-
./lib/
41-
./lib/xcsit/
42-
./bin/"
43-
)
44-
option(BOOST_ROOT "-DBOOST_ROOT=<abs path> absolute path to the boost
45-
installation directory that includes\n
46-
./include/boost/
47-
./lib/"
48-
)
4924
option(PY_DETECTOR_INTERFACE_DEBUG "
5025
-DPY_DETECTOR_INTERFACE_DEBUG=default: OFF | ON"
5126
)
5227

28+
### PYTHON
29+
FIND_PACKAGE(PythonInterp 3.5 REQUIRED)
5330

5431
set (LIBDIR lib)
5532
set (INCLUDEDIR include)
5633
set (BINDIR bin)
57-
set (PYPATH ${LIBDIR}/python2.7)
34+
set (PYPATH ${LIBDIR}/python${PYTHON_VERSION_MAJOR}.${PYTHON_VERSION_MINOR})
35+
message( "PYPATH=${PYPATH}" )
36+
5837
set (DOCDIR share/doc)
5938

6039
option (PACKAGE_MAKE "Use this option to create linux packages" OFF)
@@ -77,25 +56,57 @@ else()
7756
endif()
7857
endif()
7958

80-
message (STATUS "************************ checking python dependencies *****************************")
81-
add_subdirectory (Sources)
82-
59+
message (STATUS "************************ checking python dependencies *****************************")
60+
add_subdirectory (Sources)
61+
62+
#By default all modules are included/excluded depending on this flag.
63+
#If a flag: USE_${module_name} is passed, this will overwrite teh default.
64+
#For example:
65+
# [De-]activate all modules:
66+
# cmake -DUSE_MODULES_DEFAULT=[OFF]ON [...]
67+
# Activate a single module:
68+
# cmake -DUSE_MODULES_DEFAULT=OFF -DUSE_wpg=ON [...]
69+
# Deactivate a single module:
70+
# cmake -DUSE_MODULES_DEFAULT=ON -DUSE_wpg=OFF [...]
71+
option(USE_MODULES_DEFAULT "Default to include/exclude a module" ON)
72+
message(STATUS "**************** Including modules (default "
73+
"${USE_MODULES_DEFAULT}) ****************")
8374
# find and add modules
8475
set (SIMEX_MODULES_ROOT "${SIMEX_SOURCE_DIR}/Modules")
8576
include (find_modules)
8677
foreach(module ${SIMEX_MODULES})
8778
MESSAGE("CHECKING ${module}")
8879
get_filename_component(module_name ${module} NAME)
89-
option(${module_name} "include ${module_name} module" ON)
80+
#If a variable USE_${module_name} is defined, use its value
81+
#overwrite the default.
82+
#Since we add the USE_* variable to the cache, we re-use it with
83+
#multiple cmake calls
84+
if(DEFINED USE_${module_name})
85+
#Add a cache variable with some help text. Note the
86+
#use of FORCE option to be sure the value is updated in the
87+
#cache
88+
set(USE_${module_name} ${USE_${module_name}}
89+
CACHE BOOL "Include mdoule ${module_name}" FORCE)
90+
endif()
9091
endforeach()
9192

9293
foreach(module ${SIMEX_MODULES})
9394
get_filename_component(module_name ${module} NAME)
94-
if (${module_name})
95-
message (STATUS "***** Including module : ${module} ****")
96-
add_subdirectory("${SIMEX_MODULES_ROOT}/${module}")
97-
message (STATUS "*********************************************************")
95+
#If a request specific to this module was done, use it
96+
if (DEFINED USE_${module_name})
97+
if(USE_${module_name})
98+
message (STATUS "***** Including module ${module_name} from: ${module} ****")
99+
add_subdirectory("${SIMEX_MODULES_ROOT}/${module}")
100+
message (STATUS "*********************************************************")
101+
endif()
102+
else()
103+
if(USE_MODULES_DEFAULT)
104+
message (STATUS "***** Including module ${module_name} from: ${module} ****")
105+
add_subdirectory("${SIMEX_MODULES_ROOT}/${module}")
106+
message (STATUS "*********************************************************")
107+
endif()
98108
endif()
109+
99110
endforeach()
100111

101112
# create simex_vars.sh file

Changelog.rst

+10
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,15 @@
11
CHANGELOG
22
=========
3+
Changes from 0.3 to 0.4
4+
-----------------------
5+
* Debugged XCSITPhotonDetector
6+
* Added phase grating simulation to WPG (wavefront propagation)
7+
* Added SASE model for low gain FEL via ocelot
8+
* GAPDPhotonDiffractor for polychromatic diffraction from large samples (>10^5 atoms. (GAPD code).
9+
* Many new data analysis utilities
10+
* Integration of python-pint to support pysical units and constants
11+
* New XMDYNPhotonMatterInteractor to wrap XMDYN photon-matter interaction code
12+
* New SLURM Submitter
313

414
Changes from 0.2 to 0.3
515
-----------------------

Docker/simex/Dockerfile

+11-4
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,19 @@
1-
FROM yakser/simex_3rdparty
2-
MAINTAINER Sergey Yakubov <[email protected]>
1+
FROM chuckie82/centos_env
2+
MAINTAINER Chunhong Yoon <[email protected]>
3+
4+
ADD requirements.txt /opt/requirements.txt
5+
ADD python_install.sh /opt/python_install.sh
6+
RUN ["bash", "/opt/python_install.sh"]
7+
ENV PATH /opt/miniconda/bin:$PATH
38

49
ARG simex_script=simex_install.sh
510
ADD $simex_script /opt/simex_install.sh
11+
612
RUN ["bash", "/opt/simex_install.sh"]
13+
714
ENV SIMEX_ROOT=/opt/simex_platform
815
ENV PATH=$SIMEX_ROOT/bin:$PATH
9-
ENV PYTHONPATH=$SIMEX_ROOT/Sources/python:$SIMEX_ROOT/lib/python2.7:$PYTHONPATH
16+
ENV PYTHONPATH=$SIMEX_ROOT/Sources/python:$SIMEX_ROOT/lib/python3.6:$PYTHONPATH
1017
ENV SIMEX_TESTS=$SIMEX_ROOT/Tests
1118
ENV PYFAI_TESTIMAGES=/tmp
12-
ENTRYPOINT ["python"]
19+

Docker/simex/build_image

+3-1
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,4 @@
1-
docker build --no-cache -t yakser/simex .
1+
cp ../../requirements.txt .
2+
3+
docker build --no-cache -t chuckie82/simex .
24

Docker/simex/python_install.sh

+47
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,47 @@
1+
#!/usr/bin/env bash
2+
3+
export myminiconda=Miniconda3-4.4.10-Linux-x86_64.sh
4+
URL=https://repo.continuum.io/miniconda/$myminiconda
5+
6+
# Install dir
7+
PREFIX=/opt/miniconda
8+
9+
# Download Miniconda
10+
wget -q $URL
11+
12+
# Extract packages
13+
14+
chmod +x $myminiconda
15+
./$myminiconda -b -p $PREFIX
16+
rm ./$myminiconda
17+
cd $PREFIX
18+
19+
# config
20+
export PATH=$PREFIX/bin:$PATH
21+
conda config --set always_yes True
22+
23+
# pip cannot install pyqt
24+
conda install --no-update-deps pyqt=4
25+
26+
# delete tests
27+
find . -type d -name tests -depth -exec rm -rf {} \;
28+
find . -type d -name test -depth -exec rm -rf {} \;
29+
30+
conda clean --tarballs
31+
32+
# install requirements from file (in given order)
33+
#$PREFIX/bin/pip install -r /opt/requirements.txt
34+
xargs -L 1 pip install < /opt/requirements.txt
35+
36+
# remove .pyc
37+
find . -name \__pycache__ -depth -exec rm -rf {} \;
38+
find . -name "*.pyc" -exec rm -rf {} \;
39+
40+
41+
# remove cache
42+
rm -r pkgs/*
43+
rm -rf /root/.cache/pip
44+
45+
46+
echo "export PATH=/opt/miniconda/bin:${PATH}" >> /etc/profile.d/scripts-path.sh
47+

Docker/simex/simex_install.sh

+23-6
Original file line numberDiff line numberDiff line change
@@ -5,19 +5,25 @@ set -e
55
BRANCH=develop
66
URL=https://github.com/eucall-software/simex_platform/archive/${BRANCH}.zip
77

8-
98
cd /opt
109

1110
wget $URL
1211
unzip ${BRANCH}.zip
1312
rm ${BRANCH}.zip
1413
cd simex_platform-${BRANCH}
1514

16-
export PATH=/opt/miniconda2/bin:$PATH
17-
export HDF5_ROOT=/opt/miniconda2
15+
export PATH=/opt/miniconda/bin:$PATH
16+
export HDF5_ROOT=/opt/miniconda
17+
18+
echo "###### DONE unzip ${BRANCH}.zip"
19+
20+
conda install -c intel mkl
21+
22+
echo "##### DONE install mkl"
1823

1924
ROOT_DIR=/opt/simex_platform
2025
mkdir -p $ROOT_DIR
26+
2127
# Create new build dir and cd into it.
2228

2329
mkdir -v build
@@ -26,23 +32,34 @@ cd build
2632
# Uncomment the next line and specify the install dir for a custom user install.
2733
#cmake -DCMAKE_INSTALL_PREFIX=$ROOT_DIR $ROOT_DIR
2834
# Uncomment the next line and specify the install dir for a developer install.
29-
cmake -DINSTALL_TESTS=OFF -DSRW_OPTIMIZED=ON -DDEVELOPER_INSTALL=OFF -DCMAKE_INSTALL_PREFIX=$ROOT_DIR $ROOT_DIR ..
35+
cmake -DXCSITPhotonDetector=OFF \
36+
-DGAPDPhotonDiffractor=OFF \
37+
-DCrystFELPhotonDiffractor=OFF \
38+
-DINSTALL_TESTS=OFF \
39+
-DSRW_OPTIMIZED=ON \
40+
-DDEVELOPER_INSTALL=OFF \
41+
-DCMAKE_INSTALL_PREFIX=$ROOT_DIR \
42+
$ROOT_DIR \
43+
..
3044

3145
chmod og+rwX -R $ROOT_DIR
3246

3347
# Build the project.
3448
make
3549

50+
echo "######## done make"
3651

3752
# Install the project.
3853
make install
3954
cd ../..
4055

41-
rm -rf simex_platform-${BRANCH}
56+
echo "####### done make install"
57+
58+
#rm -rf simex_platform-${BRANCH}
4259

4360

4461
#remove tests?
45-
rm -rf $ROOT_DIR/Tests
62+
#rm -rf $ROOT_DIR/Tests
4663

4764
echo "source /opt/simex_platform/bin/simex_vars.sh" > /etc/profile.d/scripts-simex.sh && \
4865
chmod 755 /etc/profile.d/scripts-simex.sh
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
default:
2-
gcc -O3 object_recon.c -lm -Wno-unused-result -lfftw3 -o object_recon
2+
gcc -O3 object_recon.c -Wno-unused-result -fopenmp -lfftw3_omp -lfftw3 -lm -o object_recon
33
mkl:
4-
gcc -O3 object_recon.c -o object_recon -m64 -I${MKLROOT}/include -I${MKLROOT}/include/fftw -Wl,--no-as-needed -L${MKLROOT}/lib/intel64 -lmkl_intel_lp64 -lmkl_core -lmkl_sequential -lpthread -lm
4+
gcc -O3 object_recon.c -o object_recon -m64 -I${MKLROOT}/include -I${MKLROOT}/include/fftw -Wl,--no-as-needed -L${MKLROOT}/lib/intel64 -lmkl_intel_lp64 -lmkl_core -lmkl_sequential -liomp5 -lpthread -lm -ldl
55

0 commit comments

Comments
 (0)