|
You are here: Appendices > Appendix O: Integrating Other Resources with Moab > Compute Resource Managers > Event Driven Loadleveler Interface
|
|
Event Driven Loadleveler Interface |
|
Creating an event-driven interface for Loadleveler requires two steps.
The Loadleveler submit filter functions by taking a user's job command file as STDIN and sending the command file Loadleveler should process to STDOUT. If the submit filter is successful, it should exit with a status of 0. A simple sample script is provided below:
-----------
#!/bin/perl -w
while ()
{
$line = $_;
print STDOUT $line;
}
# Call wakeup script to moab scheduler
system("/usr/local/sbin/wakeup > /dev/null");
exit(0);
------------
To enable use of this script you must set SUBMITFILTER parameter in the LoadL_config file.
The moab command mschedctl is not normally available to general end users. The wrapper allows users to issue a command to request that scheduling resume to process a newly-submitted job.
A sample wakeup.c wrapper file is included below:
-----
#include
#include
#define MOABADMIN "loadl"
#define SCHEDCTLCMD /usr/local/bin/mschedctl
int main()
{
struct passwd *buf;
if ((buf = getpwnam(MOABADMIN)) == NULL)
exit(1);
setuid(buf->pw_uid);
system("SCHEDCTLCMD -r 1");
exit(0);
}
-----
To enable the wrapper, use the following steps:
Now submit a job. If all works correctly, Moab should detect and, if resources are available, start the job within one second.
Copyright © 2012 Adaptive Computing Enterprises, Inc.®