/******************************************************
* LSBLIB -- Examples
*
* lsb_submit()
* Submit command as an lsbatch job using the simplest
* version of lsb_submit()
* Note: there is no error checking in this program.
******************************************************/
#include <lsf/lsbatch.h>
/* Use the header file lsbatch.h when writing programs that use the LSF API. */
#include "combine_arg.h"
/* To use the function "combine_arg" to combine arguments on the command line include its header file "combine_arg.h". */
int main(int argc, char **argv)
{
int i;
struct submit req;
/* req holds the job specification. */
memset(&req, 0, sizeof(req));
/* initializes req to avoid core dump */
struct submitReply reply;
/* reply holds the result of submission. */
lsb_init(argv[0]);
/* Before using any batch library function, call lsb_init(). lsb_init() initializes the configuration environment. */
/* Set up the job’s specifications by initializing some of the flags in lsb_submit(). */
req.options = 0;
req.options2 = 0;
/* Set options and options2 to 0 to indicate that no options are selected. options are used by lsb_submit() to indicate modifications to the job submission action to be taken.*/
for (i = 0; i < LSF_RLIM_NLIMITS; i++)
req.rLimits[i] = DEFAULT_RLIMIT;
/* Initialize resource limits to default limits (no limit).*/
req.numProcessors = 1;
req.maxNumProcessors = 1;
/* Initialize the initial number and the maximum number of processors needed by a (parallel) job.*/
req.beginTime = 0;
/* To dispatch a job without delay assign 0 to beginTime..
req.termTime = 0;
To have no terminating deadlines, assign 0 to termTime. */
req.command = combine_arg(argc,argv);
/* Initialize the command line by assigning combine_arg to command. */
lsb_submit(&req, &reply);
/*Call lsb_submit() to submit the job with specifications. */
exit(0);
} /* main */