-
Notifications
You must be signed in to change notification settings - Fork 50
Added a timeout to pin_thread. #63
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
1cb799a
to
fecd011
Compare
} | ||
|
||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
extra empty line
scripts/remote-benchmarks-runner
Outdated
echo " | ||
echo 'Pinning thread: ${thread_name}' | ||
count=0 | ||
tid=${tid_cmd} | ||
while [ -z \"\${tid}\" ] && [ \${count} -lt 600 ]; do | ||
sleep 0.1 | ||
tid=${tid_cmd} | ||
count=\$((count + 1)) | ||
done | ||
if [ -z \"\${tid}\" ]; then | ||
echo 'Timeout: thread ${thread_name} not found after 60 seconds.' | ||
exit 1 | ||
fi | ||
echo \"tid_${thread_name}='\${tid}'\" | ||
taskset -p -c ${core} \${tid} | ||
" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Does this need a set -e
to support multi line?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
In the original code, the commands are not joined by a &&
, but a ;
. So you continue to the next no matter if the previous command fails. The current code has exactly the same semantics.
But I think setting 'set -e' would be better. There is no point continuing to the next line if the previous failed.
Also 2 cleanups were done to improve readability: 1) the string is placed over multiple lines 2) the variable containing the cmd to get the tid, is now renamed from tid to tid_cmd.
fecd011
to
32e3b9f
Compare
Also 2 cleanups were done to improve readability: