$Id$ | Latest: www.spec.org/accel2023/Docs/ |
---|
A. What is a config file? B. Benchmark selection C. Five consumers |
D. Syntax 1. Sections and scope 2. Comments 3. Whitespace 4. Quoting 5. Line continuation 6. Included files 7. Section markers E. Section merging |
F. Variables 1. Defining variables 2. $[square] substitution 3. Useful $[variables] 4. ${curly} interpolation 5. Useful ${variables} 6. Unsetting "%undef%" 7. Debug tips |
All variable types $(MAKEVAR)\$SHELLVAR $[startup] ${during_run}/$during_run %{macro} %{ENV_var} New with SPECaccel 2023 |
II. Config file options for runaccel
A. Precedence: config file vs. runaccel command line
B. Options
action allow_label_override backup_config basepeak bind check_version command_add_redirect delay deletework difflines enable_monitor env_vars expand_notes expid fail fail_build fail_run flagsurl force_monitor http_proxy http_timeout ignore_errors ignore_sigint info_wrap_columns iterations keeptmp line_width label locking log_line_width log_timestamp mail_reports mailcompress mailmethod mailport mailserver mailto make make_no_clobber makeflags mean_anyway minimize_builddirs minimize_rundirs no_input_handler no_monitor nobuild notes_wrap_columns notes_wrap_indent output_format output_root pmodel New preenv ranks rebuild reportable runlist save_build_files section_specifier_fatal setprocgroup size src.alt strict_rundir_verify table teeout threads tune use_submit_for_speed verbose verify_binaries version_url
III. Config file options for specmake
A. Commonly used Make variables
CC, CXX, FC |
B. Parallel Model Selection C. Creating your own Make variables D. += is available but use with caution E. Using buildsetup to create a sandbox F. About Automatic Rebuilds |
|
{C|CXX|F}C_VERSION_OPTION New and required with SPECaccel 2023 |
IV. Config file options for the shell
A. \$SHELLVAR variable substitution B. Options bench_post_setup build_pre_bench build_post_bench mointor_X post_setup submit |
C. Using submit 1. Basic usage 2. Reporting |
V. Config file options for human readers
VII. The config file preprocessor
A. Introduction 1. Example: Picking Model 2. Syntax Basics B. Defining macros 1. In a config file 2. On the command line 3. Predefined macros: endian, hostname...
4. Example: Adjusting the Environment 5. Redefinition |
C. Un-doing macro definition D. Using macros E. Conditionals 1. %ifdef .. %endif 2. %ifndef .. %endif 3. %if .. %endif 4. %else 5. %elif |
F. Informational directives 1. %warning 2. %error 3. %info New with SPECaccel 2023 4. %dumpmacros New with SPECaccel 2023 |
VII. Output files - and how they relate to your config file
A. Help, I've got too many config files! B. The log file 1. Useful Search Strings 2. About Temporary Debug Logs 3. Verbosity levels |
D. Help, I've got too many log files! E. Finding the build directory F. Files in the build directory G. For more information |
A. Other benchmark sets
B. Obsolete features
I.A. What is a config file?A SPECaccel config file is a file that defines how to build, run, and report on the SPECaccel benchmarks in a particular environment. It defines how SPECaccel 2023 interacts with your test environment, and lets you describe that environment in human-readable form. A config file provides detailed control of testing, including:
Using your customized options, the SPECaccel tools automatically create Makefiles, build the benchmarks, run them, generate reports, and write log files. Because they collect your options into one place, config files are key to result reproducibility. For example, if a vendor publishes SPECaccel 2023 results for the SuperHero Model 42 at the SPEC web site www.spec.org/accel2023, it is expected that a customer can demonstrate similar performance using only 3 ingredients:
|
q. This document looks big and intimidating. Where do I start? a. Don't start here. Start with the Overview and Using SPEC SPECaccel 2023 - the 'runaccel' Command. After that, please read section I.C carefully, which explains that config files contain options for five (5) different consumers. You need to recognize which options are for which consumers. Please notice that config files have 3 kinds of sections. You need to know how named sections work. From that point on, you can probably skip around among topics as they may interest you. Tip: Most topics can be found by adding '#topic' to the URL for this document. Examples: #consumers #shell #readers #sw_c_compiler Still lost? The config file directory contains several example config files (Prefixed as "Example_"). Copy the example that best matches the compiler version you're using to a new config file, and edit from there. The "Example_SUT.inc" file includes an example for the system description fields which you can either copy into your config file, or copy it to a new include file for your particular system. |
In a config file, you can reference: One or more individual benchmarks, such as 404.lbm, or entire suites, using the Short Tags in the table below.
Short Tag |
Contents | Metrics | What do Higher Scores Mean? |
accel | 12 benchmarks | SPECaccel 2023_base SPECaccel 2023_peak |
Higher scores indicate that less time is needed. |
A config file has content for five (5) distinct consumers, as shown in the table.
To understand a config file, you must understand which consumer is addressed at any given
point.
Column 3 below provides a few examples for each; click the roman numerals in column 2 for many more.
Consumer | List of options |
Examples | Brief description |
runaccel | II |
ranks
output_format reportable threads pmodel |
Options that change how runaccel itself works. Many should be familiar from Using SPECaccel 2023. output_format = text,csv tune = base reportable = yes pmodel = TGT then the defaults for the runaccel command would change as shown. Both of these would do the same thing: runaccel --config=jimmy --output=text,csv --tune=base --reportable --pmodel=TGT accel |
---|---|---|---|
specmake | III |
OPTIMIZE
PORTABILITY |
Make variables, to control benchmark builds via specmake.
Commonly used specmake variables: section III
|
shell | IV |
post_setup submit |
Commands to be executed by the Unix shell (/bin/sh)
submit = $[top]/bind.sh $command Above, a user supplied "bind.sh" shell script to perform CPU core binding.
Warning: SPECaccel config files can execute arbitrary
shell commands.
|
readers | V | hw_model
notes100 sw_compiler |
System Under Test (SUT) description, with enough detail so that the reader can understand what was tested and can reproduce your results. If a SPECaccel 2023 result is published (whether at SPEC or independently) it must be fully described. |
preprocessor | VII | %define
%ifdef %if %elif %error |
Preprocessing directives and definitions to adjust your config file prior to use. All preprocessor directives begin in column 1. Example: %if %{model} eq 'omp_target' pmodel = TGT %elif %{model} eq 'omp_inner_simd' pmodel = SMD %else # Model not defined for OpenMP, use default 'loop' pmodel = LOP %endif |
A config file contains: a header section, named sections, and a HASH section.
Scope: Every line is considered to be within the scope of one of these three. Lines prior to the first section marker are in the scope of the header section. All other lines are either in the scope of the most recently preceding section marker or in the HASH section.
Sections | Description | Example |
header section |
The header section is the first section, prior to the any named section. Most attempts to address runaccel itself are done in the header section. In the example, lines 1 through 6 are in the header section. |
$ cat -n hiroshi.cfg 1 flagsurl = $[top]/config/flags/gcc.xml 2 iterations = 1 3 output_format = text 4 runlist = 404.lbm 5 size = ref 6 tune = peak 7 openacc=peak: 8 CC_VERSION_OPTION = -v 9 CC = gcc 10 OPTIMIZE = -O2 11 404.lbm=peak: 12 OPTIMIZE = -O3 13 14 __HASH__ 15 404.lbm=peak=none: 16 # Last updated 2021-02-06 14:29:40 17 opthash=ff6059d6d9ec9577f7f49d05178c58688f31004089 18 baggage= 19 compiler_version=\ 20 @eNo1jbEOgjAYhPc+RUcdaFEJIWwGHEhQjBLjRn7LLzapLWkL8 21 kpP9OCqkdX070hmtk0bTjMUspiuhQA9RFgfDki3brEkLdkCf0y 22 0NO36VHldDROLqTSzoNS2JfS5pT/DqUAH54cv4tAsjDEC6M9au 23 FuH/CZ+c5Q+pyRd+tUlX 24 compile_options=\ 25 @eNp1T11PgzAUfe+vaPrOMjNfJGMJlLqhQBtLX3xptHYGBWoKM 26 vNp93Vjs3obadX2I+sHXZtD+0D3VXr9bX+8/InJBEMAeKBFZLq 27 KgWj06epUADLlCVqe+rFquJaKiHumJSaC1YWAuOAr/DPWvfu4I 28 mALF6zzeSpj96+RITFhJd3rG/dMaQTzEIJYV2T0DJl8RlGfl7Z 29 hjyd8vw+D9MirnY6z5LRW9NOC1yNkc/OfAJtxnuD 30 exehash=5290fe504238c6de1a13e275ab8ca11e035fbb4e7e 31 $ |
---|---|---|
or default: |
Options for the header section may also be entered in section default=default=default: or a shorter spelling thereof, such as default: This can be helpful if you need to effectively return to the header section, perhaps when using include. Tip: Nevertheless, it is usually easier to maintain a config files that keeps all runaccel options near the top, preferably in alphabetical order. |
|
Named sections |
A named section is a portion of the config file that follows a line that contains a section marker. Briefly, a section marker is a 1-to-3 part string with equals signs in the middle and a colon at the end; see detail below. The example has 2 named sections, delimited by 2 section markers on lines 7 and 11. Notice that the example sets OPTIMIZE in both of the named sections. To understand which one gets used, see the precedence rules, which describe how sections interact. |
|
HASH section |
The HASH Section is the final, automatically-generated section. It starts with __HASH__ and contains checksums. The example starts the HASH section at line 14. (For readability, the lines are truncated on the right.) The automatically-updated checksums ensure that binaries match their config file. You can optionally disable checking, but doing so is strongly discouraged. See verify_binaries. Config files printed by --output_format=config do not include the HASH section. |
Comments begin with '#'. There are two types:
Syntax | Type | Saved? | Detail |
---|---|---|---|
# | Regular | Yes | Regular comments can be full-line or trailing. A copy of your config file is saved with the test results. If you submit your results to SPEC for publication, the regular comments can be read by anyone. |
#> | Protected | No | A full-line comment that begins with #> is a protected comment and will not be saved with your results. You can use protected comments for proprietary information, for example: #> I didn't use the C++ beta because of Bob's big back-end bug. |
Both types of comments are ignored when processing the config file.
Full-line comments: If # is the first non-blank item on a line, then the whole line is a comment. Comment lines can be placed anywhere in a config file.
Trailing comments: If a line has non-blank items, you can (usually) add regular comments. You cannot write a protected trailing comment. If you try to use a protected comment after some other element, it is treated as a regular comment.
All comments below will be saved except the one that says 'NOT saved'.
# New optimizers. default=base: # Most optimizers go up to ten. OPTIMIZE = -O11 # These go to eleven. #> This comment is NOT saved COPTIMIZE = -std #> This comment is saved
Not a comment: These instances of # do not start a comment:
\# To use a # without starting a comment, put a backslash in front of it:
hw_model = MegaCorp's \#1 Semi-Autonomous Unit
notesN...# Config file notes are printed in reports as entered, including any instances of #
#notes100 = This note will not be printed, because # was the first item on the line.T notes110 = This note will be printed in reports. All of it. # Even this part.
Blank lines can be placed anywhere in a config file. They are ignored.
Spaces at the beginning of lines are ignored, with the exception that preprocessor directives always begin with a percent sign (%) in the first column. You can put spaces after the percent sign, if you wish (example).
Spaces within a line are usually ignored. Don't try to break up a section marker, and you can't break up a single word (say 'OPTIMIZE' not 'OPT I MIZE'). If multiple spaces separate line elements, it is as if there were only one space. Each of these have the same meaning:
OPTIMIZE=-O2 -noalias OPTIMIZE = -O2 -noalias
One place where spaces are considered significant is in notes, where you can use spaces to line up your comments. Notes are printed in a fixed-width font.
Trailing spaces and tabs are ignored, unless they are preceded by a backslash.
If you use double (") or single (') quotes within a config file, runaccel leaves them alone. The assumption is that you put them there because one of the consumers (such as a shell) needs them. The quotes are not significant to runaccel but may be highly significant to the consumer. See the section on quote traps.
If you use a backslash (\) it is usually not significant. The exceptions are:
Many fields, including most reader fields, can be continued by adding a number:
node_compute_hw_tcache000= 256 MB I+D on chip per chip node_compute_hw_tcache001 = 16 MB shared / 4 cores node_compute_sw_os1 = SUSE Linux Enterprise Linux Server 12 node_compute_sw_os2 = 4.12.14-94.41-default
The fields which cannot be continued are the ones that are expecting a simple integer, such as node_hw_nchips and license_num; and the ones that expect a date, such as hw_avail. You can pick your own style of numbering, as in the examples above. (Note: the stored results from your test always use three-digit numbers, and have slightly different syntax, as discussed in utility.html.)
Shell-style "here documents" with double angle brackets and a delimiter word (e.g. <<EOT) can be used to set multi-line values. Backslash-continued lines are also supported. For example:
$ cat continued_lines.cfg expand_notes = 1 output_format = text output_root = /tmp/fake_lines runlist = 404.lbm here_continued = <<EOT + This is + + a test + EOT backslash_continued = + So is +\ + this + notes1 = ${here_continued} notes2 = ${backslash_continued} $ cat continued_lines.sh runaccel --config=continued_lines --fakereport | grep txt grep '+' /tmp/fake_lines/result/accel2023*txt $ ./continued_lines.sh format: Text -> /tmp/fake_lines/result/accel2023.001.ref.txt + This is + + a test + + So is + + this + $
You can include other files in your config file using include:
Multiple files may be included.
Included files may use macros (and you can use configpp to check the effect).
Included files may write to arbitrary sections, including
(effectively) the header section.
Example: a config file is developed on one system, and applied on a different System Under Test (SUT). The compilers are, of course, installed on the development system. They might not be present on the SUT.
The compiler is described in the main config file on lines 10-12.
$ cat -n include.cfg 1 iterations = 1 2 output_format = text 3 output_root = /tmp/example 4 runlist = 404.lbm 5 size = test 6 test_sponsor = Turboblaster 7 tester = Turboblaster 8 include: SUT.inc 9 default: 10 CC = gcc 11 CC_VERSION_OPTION = -V 12 sw_compiler000 = C/C++/Fortran: Version 12.2 of 13 sw_compiler001 = GNU Compiler Collection 14 sw_avail = Aug-2022 $ Note the software date (sw_avail) on line 14 above.
$ cp Turboblaster.inc SUT.inc $ cat Turboblaster.inc default: node_compute_label = TurboBlaster 5000 node_compute_order = 1 node_compute_count = 2 node_compute_purpose = compute node_compute_hw_vendor = Mega Technology node_compute_hw_model = Turblaster 5000 node_compute_hw_cpu_name = Turbo CPU node_compute_hw_ncpuorder = 1 chips hw_avail = Feb-2023 $ Note the hardware date (hw_avail) in the include file.
$ cat include.sh runaccel --config=include | grep txt grep avail /tmp/example/result/*txt $ ./include.sh format: Text -> /tmp/example/result/accel2023.001.test.txt Test sponsor: Turboblaster Hardware availability: Feb-2023 Tested by: Turboblaster Software availability: Aug-2022 $ I.D.7. Section markers and Named sectionsA named section begins with a section marker and continues until the next section marker or the HASH section is
reached.
A section marker is a one- to three-part string of the form: benchmark[,...]=tuning[,...]=label[,...]: The three parts of a section marker are called the section specifiers, with allowed values:
Trailing default section specifiers may be omitted from a section marker. In the pairs below, in each case, the second line is equivalent to the first: accel=default: 404.lbm=base=default: default=default: accel: 404.lbm=base: default: I.E. Section merging and precedence rulesBy constructing section markers, you determine how you would like your options applied. Benchmarks are built according
to instructions in the sections that they match, subject to rules for combining sections and resolving conflicts among them.
Sections are combined using these rules.
runaccel uses perl interpolation.
Example: on the notes100 line, you could optionally add say either ${lognum} or $lognum, but don't try taking the curly brackets away from ${size}. $ cat just.cfg expand_notes = 1 notes100 = Just ${size}ing, in run $lognum output_root = /tmp/just runlist = 404.lbm size = test CC = gcc CC_VERSION_OPTION = --version $ $ cat just.sh runaccel -c just | grep txt grep Just /tmp/just/result/accel2023.001.acc.test.txt $ $ ./just.sh format: Text -> /tmp/just/result/accel2023.001.acc.test.txt Just testing, in run 001 $ Traps for the unwary
I.F.5. Useful ${curly} variablesThese variables may be of interest:
For a complete list of the available variables relative to the current config file, set expand_notes = 1 verbose = 35 # or higher Then, do a run that causes a command substitution to happen.
- Variables available for interpolation that have changed since the last list: (From config) $runmode = "speed" (From config) $size = "test" - Variables available for interpolation that have changed since the last list: (From config) $size = "ref" I.F.6. Unsetting a variable with "%undef%"It is sometimes useful to undo the setting of a variable that would otherwise be included from another section. This can be accomplished using the special value %undef%. In the example, line 14 undefines COPTIMIZE when compiling peak: $ cat -n dave.cfg 1 flagsurl = $[top]/config/flags/gcc.xml 2 iterations = 1 3 output_format = text 4 output_root = /tmp/undef 5 runlist = 404.lbm 6 size = test 7 tune = base,peak 8 default: 9 CC_VERSION_OPTION = --version 10 CC = gcc 11 OPTIMIZE = -O2 -fopenacc 12 COPTIMIZE = -fno-tree-pre 13 404.lbm=peak: 14 COPTIMIZE = %undef% 15 $ runaccel --config=dave | grep txt format: Text -> /tmp/undef/result/accel2023.001.small.test.txt $ cd /tmp/undef/benchspec/ACCEL/404.lbm/build $ grep OPTIMIZE build_base_none.0000/Makefile.spec COPTIMIZE = -fno-tree-pre OPTIMIZE = -O2 -fopenacc $ grep OPTIMIZE build_peak_none.0000/Makefile.spec COPTIMIZE = OPTIMIZE = -O2 -fopenacc $ Notice that in the build directory, COPTIMIZE is present for base and absent for peak. I.F.7. Debug tips for runaccel variablesWhen debugging a config file that uses runaccel variables, try: iterations = 1 minimize_rundirs = 0 reportable = 0 runlist = (one or two benchmarks) size = test verbose = 40 Using --fake will probably be informative. Look inside the log for the (case-sensitive) word 'From'. II. Config file options for runaccelThis section documents options that control the operation of runaccel itself. II.A. Precedence: config file vs. runaccel command lineIn the list that follows, some items are linked to the document Using SPECaccel 2023 - the 'runaccel' Command because they can be specified either in a config file, or on the runaccel command line. New with SPECaccel 2023, If an option is specified in both places, the command line wins. II.B. OptionsIn the table that follows, if an option is documented as accepting the values "no" and "yes", these may also be specified as "false" and "true", or as "0" and "1". The "Use In" column indicates where the option can be used:
III. Config file options for specmakeFor SPECaccel you do not write Makefiles. Instead, you set Make variables in the config file, which are sent to a SPEC-supplied copy of GNU Make, known as specmake. Variables with a dollar sign and parentheses, aka "round brackets", are substituted by specmake. For example: COMPILER_DIR = /usr/local/bin/ CC = $(COMPILER_DIR)cc CXX = $(COMPILER_DIR)c++ FC = $(COMPILER_DIR)f90 See below for more information on syntax of variables that you create and reference. III.A. Commonly used Make variables
The following Make variables are frequently useful. When selecting where to put a flag, please bear in mind that the run rules require that portability flags must use PORTABILITY variables.
III.B. Parallel Model SelectionSPECaccel contains one suite for OpenACC and OpenMP. Previously, accel 1.4 contained three separate suites, one for each model. To select OpenACC choose "ACC". For OpenMP, you may select between three different methods of the directives, "loop", "distribute/parallel", or "distribute/parallel" with "simd" applied to inner loops. The choice of directives will depend on the target device and compiler support. Not all compiler support all forms, and the applied parallelism may differ depending on the target. For example, using "loop" may be better when targeting offload devices such as GPUs, but "simd" better when targeting multi-core CPUs. The different forms are provide to allow users the best choice for their target and mitigate bias when favoring one form over another. Note the same model must be used for all benchmarks in base. For peak, you may select the model on a per benchmark basis. To enable, use the appropriate 'pmodel' setting. The tools then set the appropriate preprocessor define flag which makes the directives visible in the source. Note that not all compilers support all models and the compiler flag that enables the model must be set in your OPTIMIZE variable in the config file. Please consult your compiler's documentation for the supported models and options.
Note that using the define flags directly in you OPTIMIZE or PORTABILITY flags will cause the tools to error. This is to help reduce the possibiltiy of setting the pmodel to one model but then accidently enabling a different model. The config file fragment below demonstrates how to conditionally include a parallel model selected via runaccel --define option: % cat -n config/pmodel.cfg 1 # If model is not set use OpenACC 2 %ifndef %{model} 3 % define model acc 4 %endif 5 6 # Compiler flags applied to all models 7 default: 8 CC = nvc 9 OPTIMIZE = -O3 10 CXXPORTABILITY = --c++14 11 submit = $command 12 13 # OpenACC flags 14 %if %{model} eq 'acc' 15 pmodel = ACC 16 OPTIMIZE += -acc 17 %endif 18 19 # OpenMP Loop flags 20 %if %{model} eq 'loop' 21 pmodel = LOP 22 OPTIMIZE += -mp=gpu 23 %endif 24 25 # OpenMP Distribute flags 26 %if %{model} eq 'dist' 27 pmodel=TGT 28 OPTIMIZE += -mp=gpu 29 %endif 30 31 # OpenMP Distribute w/ Inner SIMD flags 32 %if %{model} eq 'simd' 33 pmodel=SMD 34 OPTIMIZE += -mp=gpu 35 %endif 36 37 # This will error since the model define flags 38 # should only be set by the tools 39 404.lbm=peak: 40 OPTIMIZE = -mp -fast -DSPEC_OPENMP_TARGET 41 % runaccel -c pmodel --fake 404.lbm | grep lbm.c nvc -c -o lbm.o -DSPEC -DNDEBUG -DSPEC -O3 -acc -DSPEC_OPENACC lbm.c % runaccel -c pmodel --fake --define model=acc 404.lbm | grep lbm.c nvc -c -o lbm.o -DSPEC -DNDEBUG -DSPEC -O3 -acc -DSPEC_OPENACC lbm.c % runaccel -c pmodel --fake --define model=loop 404.lbm | grep lbm.c nvc -c -o lbm.o -DSPEC -DNDEBUG -DSPEC -O3 -mp=gpu -DSPEC_OPENMP -DSPEC_OPENMP_LOOP lbm.c % runaccel -c pmodel --fake --define model=dist 404.lbm | grep lbm.c nvc -c -o lbm.o -DSPEC -DNDEBUG -DSPEC -O3 -mp=gpu -DSPEC_OPENMP -DSPEC_OPENMP_TARGET lbm.c % runaccel -c pmodel --fake --define model=simd 404.lbm | grep lbm.c nvc -c -o lbm.o -DSPEC -DNDEBUG -DSPEC -O3 -mp=gpu -DSPEC_OPENMP -DSPEC_OPENMP_INNER_SIMD lbm.c % runaccel -c pmodel --fake --define model=simd -T peak 404.lbm | grep ERROR ERROR: pmodel define flag "-DSPEC_OPENMP_TARGET" may only be set by the tools. III.C. Creating your own Make variablesVariables with a dollar sign and parentheses, aka "round brackets", are substituted by specmake. Deprecated feature alert: Although it is also possible to pass information to specmake using curly brackets: ${COMPILER_DIR}, this is not recommended. Instead, you should consistently use curly brackets to address runaccel and round brackets to address specmake. It is possible that a future version of runaccel may insist on interpolating curly brackets itself, rather than allowing specmake to do so. Example: $ cat makevar.cfg action = build runlist = 404.lbm default: DEBUG_SYMBOLS = --debug:symbols=expanded_info_level:42 EXTRA_FFLAGS = $(GEE) small=base: GEE = -g $(DEBUG_SYMBOLS) small=peak: GEE = -g $ cat makevar.sh runaccel --config=makevar --fake --tune=base | grep COMP: runaccel --config=makevar --fake --tune=peak | grep COMP: $ ./makevar.sh COMP: "cc -c -o lbm.o -g --debug:symbols=expanded_info_level:42 <source>" COMP: "cc -c -o lbm.o -g <source>" $ The config file above creates two variables options (DEBUG_SYMBOLS and GEE). Both are passed to specmake, which interprets them. The results are shown above using the runaccel --fake option. For an extensive example of variable substitution handled by specmake, see the SPEC CPU®2000 example at www.spec.org/cpu2000/docs/example-advanced.cfg. Search that file for LIBS, and note the long comment which provides a walk-through of a complex substitution handled by specmake. III.D. The operator "+=" is available (but should be used with caution)The operator "+=" adds to specmake variables. It may be convenient; it also may cause hard-to-diagnose bugs. Example: $ cat tmp.cfg action = build runlist = 404.lbm tune = peak default: OPTIMIZE = -O1 fprate=default: OPTIMIZE += --unroll default=peak: OPTIMIZE += --inner_unroll 404.lbm=peak: OPTIMIZE += --outer_unroll default=default=breakfast: OPTIMIZE = --jelly_roll $ runaccel --fake --config=tmp | grep lbm.c cc -c -o lbm.o -DSPEC -DSPEC_CPU -DNDEBUG -O1 --inner_unroll --unroll --outer_unroll lbm.c $ Note that the options accumulate. Caution: although the += operator adds flexibility, it may introduce hard-to-predict behavior, depending on precedence of section specifiers, the order of your config file, and other features, such as include files. Instead of using '+=' try picking different make variables for different purposes. For an example of hard-to-predict behavior, what will happen if you add --label=breakfast to the above runaccel command? (Try it.) Recommendations:
III.E Using action=buildsetup to create a sandboxWhen debugging a set of build options, it is often useful to create a "sandbox" - that is, a directory where you can play with the benchmark and its options. This example creates a build sandbox with action buildsetup. $ cat sandbox.cfg action = buildsetup label = fast output_root = /tmp/demo_buildsetup runlist = 404.lbm tune = peak default=peak: OPTIMIZE = -fast $ cat sandbox.sh runaccel --config=sandbox | grep log grep Makefile.spec /tmp/demo_buildsetup/result/accel2023.001.log $ ./sandbox.sh The log for this run is in /tmp/demo_buildsetup/result/accel2023.001.log Wrote to makefile '/tmp/demo_buildsetup/benchspec/ACCEL/404.lbm/build/build_peak_fast.0000/Makefile.spec': The action causes a directory to be created
$ cd /tmp/demo_buildsetup/benchspec/ACCEL/404.lbm/build/build_peak_fast.0000/ $ grep OPTIMIZE Makefile.spec OPTIMIZE = -fast $ specmake --dry-run cc -c -o lbm.o -DSPEC -DNDEBUG -fast lbm.c cc -c -o main.o -DSPEC -DNDEBUG -fast main.c cc -c -o specrand/specrand.o -DSPEC -DNDEBUG -fast specrand/specrand.c cc -fast lbm.o main.o specrand/specrand.o -lm -o lbm See also the chapter on specmake in SPECaccel 2023 Utilities and the sandbox examples in Avoiding runaccel. III.F. About Automatic RebuildsThe SPECaccel tools try to keep config files and binaries synchronized with each other.(*)
Testing option sensitivity: The first thing that happens in a rebuild is to delete the old binary.
The command:
No binaries are harmed. Notes: (*) Unless you change verify_binaries. Recommendation: Don't change it. (**) Recent implementations surprise less often. FIXME FIXME FIXME For detail, see the CPU2006 version of this section. IV. Config file options for the shellSome options in your config file cause commands to be executed by your shell (/bin/sh). IV.A. \$SHELLVAR variable substitutionSubstitution by the shell uses backslash dollar sign.
Example: This config file runs 404.lbm twice, with base and peak options. Only peak uses backslashes: $ cat tmp.cfg expand_notes = 1 iterations = 1 runlist = 404.lbm size = test tune = base,peak default: CC = gcc CC_VERSION_OPTION = --version default=base: submit = echo home=$HOME, spec=$SPEC > /tmp/chan; ${command} default=peak: submit = echo home=\$HOME, spec=\$SPEC > /tmp/nui; ${command} In base, $HOME and $SPEC are gobbled up by runaccel, which
obediently retuns their values: nothing at all. IV.B. Shell Options
Warning: SPECaccel config files can execute arbitrary
shell commands.
These options cause commands to be executed:
IV.C. Using submitThe config file feature submit allows you specify the command needed to launch your command as well as include and process to core bindings. This section provides examples to demonstrate how submit works with several other config file features. You might also want to search published results at www.spec.org/accel2023 for systems that are similar to your system. IV.C.1. Basic usage of submitYou can use submit to specify scripts to perform binding before the benchmark command. Submit Example 1: ${command} and mpirun
The example below runs user supplied "bind.sh" which binds CPU threads to cores, or which GPU to use. $ cat submit.cfg runlist = 404.lbm submit = sh $[top]/bind.sh ${command} IV.C.2. Reporting of submit usageIf you use the submit feature, a notes section will automatically be created to indicate that you have done so. Submit Notes ------------ The config file option 'submit' was used. You can add notes to that section, or customize it as you wish, by creating lines with notes_submit_NNN. The phrase The config file option 'submit' was used must appear somewhere in your customized notes. You can vary the capitalization of the phrase, you can even break it across multiple lines; it just needs to be present. If it is not, it will automatically be added. If you used scripts in your submit command, the full text of the script should be listed in the submit notes. V. Config file options for readersWhether or not you send your result to SPEC, you should fully disclose how you achieved the result. If it requires the installation of the GoFastLinker, you should say so. By setting the appropriate fields in the config file, you can cause information about the GoFastLinker to appear in the reports that are intended for humans. V.A. Descriptive fieldsHere are the fields that you can set to describe your testbed to readers:
V.B. Fields can vary by scope.Fields can appear and disappear based upon scope. For example, you can define the compiler optimizations you use for all benchmarks while adding those for peak only in the peak section. You can also have notes which apply to all runs and add additional notes for another section. Most (*) fields can be continued to another line by appending a numeral, for example sw_os1, sw_os2, sw_os3 if you need 3 lines to fully identify your operating system. Here is an example that uses both of these features: default: OPTIMIZE = -fast -xipo=2 notes_000 = System used mega-threading scheduler. default=peak: COPTIMIZE = -xhyper -lsmash FOPTIMIZE = -xblaster -lpile notes_001 = Smash library was used to allow potater tool optimization. notes_002 = Pile library allowed dynamic adjustment of spin delay, set with BLASTER=17. In the above example, the information about the mega-threading scheduler will be printed for both base and peak runs. The information about the smash and pile libraries will only be printed for peak runs. Note that the numerals above will be converted to a more formal style of three-digit numbers with leading zeros in the raw file; as discussed in utility.html, if you edit a rawfile you must use the more formal style of 000, 001, etc. (*) The fields which cannot be continued are the ones that are expecting a simple integer, such as: hw_nchip, hw_ncores, hw_ncoresperchip, hw_nthreadspercore, license_num; and the ones that are expecting a date: hw_avail, and sw_avail. V.C. Additional notes for the readerIn addition to the pre-defined fields, you can write as many notes as you wish. These notes are printed in the report, using a fixed-width font. For example, you can use notes to describe software or hardware information with more detail beyond the predefined fields: notes_os_001 = The operating system used service pack 2 plus patches notes_os_002 = 31415, 92653, and 58979. At installation time, the notes_os_003 = optional "Numa Performance Package" was selected. V.C.1. Notes sectionsThere are various notes sections. If there are no notes in a particular section, it is not output, so you don't need to worry about making sure you have something in each section. The sections, in order of appearance, are as follows:
Notes about the submit command are described above, with the description of the submit option. V.C.2. Note numberingStart your notes with the name of the notes section where you want the note to appear, and then add numbers to define the order of the lines. Within a section, notes are sorted by line number. The NNN above is not intended to indicate that you are restricted to 3 digits; you can use a smaller or larger number of digits as you wish, and you can skip around as you like: for example, ex-BASIC programmers might naturally use line numbers 100, 110, 120... But note that if you say notes_plat782348320742972403 you just might encounter the dreaded (and highly unusual) "out of memory" error, so don't do that. You can optionally include an underscore just before the number, but beware: if you say both notes_plat_105 and notes_plat105, both are considered to be the same line. The last one mentioned will replace the first, and it will be the only one output. V.C.3. Additional tagsFor all sections you can add an optional additional tag of your choosing before the numbers. Notes will be organized within the tags. The intent of the feature is that it may allow you to organize your system information in a manner that better suits your own categories for describing it. For example: $ cat notes_tags.cfg iterations = 1 output_format = text output_root = /tmp/notes_tags runlist = 404.lbm size = test small=base: CC = mpicc CC_VERSION_OPTION = -V notes_part_greeting_011 = ++ how notes_part_greeting_20 = ++ you? notes_part_greeting_012 = ++ are notes_part_aname_1 = ++ Veronica, notes_part_080 = ++ hi $ cat notes_tags.sh runaccel --config=notes_tags --fakereport 404.lbm | grep txt grep '++' /tmp/notes_tags/result/accel2023.001.test.txt $ ./notes_tags.sh format: Text -> /tmp/notes_tags/result/accel2023.001.test.txt ++ hi ++ Veronica, ++ how ++ are ++ you? $ V.C.4. Links in notes sectionsYou can mention URLs in your notes section, and html reports will correctly render them as hyperlinks. For example: notes_plat_001 = Additional detail may be found at notes_plat_002 = http://www.turboblaster.com/servers/big/green/ If you like, you can use descriptive text for the link by preceding it by the word LINK and adding the descriptive text in square brackets: LINK url AS [descriptive text] The brackets may be omitted if your descriptive text is a single word, without blanks. For example: notes_plat_001 = Additional detail may be found at notes_plat_002 = LINK http://www.turboblaster.com/servers/big/green/ AS [TurboBlaster Servers] When the above appears in an html report, it is rendered as: Additional detail may be found at TurboBlaster Servers And in a text report, it appears as: Platform Notes -------------- Additional detail may found at TurboBlaster Servers (http://www.turboblaster.com/servers/big/green/) Since the text report is not a context in which the reader can click on a link, it is spelled out instead. Note that because the text report spells the link out, the text line is wider than in HTML, PS, and PDF reports. When deciding where to break your notes lines, you'll have to pick whether to plan line widths for text (which may result in thin-looking lines elsewhere) or plan your line widths for HTML/PS/PDF (which may result in lines that fall of the right edge with text). The feature notes_wrap_columns won't help you here, since it is applied before the link is spelled out. VI. The config file preprocessorVI.A. IntroductionThe SPECaccel tools include a configuration file macro preprocessor. This section introduces preprocessor examples, and then discusses a few basics of syntax. VI.A.1. Preprocessor Example: Picking a ModelIn this example, the user is testing several configurations, and wants to pick an appropriate pmodel and set the appropriate optimization and portability flags.. $ cat -n preprocessor_example1.cfg 1 %if %{model} eq 'acc' 2 pmodel=ACC 3 OPTIMIZE = -fast -acc 4 %endif 5 6 %if %{model} eq 'lop' 7 pmodel=LOP 8 OPTIMIZE = -fast -mp=gpu 9 10 403.stencil: 11 PORTABILITY += -DSPEC_NO_NOTHING 12 13 %endif Lines that start with percent (%) are preprocessor directives. The percent (%) character must be in column 1. The config file preprocessor is called a macro processor because it allows you to define macros, which are brief abbreviations for longer constructs. In the example above, two macros are used: (%{model}, and %{usegpu}). Macro values are tested, and hunks of config file are included or excluded, using the conditionals %if (lines 2 and 5), and %elif (line 4). One of the conditionals includes an %else clause (line 7). The preprocessor is automatically run whenever you use runaccel, and macros may be set on the runaccel command line. Or, you can run it separately, as configpp: % specperl bin/harness/configpp -c preprocessor_example1.cfg --define model=acc | grep -e pmodel pmodel=ACC % specperl bin/harness/configpp -c preprocessor_example1.cfg --define model=lop | grep -e pmodel -e stencil -e PORT pmodel=LOP 403.stencil: PORTABILITY += -DSPEC_NO_NOTHING Notice above that preprocessor variables can be set on the command line, using either --define or '-S'. VI.A.2. Preprocessor Syntax BasicsEmphasis: Column 1. Always punch column 1. All preprocessor directives begin with the percent sign (%) in column 1. You can -- and probably should -- use indenting, but keep the percent sign on the far left. Any amount of spaces or tabs may separate the percent from the directive. The following are okay: %define foo % define bar % undef hello! The following are not okay: %define foo Space in the first column %define foo Tab in the first column #define foo <--wrong! Did you catch why the last one is wrong? This isn't CPP - use percent, not hash! One line per directive The macro preprocessor does NOT follow the same quoting rules described elsewhere for config files. In particular, you may not use line continuation, line appending, or block quotes. You may have a value of arbitrary length, but in the interests of config file readability and maintainability, please keep them relatively short. VI.B. Defining macrosMacro names may only be composed of alphanumeric characters, underscores, and hyphens, and they ARE case-sensitive. Macros can be defined in a config file or on the command line. Both ways are equivalent. Macros set on the command-line are defined first; therefore, it is not possible to use the command line to override a macro definition that occurs in the config file itself. If you want the command line to "win", see the notes below about redefinition. A macro that has not been defined will not be substituted. A macro that has been defined, but not given a value,
See the example in the next section. Having no value is not the same as having an empty string as the value. The following are NOT equivalent:
See the table about Truth and definition, below. VI.B.1. In a config fileTo define a macro in a config file, use the %define preprocessor directive. Note that no quoting is necessary when specifying the names of macros or their values. # Define a simple macro %define foo bar # Now the macro called 'foo' has the value 'bar' # It's not necessary for a macro to have a value to be useful %define baz # Now the macro called 'baz' is defined, but it has no value. Above, the macro baz has been defined, but has not been assigned a value.
$ cat macroDefinedButNoValue.cfg %define baz %ifdef %{baz} % info baz is defined. In text contexts, it looks like this: "%{baz}". %endif %if %{baz} % info In a logical context, it behaves as if it were 1 (i.e. true) %endif %if %{baz} + 3 == 4 % info In a numeric context, it behaves as if it were 1. %endif $ cat macroDefinedButNoValue.sh specperl bin/harness/configpp --config=macroDefinedButNoValue | grep INFO $ ./macroDefinedButNoValue.sh INFO: baz is defined. In text contexts, it looks like this: "". INFO: In a logical context, it behaves as if it were 1 (i.e. true) INFO: In a numeric context, it behaves as if it were 1. $ VI.B.2. On the command lineMacros can also be defined on the command line, using the --define switch. You may find it convenient to abbreviate that switch, if you prefer. The following are entirely equivalent: $ runaccel --define mymacro=something $ runaccel -S mymacro=something VI.B.3. Predefined macros endian, hostname... %{ENV_variable_name}Some useful macros are predefined, as shown in the table below. New with SPECaccel 2023: The config file preprocessor can do environment variable substitution. Environment variables to be substituted use a percent sign and curly brackets, and the name is prefixed with the string "ENV_", as %{ENV_variable_name}.
Automating output_root: You can automatically bring an output_root into your config file using %{ENV_GO} and navigate around it, as shown in the example for the ogo utility. VI.B.4. Example: Adjusting the EnvironmentNotice that %{ENV_variable_name} brings an environment variable into your config file; what if you want to push it back out to affect other things? In that case, you will also need the feature preenv, which causes runaccel to re-invoke itself with your requested variable in the environment. For example, you could set up paths for your compiler using something like this: $ cat -n test.cfg 1 action = build 2 output_root = /tmp/me 3 rebuild = 1 4 runlist = 404.lbm 5 verbose = 99 6 7 %define tentop /SW/compilers/GCC/Linux/x86_64/gcc-10.1.0 8 %define ninetop /SW/compilers/GCC/Linux/x86_64/gcc-9.2.0 9 10 %ifdef %{wantGcc9} 11 preENV_PATH = %{ninetop}/bin:%{ENV_PATH} 12 preENV_LD_LIBRARY_PATH = %{ninetop}/lib64:%{ENV_LD_LIBRARY_PATH} 13 % else 14 preENV_PATH = %{tentop}/bin:%{ENV_PATH} 15 preENV_LD_LIBRARY_PATH = %{tentop}/lib64:%{ENV_LD_LIBRARY_PATH} 16 %endif 17 18 default: 19 CC = gcc 20 CC_VERSION_OPTION = --version 21 $ The config file above builds a single benchmark, 404.lbm, using the local paths for GCC 9.2 or 10.1. Notice that in both cases, the desired path is added to the existing path: for example, on line 12, the right side accesses the existing setting via %{ENV_LD_LIBRARY_PATH} and the left side applies it to the build, via preENV_LD_LIBRARY_PATH. On line 5, the config file sets verbose=99, so that runaccel will print all possible detail and we will be able to confirm the adjusted variables. VI.B.5. RedefinitionYou will receive a warning if a previously defined macro is re-defined. In the example below, the first config file just sets a macro; the second one tests before acting. $ cat preproc.symbol.just_define.cfg %define build_ncpus 20 makeflags = -j%{build_ncpus} $ $ cat preproc.symbol.test_first.cfg %ifndef %{build_ncpus} % define build_ncpus 20 %endif makeflags = -j%{build_ncpus} $ A run script uses both config files with and without a definition on the runaccel command line: $ cat preproc.symbol.sh JUST_DEFINE="configpp --config=preproc.symbol.just_define.cfg" TEST_FIRST="configpp --config=preproc.symbol.test_first.cfg" GREP_IT='grep -e WARNING -e makeflags' echo original: $JUST_DEFINE --define build_ncpus=8 | $GREP_IT $JUST_DEFINE | $GREP_IT echo echo test1st: $TEST_FIRST --define build_ncpus=8 | $GREP_IT $TEST_FIRST | $GREP_IT $ Result: testing first with ifndef avoids a warning and does a better job of respecting the user's wishes. $ ./preproc.symbol.sh original: WARNING: Redefinition of preprocessor macro 'build_ncpus' on line 1 makeflags = -j20 makeflags = -j20 test1st: makeflags = -j8 makeflags = -j20 $ VI.C. Un-doing macro definitionSometimes you want to make the preprocessor forget about a macro that you taught it. This is easily accomplished. Macros can be undefined in two ways:
Like macro definition, the undefinition requests can't affect macros set in the config file because
those definitions effectively happen after the un-definition. For this reason, command-line undefinition is basically
useless; it can only undo macros also set on the command line. VI.D. Using macrosBy now you're probably over that initial euphoric rush that comes from wantonly defining and undefining macros, and you're looking for something more. This is it! When you want to use the value of a macro, you refer to it by name. Unfortunately, the syntax for this is not as simple as you might hope. It's not too complicated, though; to have the preprocessor expand the macro 'foo', just write %{foo} in the place where you'd like it to appear. Given the following config file snippet: %define foo Hello_ %define bar baz %define foobar Huh? %define foobaz What? %define Hello_baz Please don't do this Here's a handy table to see the various ways you can reference these values:
Easy, right? The following is also possible:
Because macro values can only be one line long, it's not possible to use the preprocessor to macro-ize large chunks of your config file at once, as may be common practice for advanced users of CPP. A macro that has not been defined will not be substituted. Note the mention of %{FOO} on the last line of this config file. $ cat macroDef.cfg action = build output_format = text output_root = /tmp/mDef rebuild = 1 runlist = 404.lbm size = test teeout = 1 default: CC = gcc C_VERSION_OPTION = --version OPTIMIZE = %{FOO} $ The failure for the first test below is expected: the GNU C compiler does not know what to do with ${FOO}. $ cat macroDef1.sh runaccel --config=macroDef | grep -e lbm.o -e ^Error -e uccess $ ./macroDef1.sh rm -rf *.o lbm.out gcc -c -o lbm.o -DSPEC -DNDEBUG -DSPEC %{FOO} -DSPEC_OPENMP -DSPEC_OPENMP_LOOP lbm.c specmake: *** [/tmp/SPECACCEL/benchspec/Makefile.defaults:365: lbm.o] Error 1 Error with make 'specmake --output-sync build': $ cat /tmp/mDef/benchspec/ACCEL/404.lbm/build/build*/make.out gcc -c -o lbm.o -DSPEC -DNDEBUG -DSPEC %{FOO} -DSPEC_OPENMP -DSPEC_OPENMP_LOOP lbm.c gcc: error: %{FOO}: No such file or directory specmake: *** [/tmp/SPECACCEL/benchspec/Makefile.defaults:365: lbm.o] Error 1 $ If you want to substitute an empty string, then assign it one. $ cat macroDef2.sh runaccel --config=macroDef --define FOO="" | grep -e lbm.o -e ^Error -e uccess $ ./macroDef2.sh rm -rf *.o lbm.out gcc -c -o lbm.o -DSPEC -DNDEBUG -DSPEC -DSPEC_OPENMP -DSPEC_OPENMP_LOOP lbm.c gcc lbm.o main.o -lm -o lbm $ VI.E. ConditionalsDefining, undefining, and expanding macros is quite an enjoyable activity in and of itself, and can even be useful on occasion. However, conditionals add an entirely new dimension to config file processing: the ability to include and exclude entire sections of text based on macros and their values. VI.E.1. %ifdef .. %endifThe %ifdef conditional provides a way to determine whether or not a particular macro has been defined. If the named macro has been defined, the conditional is true, and the text to the matching %endif is included in the text of the config file as evaluated by runaccel. Note that the matching %endif may not necessarily be the next %endif; conditionals may be nested. For example, given the following section of a config file: %define foo %ifdef %{foo} This text will be included %endif %ifdef %{bar} This text will not be included %endif The preprocessor would produce the following output: This text will be included Note especially the quoting used for the macro names in the conditional; the only time macro name quoting may be omitted is when defining or undefining it. VI.E.2. %ifndef .. %endifThe %ifndef conditional is the converse of %ifdef; If the named macro has not been defined, the conditional is true, and the text to the matching %endif is included in the text of the config file as evaluated by runaccel. Note that the matching %endif may not necessarily be the next %endif; conditionals may be nested. Given a slightly modified version of the example from earlier: %define foo %ifndef %{foo} Now THIS text will not be included %endif %ifndef %{bar} This text WILL be included %endif The preprocessor would produce the following output: This text WILL be included VI.E.3. %if .. %endifChecking whether or not a macro is defined is quite useful, but it's just a subset of the more general conditional facility available. This general form is %if expression ... %endif The expression is evaluated using a subset of the Perl interpreter, so the possibilities for testing values are fairly broad. For example, %ifdef %{foo} ... %endif is exactly equivalent to %if defined(%{foo}) ... %endif Likewise, %ifndef %{foo} ... %endif is exactly equivalent to %if !defined(%{foo}) ... %endif Using the general form, it's possible to string conditionals together: %if defined(%{foo}) && !defined(%{bar}) || %{baz} == 0 ... %endif To compare versus a string value, you must supply quotes: %if %{foo} eq 'Hello, Dave.' ... %endif You may perform basic math on macro values: %if %{foo} * 2004 > 3737 ... %endif You can do basic regular expression matching, as shown in the example for %info. More precisely, the Perl operations allowed are the :base_core and :base_math bundles, with the ability to dereference and modify variables disallowed. For more details, see the source code for config.pl (the eval_pp_conditional subroutine) and Perl's own Opcode documentation.
VI.E.4. %elseIt's possible to get by without the "else" part of the classic "if .. then .. else" trio, but it's not any fun. It works as you'd expect: %define foo %ifndef %{foo} This text will not be included %else This text WILL be included (from the else clause) %endif The preprocessor would produce the following output: This text WILL be included (from the else clause) Only one %else per conditional is allowed. VI.E.5. %elif%elif is another convenience that's been added. For those not familiar with CPP, it's an "else if" construct. You may have as many of these as you'd like. Given: %define foo Hello! %if !defined(%{foo}) This text will not be included %elif defined(%{bar}) This text won't be included either %elif '%{foo}' eq 'Hello!' This text WILL be included (from the second elif clause) %else Alas, the else here is left out as well. %endif The preprocessor would produce the following output: This text WILL be included (from the second elif clause) VI.F. Informational DirectivesIt's often helpful to be able to warn or exit on certain conditions. Perhaps there's a macro that must be set to a particular value, or maybe it's just very highly recommended. VI.F.1. %warning%warning does just what you'd expect; when the preprocessor encounters this directive, it prints the text following to stdout and the current log file, along with its location within the file being read, and continues on. $ cat warning.cfg %if !defined(%{somewhat_important_macro}) % warning You have not defined somewhat_important_macro! %endif $ $ cat warning.sh specperl bin/harness/configpp --config=warning | grep -C2 WARNING $ $ ./warning.sh *** WARNING: You have not defined somewhat_important_macro! (From line 2 of /accel2023/config/warning.cfg.) $ VI.F.2. %errorLike %warning, %error logs an error to stderr and the log file. Unlike %warning, though, it then stops the run. Consider a slightly modified version of the previous example: $ cat error.cfg %if !defined(%{REALLY_important_macro}) % error You have not defined REALLY_important_macro! %endif $ $ cat error.sh specperl bin/harness/configpp --config=error > /tmp/out echo runaccel exit code: $? grep -C2 ERROR /tmp/out $ ./error.sh runaccel exit code: 1 ************************************************************************ ERROR: You have not defined REALLY_important_macro! (From line 2 of /accel2023/config/error.cfg.) $ Unlike a warning, the error will be close to the last thing output. As you can see from the output of echo $? above, runaccel exited with an error code 1. VI.F.3. %infoThe %info directive prints a message preceded by the word INFO:. For example, $ cat -n info.cfg 1 %if !defined(%{chip}) || %{chip} !~ m/(sparc|x86)/ 2 % error Please use --define chip=sparc or --define chip=x86 3 %endif 4 5 %if %{chip} eq "sparc" 6 % define default_build_ncpus 64 7 %elif %{chip} eq "x86" 8 % define default_build_ncpus 20 9 %endif 10 %ifndef %{build_ncpus} 11 % define build_ncpus %{default_build_ncpus} 12 %endif 13 14 %info Preprocessor selections: 15 %info . build_ncpus %{build_ncpus} 16 %info . chip %{chip} 17 18 make = specmake --jobs=%{build_ncpus} --load-average=%{build_ncpus} $ $ specperl bin/harness/configpp -c info --define chip=sparc | grep -e make -e INFO INFO: Preprocessor selections: INFO: . build_ncpus 64 INFO: . chip sparc make = specmake --jobs=64 --load-average=64 $ Note in the example above:
VI.F.4. %dumpmacrosThe %dumpmacros prints the values of all macros currently defined at the point where it appears. Each macro value is preceded by the word 'DBG:'. For example, $ cat -n dumpmacros.cfg 1 %if !defined(%{chip}) || %{chip} !~ m/(sparc|x86)/ 2 % error Please use --define chip=sparc or --define chip=x86 3 %endif 4 5 %if %{chip} eq "sparc" 6 % define default_build_ncpus 64 7 %elif %{chip} eq "x86" 8 % define default_build_ncpus 20 9 %endif 10 %ifndef %{build_ncpus} 11 % define build_ncpus %{default_build_ncpus} 12 %endif 13 14 %dumpmacros $ $ specperl bin/harness/configpp -c dumpmacros --define chip=sparc | grep -e DBG DBG: build_ncpus: '%{default_build_ncpus}' DBG: chip: 'sparc' DBG: default_build_ncpus: '64' DBG: runaccel: 'configpp -c dumpmacros --define chip=sparc' $ The %dumpmacros directive is new with SPECaccel 2023. VII. Output files - and how they relate to your config fileThis section describes how the location and contents of several kinds of output files are influenced by your config file. VII.A. Help, I've got too many config files!It was mentioned above that the HASH section of the config file is written automatically by the tools. Each time your config file is updated, a backup copy is made. Thus your config directory may soon come to look like this: $ cd $SPEC/config $ ls tune.cfg* tune.cfg tune.cfg.2021-02-05T124831 tune.cfg.2021-02-05T125733 tune.cfg.2021-02-05T120242 tune.cfg.2021-02-05T125557 tune.cfg.2021-02-05T125738 tune.cfg.2021-02-05T122021 tune.cfg.2021-02-05T125603 tune.cfg.2021-02-05T125744 tune.cfg.2021-02-05T122026 tune.cfg.2021-02-05T125608 tune.cfg.2021-02-05T125749 tune.cfg.2021-02-05T124215 tune.cfg.2021-02-05T125614 tune.cfg.2021-02-05T125756 tune.cfg.2021-02-05T124222 tune.cfg.2021-02-05T125620 tune.cfg.2021-02-05T125802 tune.cfg.2021-02-05T124728 tune.cfg.2021-02-05T125626 tune.cfg.2021-02-05T125807 tune.cfg.2021-02-05T124739 tune.cfg.2021-02-05T125632 tune.cfg.2021-02-05T125812 tune.cfg.2021-02-05T124821 tune.cfg.2021-02-05T125727 $ If this feels like too much clutter, you can disable the backup mechanism, as described under backup_config. Note that doing so may leave you with a risk of losing the config file in case of a filesystem overflow or system crash. A better idea may be to periodically remove just portions of the clutter, with selective removal of older version; or sweep them to a wastebasket every now and then: $ cd $SPEC/config $ mkdir wastebasket $ mv *cfg.2021* wastebasket/ $ VII.B. The log file and verbosity levels$SPEC/result (Unix) contains reports and log files. When you are doing a build, you will probably find that you want to pay close attention to the log files such as accel2023.001.log. Depending on the verbosity level that you have selected, it will contain detailed information about how your build went. The SPECaccel 2023 tool suite provides for varying amounts of output about its actions during a run. These levels range from the bare minimum of output (level 0) to copious streams of information that are probably useful only to tools developers (level 99). Selecting one output level gives you the output from all lower levels, which may cause you to wade through more output than you might like. VII.B.1. Useful Search StringsWhen you are trying to find your way through a log file, you will probably find these (case-sensitive) search strings useful:
VII.B.2. About Temporary Debug LogsThere are also temporary debug logs, such as accel2023.001.log.debug. A debug log contains very detailed debugging output from the SPEC tools, as if --verbose 99 had been specified. For a successful run, the debug log will be removed automatically, unless you specify "--keeptmp" on the command line, or "keeptmp=yes" in your config file. For a failed run, the debug log is kept. The debug log may seem overwhelmingly wordy, repetitive, detailed, redundant, repetitive, and long-winded, and therefore useless. Suggestion: after a failure, try looking in the regular log first, which has a default verbosity level of 5. If your regular log doesn't have as much detail as you wish, then you can examine the additional detail in the debug log. If you file a support request, you may be asked to send in the debug log. VII.B.3. Verbosity levelsThe 'level' referred to in the table below is selected either in the config file verbose option or in the runaccel command as in 'runaccel --verbose n'. Levels higher than 99 are special; they are always output to your log file. You can also see them on the screen if you set verbosity to the specified level minus 100. For example, the default log level is 5. This means that on your screen you will get messages at levels 0 through 5, and 100 through 105. In your log file, you'll find the same messages, plus the messages at levels 106 through 199.
VII.D. Help, I've got too many log files!If you do many builds and runs, you may find that your result directory gets too cluttered. Within a result directory, all output formats other than .rsf can be regenerated from your .rsf files. Therefore, you could reduce clutter by deleting HTML, PDF, and other reports. You can delete old .debug logs unless you plan to submit a support request. Still feel cluttered? A simple solution is to move your result directory aside, giving it a new name.
Don't worry about creating a new directory; runaccel will do so automatically. You should be careful to ensure
no surprises for any currently-running users.
If you move result directories, it is a good idea to also clean temporary directories at the same time.
cd $SPEC
mv result old-result
rm -Rf tmp/
cd output_root # (If you use an output_root)
rm -Rf tmp/
VII.E. Finding the build directoryAs described under "About Disk Usage" in runaccel.html, the SPECaccel 2023 tools do the actual builds and runs in newly created directories. The benchmark sources are never modified in the src directory. The build directories for a benchmark are located underneath that benchmarks' top-level directory, typically $SPEC/benchspec/ACCEL/nnn.benchmark/build (Unix) (If you are using the output_root feature, then the first part of that path will change to be your requested root instead of SPEC.) The build directories have logical names, typically of the form build_<tune>_<label>.0000. If the directory build_<tune>_<label>.0000 already exists when a new build is attempted for the same tuning and label, the directory will be re-used, unless:
In such cases, the 0000 will be incremented until a name is generated that is available. You can find locked directories by searching for lock=yes in the file $SPEC/benchspec/ACCEL/<nnn.benchmark>/run/list (Unix) When more than one build directory has been created for a given tuning and label, you may need to trace the directory back to the specific build attempt that created it. You can do so by searching for the directory name in the log files: $ grep build_peak_blue271.0000 *log | grep Building accel2023.838.log: Building 404.lbm peak blue271: (build_peak_blue271.0000) [2021-02-14 05:26:09] $ In the above example, the grep command locates log #838 as the log that corresponds to this run directory. VII.F. Files in the build directoryA variety of files are output to the build directory. Here are some of the key files which can usefully be examined:
VII.G. For more informationFor more information about how the run directories work, see the descriptions of specinvoke, specmake, and specdiff in utility.html. Appendix A. TroubleshootingWhen something goes wrong, here are some things to check:
Appendix B. Obsolete/removed items |