11#!/usr/bin/env python3
2- """benchMT - SETI multi-threaded MB/AP Benchmark Tool
2+ """ benchMT - SETI multi-threaded MB/AP Benchmark Tool
33
44 This tool will extract the total number of CPU cores/threads and GPU platforms from the user's
5- environment and utilize them in running a list of apps/args specified in the benchCFG file. Using
6- less than the total number of CPU threads can be specified in the command line. This tool will
7- read a list of MB/AP apps/args from the BenchCFG file and search for the specified MB/AP apps in the
8- APP_CPU and APP_GPU directories to validate and determine platform. It will then leverage allocated
9- threads, as specified, to run all benchmark jobs, storing results in the testData directory. Use
10- the *--help* option to get a description of valid command line arguments. In support of automation,
11- some command line arguments can be specified as modes in the BenchCFG file.
5+ environment and utilize them in running a list of apps/args specified in the benchCFG file.
6+ Using less than the total number of CPU threads can be specified in the command line. This
7+ tool will read a list of MB/AP apps/args from the BenchCFG file and search for the specified
8+ MB/AP apps in the APP_CPU and APP_GPU directories to validate and determine platform. It will
9+ then leverage allocated threads, as specified, to run all benchmark jobs, storing results in
10+ the testData directory. Use the *--help* option to get a description of valid command line
11+ arguments. In support of automation, some command line arguments can be specified as modes in
12+ the BenchCFG file.
1213
1314 By default, a summary list of all jobs will update in the display as the program progresses. If
1415 there are a large number of jobs, then this display may not be useful and the *--display_slots*
1516 option can be used to display the status of each slot as the program progresses. In some cases,
1617 there will be too many slots to display, and the *--display_compact* option can used to further
1718 optimize the progress display.
1819
19- You may need to use the *--boinc_home* command option to specify the boinc home directory, which
20- is required, since boinccmd is used. Specifying --noBS on the command line will allow benchMT to
21- function without a boinc installation. An alternative BenchCFG file can be specified with the
20+ You may need to use the *--boinc_home* command option to specify the BOINC home directory, which
21+ is required, since boinccmd is used. An alternative BenchCFG file can be specified with the
2222 command line option *--cfg_file filename*.
2323
24+ The *--lsgpu* command option can be used to display information and capability of all installed
25+ GPUs. The *--purge_kernels* can be used to purge all compiled kernels from the *benchMT* working
26+ directory.
27+
2428 All WUs in the WU_test directory will be used in the creation of jobs to be run, unless the
2529 *--std_signals* option is used, in which case, WUs in the WU_std_signal will be used. The
2630 APPS_GPU and APPS_CPU directories can have more apps than are specified to run in the BenchCFG
3135 with the *--no_ref* option or forced with the *--force_ref* option. The *--energy* option can be
3236 used if your system has amdgpu drivers with compatible GPUs to give the energy used in running a
3337 task. In order to correctly associate a GPU card number with a BOINC device number, you must
34- specify this with the *--devmap B:C,B2:C2* option. I know of no reobust way to make this mapping
38+ specify this with the *--devmap B:C,B2:C2* option. I know of no robust way to make this mapping
3539 other than manually running each card individually and observing which card is being used. If
3640 you are running an AstroPulse app, you must specify the *--astropulse* option in order for it to
3741 run properly.
3842
3943 The results will be stored in a unique subdir of the testData directory. There is an overall run
4044 log txt file, a psv file useful for importing into an analytics tools, and the sah and stderr
41- files for each job run. A run name can be specified with the *--run_name* commane line option. This
42- name will be included in the name of the testData subdirectory for the current run.
45+ files for each job run. A run name can be specified with the *--run_name* command line option.
46+ This name will be included in the name of the testData subdirectory for the current run.
4347
4448 Copyright (C) 2018 RueiKe
4549
@@ -61,9 +65,9 @@ __copyright__ = 'Copyright (C) 2018 RueiKe'
6165__credits__ = ['Keith Myers - Testing and Verification' ]
6266__license__ = 'GNU General Public License'
6367__program_name__ = 'benchMT'
64- __version__ = 'v2.0.0-RC2 '
68+ __version__ = 'v2.0.0'
6569__maintainer__ = 'RueiKe'
66- __status__ = 'Release Candidate '
70+ __status__ = 'Stable Release '
6771__docformat__ = 'reStructuredText'
6872
6973import argparse
@@ -80,7 +84,6 @@ from uuid import uuid4
8084import glob
8185import shutil
8286from pathlib import Path
83- #from typing import Union
8487
8588
8689# pylint: disable=multiple-statements
@@ -111,8 +114,10 @@ class MbConst(ObjDict):
111114 """
112115 Defines benchMT constants used through out the code.
113116 """
117+ # pylint: disable=attribute-defined-outside-init
114118 # pylint: disable=too-many-instance-attributes
115119 def __init__ (self ):
120+ # pylint: disable=attribute-defined-outside-init
116121 super ().__init__ ({'boinc_home' : '/home/boinc/BOINC/' ,
117122 'cpu_app_subdir' : 'APPS_CPU/' ,
118123 'gpu_app_subdir' : 'APPS_GPU/' ,
@@ -268,7 +273,9 @@ class BenchEnv:
268273 """
269274 benchMT environment parameters.
270275 """
276+ # pylint: disable=attribute-defined-outside-init
271277 def __init__ (self ):
278+ # pylint: disable=attribute-defined-outside-init
272279 self ._display = {'hostname' : 'Hostname: {}' , 'run_name' : 'Run Name: {}' , 'app_mode' : 'APP Mode: {}' ,
273280 'benchMT_version' : 'benchMT version: {}' , 'platform' : 'Platform: {}' ,
274281 'os_desc' : 'OS Description: {}' , 'cpu_model' : 'CPU Model: {}' , 'cpu_mhz' : 'CPU MHz: {}' ,
@@ -868,7 +875,7 @@ class BenchEnv:
868875 break
869876 time .sleep (1 )
870877 except (subprocess .CalledProcessError , OSError ) as except_err :
871- print ('Error: {}, could not execute boinccmd .' .format (cmd_str ), file = sys .stderr )
878+ print ('Error: {}, could not execute {} .' .format (except_err , cmd_str ), file = sys .stderr )
872879 os .chdir (cwd )
873880
874881 def print (self , fileptr = sys .stdout ):
@@ -1161,7 +1168,7 @@ class GpuList:
11611168 line_items = linestr .split (maxsplit = 2 )
11621169 if len (line_items ) != 3 :
11631170 continue
1164- cl_vender , cl_index = tuple (re .sub (r'[\[\]]' , '' , line_items [0 ]).split ('/' ))
1171+ _cl_vender , cl_index = tuple (re .sub (r'[\[\]]' , '' , line_items [0 ]).split ('/' ))
11651172 if cl_index == '*' :
11661173 continue
11671174 if ocl_index == '' :
@@ -2912,7 +2919,7 @@ def main():
29122919 time .sleep (.5 )
29132920 except (subprocess .CalledProcessError , OSError ) as except_err :
29142921 # This exception is not effective since time succeeds even if the app fails to run.
2915- print ('Fatal Error: {} can not execute to process job: [{}].\n {} ' .format (except_err , cmd_str ))
2922+ print ('Fatal Error: {} can not execute to process job: [{}].\n ' .format (except_err , cmd_str ))
29162923 env .sum_file_ptr .close ()
29172924 env .psv_file_ptr .close ()
29182925 sys .exit (- 1 )
0 commit comments