void TemplateFilters (Status *status, Input *data, Output *results, TemplateFiltersParams *params)
where the TemplateFiltersParams structure would be
typedef struct
tagTemplateFiltersParams
{
INT4
beginTemplate;
INT4
endTemplate;
MPI_Comm
*comm;
}
TemplateFiltersParams
The main reason for this is:
CHAR statusMessage[1024]
= "";
CHAR statusError[];
INT4 CheckLALStatusPtr (Status *status, CHAR *statusMessage, CHAR *statusError)
that would be executed after each call to a function in the shared library.
CheckLALStatusPtr would parse the LAL status structure. It would return
If this method were used, the pseudo code for wrapperAPI would be as follows. (Note: in this psuedo-code, only TemplateFilters() is fully LAL compliant. The other functions also need to be made fully compliant.)
/ wrapperAPI pseudo-code
extern "C" {
#include "wrapperInterface.h"
} // On every node
in MPI_COMM_WORLD perform:
{
parseCommandLineOptions();
loadDynamicSharedObjects();
FilterInit( status,
initParams );
errorTestInit( CheckLALStatusPtr(
status, initMessage, initError ) );
IndexFilters( status,
totalTemplates );
errorTestIndex(
CheckLALStatusPtr( status, indexMessage, indexError
) );
LBComm = createLoadBalanceCommunicator();
}
// On every node
in Load Balance Communicator perform:
{
while ( notFinished()
) {
ConditionData( status,
data );
errorTestDC( CheckLALStatusPtr(
status, conditionMessage, conditionError ) );
TemplateFilters(
status, data, result, tfParams );
errorTestTF( CheckLALStatusPtr(
status, filterMessage, filterError ) );
// run on master
node only
{
masterNodeGathersResults();
masterNodeCalculatesLoad();
masterNodeInformsLDASmpiAPI();
masterSendsResultsToResultAPI();
}
// On every node
in MPI_COMM_WORLD perform:
{ LBComm = createLoadBalanceCommunicator();
}
} /* end of while
loop */
// On every node in MPI_COMM_WORLD
perform:
{
FreeFilters ( status
);
errorTestFree( CheckLALStatusPtr(
status, freeMessage, freeError ) );
MPI_Finish;
}
Page created on: Tue Apr 11 21:15:48 CDT 2000 by duncan
Last modified: Tue Apr 11 23:04:43 CDT 2000 by duncan