Changeset 5df7203
- Timestamp:
- 06/01/15 06:25:13 (9 years ago)
- Branches:
- master
- Children:
- d270799
- Parents:
- 0109b01
- git-author:
- Hal Finkel <hfinkel@…> (06/01/15 06:25:13)
- git-committer:
- Hal Finkel <hfinkel@…> (06/01/15 06:25:13)
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
README
r0109b01 r5df7203 40 40 when the peak memory usage is first reached. 41 41 42 You might have many runs of the same application (or output from many ranks of 43 an MPI job), and you'd like to pick the one for analysis with the highest 44 memory usage. If you provide a glob pattern to memlog_analyze it will do this 45 for you. Make sure you quote the glob pattern so that your shell does not 46 expand it. 47 48 /path/to/memlog/memlog_analyze "/path/to/*.memlog" 49 42 50 When running under common batch systems, the files are named 43 51 JOB_ID.HOST.PID.memlog, and when running under the BG/Q CNK, the process's rank -
memlog_analyze
r9fcaba3 r5df7203 12 12 my $ec = $_[0]; 13 13 my $usage = <<EOM; 14 Usage: $0 [options] <memlog file > [<output directory>]14 Usage: $0 [options] <memlog file or glob> [<output directory>] 15 15 options: 16 16 --leaks … … 40 40 41 41 if (! -f $memlog_fn) { 42 my @pot_fns = glob($memlog_fn); 43 if (scalar(@pot_fns)) { 44 if (!$quiet) { 45 print "Searching all files matching '$memlog_fn'\n"; 46 } 47 48 my $pot_max_rss = 0; 49 my $pos_max_rss_fn; 50 foreach my $pot_fn (@pot_fns) { 51 my $last_line = `tail -n 1 '$pot_fn'`; 52 chomp($last_line); 53 54 my @parts = split(/\t/, $last_line); 55 56 my $op = shift(@parts); 57 my $state = shift(@parts); 58 59 my ($time, $then_max_rss, $tid) = split(/\s+/, $state); 60 if ($pot_max_rss < $then_max_rss) { 61 $pot_max_rss = $then_max_rss; 62 $pos_max_rss_fn = $pot_fn; 63 } 64 } 65 66 if (defined $pos_max_rss_fn) { 67 $memlog_fn = $pos_max_rss_fn; 68 goto have_memlog_fn; 69 } 70 } 71 42 72 print_usage(1); 43 73 } 74 have_memlog_fn: 44 75 45 76 # The version of addr2line and friends that you use can make a big difference,
Note: See TracChangeset
for help on using the changeset viewer.