Using the force to write parallel HEP programs

The basic idea behind using the force method of parallel programming is to write a program (a force) which can be executed by any number of processes, including one process. The fork into parallel processes is done before the force is ever executed and the number of processes can be chosen on the basis of hardware efficiency only. Experience indicates that it is not hard to write programs which are independent of the number of executing processes on a shared-memory MIMD computer. Several such applications programs have been written for the HEP computer in HEP Fortran 77, which is standard Fortran 77 with very rudimentary parallel extensions. The constructs which seemed to be useful in these programs were formalized into a set of statements which can be macro-expanded into HEP Fortran 77. Some essential ideas to keep in mind when writing a force is that each statement is executed by all processes of the force unless an explicit synchronization prevents this. The distinction between a local variable, which has a separate memory cell assigned for each process referencing it, and a global variable, which has one memory cell which Is used by all processes, is important to keep straight. Theremore » are force constructs which make it easy to specify that a section of code is to be executed by only one process. Other constructs specify that the body of a loop is to be executed for all values of the loop index in parallel with one process handling each index value. Unless explicit force statements prevent it, a call is executed by all processes so that subroutines executed by all processes of the force are also possible.« less