Recently, we received the following question:
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)
for(qb::hostinfo()) {
? ? ? ?my $host = $_;
? ? ? ?my $job = {
? ? ? ? ? "prototype" => "cmdline",
? ? ? ? ? "hosts" => $host->{"name"},
? ? ? ? ? "package" => {
? ? ? ? ? ? ? "cmdline" => "ls"
? ? ? ? ? }
? ? ? ?};
? ? ? ?qb::submit($job);
? }