2006-02-16 15:30:10 +00:00
|
|
|
#include <stdio.h>
|
|
|
|
#include <stdlib.h>
|
2006-04-11 14:09:55 +00:00
|
|
|
#include <string.h>
|
2006-02-16 15:30:10 +00:00
|
|
|
|
|
|
|
#include <dc_client.h>
|
2006-04-07 14:18:11 +00:00
|
|
|
#include "common_defs.h"
|
2006-02-16 15:30:10 +00:00
|
|
|
|
2006-04-11 14:09:55 +00:00
|
|
|
/********************************************************************
|
|
|
|
* Common API functions
|
|
|
|
*/
|
|
|
|
|
|
|
|
int DC_getMaxMessageSize(void)
|
|
|
|
{
|
|
|
|
return MAX_MESSAGE_SIZE;
|
|
|
|
}
|
|
|
|
|
|
|
|
int DC_getMaxSubresults(void)
|
|
|
|
{
|
|
|
|
return MAX_SUBRESULTS;
|
|
|
|
}
|
|
|
|
|
|
|
|
DC_GridCapabilities DC_getGridCapabilities(void)
|
|
|
|
{
|
|
|
|
return (DC_GridCapabilities)(DC_GC_STDERR | DC_GC_STDOUT);
|
|
|
|
}
|
|
|
|
|
|
|
|
/********************************************************************
|
|
|
|
* Client API functions
|
|
|
|
*/
|
2006-02-16 15:30:10 +00:00
|
|
|
|
|
|
|
int DC_init(void)
|
|
|
|
{
|
2006-04-11 14:09:55 +00:00
|
|
|
return 0;
|
2006-02-16 15:30:10 +00:00
|
|
|
}
|
|
|
|
|
2006-04-08 11:50:14 +00:00
|
|
|
char *DC_resolveFileName(DC_FileType type, const char *logicalFileName)
|
2006-02-16 15:30:10 +00:00
|
|
|
{
|
2006-04-11 14:09:55 +00:00
|
|
|
if (!strcmp(logicalFileName, DC_CHECKPOINT_FILE))
|
|
|
|
{
|
|
|
|
return CKPT_LABEL;
|
|
|
|
}
|
|
|
|
return (char *)logicalFileName;
|
2006-04-07 14:18:11 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
int DC_sendResult(const char *logicalFileName, const char *path, DC_FileMode fileMode)
|
|
|
|
{
|
2006-04-11 14:09:55 +00:00
|
|
|
// not implemented yet!
|
2006-04-07 14:18:11 +00:00
|
|
|
|
2006-04-11 14:09:55 +00:00
|
|
|
return DC_ERR_NOTIMPL;
|
2006-02-16 15:30:10 +00:00
|
|
|
}
|
|
|
|
|
2006-04-07 14:18:11 +00:00
|
|
|
int DC_sendMessage(const char *message)
|
2006-02-16 15:30:10 +00:00
|
|
|
{
|
2006-04-11 14:09:55 +00:00
|
|
|
// not implemented yet!
|
2006-02-16 15:30:10 +00:00
|
|
|
|
2006-04-11 14:09:55 +00:00
|
|
|
return DC_ERR_NOTIMPL;
|
2006-02-16 15:30:10 +00:00
|
|
|
}
|
|
|
|
|
2006-04-08 11:50:14 +00:00
|
|
|
DC_Event *DC_checkEvent(void)
|
2006-04-07 14:18:11 +00:00
|
|
|
{
|
2006-04-11 14:09:55 +00:00
|
|
|
// not implemented yet!
|
2006-04-07 14:18:11 +00:00
|
|
|
|
2006-04-11 14:09:55 +00:00
|
|
|
return NULL;
|
2006-04-07 14:18:11 +00:00
|
|
|
}
|
|
|
|
|
2006-04-08 11:50:14 +00:00
|
|
|
void DC_destroyEvent(DC_Event *event)
|
|
|
|
{
|
2006-04-11 14:09:55 +00:00
|
|
|
// not implemented yet!
|
2006-04-08 11:50:14 +00:00
|
|
|
}
|
|
|
|
|
2006-04-07 14:18:11 +00:00
|
|
|
void DC_checkpointMade(const char *fileName)
|
2006-02-16 15:30:10 +00:00
|
|
|
{
|
2006-04-11 14:09:55 +00:00
|
|
|
// Nothing to do with it.
|
2006-02-16 15:30:10 +00:00
|
|
|
}
|
|
|
|
|
2006-04-07 14:18:11 +00:00
|
|
|
void DC_fractionDone(double fraction)
|
2006-02-16 15:30:10 +00:00
|
|
|
{
|
2006-04-11 14:09:55 +00:00
|
|
|
// Nothing to do with it.
|
2006-02-16 15:30:10 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
void DC_finish(int exitcode)
|
|
|
|
{
|
2006-04-11 14:09:55 +00:00
|
|
|
// XXX Need to send a message to the master side of the DC_API!
|
|
|
|
|
|
|
|
exit(exitcode);
|
2006-02-16 15:30:10 +00:00
|
|
|
}
|