Closed bb515 closed 4 years ago
Regarding the Travis build, I can see that the error message when building pyopencl reads:
In file included from src/wrap_constants.cpp:30:0: src/wrap_cl.hpp:57:10: fatal error: CL/cl.h: No such file or directory
include <CL/cl.h>
^
~~~~ compilation terminated. error: command 'gcc' failed with exit status 1
This is odd as it used to work before and I cannot see what change led to this. I found the following online, where it is recommended that you should either install pyopencl using conda (instead of pip) or that you could use pip install --upgrade pip setuptools wheel
, although these do not work for everyone apparently. Also, you could try rolling back to the previous version of setup.py (removing hdf5) and any other files related to the setup, just in case.
https://github.com/libtangle/qcgpu/issues/6
https://github.com/pydata/bottleneck/issues/281#issuecomment-560030902
I tried a few things in this branch, the miniconda and pyopencl installations worked but I now get another error which seems to indicate that the hardware devices cannot be detected. @bb515 Take a look and let me know what you think.
Running the examples (both 1 and 2) gives me the following error locally:
Traceback (most recent call last): File "example.py", line 11, in
from pstats import SortKey, Stats ImportError: cannot import name 'SortKey'
I ran the tests locally and 4 of them failed, see log below, you might not be seeing those in Travis as it fails to run due to the pyopencl issue:
Possibly fixed in this commit https://github.com/alan-turing-institute/Probabilistic-Peridynamics/pull/72/commits/0e8d8bf8279c0e2998d41f3fbe0989e3f9258a33 The tests originally being performed on a CPU, and not checked with a GPU. The dtype of the arrays used in the tests have been changed to be compatible with a GPU. The following dtypes were changed... In the opencl cases, 'int' was changed to 'intc', 'float' was changed to 'float64' In the cython case, 'int' dtypes were changed to 'int32'.
I have done the tests on a GPU now and they all seem to be working fine. Please re-run the tests on your local machine and let me know if this issue persists.
Running the examples (both 1 and 2) gives me the following error locally:
Traceback (most recent call last): File "example.py", line 11, in from pstats import SortKey, Stats ImportError: cannot import name 'SortKey'
What version of python are you using? The readme says that this package requires Python 3.7+ This might be the issue: https://stackoverflow.com/questions/53490248/python-cprofile-error-importing-sortkey-from-pstats
Regarding the Travis build, I can see that the error message when building pyopencl reads:
In file included from src/wrap_constants.cpp:30:0: src/wrap_cl.hpp:57:10: fatal error: CL/cl.h: No such file or directory
include <CL/cl.h>
^
~~~~ compilation terminated. error: command 'gcc' failed with exit status 1This is odd as it used to work before and I cannot see what change led to this. I found the following online, where it is recommended that you should either install pyopencl using conda (instead of pip) or that you could use
pip install --upgrade pip setuptools wheel
, although these do not work for everyone apparently. Also, you could try rolling back to the previous version of setup.py (removing hdf5) and any other files related to the setup, just in case. libtangle/qcgpu#6 pydata/bottleneck#281 (comment)
I have pushed a branch that is identical to the master branch here which results in the same build error. It seems that simply running the tests on the master branch again results in the same error, unless the act of pushing a clone of the branch from my laptop has broken the code in some way.
I will investigate by making the same changes you have made on fix_travis_setup, and open an issue.,
Running the examples (both 1 and 2) gives me the following error locally:
Traceback (most recent call last): File "example.py", line 11, in from pstats import SortKey, Stats ImportError: cannot import name 'SortKey'
What version of python are you using? The readme says that this package requires Python 3.7+ This might be the issue: https://stackoverflow.com/questions/53490248/python-cprofile-error-importing-sortkey-from-pstats
True, we actually fixed this with Jim a couple of months ago by requiring python 3.7+
@bb515 One other possibility for the errors in travis is some upstream change that broke the build, e.g. some newer version of pyopencl causes the issue, in which case it might work if you explicitly use an older version of the package in your travis script.
@bb515 One other possibility for the errors in travis is some upstream change that broke the build, e.g. some newer version of pyopencl causes the issue, in which case it might work if you explicitly use an older version of the package in your travis script.
Yes, this was the issue. Working with 'pip install pyopencl==2020.1' but not working with 'pip install pyopencl==2020.2'. We can investigate why this is later, but for now I will explicitly install the 2020.1 version. Closing issue.
Merging #72 into develop will decrease coverage by
8.91%
. The diff coverage is89.18%
.
@@ Coverage Diff @@
## develop #72 +/- ##
===========================================
- Coverage 99.14% 90.22% -8.92%
===========================================
Files 6 6
Lines 233 788 +555
===========================================
+ Hits 231 711 +480
- Misses 2 77 +75
Impacted Files | Coverage Δ | |
---|---|---|
peridynamics/__init__.py | 100.00% <ø> (ø) |
|
peridynamics/model.py | 87.10% <85.26%> (-12.90%) |
:arrow_down: |
peridynamics/cl/utilities.py | 91.66% <92.00%> (-3.58%) |
:arrow_down: |
peridynamics/integrators.py | 96.00% <95.89%> (-4.00%) |
:arrow_down: |
peridynamics/cl/__init__.py | 100.00% <100.00%> (ø) |
|
peridynamics/utilities.py | 100.00% <100.00%> (ø) |
Continue to review full report at Codecov.
Legend - Click here to learn more
Δ = absolute <relative> (impact)
,ø = not affected
,? = missing data
Powered by Codecov. Last update b69f82a...e900aa2. Read the comment docs.
Should the last part of examples/example2/example.py be cleaned (i.e. the commented lines)?
@bb515 Also, one more thing: In the README.md, it help new users a lot to have an overview of the package and its capabilities in the first section (before Building and Installation). This should be a few sentences about what problems this package addresses (with some example applications and a note that many of those are computationally intensive and slow without using a gpu, etc) and then a list of bullet points with the main features: Supported pperidynamics systems, input file formats, supported integrators, boundary options, CPU/GPU options and anything else you think is important to know.
And then a copy of the example code you have in the docstring of the Model class which can serve as a front page demo (no need to make the code complete, just include the main/default workflow and simplify as much as possible).
I think it has now shaped up very well, great work @bb515
I ran the tests locally and 4 of them failed, see log below, you might not be seeing those in Travis as it fails to run due to the pyopencl issue: