Open yihengwuKP opened 2 years ago
I also did a gdb run, just in case it's helpful for debugging:
gdb python
run Protein_DNA_example_CPU.py
and the final part of the output is:
......
[Thread 0x7fffd72b2700 (LWP 10666) exited]
[Thread 0x7fffd8ab5700 (LWP 10662) exited]
[Thread 0x7fffe4acd700 (LWP 10633) exited]
[Thread 0x7fffdc2bc700 (LWP 10655) exited]
[Thread 0x7fffdeac1700 (LWP 10648) exited]
[Thread 0x7fffe0ac5700 (LWP 10643) exited]
[Thread 0x7fffe42cc700 (LWP 10634) exited]
[Thread 0x7fffe2ac9700 (LWP 10637) exited]
Bond
Angle
Stacking
Dihedral
BasePair
CrossStacking
Exclusion
Electrostatics
ExclusionProteinDNA
ElectrostaticsProteinDNA
Connectivity
Chain
Chi
Excl
0
639
rama
rama_pro
contact
Number of atom: 1171 Number of residue: 179
Contact cutoff 1.0 nm
NonbondedMethod: 1
670096
670096
frag
Loading Fragment files(Gro files)
Saving fragment table as npy file to speed up future calculation.
.conda/envs/dinucl/lib/python3.6/site-packages/numpy/core/_asarray.py:136: VisibleDeprecationWarning: Creating an ndarray from ragged nested sequences (which is a list-or-tuple of lists-or-tuples-or ndarrays with different lengths or shapes) is deprecated. If you meant to do this, you must specify 'dtype=object' when creating the ndarray
return array(a, dtype, copy=False, order=order, subok=True)
All gro files information have been stored in the ./single_frags.npy.
You might want to set the 'UseSavedFragTable'=True to speed up the loading next time.
But be sure to remove the .npy file if you modify the .mem file. otherwise it will keep using the old frag memeory.
beta1
beta_1 term ON
beta2
beta_2 term ON
beta3
beta_3 term ON
pap1
pap_1 term ON
No ssweight given, assume all zero
pap2
pap_2 term ON
No ssweight given, assume all zero
Setting up the simulation...
Program received signal SIGSEGV, Segmentation fault.
0x00007ffff63272c1 in OpenMM::ContextImpl::ContextImpl(OpenMM::Context&, OpenMM::System const&, OpenMM::Integrator&, OpenMM::Platform*, std::map<std::string, std::string, std::less<std::string>, std::allocator<std::pair<std::string const, std::string> > > const&, OpenMM::ContextImpl*) () from /home/yihengwu917/.conda/envs/dinucl/lib/python3.6/site-packages/simtk/openmm/../../../../libOpenMM.so
Missing separate debuginfos, use: debuginfo-install glibc-2.17-292.el7.x86_64
Thank you for writing the steps so clearly, I could easily reproduce the segmentation fault. I still find it strange that the error only happens at the end of the program, so maybe when openmm is trying to clean its variables. The error commenting the line you mentioned seems related, but the forces
variable is not used by openmm, so I don't know why it would cause an earlier segmentation fault. Anyway, it seems to me that what it is causing the error are the ExclusionProteinDNA and the ElectrostaticsProteinDNA forces. Can you tell me if you stop getting the segmentation fault when you comment this section:
#Add DNA-protein interaction forces
#for force_name in open3SPN2.protein_dna_forces:
# print(force_name)
# force = open3SPN2.protein_dna_forces[force_name](dna,protein)
# s.addForce(force)
# forces.update({force_name: force})
hmmm intertesting, you are right, after commenting this block out, the segmentation fault is gone, not even at the end of the program.
Describe the bug There is always a 'segmentation fault' thrown after the simulation of 1lmb example in my local CPU platform. Although this seems harmless as we already finished the simulation, I found that if I comment out
forces.update({force_name:force})
(line 179) in Protein-DNA section, this 'segmentation fault' will be thrown before the simualtion. Weirdly I actually can't reproduce the latter behaviour in my local environment but can in cluster, both platform CPU and CUDA.To Reproduce Steps to reproduce the behavior:
jupyter nbconvert --to python Protein_DNA_example_CPU.ipynb
python Protein_DNA_example_CPU.py
or further, comment out line 179
python Protein_DNA_example_CPU.py
Expected behavior For the run of original
Protein_DNA_example_CPU.py
, we expect it to run without any errors; for commenting out the forces dictionary updating line, we expect it has no effect at all on the simulation because the dictionaryforces
is just used to store the names of the potentials and their force. (The reason why I comment it out is, I try to get rid of theforces
entirely, but found that this segfault would be thrown earlier, and I found that the critical component is the Protein-DNA force updates. ) Practically I'll just continue to use thisforces
and it works, but it's an interesting (and a bit weird) bug so I am reporting it. And like I said, I can't reproduce it in local environment (even if I directly download the buggy script) but it produces bugs in the cluster.Desktop (please complete the following information):
Error message For the original run:
For the commented run:
For this commented run, the error is thrown in the line 210:
I digged in a bit, and it further calls the initialization of the
context
, and that's the place the segfault is thrown:It's uncertain to me why or how this bug is created, and I would really appreciate it if you can share some insights on this!