segmentation fault

193 views
Skip to first unread message

Sunidhi

unread,
Apr 13, 2022, 1:19:23 PM4/13/22
to hoomd-users
Hi,

I am a new user of hoomd. I wanted to build a compound C-A-B using mbuild and then pack 1095 of these compounds into a box (using mbuild packmol) and save it as a gsd file for hoomd to read. I gave the final gsd file created by mbuild (box_abc.gsd) to hoomd using create_state_from_gsd and added the bonded and non bonded parameters. However when I am running a normal NVT run my kernel dies and there is a segmentation fault error. I have attached the hoomd script (jupyter notebook) for the same. Can you please take a look at this matter? Any information will be helpful.

The hoomd version I am using is the conda installation of hoomd-blue-3.0.0dev4 gpu version. I have increased the memory to 100gb and I still get the same error.


Thanks!

Sunidhi
box_abc.gsd
test.ipynb

Corwin Kerr

unread,
Apr 13, 2022, 2:14:18 PM4/13/22
to hoomd...@googlegroups.com
Hi Sunidhi,
Firstly, please update to the released version of hoomd 3.0.1. The version you are using is over a year old. There have been a lot of changes since beta v 4.
See https://hoomd-blue.readthedocs.io/en/v3.0.1/changelog.html for changes you may need to make to your script.

Best,
Corwin

--
You received this message because you are subscribed to the Google Groups "hoomd-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to hoomd-users...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/hoomd-users/bfae2750-c093-4a28-9e30-c36160377307n%40googlegroups.com.

Sunidhi

unread,
Apr 13, 2022, 2:30:04 PM4/13/22
to hoomd-users

Thanks for your reply! I understand, maybe I am missing something during the installation. Following the protocol listed here (https://hoomd-blue.readthedocs.io/en/v3.0.1/installation.html)
Using Python/3.6.3
$conda install -c conda-forge/label/hoomd_dev hoomd=*=*gpu*

This installs hoomd 3.0.0dev4-gpu_py36h182c3cc_0

$conda install -c conda-forge/label/hoomd hoomd=*=*gpu*

This installs hoomd 2.9.4-gpu_py36h334955f_1 

Joshua Anderson

unread,
Apr 13, 2022, 4:44:12 PM4/13/22
to hoomd...@googlegroups.com
Sunidhi,

Python 3.6 is past end of life and conda-forge stopped providing packages built against python 3.6 a long time ago. Upgrade to a current version of Python to obtain hoomd v3.0.1 through conda-forge.
------
Joshua A. Anderson, Ph.D.
Research Area Specialist, Chemical Engineering, University of Michigan
> To view this discussion on the web visit https://groups.google.com/d/msgid/hoomd-users/ed137fcb-e4b8-4f6b-a09b-c733ee0f3811n%40googlegroups.com.

Sunidhi

unread,
Apr 13, 2022, 8:08:03 PM4/13/22
to hoomd-users
Hi Joshua,

Thanks for the information. I used Python 3.7 and tried to install hoomd 3.0.1. The cpu version got installed while the gpu version, I am getting an error of "PackageNotFoundError"

Anyway using the updated hoomd.3.0.1 cpu version still gives the segmentation fault error.

Sunidhi

Joshua Anderson

unread,
Apr 14, 2022, 7:58:04 AM4/14/22
to hoomd...@googlegroups.com
Sunidhi,

The GPU builds are posted on conda-forge: https://anaconda.org/conda-forge/hoomd/files?version=3.0.1. In a fresh miniforge install, I tested:
$ conda install -c conda-forge "hoomd=*=*gpu*"
and it installed `conda-forge/linux-64::hoomd-3.0.1-gpu_py39h2f4d77a_0` as expected.

I don't develop conda or conda-forge, so you will need to reach out to their support channels for further support on conda package installation.

I am not able to debug the segmentation fault you report. While I like that you are using mbuild to initialize your system, I don't need to see or run that code to debug your hoomd script. I attempted to run only the hoomd portion of the script that you provided, and had to fix several errors (missing the buffer argument, remove seed argument). The last error I got which I did not attempt to fix was "RuntimeError: No angle types in the system.".

If you are certain that the segmentation fault is occurring in HOOMD, please submit a minimal HOOMD Python script + input file that demonstrate the problem that execute with HOOMD v3.0.1. I need it as a .py file so I can easily run it with a debugger (Jupyter manages kernel launches in the background with no easy opportunity to attach a debugger).
------
Joshua A. Anderson, Ph.D.
Research Area Specialist, Chemical Engineering, University of Michigan

> To view this discussion on the web visit https://groups.google.com/d/msgid/hoomd-users/d8ce4de0-9a5a-43fc-ba5c-bce6ec7f8fc6n%40googlegroups.com.

Sunidhi

unread,
Apr 14, 2022, 1:40:11 PM4/14/22
to hoomd-users
Hi Joshua,

Thanks for your reply. I think it might be that the cluster has old anaconda, hence it is not able to find the GPU version. 

However the segmentation fault happen in the CPU version of hoomd.3.0.1 as well. 

The gsd file system just has bond connectivity and 1095 molecules of C-A-B. I am defining the bond and angle force constant and equilibrium value using hoomd. I am not sure maybe this way of defining the bond and angle FF parameters doesn't work. Anyway even if those harmonic lines are commented and nonbonded interactions are only jtaken into consideration the error of segmentation fault still persists.

I have attached the python script with only hoomd and the initial system file. Please take a look. I appreciate all the help.

Thanks!
Sunidhi

test.py
box_abc.gsd

Joshua Anderson

unread,
Apr 14, 2022, 5:20:34 PM4/14/22
to hoomd...@googlegroups.com
Sunidhi,

I am not able to reproduce the segmentation fault with the latest test.py script. I get:

$ python test.py
Traceback (most recent call last):
File "/home/joaander/test.py", line 35, in <module>
cell = hoomd.md.nlist.Cell()
TypeError: __init__() missing 1 required positional argument: 'buffer'

It appears you did not update the script for v3.0.0.
------
Joshua A. Anderson, Ph.D.
Research Area Specialist, Chemical Engineering, University of Michigan

> To view this discussion on the web visit https://groups.google.com/d/msgid/hoomd-users/b01016b3-8f4c-4433-806e-eb5bd5e75485n%40googlegroups.com.
> <test.py><box_abc.gsd>

Sunidhi

unread,
Apr 14, 2022, 5:35:52 PM4/14/22
to hoomd-users
Hi Joshua,

Not sure the script I sent, when I am running it on the cluster it gives me  the error attached below

notice(2): Setting number of TBB threads to value of OMP_NUM_THREADS=1

/cm/local/apps/slurm/var/spool/job34311619/slurm_script: line 14: 13310 Segmentation fault      ./test.py

The error is the same "Segmentation fault" when I add buffer to the neighbor list.

cell = hoomd.md.nlist.Cell(buffer=0.4)

notice(2): Setting number of TBB threads to value of OMP_NUM_THREADS=1

/cm/local/apps/slurm/var/spool/job34311599/slurm_script: line 14: 12561 Segmentation fault      ./test.py

I am not sure if I am missing. May I ask does hoomd require a lot of memory?

Thanks!

Sunidhi



Joshua Anderson

unread,
Apr 15, 2022, 6:25:32 AM4/15/22
to hoomd...@googlegroups.com
Sunidhi,

The amount of memory HOOMD uses depends on the inputs you provide it.

It is very important that you share the *minimal* steps needed to reproduce the problem. If running your code with `cell = hoomd.md.nlist.Cell()` does not give the same error I shared, then your script doesn't even reach that line of code. Also, if you are "not sure" what script you even sent, then don't expect to have a coherent conversation about it. If there is any question, next time check the thread on the group page or your sent message folder to confirm. The quality of the answers you get on this list is directly proportionate to the quality of your question.

You mentioned "anaconda" in one message, so I do have another random guess at the cause of the segmentation fault. Install HOOMD in a new, clean miniconda or miniforge environment (use the latest version, please) as stated in the documentation. Anaconda includes hundreds of packages, many of which are not compatible with those on the conda-forge channel. When you install HOOMD along with an incompatible dependency, undefined behavior (such as segmentation faults) will occur.

If this still doesn't solve the problem, then in your next message please include the minimal code that produces the problem (this should be 3-4 lines of code max given your description so far) AND share the output of:
$ python3 --version
$ python3 -c "import hoomd; print(hoomd.version.version); print(hoomd)"
$ conda --version
$ conda list
------
Joshua A. Anderson, Ph.D.
Research Area Specialist, Chemical Engineering, University of Michigan

> To view this discussion on the web visit https://groups.google.com/d/msgid/hoomd-users/cc3c0336-9009-4054-bdca-fa8b8f51f101n%40googlegroups.com.

Reply all
Reply to author
Forward
0 new messages