[MPICH] MPICH105 shm drops packages on SUN niagara
chong tan
chong_guan_tan at yahoo.com
Fri Apr 27 17:24:09 CDT 2007
The following code reproduces the problem. I think you maybe able to reproduce the error on
Linux, but I am not sure.
It is best to run :
mpiexec -n 8 a.out
to reproduce the problem. You will need a machine with 8CPU/cores. SOmetime you will need to
run the code multiple time to see the error.
there will be files fast_mpi_?.dmp created, where ? is the rank of the related 'rank'. When MPI get stuck,
you should look at the last line of fast_mpi_0.dmp. If it says:
read from child 7
then you should look at the last line of fast_mpi_7.dmp, it will say:
read from master
hope this help to debug the error.
thanks
tan
---------------------
#include "stdlib.h"
#include "stdio.h"
#include "mpi.h"
#define LOOP_COUNT 1000000
#define DATA_SIZE 4
#define MP_TAG 999
main()
{
int nProc, rank ;
int argc = 0 ;
int i, j, status ;
char buf[ 128 ] ;
FILE *pf ;
MPI_Init( &argc, NULL ) ;
MPI_Comm_size( MPI_COMM_WORLD, &nProc ) ;
MPI_Comm_rank( MPI_COMM_WORLD, &rank ) ;
sprintf( buf, "fast_mpi_%d.dmp", rank ) ;
pf = fopen( buf, "w" ) ;
if( !rank ) {
int **psend ;
int **precv ;
psend = (int**)calloc( nProc, sizeof( int *) ) ;
precv = (int**)calloc( nProc, sizeof( int *) ) ;
for( i = 0 ; i < nProc ; i++ ) {
psend[ i ] = (int*)calloc( DATA_SIZE, sizeof( int ) ) ;
precv[ i ] = (int*)calloc( DATA_SIZE, sizeof( int ) ) ;
}
for( i = 0 ; i < LOOP_COUNT ; i++ ) {
fprintf( pf, "Master : loop %d\n", i ) ;
fflush( pf ) ;
for( j = 1 ; j < nProc ; j++ ) {
fprintf( pf, " read from child %d\n", j ) ;
fflush( pf ) ;
status = MPI_Recv( precv[ j ], DATA_SIZE, MPI_LONG, j, MP_TAG, MPI_COMM_WORLD, MP
I_STATUS_IGNORE ) ;
fprintf( pf, " read from child %d done, status = %d\n", j, status ) ;
fflush( pf ) ;
}
for( j = 1 ; j < nProc ; j++ ) {
fprintf( pf, " send to child %d\n", j ) ;
fflush( pf ) ;
status = MPI_Send( psend[ j ], DATA_SIZE - 1, MPI_LONG, j, MP_TAG, MPI_COMM_WORLD
) ;
fprintf( pf, " send to child %d done, status = %d\n", j, status ) ;
fflush( pf ) ;
}
}
} else {
int *psend ;
int *precv ;
psend = (int*)calloc( DATA_SIZE, sizeof( int ) ) ;
precv = (int*)calloc( DATA_SIZE, sizeof( int ) ) ;
for( i = 0 ; i < LOOP_COUNT ; i++ ) {
fprintf( pf, " send to master\n" ) ;
fflush( pf ) ;
status = MPI_Send( psend, DATA_SIZE - 1, MPI_LONG, 0, MP_TAG, MPI_COMM_WORLD ) ;
fprintf( pf, " send to master done, status = %d\n", status ) ;
fflush( pf ) ;
fprintf( pf, " read from master\n" ) ;
fflush( pf ) ;
status = MPI_Recv( precv, DATA_SIZE, MPI_LONG, 0, MP_TAG, MPI_COMM_WORLD, MPI_STATUS_IGNORE ) ;
fprintf( pf, " read from master done, status = %d\n", status ) ;
fflush( pf ) ;
}
}
fclose( pf ) ;
MPI_Finalize() ;
}
__________________________________________________
Do You Yahoo!?
Tired of spam? Yahoo! Mail has the best spam protection around
http://mail.yahoo.com
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.mcs.anl.gov/pipermail/mpich-discuss/attachments/20070427/c9131a47/attachment.htm>
More information about the mpich-discuss
mailing list