RE: [rtems-tools] tester: Update jobs configuration
ping -Original Message- From: Ryan Long Sent: Wednesday, December 8, 2021 9:29 AM To: devel@rtems.org Subject: Re: [rtems-tools] tester: Update jobs configuration ping On 11/1/2021 5:31 PM, Ryan Long wrote: > ping > > -Original Message- > From: Ryan Long > Sent: Wednesday, October 20, 2021 3:06 PM > To: devel@rtems.org > Cc: Ryan Long > Subject: [rtems-tools] tester: Update jobs configuration > > Allow for default_jobs and max_jobs to be specified in the BSP's > configuration file. > --- > rtemstoolkit/options.py| 45 > +- > tester/rtems/testing/bsps/beagleboardxm.ini| 2 +- > tester/rtems/testing/bsps/beagleboneblack.ini | 2 +- > tester/rtems/testing/bsps/imx7.ini | 2 +- > tester/rtems/testing/bsps/mcf5235.ini | 2 +- > tester/rtems/testing/bsps/mvme2307.ini | 2 +- > tester/rtems/testing/bsps/pc.ini | 2 +- > tester/rtems/testing/bsps/qoriq_e500.ini | 2 +- > tester/rtems/testing/bsps/qoriq_e6500_32.ini | 2 +- > tester/rtems/testing/bsps/qoriq_e6500_64.ini | 2 +- > tester/rtems/testing/bsps/raspberrypi2.ini | 2 +- > tester/rtems/testing/bsps/xilinx_versal_vck190.ini | 2 +- > .../rtems/testing/bsps/xilinx_zynq_a9_qemu_smp.ini | 2 +- > tester/rtems/testing/bsps/xilinx_zynq_zc706.ini| 2 +- > tester/rtems/testing/bsps/xilinx_zynq_zedboard.ini | 2 +- > .../testing/bsps/xilinx_zynqmp_ilp32_zu3eg.ini | 2 +- > .../testing/bsps/xilinx_zynqmp_lp64_zu3eg.ini | 2 +- > tester/rtems/testing/defaults.mc | 2 + > 18 files changed, 45 insertions(+), 34 deletions(-) > > diff --git a/rtemstoolkit/options.py b/rtemstoolkit/options.py index > 5ebe3bc..4b7a93a 100644 > --- a/rtemstoolkit/options.py > +++ b/rtemstoolkit/options.py > @@ -102,7 +102,7 @@ class command_line(object): > '--no-clean': 'Do not clean up the build > tree', > '--always-clean': 'Always clean the build tree, > even with an error', > '--keep-going': 'Do not stop on an error.', > -'--jobs=[0..n,none,half,full]': 'Run with specified number of > jobs, default: num CPUs.', > +'--jobs=[0..n,none,half,full]': 'Run with specified > + number of jobs (default: defined in configuration file)', > '--macros file[,file]': 'Macro format files to load > after the defaults', > '--log file': 'Log file where all build > output is written to', > } > @@ -327,6 +327,11 @@ class command_line(object): > # Handle the jobs for make > if '_ncpus' not in self.defaults: > raise error.general('host number of CPUs not set') > +if self.defaults['default_jobs'] != '0': > +print( > +'default_jobs is %d and the default is %d' % > +(self.defaults['default_jobs'], 0) > +) > ncpus = self.jobs(self.defaults['_ncpus']) > if ncpus > 1: > self.defaults['_smp_mflags'] = '-j %d' % (ncpus) @@ -427,28 > +432,25 @@ class command_line(object): > um += [m] > return um if len(um) else None > > -def jobs(self, cpus): > +def jobs(self, num_cpus): > try: > -cpus = int(cpus) > +cpus = int(num_cpus) > except: > raise error.general('invalid host cpu value') > opt_jobs = self.opts['jobs'] > if opt_jobs == 'default': > -_jobs = self.defaults.get_value('jobs') > -if _jobs is not None: > -if _jobs == 'none': > -cpus = 0 > -elif _jobs == 'max': > -pass > -elif _jobs == 'half': > -cpus = cpus / 2 > -else: > -try: > -cpus = int(_jobs) > -except: > -raise error.general('invalid %%{jobs} value: %s' % > (_jobs)) > +_jobs = self.defaults.get_value('default_jobs') > +if _jobs == 'none': > +cpus = 0 > +elif _jobs == 'max': > +pass > +elif _jobs == 'half': > +cpus = cpus / 2 > else: > -opt_jobs = 'max' > +try: > +cpus = int(_jobs) > +except: > +raise error.general('invalid %%{jobs} value: %s' > + %
Re: [rtems-tools] tester: Update jobs configuration
ping On 11/1/2021 5:31 PM, Ryan Long wrote: ping -Original Message- From: Ryan Long Sent: Wednesday, October 20, 2021 3:06 PM To: devel@rtems.org Cc: Ryan Long Subject: [rtems-tools] tester: Update jobs configuration Allow for default_jobs and max_jobs to be specified in the BSP's configuration file. --- rtemstoolkit/options.py| 45 +- tester/rtems/testing/bsps/beagleboardxm.ini| 2 +- tester/rtems/testing/bsps/beagleboneblack.ini | 2 +- tester/rtems/testing/bsps/imx7.ini | 2 +- tester/rtems/testing/bsps/mcf5235.ini | 2 +- tester/rtems/testing/bsps/mvme2307.ini | 2 +- tester/rtems/testing/bsps/pc.ini | 2 +- tester/rtems/testing/bsps/qoriq_e500.ini | 2 +- tester/rtems/testing/bsps/qoriq_e6500_32.ini | 2 +- tester/rtems/testing/bsps/qoriq_e6500_64.ini | 2 +- tester/rtems/testing/bsps/raspberrypi2.ini | 2 +- tester/rtems/testing/bsps/xilinx_versal_vck190.ini | 2 +- .../rtems/testing/bsps/xilinx_zynq_a9_qemu_smp.ini | 2 +- tester/rtems/testing/bsps/xilinx_zynq_zc706.ini| 2 +- tester/rtems/testing/bsps/xilinx_zynq_zedboard.ini | 2 +- .../testing/bsps/xilinx_zynqmp_ilp32_zu3eg.ini | 2 +- .../testing/bsps/xilinx_zynqmp_lp64_zu3eg.ini | 2 +- tester/rtems/testing/defaults.mc | 2 + 18 files changed, 45 insertions(+), 34 deletions(-) diff --git a/rtemstoolkit/options.py b/rtemstoolkit/options.py index 5ebe3bc..4b7a93a 100644 --- a/rtemstoolkit/options.py +++ b/rtemstoolkit/options.py @@ -102,7 +102,7 @@ class command_line(object): '--no-clean': 'Do not clean up the build tree', '--always-clean': 'Always clean the build tree, even with an error', '--keep-going': 'Do not stop on an error.', -'--jobs=[0..n,none,half,full]': 'Run with specified number of jobs, default: num CPUs.', +'--jobs=[0..n,none,half,full]': 'Run with specified number + of jobs (default: defined in configuration file)', '--macros file[,file]': 'Macro format files to load after the defaults', '--log file': 'Log file where all build output is written to', } @@ -327,6 +327,11 @@ class command_line(object): # Handle the jobs for make if '_ncpus' not in self.defaults: raise error.general('host number of CPUs not set') +if self.defaults['default_jobs'] != '0': +print( +'default_jobs is %d and the default is %d' % +(self.defaults['default_jobs'], 0) +) ncpus = self.jobs(self.defaults['_ncpus']) if ncpus > 1: self.defaults['_smp_mflags'] = '-j %d' % (ncpus) @@ -427,28 +432,25 @@ class command_line(object): um += [m] return um if len(um) else None -def jobs(self, cpus): +def jobs(self, num_cpus): try: -cpus = int(cpus) +cpus = int(num_cpus) except: raise error.general('invalid host cpu value') opt_jobs = self.opts['jobs'] if opt_jobs == 'default': -_jobs = self.defaults.get_value('jobs') -if _jobs is not None: -if _jobs == 'none': -cpus = 0 -elif _jobs == 'max': -pass -elif _jobs == 'half': -cpus = cpus / 2 -else: -try: -cpus = int(_jobs) -except: -raise error.general('invalid %%{jobs} value: %s' % (_jobs)) +_jobs = self.defaults.get_value('default_jobs') +if _jobs == 'none': +cpus = 0 +elif _jobs == 'max': +pass +elif _jobs == 'half': +cpus = cpus / 2 else: -opt_jobs = 'max' +try: +cpus = int(_jobs) +except: +raise error.general('invalid %%{jobs} value: %s' % + (_jobs)) if opt_jobs != 'default': if opt_jobs == 'none': cpus = 0 @@ -474,7 +476,14 @@ class command_line(object): if not ok: raise error.internal('bad jobs option: %s' % (opt_jobs)) if cpus <= 0: -cpu = 1 +cpus = 1 +max_jobs = int(self.defaults.get_value('max_jobs')) +if max_jobs == 0: +max_jobs = cpus +if cpus > max_jobs: +raise error.internal( +'exceeded maximum number of jobs: %d > %d' % (cpus, max_jobs) +) return cpus def params(self): diff --git
Re: [rtems-tools] tester: Update jobs configuration
ping On 11/15/2021 4:39 PM, Ryan Long wrote: ping On 11/1/2021 5:31 PM, Ryan Long wrote: ping -Original Message- From: Ryan Long Sent: Wednesday, October 20, 2021 3:06 PM To: devel@rtems.org Cc: Ryan Long Subject: [rtems-tools] tester: Update jobs configuration Allow for default_jobs and max_jobs to be specified in the BSP's configuration file. --- rtemstoolkit/options.py | 45 +- tester/rtems/testing/bsps/beagleboardxm.ini | 2 +- tester/rtems/testing/bsps/beagleboneblack.ini | 2 +- tester/rtems/testing/bsps/imx7.ini | 2 +- tester/rtems/testing/bsps/mcf5235.ini | 2 +- tester/rtems/testing/bsps/mvme2307.ini | 2 +- tester/rtems/testing/bsps/pc.ini | 2 +- tester/rtems/testing/bsps/qoriq_e500.ini | 2 +- tester/rtems/testing/bsps/qoriq_e6500_32.ini | 2 +- tester/rtems/testing/bsps/qoriq_e6500_64.ini | 2 +- tester/rtems/testing/bsps/raspberrypi2.ini | 2 +- tester/rtems/testing/bsps/xilinx_versal_vck190.ini | 2 +- .../rtems/testing/bsps/xilinx_zynq_a9_qemu_smp.ini | 2 +- tester/rtems/testing/bsps/xilinx_zynq_zc706.ini | 2 +- tester/rtems/testing/bsps/xilinx_zynq_zedboard.ini | 2 +- .../testing/bsps/xilinx_zynqmp_ilp32_zu3eg.ini | 2 +- .../testing/bsps/xilinx_zynqmp_lp64_zu3eg.ini | 2 +- tester/rtems/testing/defaults.mc | 2 + 18 files changed, 45 insertions(+), 34 deletions(-) diff --git a/rtemstoolkit/options.py b/rtemstoolkit/options.py index 5ebe3bc..4b7a93a 100644 --- a/rtemstoolkit/options.py +++ b/rtemstoolkit/options.py @@ -102,7 +102,7 @@ class command_line(object): '--no-clean': 'Do not clean up the build tree', '--always-clean': 'Always clean the build tree, even with an error', '--keep-going': 'Do not stop on an error.', - '--jobs=[0..n,none,half,full]': 'Run with specified number of jobs, default: num CPUs.', + '--jobs=[0..n,none,half,full]': 'Run with specified number + of jobs (default: defined in configuration file)', '--macros file[,file]': 'Macro format files to load after the defaults', '--log file': 'Log file where all build output is written to', } @@ -327,6 +327,11 @@ class command_line(object): # Handle the jobs for make if '_ncpus' not in self.defaults: raise error.general('host number of CPUs not set') + if self.defaults['default_jobs'] != '0': + print( + 'default_jobs is %d and the default is %d' % + (self.defaults['default_jobs'], 0) + ) ncpus = self.jobs(self.defaults['_ncpus']) if ncpus > 1: self.defaults['_smp_mflags'] = '-j %d' % (ncpus) @@ -427,28 +432,25 @@ class command_line(object): um += [m] return um if len(um) else None - def jobs(self, cpus): + def jobs(self, num_cpus): try: - cpus = int(cpus) + cpus = int(num_cpus) except: raise error.general('invalid host cpu value') opt_jobs = self.opts['jobs'] if opt_jobs == 'default': - _jobs = self.defaults.get_value('jobs') - if _jobs is not None: - if _jobs == 'none': - cpus = 0 - elif _jobs == 'max': - pass - elif _jobs == 'half': - cpus = cpus / 2 - else: - try: - cpus = int(_jobs) - except: - raise error.general('invalid %%{jobs} value: %s' % (_jobs)) + _jobs = self.defaults.get_value('default_jobs') + if _jobs == 'none': + cpus = 0 + elif _jobs == 'max': + pass + elif _jobs == 'half': + cpus = cpus / 2 else: - opt_jobs = 'max' + try: + cpus = int(_jobs) + except: + raise error.general('invalid %%{jobs} value: %s' % + (_jobs)) if opt_jobs != 'default': if opt_jobs == 'none': cpus = 0 @@ -474,7 +476,14 @@ class command_line(object): if not ok: raise error.internal('bad jobs option: %s' % (opt_jobs)) if cpus <= 0: - cpu = 1 + cpus = 1 + max_jobs = int(self.defaults.get_value('max_jobs')) + if max_jobs == 0: + max_jobs = cpus + if cpus > max_jobs: + raise error.internal( + 'exceeded maximum number of jobs: %d > %d' % (cpus, max_jobs) + ) return cpus
Re: [rtems-tools] tester: Update jobs configuration
ping On 11/1/2021 5:31 PM, Ryan Long wrote: ping -Original Message- From: Ryan Long Sent: Wednesday, October 20, 2021 3:06 PM To: devel@rtems.org Cc: Ryan Long Subject: [rtems-tools] tester: Update jobs configuration Allow for default_jobs and max_jobs to be specified in the BSP's configuration file. --- rtemstoolkit/options.py| 45 +- tester/rtems/testing/bsps/beagleboardxm.ini| 2 +- tester/rtems/testing/bsps/beagleboneblack.ini | 2 +- tester/rtems/testing/bsps/imx7.ini | 2 +- tester/rtems/testing/bsps/mcf5235.ini | 2 +- tester/rtems/testing/bsps/mvme2307.ini | 2 +- tester/rtems/testing/bsps/pc.ini | 2 +- tester/rtems/testing/bsps/qoriq_e500.ini | 2 +- tester/rtems/testing/bsps/qoriq_e6500_32.ini | 2 +- tester/rtems/testing/bsps/qoriq_e6500_64.ini | 2 +- tester/rtems/testing/bsps/raspberrypi2.ini | 2 +- tester/rtems/testing/bsps/xilinx_versal_vck190.ini | 2 +- .../rtems/testing/bsps/xilinx_zynq_a9_qemu_smp.ini | 2 +- tester/rtems/testing/bsps/xilinx_zynq_zc706.ini| 2 +- tester/rtems/testing/bsps/xilinx_zynq_zedboard.ini | 2 +- .../testing/bsps/xilinx_zynqmp_ilp32_zu3eg.ini | 2 +- .../testing/bsps/xilinx_zynqmp_lp64_zu3eg.ini | 2 +- tester/rtems/testing/defaults.mc | 2 + 18 files changed, 45 insertions(+), 34 deletions(-) diff --git a/rtemstoolkit/options.py b/rtemstoolkit/options.py index 5ebe3bc..4b7a93a 100644 --- a/rtemstoolkit/options.py +++ b/rtemstoolkit/options.py @@ -102,7 +102,7 @@ class command_line(object): '--no-clean': 'Do not clean up the build tree', '--always-clean': 'Always clean the build tree, even with an error', '--keep-going': 'Do not stop on an error.', -'--jobs=[0..n,none,half,full]': 'Run with specified number of jobs, default: num CPUs.', +'--jobs=[0..n,none,half,full]': 'Run with specified number + of jobs (default: defined in configuration file)', '--macros file[,file]': 'Macro format files to load after the defaults', '--log file': 'Log file where all build output is written to', } @@ -327,6 +327,11 @@ class command_line(object): # Handle the jobs for make if '_ncpus' not in self.defaults: raise error.general('host number of CPUs not set') +if self.defaults['default_jobs'] != '0': +print( +'default_jobs is %d and the default is %d' % +(self.defaults['default_jobs'], 0) +) ncpus = self.jobs(self.defaults['_ncpus']) if ncpus > 1: self.defaults['_smp_mflags'] = '-j %d' % (ncpus) @@ -427,28 +432,25 @@ class command_line(object): um += [m] return um if len(um) else None -def jobs(self, cpus): +def jobs(self, num_cpus): try: -cpus = int(cpus) +cpus = int(num_cpus) except: raise error.general('invalid host cpu value') opt_jobs = self.opts['jobs'] if opt_jobs == 'default': -_jobs = self.defaults.get_value('jobs') -if _jobs is not None: -if _jobs == 'none': -cpus = 0 -elif _jobs == 'max': -pass -elif _jobs == 'half': -cpus = cpus / 2 -else: -try: -cpus = int(_jobs) -except: -raise error.general('invalid %%{jobs} value: %s' % (_jobs)) +_jobs = self.defaults.get_value('default_jobs') +if _jobs == 'none': +cpus = 0 +elif _jobs == 'max': +pass +elif _jobs == 'half': +cpus = cpus / 2 else: -opt_jobs = 'max' +try: +cpus = int(_jobs) +except: +raise error.general('invalid %%{jobs} value: %s' % + (_jobs)) if opt_jobs != 'default': if opt_jobs == 'none': cpus = 0 @@ -474,7 +476,14 @@ class command_line(object): if not ok: raise error.internal('bad jobs option: %s' % (opt_jobs)) if cpus <= 0: -cpu = 1 +cpus = 1 +max_jobs = int(self.defaults.get_value('max_jobs')) +if max_jobs == 0: +max_jobs = cpus +if cpus > max_jobs: +raise error.internal( +'exceeded maximum number of jobs: %d > %d' % (cpus, max_jobs) +) return cpus def params(self): diff --git
RE: [rtems-tools] tester: Update jobs configuration
ping -Original Message- From: Ryan Long Sent: Wednesday, October 20, 2021 3:06 PM To: devel@rtems.org Cc: Ryan Long Subject: [rtems-tools] tester: Update jobs configuration Allow for default_jobs and max_jobs to be specified in the BSP's configuration file. --- rtemstoolkit/options.py| 45 +- tester/rtems/testing/bsps/beagleboardxm.ini| 2 +- tester/rtems/testing/bsps/beagleboneblack.ini | 2 +- tester/rtems/testing/bsps/imx7.ini | 2 +- tester/rtems/testing/bsps/mcf5235.ini | 2 +- tester/rtems/testing/bsps/mvme2307.ini | 2 +- tester/rtems/testing/bsps/pc.ini | 2 +- tester/rtems/testing/bsps/qoriq_e500.ini | 2 +- tester/rtems/testing/bsps/qoriq_e6500_32.ini | 2 +- tester/rtems/testing/bsps/qoriq_e6500_64.ini | 2 +- tester/rtems/testing/bsps/raspberrypi2.ini | 2 +- tester/rtems/testing/bsps/xilinx_versal_vck190.ini | 2 +- .../rtems/testing/bsps/xilinx_zynq_a9_qemu_smp.ini | 2 +- tester/rtems/testing/bsps/xilinx_zynq_zc706.ini| 2 +- tester/rtems/testing/bsps/xilinx_zynq_zedboard.ini | 2 +- .../testing/bsps/xilinx_zynqmp_ilp32_zu3eg.ini | 2 +- .../testing/bsps/xilinx_zynqmp_lp64_zu3eg.ini | 2 +- tester/rtems/testing/defaults.mc | 2 + 18 files changed, 45 insertions(+), 34 deletions(-) diff --git a/rtemstoolkit/options.py b/rtemstoolkit/options.py index 5ebe3bc..4b7a93a 100644 --- a/rtemstoolkit/options.py +++ b/rtemstoolkit/options.py @@ -102,7 +102,7 @@ class command_line(object): '--no-clean': 'Do not clean up the build tree', '--always-clean': 'Always clean the build tree, even with an error', '--keep-going': 'Do not stop on an error.', -'--jobs=[0..n,none,half,full]': 'Run with specified number of jobs, default: num CPUs.', +'--jobs=[0..n,none,half,full]': 'Run with specified number + of jobs (default: defined in configuration file)', '--macros file[,file]': 'Macro format files to load after the defaults', '--log file': 'Log file where all build output is written to', } @@ -327,6 +327,11 @@ class command_line(object): # Handle the jobs for make if '_ncpus' not in self.defaults: raise error.general('host number of CPUs not set') +if self.defaults['default_jobs'] != '0': +print( +'default_jobs is %d and the default is %d' % +(self.defaults['default_jobs'], 0) +) ncpus = self.jobs(self.defaults['_ncpus']) if ncpus > 1: self.defaults['_smp_mflags'] = '-j %d' % (ncpus) @@ -427,28 +432,25 @@ class command_line(object): um += [m] return um if len(um) else None -def jobs(self, cpus): +def jobs(self, num_cpus): try: -cpus = int(cpus) +cpus = int(num_cpus) except: raise error.general('invalid host cpu value') opt_jobs = self.opts['jobs'] if opt_jobs == 'default': -_jobs = self.defaults.get_value('jobs') -if _jobs is not None: -if _jobs == 'none': -cpus = 0 -elif _jobs == 'max': -pass -elif _jobs == 'half': -cpus = cpus / 2 -else: -try: -cpus = int(_jobs) -except: -raise error.general('invalid %%{jobs} value: %s' % (_jobs)) +_jobs = self.defaults.get_value('default_jobs') +if _jobs == 'none': +cpus = 0 +elif _jobs == 'max': +pass +elif _jobs == 'half': +cpus = cpus / 2 else: -opt_jobs = 'max' +try: +cpus = int(_jobs) +except: +raise error.general('invalid %%{jobs} value: %s' % + (_jobs)) if opt_jobs != 'default': if opt_jobs == 'none': cpus = 0 @@ -474,7 +476,14 @@ class command_line(object): if not ok: raise error.internal('bad jobs option: %s' % (opt_jobs)) if cpus <= 0: -cpu = 1 +cpus = 1 +max_jobs = int(self.defaults.get_value('max_jobs')) +if max_jobs == 0: +max_jobs = cpus +if cpus > max_jobs: +raise error.internal( +'exceeded maximum number of jobs: %d > %d' % (cpus, max_jobs) +) return cpus def params(self): diff --git a/tester/rtems/testing/bsps/beagleboardxm.ini b/tester/rtems/testing/bsps/beagleboardxm.ini index e8a79a6..72e6e8f 100644