Skip to content

Commit

Permalink
wreckrun: add gpus to fake R_lite with -g option
Browse files Browse the repository at this point in the history
When the -g, --gpus-per-task option is used and no scheduler is
loaded, add "fake" GPU resources to the generated R_lite. This
will be helpful in testing plugins and other parts of flux-core
that look for allocated GPUs in R_lite.
  • Loading branch information
grondo committed Jul 25, 2018
1 parent 5c19ad2 commit 855b8db
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion src/cmd/flux-wreckrun
Original file line number Diff line number Diff line change
Expand Up @@ -91,12 +91,17 @@ local function alloc_tasks (f, wreck, lwj)
end
end
for i, ntasks in ipairs (counts) do
local gpus_per_task = tonumber (wreck.opts.g or 0)
local rank = i - 1
local corelist = "0"
local gpulist = nil
if gpus_per_task > 0 then
gpulist = "0-".. (ntasks * gpus_per_task) - 1
end
if ntasks > 1 then
corelist = corelist .. "-" .. ntasks - 1
end
table.insert (Rlite, { rank = rank, children = { core = corelist } })
table.insert (Rlite, { rank = rank, children = { core = corelist, gpu = gpulist } })
if not r[ntasks] then r[ntasks] = {} end
table.insert (r[ntasks], rank)
end
Expand Down

0 comments on commit 855b8db

Please sign in to comment.