Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
464 commits
Select commit Hold shift + click to select a range
4973949
fixes doc
Mar 12, 2020
142af47
some changes to import fft
Mar 16, 2020
a5b2021
further step to debug
Mar 17, 2020
1fe5d68
import fft now doesn't use cppimport, compiles to a temporary directo…
Apr 1, 2020
9071a10
initial refactor. Now subclasses the UnixCCompiler like a real person
Apr 1, 2020
04773ca
Removes the find module- not needed anymore
Apr 2, 2020
7a82798
clean up imports
Apr 2, 2020
417e771
Moving more to gpu - broken
bjoernenders Apr 6, 2020
1a76f5a
All elements in place, needs testing
bjoernenders Apr 6, 2020
440ce73
smaller fixes
bjoernenders Apr 6, 2020
32073c0
get rid of unnecessary printing
Apr 6, 2020
9f90e8c
Executes now with segfault when saving, can't confirm reco
bjoernenders Apr 6, 2020
0924ea1
save final result, even if autosave is false (like current master)
daurer Apr 10, 2020
0e8f850
Fixing travis build, ignoring all acceleration tests for now
daurer Apr 10, 2020
119c61f
refactor so that the temporary directories are cleaned up
Apr 24, 2020
12804ce
Merge branch 'pycuda' of github.com:ptycho/ptypy into pycuda
Apr 24, 2020
4cd09e4
moved tag for cuda tests in correct place
daurer Apr 24, 2020
49571a8
Bugfix: reduce epsilon in fourier update to avoid overflow issues
daurer May 12, 2020
f8092a7
remove trace of debugging
daurer May 13, 2020
f0bcdd2
Added memory to ML_pycuda but it's not used yet. Smaller fixes like LL
bjoernenders Jul 28, 2020
22deba8
Added regularizer to ML_pycuda with unity tests
bjoernenders Aug 3, 2020
ca21b3b
pycuda floating intensities first pass
bjoernenders Aug 4, 2020
4085ea0
Nans are gone, executs but differs from ML and ML_serial
bjoernenders Aug 4, 2020
16bea1b
Float intens test part one, renaming
bjoernenders Aug 4, 2020
b3418e0
Fixed a weird issue probably resulting from races when writing out th…
bjoernenders Aug 5, 2020
3db109a
renamed engine
bjoernenders Aug 6, 2020
c47b868
Merge branch 'ML_gpu' into pycuda_merge
bjoernenders Aug 6, 2020
9cbf13d
Fixed accelerate tests
bjoernenders Aug 6, 2020
fdadb53
using older version of pyopencl to fix travis build
daurer Aug 6, 2020
b7463b8
Restore normal Storage.data at the end, since its context has been ch…
daurer Aug 6, 2020
ccbc480
removed print statements
daurer Aug 13, 2020
257348c
made support constraint work by copying data to CPU and back
daurer Aug 13, 2020
b17c7b4
Added pycuda tests for gaussian filter, expected to fail
daurer Aug 13, 2020
2c71979
new template DM/ML pycuda template
bjoernenders Aug 17, 2020
b0e4403
Merge branch 'pycuda' of https://github.com/ptycho/ptypy into pycuda
bjoernenders Aug 17, 2020
b5ef2cc
Merge branch 'master' into pycuda
bjoernenders Aug 17, 2020
c3d650b
Added complex convolution kernel, tests passing
daurer Aug 18, 2020
32e458c
tiding up
daurer Aug 18, 2020
a327022
Merge branch 'pycuda' into pycuda_smoothing_kernel
daurer Aug 18, 2020
e51998e
object smoothing in DM_serial, DM_pycuda and DM_pycuda_streams
daurer Aug 19, 2020
af84802
fixed smoothing preconditioner in ML_pycuda
daurer Aug 19, 2020
4055bca
cast to int to avoid np.isscalar warning
daurer Aug 20, 2020
7b806ac
cast to int to avoid np.isscalar warnings
daurer Aug 20, 2020
d820307
include archflag in linker command to avoid warnings
daurer Aug 20, 2020
7f3f8b0
Create new context in engine_initiatlize \nthis allows to run multipl…
daurer Aug 20, 2020
4d8e4a2
Merge pull request #266 from ptycho/pycuda_smoothing_kernel
daurer Aug 21, 2020
175c819
Cleaning up and preparing for log-likelihood
daurer Aug 25, 2020
a15bd6e
fix name of engine in diamond benchmarks
daurer Aug 25, 2020
ffefa15
Added array-based kernel for log likelihood and tested against regula…
daurer Aug 26, 2020
2ba306e
log-likelihood error in DM_serial
daurer Sep 2, 2020
3d069f3
prepare for log-likelihood kernel, test is failing
daurer Sep 2, 2020
33f81a3
new kernel for log_likelihood, improved tests, seems to work
daurer Sep 2, 2020
ee4885e
clean up
daurer Sep 2, 2020
89b5eb7
more cleanup
daurer Sep 2, 2020
e69b86e
Implemented exit error in DM_serial, including unit test
daurer Sep 3, 2020
8f60a77
Implemented exit_error dor DM_pycuda doing the reduction on the CPU, …
daurer Sep 3, 2020
6a68fd8
Move tests for exit_error to Fourier kernel
daurer Sep 3, 2020
6cd0f4a
Full implementation of exit error on the GPU, works in tests and example
daurer Sep 3, 2020
4ace031
simplified log-likelihood reduction
daurer Sep 3, 2020
b20c329
Merge branch 'master' into pycuda
daurer Sep 4, 2020
f70afcc
added todo
daurer Sep 7, 2020
914088f
added new line
daurer Sep 7, 2020
3b93cc6
Merge pull request #267 from ptycho/pycuda_error_metrics
daurer Sep 7, 2020
bd81166
Removed debugging traces
daurer Sep 7, 2020
b104771
fixed tests
daurer Sep 7, 2020
0c9ec7f
Fixed bug in DM_pycuda
daurer Sep 7, 2020
9c7b407
Added error metrics to DM_pycuda_streams
daurer Sep 7, 2020
ade5983
Bugfix in pycuda_streams
daurer Sep 8, 2020
c01a691
device memory pool is causing problems in tests
daurer Sep 29, 2020
fab89e9
ML pycuda is broken -> fixed (#269)
daurer Oct 7, 2020
974a21c
bugfix: forgot to create placeholder for GPU memory
daurer Oct 22, 2020
836bcd0
fix in position refinement kernel
daurer Oct 22, 2020
b940aa9
Merge branch 'master' into pycuda
bjoernenders Nov 10, 2020
97eafb5
[WIP] Enable nearfield propagation for pycuda engines (#275)
bjoernenders Nov 13, 2020
42abe19
create rank_local for non-mpi start
bjoernenders Nov 20, 2020
5b4b5c0
[bugfix] Gaussian kernel now works with non-square images (#276)
daurer Nov 20, 2020
a6e3f40
apply probe support for non-MPI case, this closes #277
daurer Nov 25, 2020
0beb4d7
Introduce fourier_power_bound parameter (#279)
daurer Dec 14, 2020
90211dc
Fix Gaussian filtering kernel (#281)
daurer Dec 15, 2020
a36762f
Take abs of data (same as DM engine)
daurer Jan 18, 2021
2283ced
Revived old streaming engine
bjoernenders Jan 27, 2021
33972af
Bug fix to save new pos for new DM engines (#284)
daurer Jan 27, 2021
5a6f845
Use consistent variable names
daurer Jan 27, 2021
d96ef63
Bugfix: only convert to new coords when posref used
daurer Jan 28, 2021
98dc2ca
Merge branch 'master' into pycuda
daurer Feb 3, 2021
40f4daa
update test workflow
daurer Feb 3, 2021
bebe18b
Improve data loading scaling with decreasing frames_per_block (#286)
daurer Feb 3, 2021
72cd108
move tests to root level
daurer Feb 10, 2021
a995cd7
fix imports
daurer Feb 10, 2021
7617bec
Merge branch 'master' into pycuda
daurer Feb 16, 2021
8805238
Added new DM_local engine, currently does nothing
daurer Feb 18, 2021
49cf3eb
started working on iterator
daurer Feb 19, 2021
ccf7f16
Merge branch 'master' into pycuda
daurer Feb 19, 2021
7361af4
Merge branch 'pycuda' into gpu-hackathon
daurer Feb 19, 2021
cd99231
DM_local works with alpha=0
daurer Feb 19, 2021
0b3f615
Merge branch 'master' into pycuda
daurer Feb 19, 2021
8519704
Merge branch 'pycuda' into gpu-hackathon
daurer Feb 19, 2021
d84f4ff
DM_local work in progress
daurer Feb 19, 2021
ebbe022
same power bound for all scans
daurer Feb 22, 2021
90961ef
Use shuffled vieworder
daurer Feb 22, 2021
950a5c3
WIP: Reorganizing GPU efforts (#291)
bjoernenders Feb 27, 2021
a14f90e
Merge branch 'pycuda' into gpu-hackathon
daurer Feb 27, 2021
998c969
fixed imports
daurer Feb 27, 2021
1fb4ea2
fixed imports in accelerate tests
daurer Feb 27, 2021
0bc0a98
Merge branch 'pycuda' into gpu-hackathon
daurer Feb 27, 2021
6471c31
more import fixes
daurer Feb 27, 2021
e365392
Merge branch 'pycuda' into gpu-hackathon
daurer Feb 27, 2021
47ebe6b
More import fixes
daurer Feb 28, 2021
99f6ad7
Save out arrays for debugging
daurer Feb 28, 2021
0150209
Added DLS tests based on real data
daurer Feb 28, 2021
709c65d
most of dls_tests are working now
daurer Feb 28, 2021
6fd3928
improve dls_tests
daurer Mar 1, 2021
63771a1
DM_pycuda_stream fully functional plus extras (#292)
bjoernenders Mar 2, 2021
e54e15f
DLS real data tests now working, not all are passing
daurer Mar 2, 2021
988031b
Test with atomics for now
daurer Mar 2, 2021
07af856
Merge branch 'pycuda' into gpu-hackathon
daurer Mar 2, 2021
993572d
improved dls_tests
daurer Mar 3, 2021
51c2e81
small change to dls_tests
daurer Mar 3, 2021
0f3c520
only read regul data for regularization tests
daurer Mar 3, 2021
ddb03c9
Testing make_a012: still failing
daurer Mar 3, 2021
66ae199
Fixed import
daurer Mar 4, 2021
93d996c
Merge branch 'pycuda' into gpu-hackathon
daurer Mar 4, 2021
8c4dda4
Testing probe/object update without atomics
daurer Mar 4, 2021
002658e
Gpu flexible datatypes (#294)
xcelerit-team Mar 4, 2021
7838ce4
Making ob/pr denominator real, tests passing (#295)
daurer Mar 5, 2021
924851d
removed unused code throwing a confusing error
daurer Mar 5, 2021
49247c1
Gpu precision and bugfixes (#296)
xcelerit-team Mar 5, 2021
f5c9e50
simplifying ob/pr updates by removing denominator type (#297)
xcelerit-team Mar 5, 2021
a3ee838
Save Imodel
daurer Mar 8, 2021
527ce47
Added crop_pad and testing (#300)
bjoernenders Mar 9, 2021
0219aeb
Gpu hackathon: intensity kernel fix (#301)
xcelerit-team Mar 9, 2021
c93ddf3
Gpu hackathon: accuracy scripts (#302)
xcelerit-team Mar 9, 2021
3705653
Gpu hackathon: crop pad (#303)
xcelerit-team Mar 10, 2021
5409b17
consolidate yml files (#307)
daurer Mar 18, 2021
6a4c203
WIP: Local douglas rachford algorithm (#304)
daurer Mar 18, 2021
74fd603
Use blockmodel in DR templates
daurer Mar 18, 2021
45f0943
added benchmark script that fails with DM_pycuda_stream
daurer Mar 18, 2021
7c058ab
update scan name
daurer Mar 18, 2021
90ca185
Fixed bug in GpuDataManager2 that would overallocate blocks.
bjoernenders Mar 19, 2021
054ac6c
fixing transpose kernel call, as that moved to its own class
xcelerit-team Mar 22, 2021
6dd41bf
includes scratchmem sizi in dict key (#308)
bjoernenders Mar 24, 2021
c8b3f7b
updates to imported FFT to compile all supported sizes into the same …
xcelerit-team Mar 30, 2021
ce89ee7
integrating filtered_cufft in setup.py
xcelerit-team Mar 30, 2021
6c4904b
cleanup and re-organising file locations
xcelerit-team Mar 30, 2021
077c8a2
Revert accidental commit: "cleanup and re-organising file locations"
xcelerit-team Mar 30, 2021
e10d3b5
Revert accidental commit: "integrating filtered_cufft in setup.py"
xcelerit-team Mar 30, 2021
59a5f9c
Revert acidental commit: "updates to imported FFT to compile all supp…
xcelerit-team Mar 30, 2021
ad4e81e
Fix in context initialisation to raise an exception (#312)
xcelerit-team Mar 31, 2021
2849395
WIP: position correction (#309)
daurer Apr 1, 2021
13cffa5
no need to test for ML with position refinement
daurer Apr 1, 2021
b6c9c66
Merge branch 'pycuda' into gpu-hackathon
daurer Apr 1, 2021
b134bc6
archived extensions.py
daurer Apr 1, 2021
84665b5
Gpu smoothing fix (#314)
daurer Apr 1, 2021
9dbf5ff
Precompile cufft during setup to avoid MPI failures and speed up exec…
xcelerit-team Apr 1, 2021
0fb4d94
needed to make changes in position correction tests
daurer Apr 2, 2021
3383e7a
Gpu NCCL wrapper (#310)
xcelerit-team Apr 5, 2021
1c36ab8
checking at runtime if nccl/cuda-mpi are available
daurer Apr 6, 2021
2f10f86
Fixed bugs in address manglers
daurer Apr 7, 2021
0db7515
Fixed bug in DM stream engines related to smoothing/object update
daurer Apr 8, 2021
c8d4a23
reversing the order of the support constraints (#315)
daurer Apr 9, 2021
aef47bc
Make basic fourier update a true blend between DM and AP (#288)
daurer Apr 9, 2021
e70bae1
Cleaned up debugging traces
daurer Apr 9, 2021
9b458e7
Merge pull request #317 from ptycho/gpu-hackathon
daurer Apr 9, 2021
453e3a1
pycuda engines need to be explicitely imported
daurer Apr 9, 2021
c6c8484
Merge branch 'master' into pycuda
daurer Apr 9, 2021
dd8de8b
remove print statement
daurer Apr 16, 2021
842fba4
We need a third object copy for smoothing in the stream engines (#321)
daurer Apr 20, 2021
e127ab3
small bugfix
bjoernenders Apr 21, 2021
4cebc0d
bugfix: rescale size of aux when using MPI (#322)
daurer Apr 27, 2021
d70a20c
Update multi_gpu.py (#324)
bjoernenders Apr 28, 2021
4d21c07
Add option to choose fft lib in ML_pycuda (#326)
daurer May 3, 2021
e749a33
add padding to the HDF5loader (#330)
daurer May 5, 2021
d29e7ff
Allow different masks for spectro scans (#333)
daurer May 14, 2021
3db0afe
Record new positions only if requested (#328)
daurer May 14, 2021
2bcea77
Make recording of local error map optional (#329)
daurer May 14, 2021
f6f1763
Check if position refinement amplitude is large enough (#331)
daurer May 14, 2021
68c5b25
bugfix: correctly resize the aux shape (#332)
daurer May 17, 2021
92862d1
Use correct aux shape in propagation kernel tests
daurer May 18, 2021
57d8a9f
Update release_notes.md
bjoernenders May 18, 2021
32eede8
gather_dict/bcast_dict can create issues with multinode MPI (#327)
daurer May 19, 2021
c4ebe76
Position refinement for ML (#334)
daurer May 20, 2021
b554e99
avoid elementwise comparison
daurer May 23, 2021
288f0b0
Merge branch 'pycuda' of github.com:ptycho/ptypy into pycuda
daurer May 23, 2021
6e13c36
avoid elementwise comparison (after fixing typo)
daurer May 23, 2021
b8abea6
only update views for the original container (#337)
daurer Jun 1, 2021
6a491d0
remove automatic import of all experiment classes (#338)
daurer Jun 9, 2021
f49ce58
WIP: Python 3.9 (#339)
daurer Jun 9, 2021
8c40dc6
Allow for non-boolean frame filter in HDF5Loader
daurer Jun 10, 2021
40551f3
Merge branch 'master' into pycuda
daurer Jun 10, 2021
ffab44b
removed dependency
daurer Jun 14, 2021
105b978
fixed more invalid escape sequences
daurer Jun 14, 2021
f968a68
Fixed parsing of framefilter and solved dtype deprecation warnings
daurer Jun 14, 2021
6ec30c1
More dtype fixes to remove deprecation warnings
daurer Jun 14, 2021
3219263
select outer index for framefilter
daurer Jun 18, 2021
e97d787
log power bound
daurer Jul 13, 2021
4d5a04b
save floating intensities in ML_serial and ML_pycuda (#353)
daurer Jul 13, 2021
5e207e4
Clean exit when data does not fit into device memory (#354)
daurer Jul 13, 2021
d388852
DM_pycuda engines don't fully clear memory (#352)
daurer Jul 26, 2021
d855f2a
Remove traces of OpenCL engine (#311)
daurer Jul 30, 2021
407414b
correct order fixes problem with setstream tests
daurer Aug 6, 2021
f6c0d9d
fixed dtype
daurer Aug 6, 2021
cc25881
convert to int to avoid deprecation warnings
daurer Sep 9, 2021
6e640c9
WIP: include a general form of projection update (#361)
bjoernenders Sep 10, 2021
15782e9
Merge pull request #365 from ptycho/depecration-warnings
daurer Sep 10, 2021
0fbb606
Stochastic Douglas-Rachford algorithm (#359)
daurer Sep 16, 2021
ad9355d
Optional global object norm in ePIE (#367)
daurer Sep 24, 2021
c4a7374
Introducing the idea of customized engines with an object regulariser…
daurer Oct 8, 2021
d7e29fb
clean exit that also works with interactive python (e.g. notebooks) (…
daurer Oct 11, 2021
c2158ee
move non-standard engines into custom folder (#369)
daurer Oct 11, 2021
e400b91
Make fft chooser more intelligent, update compute_levels (#370)
daurer Oct 11, 2021
da801ad
roll back to require CUDA >=11.0 for cufft
daurer Oct 12, 2021
beb6f61
cufft compile flags (#372)
daurer Oct 19, 2021
adc7eff
use probe_update_start in stochastic serial/pycuda engines
daurer Oct 21, 2021
68a05c4
bugfix: forgot new argument in FFT chooser
daurer Oct 22, 2021
873a5c9
Improve logging (#371)
daurer Oct 27, 2021
5e61e4a
Updating release notes
daurer Nov 2, 2021
db8a4f0
Fix how frames_per_block is defined (#375)
daurer Nov 12, 2021
a5202bd
added convenience loaders for GPU engines and ptyscan modules (#376)
daurer Nov 15, 2021
c7598db
Rebranding projectional pycuda engines (#377)
daurer Nov 24, 2021
e5e9d14
EPIE improvements (#378)
daurer Nov 24, 2021
ab89a5a
make MPI optional (#379)
daurer Dec 3, 2021
33f5afd
Added wrapper for timing main ptycho functions (#381)
daurer Dec 13, 2021
0b1c2be
Derive engine name from params not class
daurer Dec 14, 2021
8fca5c0
Shift object and exit waves during centring probe (#373)
ptim0626 Dec 14, 2021
29e67e1
fixed imports for opencl engines
daurer Jan 17, 2022
ddfe901
Pre-determine if data is distributed (#335)
daurer Jan 18, 2022
9f9c0ac
Reorganise templates (#384)
daurer Jan 20, 2022
0bb4325
add minimal prep and run script in accelerate templates
daurer Jan 25, 2022
9c5f872
updated dependencies for pycuda engines
daurer Jan 25, 2022
c819e80
[WIP] Memory management for ML_pycuda engine revised after projection…
bjoernenders Jan 28, 2022
108b0c6
cleaned up gpudata test
daurer Jan 31, 2022
7953c33
Merge branches 'pycuda' and 'pycuda' of github.com:ptycho/ptypy into …
daurer Jan 31, 2022
b9d8696
temporarily disable flake8 linter (causing trouble with python 3.8)
daurer Jan 31, 2022
4b0f213
fix import
daurer Feb 1, 2022
9cd810c
fixed goudata tests and small bug in mem utils
daurer Feb 1, 2022
3d0b074
new hdf5 loader using mutliprocessing (#380)
daurer Feb 25, 2022
9fdcda4
WIP: Unit tests for engines (#389)
daurer Mar 4, 2022
446d2e7
revert Brenorm changes
daurer Mar 7, 2022
358a30d
moved cufft extension into separate module (#390)
daurer Mar 22, 2022
e2d93b2
fixed small bug in log_likelihood.cu
daurer Mar 25, 2022
325a6dd
WIP: Release 0.5 (#393)
bjoernenders Mar 29, 2022
8eb823e
archived unused tests, specified valid tests in setup.cfg
daurer Mar 30, 2022
c0a9487
simplified workflow, put back linter
daurer Mar 30, 2022
09e1fbe
Merge branch 'pycuda' of github.com:ptycho/ptypy into pycuda
daurer Mar 30, 2022
d3ecab5
solved conflict about template
daurer Mar 30, 2022
442e3ea
formatting changes for 0.5 release
daurer Mar 30, 2022
e15aebc
formatting changes to release notes
daurer Mar 30, 2022
fe56ca4
adjust length of underlines
daurer Apr 4, 2022
cfb3c94
typeDict is a depcreated alias of sctypeDict
daurer May 4, 2022
72f54d3
_MODE_CONV removed with PIL 9.1.0 (#399)
daurer May 4, 2022
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
65 changes: 65 additions & 0 deletions .clang-format
Original file line number Diff line number Diff line change
@@ -0,0 +1,65 @@
---
Language: Cpp
# BasedOnStyle: Google
AccessModifierOffset: -2
AlignAfterOpenBracket: true
AlignEscapedNewlinesLeft: false
AlignOperands: true
AlignTrailingComments: true
AllowAllParametersOfDeclarationOnNextLine: true
AllowShortBlocksOnASingleLine: false
AllowShortCaseLabelsOnASingleLine: false
AllowShortIfStatementsOnASingleLine: false
AllowShortLoopsOnASingleLine: true
AllowShortFunctionsOnASingleLine: All
AlwaysBreakAfterDefinitionReturnType: false
AlwaysBreakTemplateDeclarations: true
AlwaysBreakBeforeMultilineStrings: true
BreakBeforeBinaryOperators: None
BreakBeforeTernaryOperators: true
BreakConstructorInitializersBeforeComma: false
BinPackParameters: false
BinPackArguments: false
ColumnLimit: 80
ConstructorInitializerAllOnOneLineOrOnePerLine: true
ConstructorInitializerIndentWidth: 4
DerivePointerAlignment: true
ExperimentalAutoDetectBinPacking: false
IndentCaseLabels: true
IndentWrappedFunctionNames: false
IndentFunctionDeclarationAfterType: false
MaxEmptyLinesToKeep: 1
KeepEmptyLinesAtTheStartOfBlocks: false
NamespaceIndentation: None
ObjCBlockIndentWidth: 2
ObjCSpaceAfterProperty: false
ObjCSpaceBeforeProtocolList: false
PenaltyBreakBeforeFirstCallParameter: 1
PenaltyBreakComment: 300
PenaltyBreakString: 1000
PenaltyBreakFirstLessLess: 120
PenaltyExcessCharacter: 1000000
PenaltyReturnTypeOnItsOwnLine: 200
PointerAlignment: Left
SpacesBeforeTrailingComments: 2
Cpp11BracedListStyle: true
Standard: Auto
IndentWidth: 2
TabWidth: 8
UseTab: Never
BreakBeforeBraces: Allman
SpacesInParentheses: false
SpacesInSquareBrackets: false
SpacesInAngles: false
SpaceInEmptyParentheses: false
SpacesInCStyleCastParentheses: false
SpaceAfterCStyleCast: false
SpacesInContainerLiterals: true
SpaceBeforeAssignmentOperators: true
ContinuationIndentWidth: 4
CommentPragmas: '^ IWYU pragma:'
ForEachMacros: [ foreach, Q_FOREACH, BOOST_FOREACH ]
SpaceBeforeParens: ControlStatements
DisableFormat: false
...

26 changes: 14 additions & 12 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -21,37 +21,39 @@ jobs:
runs-on: ubuntu-latest
strategy:
max-parallel: 5
matrix:
python-version: [3.7,3.8,3.9]

steps:
- uses: actions/checkout@v2
- name: Set up Python 3.7
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v2
with:
python-version: 3.7
python-version: ${{ matrix.python-version }}
- name: Add conda to system path
run: |
# $CONDA is an environment variable pointing to the root of the miniconda directory
echo $CONDA/bin >> $GITHUB_PATH
- name: Install dependencies
run: |
conda env update --file ptypy_core_dependencies.yml --name base
conda env update --file dependencies_core.yml --name base
- name: Prepare ptypy
run: |
# Dry install to create ptypy/version.py
python setup.py install -n
# - name: Lint with flake8
# run: |
# conda install flake8
# # stop the build if there are Python syntax errors or undefined names
# flake8 . --count --select=E9,F63,F7,F82 --show-source --statistics
# # exit-zero treats all errors as warnings. The GitHub editor is 127 chars wide
# flake8 . --count --exit-zero --max-complexity=10 --max-line-length=127 --statistics
- name: Lint with flake8
run: |
conda install flake8
# stop the build if there are Python syntax errors or undefined names
flake8 . --count --select=E9,F63,F7,F82 --show-source --statistics
# exit-zero treats all errors as warnings. The GitHub editor is 127 chars wide
# flake8 . --count --exit-zero --max-complexity=10 --max-line-length=127 --statistics
- name: Test with pytest
run: |
conda install pytest
conda install pytest-cov
# pytest ptypy/test --doctest-modules --junitxml=junit/test-results.xml --cov=ptypy --cov-report=xml --cov-report=html --cov-config=.coveragerc
pytest
# pytest ptypy/test -v --doctest-modules --junitxml=junit/test-results.xml --cov=ptypy --cov-report=xml --cov-report=html --cov-config=.coveragerc
pytest -v
# - name: cobertura-report
# if: github.event_name == 'pull_request' && (github.event.action == 'opened' || github.event.action == 'reopened' || github.event.action == 'synchronize')
# uses: 5monkeys/cobertura-action@v7
Expand Down
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -28,3 +28,4 @@ ptypy/version.py
/env
*.egg-info
.DS_Store
.ipynb_checkpoints
19 changes: 18 additions & 1 deletion .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,8 @@ sudo: true
language: python
python:
- 3.7
compiler:
- gcc
before_install:
- wget https://repo.continuum.io/miniconda/Miniconda3-latest-Linux-x86_64.sh -O miniconda.sh; # grab miniconda
- bash miniconda.sh -b -p $HOME/miniconda # install miniconda
Expand All @@ -12,6 +14,21 @@ before_install:
- conda install pyyaml
- conda info -a # and print the info

- CUDA=10.1.105-1
- CUDA_SHORT=10.1
- UBUNTU_VERSION=ubuntu1804
- INSTALLER=cuda-repo-${UBUNTU_VERSION}_${CUDA}_amd64.deb
- wget http://developer.download.nvidia.com/compute/cuda/repos/${UBUNTU_VERSION}/x86_64/${INSTALLER}
- sudo dpkg -i ${INSTALLER}
- wget https://developer.download.nvidia.com/compute/cuda/repos/${UBUNTU_VERSION}/x86_64/7fa2af80.pub
- sudo apt-key add 7fa2af80.pub
- sudo apt update -qq
- sudo apt install -y cuda-core-${CUDA_SHORT/./-} cuda-cudart-dev-${CUDA_SHORT/./-} cuda-cufft-dev-${CUDA_SHORT/./-} cuda-curand-dev-${CUDA_SHORT/./-}
- sudo apt clean
- CUDA_HOME=/usr/local/cuda-${CUDA_SHORT}
- LD_LIBRARY_PATH=${CUDA_HOME}/lib64:${LD_LIBRARY_PATH}
- PATH=${CUDA_HOME}/bin:${PATH}

env:
- TEST_ENV_NAME=ptypy_core_dependencies
- TEST_ENV_NAME=ptypy_full_dependencies
Expand All @@ -27,7 +44,7 @@ script:
- echo $PYTHONPATH
- conda list
- python setup.py install # install ptypy
- py.test ptypy/test -v --cov ptypy --cov-report term-missing # now run the tests
- py.test test -v --ignore=ptypy/test/accelerate_tests --cov ptypy --cov-report term-missing # now run the tests

after_script:
- coveralls
Expand Down
11 changes: 8 additions & 3 deletions README.rst
Original file line number Diff line number Diff line change
Expand Up @@ -33,15 +33,18 @@ To get started quickly, please find the official documentation at the project pa
Features
--------

* **Difference Map** [#dm]_ algorithm engine with power bound constraint
* **Difference Map** [#dm]_ algorithm engine with power bound constraint [#power]_.
* **Maximum Likelihood** [#ml]_ engine with preconditioners and regularizers.
* A few more engines (RAAR, sDR, ePIE, ...).

* **Fully parallelized** (CPU only) using the Massage Passing Interface
(`MPI <https://en.wikipedia.org/wiki/Message_Passing_Interface>`_).
Simply execute your script with::

$ mpiexec -n [nodes] python <your_ptypy_script>.py

* **GPU acceleration** based on custom kernels, pycuda, and reikna.

* A **client-server** approach for visualization and control based on
`ZeroMQ <http://www.zeromq.org>`_ .
The reconstruction may run on a remote hpc cluster while your desktop
Expand All @@ -60,11 +63,11 @@ Installation

Installation should be as simple as ::

$ sudo python setup.py install
$ sudo pip install .

or, as a user, ::

$ python setup.py install --user
$ pip install . --user


Dependencies
Expand Down Expand Up @@ -130,3 +133,5 @@ References
.. [#dm] P.Thibault, M.Dierolf *et al.*, *Science* **321**, 7 (2009), `doi <http://dx.doi.org/10.1126/science.1158573>`_

.. [#ml] P.Thibault and M.Guizar-Sicairos, *New J. of Phys.* **14**, 6 (2012), `doi <http://dx.doi.org/10.1088/1367-2630/14/6/063004>`_

.. [#power] K.Giewekemeyer *et al.*, **PNAS 108**, 2 (2007), `suppl. material <https://www.pnas.org/doi/10.1073/pnas.0905846107#supplementary-materials>`__, `doi <https://doi.org/10.1073/pnas.0905846107>`__
7 changes: 7 additions & 0 deletions archive/array_based/__init__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
'''
A module for gpu acceleration

'''
import numpy as np
COMPLEX_TYPE= np.complex64
FLOAT_TYPE = np.float32
87 changes: 87 additions & 0 deletions archive/array_based/array_utils.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,87 @@
'''
useful utilities from ptypy that should be ported to gpu. These don't ahve external dependencies
'''
import numpy as np
from scipy import ndimage as ndi


def dot(A, B, acc_dtype=np.float64):
assert A.dtype == B.dtype, "Input arrays must of same data type"
if np.iscomplexobj(B):
out = np.sum(np.multiply(A, B.conj()).real, dtype=acc_dtype)
else:
out = np.sum(np.multiply(A, B), dtype=acc_dtype)
return out


def norm2(A):
return dot(A, A)


def abs2(input):
'''

:param input. An array that we want to take the absolute value of and square. Can be inplace. Can be complex or real.
:return: The real valued abs**2 array
'''
return np.multiply(input, input.conj()).real

def sum_to_buffer(in1, outshape, in1_addr, out1_addr, dtype):
'''
:param in1. An array . Can be inplace. Can be complex or real.
:param outshape. An array.
:param in1_addr. An array . Can be inplace. Can be complex or real.
:param out1_addr. An array . Can be inplace. Can be complex or real.
:return: The real valued abs**2 array
'''
out1 = np.zeros(outshape, dtype=dtype)
inshape = in1.shape
for i1, o1 in zip(in1_addr, out1_addr):
out1[o1[0], o1[1]:(o1[1] + inshape[1]), o1[2]:(o1[2] + inshape[2])] += in1[i1[0]]
return out1

def norm2(input):
'''
Input here could be a variety of 1D, 2D, 3D complex or real. all will be single precision at least.
return should be real
'''
return np.sum(abs2(input))

def complex_gaussian_filter(input, mfs):
'''
takes 2D and 3D arrays. Complex input, complex output. mfs has len 0<x<=2
'''
if len(mfs)>2:
raise NotImplementedError("Only batches of 2D arrays allowed!")

if input.ndim == 3:
mfs = np.insert(mfs, 0, 0)

return (ndi.gaussian_filter(np.real(input), mfs) +1j *ndi.gaussian_filter(np.imag(input), mfs)).astype(input.dtype)

def mass_center(A):
'''
Input will always be real, and 2d or 3d, single precision here
'''
return np.array(ndi.measurements.center_of_mass(A), dtype=A.dtype)

def interpolated_shift(c, shift, do_linear=False):
'''
complex bicubic interpolated shift.
complex output. This shift should be applied to 2D arrays. shift should have len=c.ndims

'''
if not do_linear:
return ndi.interpolation.shift(np.real(c), shift, order=3, prefilter=True) + 1j*ndi.interpolation.shift(np.imag(c), shift, order=3, prefilter=True)
else:
return ndi.interpolation.shift(np.real(c), shift, order=1, mode='constant', cval=0, prefilter=False) + 1j * ndi.interpolation.shift(np.imag(c), shift, order=1, mode='constant', cval=0, prefilter=False)


def clip_complex_magnitudes_to_range(complex_input, clip_min, clip_max):
'''
This takes a single precision 2D complex input, clips the absolute magnitudes to be within a range, but leaves the phase untouched.
'''
ampl = np.abs(complex_input)
phase = np.exp(1j * np.angle(complex_input))
ampl = np.clip(ampl, clip_min, clip_max)
complex_input[:] = ampl * phase
22 changes: 22 additions & 0 deletions archive/array_based/base.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
from collections import OrderedDict

class Adict(object):

def __init__(self):
pass


class BaseKernel(object):

def __init__(self, queue_thread=None, verbose=False):

self.queue = queue_thread
self.verbose = False
self.npy = Adict()
self.ocl = Adict()
self.benchmark = OrderedDict()


def log(self, x):
if self.verbose:
print(x)
Loading