Basic HTML version of Foils prepared 2 October 1995

Foil 19 Node Program: Message Passing for Laplace Sover

From New CPS615 Foils-- D 23 September 95 CPS615 Basic Simulation Track for Computational Science -- Fall Semester 95. by Geoffrey C. Fox


1 Initialization NLOC=NTOT/NPROC (Assume NTOT divisible by NPROC)
    • I1=2
    • NLOC1=NLOC + 1
    • IF (PROCNUM.EQ.NPROC-1 .or. PROCNUM.EQ.0) NLOC1=NLOC1-1
2 BASIC LOOP
3 BEGIN TEST = 0
4 Shift to the right SOURCE = PHIOLD(NLOC1) address of data to be sent IF(PROCNUM.EQ.NPROC-1) SOURCE = "DUMMY" DEST = PHIOLD(1) address where data to be stored IF(PROCNUM.EQ.1)DEST = "DUMMY" CALL MPSHIFT(+1, SOURCE, DEST)
5 Shift to left SOURCE = FOLD(I1) IF(PROCNUM.EQ.0) SOURCE = "DUMMY" address of data to be sent DEST = PHIOLD(NLOC1+1) IF(PROCNUM.EQ.NPROC-1) DEST = "DUMMY" address where data to be stored CALL MPSHIFT(-1, SOURCE, DEST)
    • DO 1 I=I1,NLOC1 TEMP = 0.5 * (PHIOLD(I-1) + PHIOLD(I+1)) TEST = AMAX1(TEST,ABS(TEMP-PHIOLD(I))) 1 PHINEW (I) = TEMP DO 2 I=I1, NLOC1 2 PHIOLD(I) = PHINEW(I)
    • CALL GLOBALMAX (TEST) IF (TEST>CONVG) GO TO BEGIN ELSE STOP

in Table To:


© on Tue Oct 7 1997