NAME
Schedule::Load::ResourceReq - Generate a request for a single resource
SYNOPSIS
See Schedule::Load::Schedule
DESCRIPTION
This package provides a constructor for a request of a single resource. When scheduling, multiple resource requests may be created and the scheduler will fill (or deny) all requests in one atomic operation. This prevents nasty deadlocks (like the chopsticks deadlock.)
METHODS
PARAMETERS
The following parameters are accepted by new(), and are also may be read via accessor methods.
- allow_reserved
-
When set, reserved hosts may be scheduled.
- classes
-
An array reference of which classes the host must support to allow this job to be run on that host. Defaults to [], which allows any host.
- favor_host
-
The hostname to try and choose if all is equal, under the presumption that there are disk access time benefits to doing so. Defaults to the current host.
- jobs_running
-
Current number of jobs the requester is running. This is compared to max_jobs.
- keep_idle_cpus
-
Minimum of cpus that should remain idle before scheduling this job. Negative fraction indicates that percentage of the clump, for example -0.5 will keep at least 50% of all CPUsidle. Defaults to 0.
- match_cb
-
A string containing a subroutine which will be passed a host reference and should return true if this host has the necessary properties. This must only look at constant properties of the host (IE NOT the current host loading), as the match results may be cached. This will be evaluated in a Safe container, and can do only minimal core functions. For example: match_cb=>"sub{return $_[0]->get_undef('memory')>512;}"
- max_jobs
-
Maximum number of jobs that can be issued if allow_none is specified in a scheduler request. Negative fraction indicates that percentage of the clump, for example -0.5 will use at most 50% of all CPUs. Defaults to 100% of the clump.
- rating_cb
-
A string containing a subroutine which will be passed a host reference and should return a number that is compared against other hosts' ratings to determine the best host for a new job. This may include dynamic information such as instantaneous loading. A return of zero indicates this host may not be used. Ratings closer to zero are better. Defaults to a function that includes the load_limit and the cpu percentage free. Evaluated in a Safe container, and can do only minimal core functions.
DISTRIBUTION
The latest version is available from CPAN and from http://www.veripool.org/.
Copyright 1998-2011 by Wilson Snyder. This package is free software; you can redistribute it and/or modify it under the terms of either the GNU Lesser General Public License Version 3 or the Perl Artistic License Version 2.0.
AUTHORS
Wilson Snyder <wsnyder@wsnyder.org>
SEE ALSO
Schedule::Load, Schedule::Load::Hosts, Schedule::Load::Hosts::Host