Skip to content
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

run-suite:Option to specify install director and by defualt use cwd #23

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
19 changes: 13 additions & 6 deletions bin/run-suite
100755 → 100644
Original file line number Diff line number Diff line change
Expand Up @@ -96,6 +96,7 @@ def invoke_benchmark(benchmark_executable, args):

def is_benchmark(filepath):
# Don't execute this script again
print os.path.realpath(__file__), os.path.relpath(__file__)
if filepath == os.path.realpath(__file__):
return False

Expand All @@ -111,22 +112,27 @@ def is_benchmark(filepath):
return True

if __name__ == '__main__':
install_dir = os.path.dirname(os.path.realpath(__file__))
#install_dir = os.path.dirname(os.path.realpath(__file__))

profilename = 'default'

if len(sys.argv) != 2:
if len(sys.argv) < 2:
print("Usage: ./run-suite <profile>")
print("Valid profiles are:", " ".join(x for x in profiles))
sys.exit(-1)

if not sys.argv[1] in profiles:
profilename = sys.argv[1]

if not profilename in profiles:
print("Invalid benchmarking profile:",sys.argv[1])
print("Valid profiles are:"," ".join(x for x in profiles))
sys.exit(-1)

profilename = sys.argv[1]


if len(sys.argv) == 3:
install_dir = sys.argv[2]
else:
install_dir = os.getcwd()

print("Using test profile:",profilename)
profile = profiles[profilename]

Expand All @@ -147,6 +153,7 @@ if __name__ == '__main__':
for filename in files:
benchmark_name = filename
benchmark_executable = os.path.realpath(filename)
print install_dir, benchmark_name, benchmark_executable, filename
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please use python3 syntax ;) print(...).
If you execute the script with python 2, this might be an explanation why some things such as the detection whether the script executes itself don't work correctly.

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't think it was a python version problem. The script tries to run itself if you use a different directory than sycl-bench/bin to install benchmark binaries. Try it.

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I've just made a run with python2 and it worked - so that's not the culprit. Not sure what you mean - I have my installed script and benchmark in $ROOT/cmake-build/install/bin and it works fine. Can you please describe how your setup looks like? Where do you install to?

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Try by specifying -DCMAKE_INSTALL_PREFIX=build-dir during cmake.

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Tried this, still working ;) Maybe there is a symlink or something like that in your path? Anyway, having thought about it I now believe just moving the benchmarks to a subdirectory is the most elegant solution.

if is_benchmark(benchmark_executable):

print("\n\n##################################################")
Expand Down