求A1,A2,…,A8的累加和,有如下程序。S1Al=Al+A2S2A3=A3+A4S3A5=A5+A6S4A7=A7+A8S5Al=Al+A3S6A5=A5+A7S7A1=A1+A5写出用FORK、JOIN语句表示其并行任务的派生和汇合关系的程序,以假想使此程序能在多处理机上运行。
FORK 20 FORK 30 FORK 40 10 A1=A1+A2 JOIN 4 GOTO 80 20 A3=A3+A4 JOIN 4 GOTO 80 30 A5=A5+A6 JOIN 4 GOTO 80 40 A7=A7+A8 JOIN 4 80 FORK 60 50 A1=A1+A3 JOIN 2 GOTO 70 60 A5=A5+A7 JOIN 2 70 A1=A1+A5