Path: utzoo!utgpu!jarvis.csri.toronto.edu!mailrus!csd4.milw.wisc.edu!uxc!uxc.cso.uiuc.edu!kailand!horizon!ming From: ming@horizon.KAI.COM Newsgroups: comp.sys.sequent Subject: Re: the KAP Fortran Preprocessor Message-ID: <2400035@horizon> Date: 8 Feb 89 15:01:00 GMT References: <534@kl-cs.UUCP> Lines: 54 Nf-ID: #R:kl-cs.UUCP:534:horizon:2400035:000:2238 Nf-From: horizon.KAI.COM!ming Feb 8 09:01:00 1989 In programming for parallel execution, the user has to be aware of the potential of changing computational precision in some arithmetic operations, in particular, the reduction operation. Reductions are typically implemented for parallel execution by allowing each processor to accumulate a local result, then combine the local results into the global result at the end of the loop. The arithmetic operations are done in a different order than the sequential program; consequently, roundoff error is accumulated differently and the answer may differ from the original program output. It is important to note that this roundoff error is different than scalar, not "worse" in a mathematical sense. If reproducibility is important, the KAP/Sequent user can set a ROUNDOFF switch on the command line, telling KAP to generate code that will reproduce the same answer as the serial program at the expense of execution speed. For instance, for the following loop: C$DOACROSS REDUCTION(S),SHARE(a) DO 10 i = 1,n s = s + a(i) 10 continue in serial mode: Computation is done in the following sequence s = s + a(1) + a(2) + a(3) + .... in parallel mode with 3 processors on a Sequent machine which uses static scheduling, i.e. process 1 will be executing iteration 1,4,7... process 2 will be executing iteration 2,5,8,... process 3 will be executing iteration 3,6,9,... Computation is done in the following manner: p1 : ls1 = a(1) + a(4) + a(7) + .... p2 : ls2 = a(2) + a(5) + a(8) + .... p3 : ls3 = a(3) + a(6) + a(9) + .... s = ls1 + ls2 + ls3 Precision may be changed in the process and since the order of accumulating the result is different in concurrent mode and serial mode, different answers may result. If KAP is run with roundoff=0, reduction operations will be done with an ordered critical section to ensure that the answer is accumulated in the same order as the serial execution. Please refer to the KAP/Sequent User's Guide for more details. If a KAP/Sequent user has any problem or questions on using KAP, please feel free to call the KAI customer representative at (217) 356-2288 or send e-mail to internet: kai@kai.com UUCP : {uunet,ucbvax}!uiucuxc!kailand!kai