Re: [gmx-users] debugging

2020-04-28 Thread Christian Blau

Hi Miro,


This can be of great help and a wonderful learning experience; at the 
same time also an enormous time-sink.


First, you did already do a bunch of very helpful work in trying to find 
the latest version, where things still work,  have the error be 
reproducible on a test system.


If you were to file an issue on gitlab here: 
https://gitlab.com/gromacs/gromacs/-/issues - note that we moved from 
redmine - with the test sytem attached, this would help tremendously in 
fixing the bug.



If you are up for the joy of debugging yourself and possibly provide 
your solution to gromacs, here are the steps that I would take:


0. check that this issue has not been already reported and solved (try 
the latest patch release (you did that), check in gitlab issues)


1. identify the smallest system where the issue occurs (or at least 
reasonably small, so that you can test quickly)


2. have a debug built of gromacs, using -DCMAKE_BUILD_TYPE=Debug

3. Set up a good build and debug environment. This in itself can take 
some time to find something that works well for the system that you're 
on. For a quick start gdb might work as well, more visual aids via IDEs 
like vscode and clion, ... are very useful.


4. Find the line where the error occurs (segfaults are kind of nice 
because they are very clear errors, often in a specific line and often a 
result of overlooked memory management (we're working our way through 
removing this via modernisation to modern C++ standards, but not there yet))


5. Look at the call hierarchy, try to understand the larger context that 
you're in.


6. Try to identify the smallest surrounding context in which the bug 
occurs, try to figure which function/class allocates the memory for the 
object that causes the segfault


If there are tests and the context is not too large:

  7. See if there are some tests written for this context. (usually 
there are corresponding .cpp files in the test folder where bugs occur), 
add a test that reproduces the buggy behaviour.


  8. Compile the tests, change code, then recompile tests until your 
test passes.


  9. Check that your intial case works, otherwise add more tests that 
catch the failing behaviour, fix, repeat


Otherwise:

Follow memory allocations, resizes, etc of the offending object, see if 
you can trigger the segfault earlier by trying to access memory that you 
know should be accessible.


Finally open a new merge-request on gitlab (see under 
https://gitlab.com/gromacs/gromacs/-/merge_requests), or create a merge 
request from the issue you had opened. Wait for comments and code-review.



Hope that gives you a feeling for the task on hand - I would personally 
definitely recommend at least looking *at* the source code and giving it 
a shot, also for the sake of getting a feel for the internal gears of 
GROMACS and just taking it as far as you can and have time.


Happy coding,

Christian

On 2020-04-28 12:16, Miro Astore wrote:


Hi all,

I am interested in how Gromacs works at the back end but I don't have much
C experience so this might be silly.

I have noticed that one of my systems that includes virtual sites parses
fine through grompp in gromacs 2019.1 and 3 but fails in 2020.1 with a
segmentation fault.
21169 Segmentation fault  (core dumped)
I'd like to try and debug this further. Should I try and go after this
myself?


--
Gromacs Users mailing list

* Please search the archive at 
http://www.gromacs.org/Support/Mailing_Lists/GMX-Users_List before posting!

* Can't post? Read http://www.gromacs.org/Support/Mailing_Lists

* For (un)subscribe requests visit
https://maillist.sys.kth.se/mailman/listinfo/gromacs.org_gmx-users or send a 
mail to gmx-users-requ...@gromacs.org.

[gmx-users] debugging

2020-04-28 Thread Miro Astore
Hi all,

I am interested in how Gromacs works at the back end but I don't have much
C experience so this might be silly.

I have noticed that one of my systems that includes virtual sites parses
fine through grompp in gromacs 2019.1 and 3 but fails in 2020.1 with a
segmentation fault.
21169 Segmentation fault  (core dumped)
I'd like to try and debug this further. Should I try and go after this
myself?

-- 
Miro A. Astore   (he/him)
PhD Candidate | Computational Biophysics
Office 434 A28 School of Physics
University of Sydney
-- 
Gromacs Users mailing list

* Please search the archive at 
http://www.gromacs.org/Support/Mailing_Lists/GMX-Users_List before posting!

* Can't post? Read http://www.gromacs.org/Support/Mailing_Lists

* For (un)subscribe requests visit
https://maillist.sys.kth.se/mailman/listinfo/gromacs.org_gmx-users or send a 
mail to gmx-users-requ...@gromacs.org.


Re: [gmx-users] Debugging 'inconsistent shifts'

2015-01-16 Thread Kalev Takkis
On 15 January 2015 at 19:44, Justin Lemkul  wrote:

>
>
> On 1/15/15 11:25 AM, Kalev Takkis wrote:
>
>> On 15 January 2015 at 00:09, Justin Lemkul  wrote:
>>
>>
>>>
>>> On 1/14/15 4:44 PM, Kalev Takkis wrote:
>>>
>>>  Hi, list!

 GROMACS complains about inconsistent shifts and suggests me to check my
 topology. I have so done, but the problem is not immediately obvious.
 How
 can I make it tell me exactly which atoms/bonds it finds faulty?


  What were you doing when the error came up?  What was your exact
>>> command?
>>> What is your system?
>>>
>>>
>> Temperature equilibration, commands given were
>>   gmx grompp -f nvt.mdp -c simcell_minim.gro -p simcell.top -o
>> simcell_temp.tpr
>>   gmx mdrun -v -deffnm simcell_temp
>>
>> GROMACS version 5.0.4, ff OPLS-AA
>> Equilibration finishes without other problems, I can continue with the
>> next
>> step without the system blowing up. The error is not encountered during
>> minimisation, it finishes fine, energies are reasonable and no trace of
>> inconsistent shifts is found in the log.
>> System is chromatography column, silica slab with attached hydrocarbon
>> chains. The crystal surface is infinite in xz plane, so the mdp file
>> specifies
>> pbc = xyz
>> periodic_molecules = yes
>>
>>
> Have you verified that all the bonded terms that span a periodic boundary
> are specified correctly?
>
>  The model is hacked together from silica unit cell and chains using
>> pdb2gmx, so it's entirely possible that there is indeed something wrong
>> with my system. I'd like to know where. When GROMACS encounters this error
>>
>
> The topology is the first and most likely source of error.
>
>  can I make it reveal more details? Which atoms/bonds are involved? Some
>> diagnostics tool or verbosity switch to mdrun maybe?
>>
>>
> How soon does the system blow up?  General troubleshooting advice is at
> http://www.gromacs.org/Documentation/Terminology/Blowing_Up#Diagnosing_an_
> Unstable_System
>

It doesn't. Noticed the message in the terminal window when I was trying to
improve the visual with trjconv after the production run. Then went back
through the logs and found that it was first reported in NVE equilibration.

>
> All GROMACS tools have a -debug flag that can be set, but you'll dump out
> a massive file with a ton of information you don't need.  If you're not
> used to reading through it, it can be more of an obstacle than a useful
> tool :)


No kidding. 1 step run -> 25MB log file. Fortunately grep was able to
extract the list of wonky atoms in a nice concise manner. Thank you for the
advice.


All the best,
Kalev

>
>
> -Justin
>
> --
> ==
>
> Justin A. Lemkul, Ph.D.
> Ruth L. Kirschstein NRSA Postdoctoral Fellow
>
> Department of Pharmaceutical Sciences
> School of Pharmacy
> Health Sciences Facility II, Room 629
> University of Maryland, Baltimore
> 20 Penn St.
> Baltimore, MD 21201
>
> jalem...@outerbanks.umaryland.edu | (410) 706-7441
> http://mackerell.umaryland.edu/~jalemkul
>
> ==
> --
> Gromacs Users mailing list
>
> * Please search the archive at http://www.gromacs.org/
> Support/Mailing_Lists/GMX-Users_List before posting!
>
> * Can't post? Read http://www.gromacs.org/Support/Mailing_Lists
>
> * For (un)subscribe requests visit
> https://maillist.sys.kth.se/mailman/listinfo/gromacs.org_gmx-users or
> send a mail to gmx-users-requ...@gromacs.org.
>
-- 
Gromacs Users mailing list

* Please search the archive at 
http://www.gromacs.org/Support/Mailing_Lists/GMX-Users_List before posting!

* Can't post? Read http://www.gromacs.org/Support/Mailing_Lists

* For (un)subscribe requests visit
https://maillist.sys.kth.se/mailman/listinfo/gromacs.org_gmx-users or send a 
mail to gmx-users-requ...@gromacs.org.


Re: [gmx-users] Debugging 'inconsistent shifts'

2015-01-15 Thread Justin Lemkul



On 1/15/15 11:25 AM, Kalev Takkis wrote:

On 15 January 2015 at 00:09, Justin Lemkul  wrote:




On 1/14/15 4:44 PM, Kalev Takkis wrote:


Hi, list!

GROMACS complains about inconsistent shifts and suggests me to check my
topology. I have so done, but the problem is not immediately obvious. How
can I make it tell me exactly which atoms/bonds it finds faulty?



What were you doing when the error came up?  What was your exact command?
What is your system?



Temperature equilibration, commands given were
  gmx grompp -f nvt.mdp -c simcell_minim.gro -p simcell.top -o
simcell_temp.tpr
  gmx mdrun -v -deffnm simcell_temp

GROMACS version 5.0.4, ff OPLS-AA
Equilibration finishes without other problems, I can continue with the next
step without the system blowing up. The error is not encountered during
minimisation, it finishes fine, energies are reasonable and no trace of
inconsistent shifts is found in the log.
System is chromatography column, silica slab with attached hydrocarbon
chains. The crystal surface is infinite in xz plane, so the mdp file
specifies
pbc = xyz
periodic_molecules = yes



Have you verified that all the bonded terms that span a periodic boundary are 
specified correctly?



The model is hacked together from silica unit cell and chains using
pdb2gmx, so it's entirely possible that there is indeed something wrong
with my system. I'd like to know where. When GROMACS encounters this error


The topology is the first and most likely source of error.


can I make it reveal more details? Which atoms/bonds are involved? Some
diagnostics tool or verbosity switch to mdrun maybe?



How soon does the system blow up?  General troubleshooting advice is at 
http://www.gromacs.org/Documentation/Terminology/Blowing_Up#Diagnosing_an_Unstable_System


All GROMACS tools have a -debug flag that can be set, but you'll dump out a 
massive file with a ton of information you don't need.  If you're not used to 
reading through it, it can be more of an obstacle than a useful tool :)


-Justin

--
==

Justin A. Lemkul, Ph.D.
Ruth L. Kirschstein NRSA Postdoctoral Fellow

Department of Pharmaceutical Sciences
School of Pharmacy
Health Sciences Facility II, Room 629
University of Maryland, Baltimore
20 Penn St.
Baltimore, MD 21201

jalem...@outerbanks.umaryland.edu | (410) 706-7441
http://mackerell.umaryland.edu/~jalemkul

==
--
Gromacs Users mailing list

* Please search the archive at 
http://www.gromacs.org/Support/Mailing_Lists/GMX-Users_List before posting!

* Can't post? Read http://www.gromacs.org/Support/Mailing_Lists

* For (un)subscribe requests visit
https://maillist.sys.kth.se/mailman/listinfo/gromacs.org_gmx-users or send a 
mail to gmx-users-requ...@gromacs.org.


Re: [gmx-users] Debugging 'inconsistent shifts'

2015-01-15 Thread Kalev Takkis
On 15 January 2015 at 00:09, Justin Lemkul  wrote:

>
>
> On 1/14/15 4:44 PM, Kalev Takkis wrote:
>
>> Hi, list!
>>
>> GROMACS complains about inconsistent shifts and suggests me to check my
>> topology. I have so done, but the problem is not immediately obvious. How
>> can I make it tell me exactly which atoms/bonds it finds faulty?
>>
>>
> What were you doing when the error came up?  What was your exact command?
> What is your system?
>

Temperature equilibration, commands given were
 gmx grompp -f nvt.mdp -c simcell_minim.gro -p simcell.top -o
simcell_temp.tpr
 gmx mdrun -v -deffnm simcell_temp

GROMACS version 5.0.4, ff OPLS-AA
Equilibration finishes without other problems, I can continue with the next
step without the system blowing up. The error is not encountered during
minimisation, it finishes fine, energies are reasonable and no trace of
inconsistent shifts is found in the log.
System is chromatography column, silica slab with attached hydrocarbon
chains. The crystal surface is infinite in xz plane, so the mdp file
specifies
pbc = xyz
periodic_molecules = yes

The model is hacked together from silica unit cell and chains using
pdb2gmx, so it's entirely possible that there is indeed something wrong
with my system. I'd like to know where. When GROMACS encounters this error
can I make it reveal more details? Which atoms/bonds are involved? Some
diagnostics tool or verbosity switch to mdrun maybe?


All the best,
Kalev


>
> -Justin
>
> --
> ==
>
> Justin A. Lemkul, Ph.D.
> Ruth L. Kirschstein NRSA Postdoctoral Fellow
>
> Department of Pharmaceutical Sciences
> School of Pharmacy
> Health Sciences Facility II, Room 629
> University of Maryland, Baltimore
> 20 Penn St.
> Baltimore, MD 21201
>
> jalem...@outerbanks.umaryland.edu | (410) 706-7441
> http://mackerell.umaryland.edu/~jalemkul
>
> ==
> --
> Gromacs Users mailing list
>
> * Please search the archive at http://www.gromacs.org/
> Support/Mailing_Lists/GMX-Users_List before posting!
>
> * Can't post? Read http://www.gromacs.org/Support/Mailing_Lists
>
> * For (un)subscribe requests visit
> https://maillist.sys.kth.se/mailman/listinfo/gromacs.org_gmx-users or
> send a mail to gmx-users-requ...@gromacs.org.
>
-- 
Gromacs Users mailing list

* Please search the archive at 
http://www.gromacs.org/Support/Mailing_Lists/GMX-Users_List before posting!

* Can't post? Read http://www.gromacs.org/Support/Mailing_Lists

* For (un)subscribe requests visit
https://maillist.sys.kth.se/mailman/listinfo/gromacs.org_gmx-users or send a 
mail to gmx-users-requ...@gromacs.org.


Re: [gmx-users] Debugging 'inconsistent shifts'

2015-01-14 Thread Justin Lemkul



On 1/14/15 4:44 PM, Kalev Takkis wrote:

Hi, list!

GROMACS complains about inconsistent shifts and suggests me to check my
topology. I have so done, but the problem is not immediately obvious. How
can I make it tell me exactly which atoms/bonds it finds faulty?



What were you doing when the error came up?  What was your exact command?  What 
is your system?


-Justin

--
==

Justin A. Lemkul, Ph.D.
Ruth L. Kirschstein NRSA Postdoctoral Fellow

Department of Pharmaceutical Sciences
School of Pharmacy
Health Sciences Facility II, Room 629
University of Maryland, Baltimore
20 Penn St.
Baltimore, MD 21201

jalem...@outerbanks.umaryland.edu | (410) 706-7441
http://mackerell.umaryland.edu/~jalemkul

==
--
Gromacs Users mailing list

* Please search the archive at 
http://www.gromacs.org/Support/Mailing_Lists/GMX-Users_List before posting!

* Can't post? Read http://www.gromacs.org/Support/Mailing_Lists

* For (un)subscribe requests visit
https://maillist.sys.kth.se/mailman/listinfo/gromacs.org_gmx-users or send a 
mail to gmx-users-requ...@gromacs.org.


[gmx-users] Debugging 'inconsistent shifts'

2015-01-14 Thread Kalev Takkis
Hi, list!

GROMACS complains about inconsistent shifts and suggests me to check my
topology. I have so done, but the problem is not immediately obvious. How
can I make it tell me exactly which atoms/bonds it finds faulty?

All the best,
Kalev Takkis

Institute of Chemistry
Faculty of Science and Technology
University of Tartu
Ravila 14a
Tartu 50411
ESTONIA
-- 
Gromacs Users mailing list

* Please search the archive at 
http://www.gromacs.org/Support/Mailing_Lists/GMX-Users_List before posting!

* Can't post? Read http://www.gromacs.org/Support/Mailing_Lists

* For (un)subscribe requests visit
https://maillist.sys.kth.se/mailman/listinfo/gromacs.org_gmx-users or send a 
mail to gmx-users-requ...@gromacs.org.