Dear Llamas,
While porting some profiling libraries to LAM/MPI, I notice the
following C program is able to run and finish without any error
under LAM/MPI-7.1.2b22.
*****************************************************
#include "mpi.h"
#include <stdio.h>
int main( int argc, char *argv[] )
{
int rank, size;
int namelen;
char processor_name[MPI_MAX_PROCESSOR_NAME];
MPI_Init( &argc, &argv );
MPI_Comm_size( MPI_COMM_WORLD, &size );
MPI_Comm_rank( MPI_COMM_WORLD, &rank );
MPI_Get_processor_name( processor_name, &namelen );
fprintf( stdout,"Process %d on %s\n", rank, processor_name );
/* The following MPI call violates MPI-1.1, section 2.2 */
MPI_Allreduce( &rank, &rank, 1, MPI_INT, MPI_MAX, MPI_COMM_WORLD );
fprintf( stdout, "Maximum rank is %d\n", rank );
MPI_Finalize();
return 0;
}
*****************************************************
The way the send(IN) and receive(OUT) buffers is used in MPI_Allreduce
in the sample code violates MPI-1.1, section 2.2, or
http://www.mpi-forum.org/docs/mpi-11-html/node10.html#Node10
Since the standard prohibits aliasing of arguments, should LAM/MPI signal
this as an error ?
Thanks,
A.Chan
|