annex.jobs=cpus etc
Added the ability to run one job per CPU (core), by setting annex.jobs=cpus, or using option --jobs=cpus or -Jcpus. Built with future expansion in mind, including not defaulting matching on Concurrency so more constructors can later be added, and using "cpu" instead of "0".
This commit is contained in:
parent
459bbd9005
commit
82186ca58f
20 changed files with 105 additions and 32 deletions
|
@ -366,14 +366,15 @@ jsonProgressOption =
|
|||
jobsOption :: [GlobalOption]
|
||||
jobsOption =
|
||||
[ globalSetter set $
|
||||
option auto
|
||||
( long "jobs" <> short 'J' <> metavar paramNumber
|
||||
option (maybeReader parseConcurrency)
|
||||
( long "jobs" <> short 'J'
|
||||
<> metavar (paramNumber `paramOr` "cpu")
|
||||
<> help "enable concurrent jobs"
|
||||
<> hidden
|
||||
)
|
||||
]
|
||||
where
|
||||
set n = Annex.changeState $ \s -> s { Annex.concurrency = Concurrent n }
|
||||
set v = Annex.changeState $ \s -> s { Annex.concurrency = v }
|
||||
|
||||
timeLimitOption :: [GlobalOption]
|
||||
timeLimitOption =
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue