Difference between revisions of "MPI"
From HCL
Line 1: | Line 1: | ||
You can choose different MPIs: | You can choose different MPIs: | ||
+ | * Open MPI: [http://www.open-mpi.org] | ||
− | + | == Debugging == | |
− | + | * Add the following code: | |
+ | <source lang="C"> | ||
+ | int rank; | ||
+ | MPI_Comm_rank(MPI_COMM_WORLD, &rank); | ||
+ | if (!rank) | ||
+ | getc(stdin); | ||
+ | MPI_Barrier(MPI_COMM_WORLD); | ||
+ | </source> | ||
+ | * Compile your code with <code>-g</code> option | ||
+ | * Run parallel application | ||
+ | * Attach to process(es) from [[GDB]] | ||
+ | ** MPICH-1 runs a background process for each application process: 0, 0b, 1, 1b, ..., therefore, attach to the first ones. |
Revision as of 14:50, 1 February 2010
You can choose different MPIs:
- Open MPI: [1]
Debugging
- Add the following code:
int rank;
MPI_Comm_rank(MPI_COMM_WORLD, &rank);
if (!rank)
getc(stdin);
MPI_Barrier(MPI_COMM_WORLD);
- Compile your code with
-g
option - Run parallel application
- Attach to process(es) from GDB
- MPICH-1 runs a background process for each application process: 0, 0b, 1, 1b, ..., therefore, attach to the first ones.