TotalView Online Help : Chapter 10 Other Topics : Memory Debugging in Parallel Environments : IBM PE
IBM PE
Here's how to use the MemoryScape with IBM PE MPI codes.There are two alternatives. The first is to place the following proc within your .tvdrc file:
# Automatically enable memory error notifications
# (without enabling memory debugging) for poe programs.
proc enable_mem {loaded_id} {
set mem_prog poe
set executable_name [TV::image get $loaded_id name]
set file_component [file tail $executable_name]
if {[string compare $file_component $mem_prog] == 0} {
puts "Enabling Memory Debugger for $file_component”
dheap -notify
}
}
 
# Append this proc to TotalView’s image load
# callbacks so that it runs this macro automatically
dlappend TV::image_load_callbacks enable_mem
Here’s the second method:
1. You must prepare your parallel application to use MemoryScape’s agent as in "Linking Your Application With the Agent" and in "Installing tvheap_mr.a on AIX". Here is an example that usually works:
mpcc_r -g test.o -o test -Lpath_mr -Lpath \
path/aix_malloctype.o
2. Start TotalView on poe as usual:
totalview poe -a test args
 
NOTE >> Because tvheap_mr.a is not in poe’s LIBPATH, enabling memory debugging upon the poe process will cause problems because poe will not be able to locate the tvheap_mr.a malloc replacement library.
3. If you want TotalView to notify you when a heap error occurs in your application (and you probably do):
Select the Debug> Stop on Memory Error command from the Process Window showing poe. This command turns on notification in the poe process. The MPI processes to which TotalView will attach inherit notification.
4. Run the poe process.
5. Select Debug > Open MemoryScape from the menu to open MemoryScape to examine your memory usage.