-
Notifications
You must be signed in to change notification settings - Fork 38
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Reporting Issues with Pytraj using tutorials #1647
Comments
@PhiMykah which errors are you encountering? can you please paste here (vs uploading the notebook). |
Okay, a lot of segmentation faults and free errors. Loading using pt.load:double free or corruption (!prev) Fatal Python error: Aborted Current thread 0x00007fccdbe82480 (most recent call first): File "/.../pytraj/io.py", line 137 in load File "<stdin>", line 1 in <module> Extension modules: numpy.core._multiarray_umath, numpy.core._multiarray_tests, numpy.linalg._umath_linalg, numpy.fft._pocketfft_internal, numpy.random._common, numpy.random.bit_generator, numpy.random._bounded_integers, numpy.random._mt19937, numpy.random.mtrand, numpy.random._philox, numpy.random._pcg64, numpy.random._sfc64, numpy.random._generator, pytraj.core.c_dict, pytraj.core.box, pytraj.core.parameter_types, pytraj.core.coordinfo, pytraj.datafiles.datafiles, pytraj.utils.cyutils, pytraj.analysis.c_action.c_action, pytraj.analysis.c_action.actionlist, pytraj.trajectory.c_traj.c_trajectory, pytraj.datasets.c_datasets, pytraj.core.c_core, pytraj.datasets.cast_dataset, pytraj.datasets.c_datasetlist, pytraj.trajectory.c_traj.c_trajout, pytraj.trajectory.frame, pytraj.core.c_options, pytraj.topology.topology, pytraj.math.cpp_math, pytraj.core.topology_objects, pytraj.analysis.c_analysis.c_analysis (total: 33) Aborted (core dumped) using
|
@drroe do you think that this is caused my your recent commits in cpptraj?
Since we saw that in CI tests.
Hai
|
Sorry droe, I will remove your comment so you won't receive notification for this thread. |
@PhiMykah for now, can you please use the cpptraj's git commit that had the green tests?
![]() |
Sure! I'll give it a shot. |
@hainm Testing through all of the tutorial cases, they all seem to work on this cpptraj git commit head. |
Hi, So while it is possible there is indeed an issue with cpptraj, I've managed to track down the bad behavior (at least with my local conda environment) to which cython version is being used. I noticed that a recent python 3.8 conda environment, a pytraj test was failing with an abort:
However, an older python 3.8 conda environment was working just fine:
Comparing the two environments via
Version 3.0.0 was also broken, but downgrading to 0.29.36 worked. So it seems like the problem is that the 3.X.X versions of python do not work with pytraj. I often run cpptraj tests with valgrind enabled, so I'm pretty confident that there are no memory errors or leaks in libcpptraj.so itself (although I'm going to run one right now to be certain). Therefore I think the issue is either a bug in cython itself, or a bug in pytraj that is being exposed by the upgrade from the 0.X.X series to the 3.X.X series. @PhiMykah can you try downgrading your cython to one of the 0.X.X versions and see if the issue goes away? |
hi @drroe Thanks for investigating. It's still unclear to me how checking out the "green" commit from cpptraj helps resolve the segmentation fault too. |
Hello! Looking in my conda environment, my cython version is 0.29.36, as it likely came from the amber installation. I will attempt to downgrade to python 3.8.18, but the version amber gave me was 3.11.5. Thank you for your reply and help! @drroe |
hi @PhiMykah I think @drroe meant about checking the cython version (not the python version). The latest cython version is |
|
Pinning cython to 0.29.36 worked for the CI framework: Amber-MD/cpptraj#1062
@PhiMykah So you're saying that with cython 0.29.36 you are still getting errors? If that is the case you should list in exact detail how you set up your tests. What version of amber, what your cmake configure line was, etc. I will try to reproduce what you are seeing locally. |
@drroe My amber version is most recent version of amber23 (but the folder name is amber22 when it was installed). I used I followed the amber22 guide for installing from source:
I got the 4 expected errors from the test as well. Hope this helps! |
@PhiMykah more importantly, are you using macos or not? |
@hainm I am running Ubuntu 22.04.3 LTS. |
@PhiMykah I'm using a fresh install of AmberTools 23 on Fedora 38 (GNU 13.2.1, cmake 3.27.7). Used the
Note: I did have to fix the miniconda libstdc++:
This is because the Fedora GLIBC version is ahead of conda's. To fix it you just need to link the conda libstdc++ to the system one. This is a conda issue and does not result in the errors you were seeing: An independent python script appears to work fine.
So I'm unable to reproduce the issues you are seeing. |
@drroe I confirm with you that using pytraj's master (as of today) and cpptraj (latest, with pinning cython) and cython 0.29.36 is ok on my macos. I will test with cython 3 soon. |
I confirm that cython 3 is indeed an issue. |
I will attempt to obtain a fresh install of AmberTools23 and obtain the masters of pytraj and cpptraj
Yes, I used pytraj and cpptraj both built from source on the most recent versions, not the pytraj and cpptraj installed in ambertools. I will attempt to install again while also using cython 0.29.36 and fixing the libstdc++ import error. |
@PhiMykah one important thing to note is that different versions of cpptraj/pytraj should not be mixed, i.e. don't use AmberTools pytraj with GitHub cpptraj or vice versa. The reason is that API changes in the GitHub version of cpptraj are only accounted for in the GitHub version of pytraj. |
@drroe @hainm Great news! After much struggle, most recent version of amber with most recent version of pytraj and cpptraj seems to be working properly! Some things to note: Please let me know if theres any part of the code you would like me to contribute to now that I have a smooth working environment. What @hainm mentioned about cython is probably also correct, but I am unsure what happened that caused my earlier source to not work properly. |
um, this suggestion doesn't resolve if using cython 3.0 either. So it's indeed an issue with cython. @PhiMykah for now, please stick with cython |
Let's close this topic and move the segmentation fault with cython 3.0 to #1648 |
Hello!
I was doing some testing of the pytraj code, imported as a package from source, with the latest version of amber, cpptraj, and compiled libcpptraj. I wanted to identify some issues that came up as I worked through it. I have made 4 jupyter notebooks documenting the errors I received, and I tested using the "trytophan zipper." There may be something I am missing, however if that is the case it should be evident by my logs.
I worked on four tutorials: Basic Examples, Energy Decomposition, Pairwise RMSD, and Plot Correlation Matrix. Here is the archive of the four notebooks saved:
pytraj-notebook-testing.tar.gz
Please let me know if there is anything I can do to work with these errors if possible!
The text was updated successfully, but these errors were encountered: