Monitor All Called Subroutines

  • Thread starter minger
  • Start date
  • Tags
    Monitor
In summary, the conversation discusses a problem with a CFD solver written in Fortran 90 where a variable is causing issues due to incorrect assumptions. The individual is looking for a way to track the calls made by the program while it runs and is recommended to use a debugger tool such as TotalView or print statements in the code.
  • #1
minger
Science Advisor
1,496
2
Hey guys, I have a little problem with a code that I work with. The code is a full CFD solver written in Fortran 90. I need to make a change to a variable that gets passed all over the place. Basically its allocated to say N³, but at some point a routines operates on it thinking that it's only (N-x)³, so when it goes back to the original size, the data is essentially "shifted" to the lower indices.

Is there any way that I can track the calls that the program makes as it runs? I tried running gprof, but it doesn't seem to get everything. Furthermore it seems to be made more for optimization that tracking anyways.

This would really help a lot, thanks.
 
Technology news on Phys.org
  • #2


Hello,

Thank you for reaching out with your issue. I understand that you are working with a CFD solver written in Fortran 90 and need to make a change to a variable that is causing issues. It seems that the data is being shifted to lower indices due to a routine operating on it with the assumption that it is only (N-x)³, instead of N³.

In order to track the calls that the program makes while it runs, you can use a debugger tool. A debugger allows you to step through the code line by line, keeping track of the values of variables and the flow of the program. This will help you identify where the issue is occurring and how the variable is being changed.

One popular debugger for Fortran programs is TotalView. It allows you to set breakpoints, watch variables, and step through the code. It also has a feature called "reverse debugging" which allows you to go back in time and see how a variable has changed over the course of the program.

Another option is to use print statements in strategic locations in the code to track the value of the variable as it goes through different routines. This can be a bit more time-consuming, but it can also be helpful in pinpointing the issue.

I hope this helps and good luck with your project! Let me know if you have any further questions.
 
  • #3


I would suggest using a debugging tool or software to monitor all called subroutines in your code. There are many debugging tools available that can help track the flow of your program and identify any errors or issues. Some examples include gdb, Valgrind, and TotalView. These tools allow you to set breakpoints, inspect variables, and trace the execution of your code. They can also help identify any memory-related issues, which may be causing the problem you described. Additionally, using a version control system such as Git can also help track changes made to your code and make it easier to identify any potential issues. I would also recommend thoroughly testing your code with different input values to ensure that it is functioning correctly.
 

1. What is the purpose of monitoring all called subroutines?

The purpose of monitoring all called subroutines is to track the flow of a program and identify any potential errors or bottlenecks. By monitoring all called subroutines, you can analyze the performance of each subroutine and make necessary improvements to optimize the overall program.

2. How does monitoring all called subroutines affect the performance of a program?

Monitoring all called subroutines can have a slight impact on the performance of a program, as it adds additional steps to the execution process. However, the benefits of identifying and fixing any issues in the code can outweigh this slight decrease in performance.

3. What tools or techniques can be used to monitor all called subroutines?

There are various tools and techniques that can be used to monitor all called subroutines, such as debugging software, code profilers, and performance monitoring tools. You can also manually add code to track the execution of each subroutine.

4. Can monitoring all called subroutines be used for all programming languages?

Monitoring all called subroutines can be used for most programming languages, as long as the language supports debugging and code profiling. However, the specific tools and techniques used may vary depending on the language and development environment.

5. What are some benefits of monitoring all called subroutines?

Some benefits of monitoring all called subroutines include identifying and fixing errors, improving program efficiency, and gaining a better understanding of the program's flow and performance. It can also help with troubleshooting and debugging complex programs.

Similar threads

  • Programming and Computer Science
Replies
3
Views
1K
  • Engineering and Comp Sci Homework Help
Replies
7
Views
1K
  • Programming and Computer Science
Replies
8
Views
3K
  • Programming and Computer Science
Replies
2
Views
1K
  • Programming and Computer Science
Replies
4
Views
605
  • Programming and Computer Science
Replies
20
Views
1K
  • Programming and Computer Science
Replies
6
Views
8K
Replies
6
Views
1K
  • Programming and Computer Science
Replies
12
Views
3K
  • Programming and Computer Science
Replies
8
Views
2K
Back
Top