- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Hi
How to set a breakpoint on a given rank? In the following example, I would like to set a breakpoint on rank0, but not on rank 1 and rank2. how do I do it? How do I switch between different rank? Thanks.
[linfa@ran testrun]$ mpirun -gdb -np 3 ../exec/intelmpitest
WARNING: Can't read mpd.hosts for list of hosts, start only on current
0-2: (gdb)
Thanks.
How to set a breakpoint on a given rank? In the following example, I would like to set a breakpoint on rank0, but not on rank 1 and rank2. how do I do it? How do I switch between different rank? Thanks.
[linfa@ran testrun]$ mpirun -gdb -np 3 ../exec/intelmpitest
WARNING: Can't read mpd.hosts for list of hosts, start only on current
0-2: (gdb)
Thanks.
Link Copied
4 Replies
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Hi linfa,
Using 'z' command you can switch active processes. For example:
[zzz@serv1002 zzz]$
[zzz@serv1002 zzz]$ mpiexec -gdb -n 4 ./test_debug
0-3: (gdb) z 1-3
1-3: (gdb) b 53
1-3: Breakpoint 2 at 0x4009f3: file test.c, line 53.
1-3: (gdb) z
0-3: (gdb) r
0-3: Continuing.
0: Hello world: rank 0 of 4 running on svlmpicl1002
1-3:
2: Breakpoint 2, main (argc=1, argv=0x7fff2a943e58) at test.c:53
3: Breakpoint 2, main (argc=1, argv=0x7fff70c3ba18) at test.c:53
1: Breakpoint 2, main (argc=1, argv=0x7fff53837d48) at test.c:53
1-3: 53 MPI_Send (&namelen, 1, MPI_INT, 0, 1, MPI_COMM_WORLD);
1-3: (gdb) 1-3: (gdb) list
1-3: 48
1-3: 49 } else {
1-3: 50
1-3: 51 MPI_Send (&rank, 1, MPI_INT, 0, 1, MPI_COMM_WORLD);
1-3: 52 MPI_Send (&size, 1, MPI_INT, 0, 1, MPI_COMM_WORLD);
1-3: 53 MPI_Send (&namelen, 1, MPI_INT, 0, 1, MPI_COMM_WORLD);
1-3: 54 MPI_Send (name, namelen + 1, MPI_CHAR, 0, 1, MPI_COMM_WORLD);
1-3: 55
1-3: 56 }
1-3: 57
1-3: (gdb)
Did you ask about this command?
Regards!
Dmitry
Using 'z' command you can switch active processes. For example:
[zzz@serv1002 zzz]$
[zzz@serv1002 zzz]$ mpiexec -gdb -n 4 ./test_debug
0-3: (gdb) z 1-3
1-3: (gdb) b 53
1-3: Breakpoint 2 at 0x4009f3: file test.c, line 53.
1-3: (gdb) z
0-3: (gdb) r
0-3: Continuing.
0: Hello world: rank 0 of 4 running on svlmpicl1002
1-3:
2: Breakpoint 2, main (argc=1, argv=0x7fff2a943e58) at test.c:53
3: Breakpoint 2, main (argc=1, argv=0x7fff70c3ba18) at test.c:53
1: Breakpoint 2, main (argc=1, argv=0x7fff53837d48) at test.c:53
1-3: 53 MPI_Send (&namelen, 1, MPI_INT, 0, 1, MPI_COMM_WORLD);
1-3: (gdb) 1-3: (gdb) list
1-3: 48
1-3: 49 } else {
1-3: 50
1-3: 51 MPI_Send (&rank, 1, MPI_INT, 0, 1, MPI_COMM_WORLD);
1-3: 52 MPI_Send (&size, 1, MPI_INT, 0, 1, MPI_COMM_WORLD);
1-3: 53 MPI_Send (&namelen, 1, MPI_INT, 0, 1, MPI_COMM_WORLD);
1-3: 54 MPI_Send (name, namelen + 1, MPI_CHAR, 0, 1, MPI_COMM_WORLD);
1-3: 55
1-3: 56 }
1-3: 57
1-3: (gdb)
Did you ask about this command?
Regards!
Dmitry
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Hi Dmitry,
Wow! That is exactly what I want! Thanks very much!
Linfa
Wow! That is exactly what I want! Thanks very much!
Linfa
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
How would this be done using eclipse?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
I'm afraid this doesn't work for me because the code launches immediately and there is no chance to enter commands, and also CTRL-C doesn't work to halt the program. Any advice on how to get around this?
Reply
Topic Options
- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Printer Friendly Page