Skip to content

Commit

Permalink
Add --queues_avoid to walk cmd
Browse files Browse the repository at this point in the history
  • Loading branch information
rk1274 committed Sep 27, 2024
1 parent 19f68be commit c3eada5
Showing 1 changed file with 9 additions and 4 deletions.
13 changes: 9 additions & 4 deletions cmd/multi.go
Original file line number Diff line number Diff line change
Expand Up @@ -222,7 +222,7 @@ func doMultiScheduling(args []string, workDir, forcedQueue, queuesToAvoid string
}

if !finishPartial { //nolint:nestif
scheduleWalkJobs(outputRoot, args, unique, multiStatJobs, multiInodes, multiCh, forcedQueue, s)
scheduleWalkJobs(outputRoot, args, unique, multiStatJobs, multiInodes, multiCh, forcedQueue, queuesToAvoid, s)

if partialDirMerge != "" {
unique = scheduleStaticCopy(outputRoot, unique, partialDirMerge, partialDirClean, s)
Expand All @@ -246,12 +246,12 @@ func doMultiScheduling(args []string, workDir, forcedQueue, queuesToAvoid string
// path. The second scheduler is used to add combine jobs, which need a memory
// override.
func scheduleWalkJobs(outputRoot string, desiredPaths []string, unique string,
numStatJobs, inodesPerStat int, yamlPath, queue string, s *scheduler.Scheduler,
numStatJobs, inodesPerStat int, yamlPath, queue, queuesAvoid string, s *scheduler.Scheduler,
) {
walkJobs := make([]*jobqueue.Job, len(desiredPaths))
combineJobs := make([]*jobqueue.Job, len(desiredPaths))

cmd := buildWalkCommand(s, numStatJobs, inodesPerStat, yamlPath, queue)
cmd := buildWalkCommand(s, numStatJobs, inodesPerStat, yamlPath, queue, queuesAvoid)

reqWalk, reqCombine := reqs()

Expand All @@ -273,7 +273,8 @@ func scheduleWalkJobs(outputRoot string, desiredPaths []string, unique string,

// buildWalkCommand builds a wrstat walk command line based on the given n,
// yaml path, queue, and if sudo is in effect.
func buildWalkCommand(s *scheduler.Scheduler, numStatJobs, inodesPerStat int, yamlPath, queue string) string {
func buildWalkCommand(s *scheduler.Scheduler, numStatJobs, inodesPerStat int,
yamlPath, queue, queuesAvoid string) string {
cmd := s.Executable() + " walk "

if numStatJobs > 0 {
Expand All @@ -290,6 +291,10 @@ func buildWalkCommand(s *scheduler.Scheduler, numStatJobs, inodesPerStat int, ya
cmd += fmt.Sprintf("--queue %s ", queue)
}

if queuesAvoid != "" {
cmd += fmt.Sprintf("--queues_avoid %s ", queuesAvoid)
}

if sudo {
cmd += "--sudo "
}
Expand Down

0 comments on commit c3eada5

Please sign in to comment.