Moab Workload Manager

Event Driven LL Interface

   Creating an event driven interface for Loadleveler requires two steps.
  1. Create and enable the Loadleveler submit filter
  2. Create a suid wrapper to allow global use of the mschedctl -r command

Step 1: Create a submit filter.

   The LL submit filter functions by taking a users job command file as STDIN and sending the command file LL 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.

Step 2: Create wrapper

   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:

  • edit 'MOABADMIN' and 'SCHEDCTLCMD' #defines in wakeup.c as needed
  • compile code
  • make wakeup owned by MOABADMIN - ie, chown loadl wakeup
  • make wakeup setuid for owner - ie, chmod 4711 wakeup
  • verify non-admin users can successfully run wakeup

   Now submit a job.  If all works correctly, Moab should detect and, if resources are available, start the job within one second.