Hi everyone,
I'm trying to script several passes of some SPEC CPU 2000 benchmarks for some research looking into how different processes compete for cache resources on a multi-core system.
I have time scheduled on the target system tomorrow, so
I need this resolved quickly.
Here's the problem:
Below is a command, which I have stored in the variable $TASK
Code:
cputrack -evf -t -T0.1 -c pic0=l2_lines_in,sys -o sched5_pass1_L2.txt /cs/systems/CMPT886/home/pss10/886-assign1/runbind -p0 /cs/systems/CMPT886/home/pss10/886-assign1/spec/186.crafty/exe/crafty_base.sol-x86 < /cs/systems/CMPT886/home/pss10/886-assign1/spec/186.crafty/data/ref/input/crafty.in
Here it is again, with some newlines and indentation to make it more readable:
Code:
cputrack -evf -t -T0.1 -c pic0=l2_lines_in,sys -o sched5_pass1_L2.txt
/cs/systems/CMPT886/home/pss10/886-assign1/runbind -p0
/cs/systems/CMPT886/home/pss10/886-assign1/spec/186.crafty/exe/crafty_base.sol-x86
< /cs/systems/CMPT886/home/pss10/886-assign1/spec/186.crafty/data/ref/input/crafty.in &
It does the following:
- Run "cputrack", counting L2 cache misses, and storing the output in the file sched5_pass1_L2.txt
- The program that cputrack will track is "runbind", which simply runs a program on processor 0
- Runbind itself takes the actual benchmark (SPEC CPU's Crafty, a chess program)
- Finally, "crafty" takes the crafty.in file, which is a series of chess moves for it to compete against
This is where it gets weirdIf I run the command on the Bash command line myself, using the exact command from the first CODE block in this post (followed by an ampersand to background it), it works fine. The following output is produced:
Code:
[1] 127800
bash-3.2$ pid 127802 bound to proc 0.
Will wait for 127802.
Will exec program /cs/systems/CMPT886/home/pss10/886-assign1/spec/186.crafty/exe/crafty_base.sol-x86 to run on processor 0.
Arguments are: /cs/systems/CMPT886/home/pss10/886-assign1/spec/186.crafty/exe/crafty_base.sol-x86
Crafty v14.3
< TRUNCATED - program runs fine >
HOWEVER, If I run it from withing a bash script using the following command:
Code:
${TASK} &
it does NOT work. I get the following result:
Code:
pid 127780 bound to proc 0.
Will wait for 127780.
Will exec program /cs/systems/CMPT886/home/pss10/886-assign1/spec/186.crafty/exe/crafty_base.sol-x86 to run on processor 0.
Arguments are: /cs/systems/CMPT886/home/pss10/886-assign1/spec/186.crafty/exe/crafty_base.sol-x86 < /cs/systems/CMPT886/home/pss10/886-assign1/spec/186.crafty/data/ref/input/crafty.in
Crafty v14.3
ERROR "<" is unknown command-line option
ERROR "/cs/systems/CMPT886/home/pss10/886-assign1/spec/186.crafty/data/ref/input/crafty.in" is unknown command-line option
It appears that in the first case, the "< crafty.in" portion is not seen as an argument, and is instead piped in as desired. However, when running in the script, the "< crafty.in" is treated as an argument, which Crafty doesn't recognize.
Is there some sort of scope issue? Can I place something like parenthesis somewhere to clear up any ambiguities?Thank you! Your help will be greatly appreciated!