Allocation phase

See sch.mod.allocexample.c for details..

  1. Optional.

    Define criteria type for external resource requirements.

  2. Optional.

    Implement New() function in the handler for the resource criteria type.

  3. Implement callback AllocatorFn():
    1. Check if the allocation has the type of SCH_MOD_DECISION_DISPATCH. If not, just return (lsb_alloc_type()).
    2. Optional. Get external message, and decide whether to continue (lsb_job_getextresreq()).
    3. Get current slot distribution in allocation and availability information for all candidate hosts (lsb_alloc_gethostslot()).
    4. Modify the allocation (lsb_alloc_modify()).

      Use lsb_alloc_modify() gradually, not for big changes, because lsb_alloc_modify() may return FALSE due to conflict with other scheduling policies, such as user slot limits on host.

    In sch.mod.allocexample.c, slots are adjusted in small steps.

  4. Implement sched_init(). This function is the plugin initialization function, which is called when the plugin is loaded.
    1. Optional. Create a handler for resource requirement processing, and register it to the scheduler framework (lsb_resreq_registerhandler()).
    2. Register the allocation callback AllocatorFn() (lsb_alloc_registerallocator()).