how can I debug the C++ parts if I want to track how the programs and sub-routines are called in esys?

Asked by Kan

Hi,

I am now learning the esys to get understanding the DEM, so it is very useful if I can follow the running flow of the program.
But since now it is called by python, I do now know how to get inside the running procedure of how the program is runing, like in a DEBUG mode in Visual Studio, to know which function is called first and what is later.

I read the code, but it seems difficult to understand DEM if I can not run it and follow the running flow.

Do you have any suggestion.

Thanks.

Question information

Language:
English Edit question
Status:
Answered
For:
ESyS-Particle Edit question
Assignee:
No assignee Edit question
Last query:
Last reply:
Revision history for this message
Dion Weatherley (d-weatherley) said :
#1

Hi Kan,

Thanks for the question. Reading the ESyS-Particle code is probably not the best way to learn about DEM as the MPI parallel implementation and python interface make it somewhat complicated. To understand the algorithms and theory of DEM, I recommend you read chapter 2 of "Computational Granular Dynamics Models and Algorithms" by Poschel and Schwager:
http://www.amazon.com/Computational-Granular-Dynamics-Algorithms-Computation/dp/3540214852

This is an excellent introduction to DEM and how to implement the algorithms. ESyS-Particle uses a very similar approach to that described in the book.

If you want to trace which function calls are made, you can add <i>setVerbosity(True)</i> to the start of your python script. This will produce a huge amount of debug output that should help you understand the order in which subroutines are called.

I hope this helps.

Cheers,

Dion.

Can you help with this problem?

Provide an answer of your own, or ask Kan for more information if necessary.

To post a message you must log in.