[RegCNET] A small code for checking if MPICH well installed

XUNQIANG BI bixq at ictp.it
Tue Nov 25 09:17:11 CET 2008


Dear all:

There are some reports about the parallel environment configuration
at RegCNET. Here is a small code to check if the MPICH is well
installed. It is a basic requirement that your MPICH to pass 
this check (though the byteswapio problem is not included at
this check).

sample.f

        include 'mpif.h'
        integer myid,ierr,NCPU
        integer status(MPI_STATUS_SIZE)
        call MPI_INIT(ierr)
        call MPI_COMM_RANK(MPI_COMM_WORLD,myid,ierr)
        call MPI_COMM_SIZE(MPI_COMM_WORLD,NCPU,ierr)
        print *,"process",myid,"of",NCPU
        call MPI_FINALIZE(ierr)
        stop
        end

then,
You compile it,

mpif90 -o a.out sample.f

Then submit the job,

mpirun -np 4 ./a.out

Best regards,
Xunqiang Bi




More information about the RegCNET mailing list