next up previous contents
Next: MCHF Up: MPI version Previous: I/O Files   Contents

Parallel routines

nonh was modified to its parallel version, mpi_nonh by converting the main loop to parallel, and a section of the code shows how this was accomplished: goal:
         do jb = myid+1,ncfg,nprocs
           if (mod(jb,1000) .eq. 0) write(0,*) '   jb =',jb

           CALL SHELLSJB(jb)
           CALL ANGMOMG(NEW,NZERO,IFIRST)

           mycol = mycol + 1
           jptr(mycol) = nij
         end do

The variable jb refers to the current column, and each node will process only the myid+1 + jb*nprocs column, where nprocs is the total number of processors, myid is the processor id (0,1,2... to.. nprocs-1).

mpi_orbitals() is virtually the same, but with added common /MPI/ myid, nprocs, ierr, istat(MPI_STATUS_SIZE). Only the node with myid=0 writes data to UNIT=25, (which is the file cfg.h) and the common was used to convey the myid value. mpi_angmom() has been modified to allow for correct increments of the variables lij, ja, jb, ntot.

The nonh program implements parallel output for the largest data files, Figure  6.20.

Figure 5.9: The angular data are stored in files, which are written in parallel. Files with negligible IO requirements are read/written by node 0.
\begin{figure}\centerline{ \psfig{file=tex/fig/mpi_io_nonh.eps}}\end{figure}



2001-10-11