American Academy of Actuaries
HPC_Partition
Although the workbook setup may
be done during the first callback to
HPC_Initialize, the HPC_Partition
callbacks are when the user will push
a small bit of unique information to
each compute node. This partition
callback activity with partition creation will continue until the HPC_
Partition function senses an end and
notifies the HPC session broker. Each
partition is used during an execution
of a workbook that is on a file share
accessible to all compute nodes. This
execute workbook is opened by the
HPC session manager prior to delivery of partition data. The client
workbook is functionally idle between
callbacks asking for partition data and
HPC_Merge callbacks delivering results. The Excel graphical user interface (GUI), however, is available during these idle periods. Some of these
asynchronous, HPC events merit closer examination.
HPC_Execute
This is a VBA function. It will be
called multiple times in every instance
of Excel that is running and allocated
to the HPC job. We will note in a mo-
ment that N instances of Excel run-
ning do not necessarily translate into
N computers; the N instances likely
are running on M computers where
M<N, and perhaps substantially so.
We also know that the number of
parallel simulations or valuations is
much larger than N. Each of the N
Excel instances will have its HPC_Ex-
ecute code executed multiple times.
The HPC broker is going to reuse in-
stances of Excel; each time partition
data are given to HPC_Execute dur-
ing callbacks. The quantum of parti-
tion data, plus whatever
else is in the operational
sphere of the Excel
workbook, is all that the
execution code has to
work with. This thought
is captured in the pseu-
do code in Figure 2.
Figure 2: Excel HPC Execution Stream
Public Function HPC_Execute(data as Variant) as Variant
‘Take the Variant information and put it in cell range.
‘Do an Application.Calculate. Excel uses cellular logic, calls
to macros or UDFs to calculate all dependency relationships.
‘Gather information to be passed back from the compute
node to the HPC client.
‘Create and assign the HPC_Execute variant variable that is
given to the HPC client during an HPC_Merge callback and
after the end of this HPC_Execute subroutine.
End Sub
of prior executions, nor should they.
The execute activity is a service—a
partition of data is handled by this
service and a result returned to the
HPC_client.
HPC_Merge
After each execute there is an HPC_
Merge callback, and the client workbook can do anything that may be
required with the result, including just
remembering it. The remembrance
could be manifest in transfer of the data
variant to worksheet cells, writing them
to a disconnected ODBC data set or
pushing them through an ODBC connection to an external database. Speedy
handling, however, is important.
HPC_Finalize Callback
How does the HPC client know that
processing is complete? The HPC_
Merge data are received in an unknown order, so the client is given
a final callback after the last HPC_
Merge reporting that the HPC job
is finished. The conclusion of a job
could be a result of successful completion of the partition-execute-merge sequence. But it also could
be a result of abnormal termination
because of error or job cancellation
by other means. All of these circumstances will result in a callback to