Author Topic: Sending jobs to all the hosts on the farm  (Read 3418 times)

eric

  • Hero Member
  • *****
  • Posts: 229
Sending jobs to all the hosts on the farm
« on: January 15, 2005, 04:18:54 AM »
Recently, we received the following question:

Quote
Is there an easy way to have a job run on all worker host machines?
e.g. we wish to run a setup script prior to a job, and would like it to execute on all host machines.

The short answer is: no.
The longer answer is: not yet. We'll be supporting such a feature in 4.0.

In the meantime, you can do something similar with a teeny bit of perl code. Basically, you ask the supervisor for a list of all the hosts it knows about, an then send a qbsub to each host with the same command ("ls" in this example)

Code: [Select]
for(qb::hostinfo()) {
? ? ? ?my $host = $_;
? ? ? ?my $job = {
? ? ? ? ? "prototype" => "cmdline",
? ? ? ? ? "hosts" => $host->{"name"},
? ? ? ? ? "package" => {
? ? ? ? ? ? ? "cmdline" => "ls"
? ? ? ? ? }
? ? ? ?};
? ? ? ?qb::submit($job);
? }

troy

  • Guest
Re: Sending jobs to all the hosts on the farm
« Reply #1 on: November 08, 2005, 08:20:35 AM »

John Burk did something like this at EA - can't remember exactly how. He made an explicit list of all the hosts, and (somehow?) ensured that the agenda would run once on each host (so, only one job).

anthony

  • Senior Software Engineer
  • Hero Member
  • *****
  • Posts: 183
Re: Sending jobs to all the hosts on the farm
« Reply #2 on: November 10, 2005, 09:39:52 PM »
Yhea the 4.0 method is to do this:

my $job = {
    "flags" => "host_list",
     .... stuff ...
}


qb::submit($job);