User`s guide
8 Program Communicating Jobs
8-4
Program Communicating Jobs for a Supported Scheduler
In this section...
“Schedulers and Conditions” on page 8-4
“Code the Task Function” on page 8-4
“Code in the Client” on page 8-5
Schedulers and Conditions
You can run a communicating job using any type of scheduler. This section illustrates
how to program communicating jobs for supported schedulers (MJS, local scheduler,
Microsoft Windows HPC Server (including CCS), Platform LSF, PBS Pro, or TORQUE).
To use this supported interface for communicating jobs, the following conditions must
apply:
• You must have a shared file system between client and cluster machines
• You must be able to submit jobs directly to the scheduler from the client machine
Note When using any third-party scheduler for running a communicating job, if all these
conditions are not met, you must use the generic scheduler interface. (Communicating
jobs also include pmode, parpool, spmd, and parfor.) See “Program Communicating
Jobs for a Generic Scheduler” on page 8-7.
Code the Task Function
In this section a simple example illustrates the basic principles of programming a
communicating job with a third-party scheduler. In this example, the worker whose
labindex value is 1 creates a magic square comprised of a number of rows and
columns that is equal to the number of workers running the job (numlabs). In this case,
four workers run a communicating job with a 4-by-4 magic square. The first worker
broadcasts the matrix with labBroadcast to all the other workers , each of which
calculates the sum of one column of the matrix. All of these column sums are combined
with the gplus function to calculate the total sum of the elements of the original magic
square.