File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 3030import json
3131from multiprocessing import Pool
3232from multiprocessing .pool import Pool as PoolType
33+ import os
3334from pathlib import Path , PurePath
3435import re
3536import sys
@@ -743,6 +744,8 @@ def finish_retile(ctxfile: TextIO, summarydir: Path) -> None:
743744
744745
745746if __name__ == '__main__' :
747+ cpu_count = os .process_cpu_count () # type: ignore[attr-defined]
748+
746749 parser = ArgumentParser ()
747750 subparsers = parser .add_subparsers (metavar = 'subcommand' , required = True )
748751
@@ -779,8 +782,8 @@ def finish_retile(ctxfile: TextIO, summarydir: Path) -> None:
779782 metavar = 'COUNT' ,
780783 dest = 'workers' ,
781784 type = int ,
782- default = 4 ,
783- help = 'number of worker processes to start [4 ]' ,
785+ default = cpu_count ,
786+ help = f 'number of worker processes to start [{ cpu_count } ]' ,
784787 )
785788 parser_tile .set_defaults (cmd = 'tile' )
786789
You can’t perform that action at this time.
0 commit comments