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

evaluate2.sh: Add Time Limit for Runs #293

Merged
merged 2 commits into from
Jan 11, 2024

Conversation

hundredwatt
Copy link
Contributor

@hundredwatt hundredwatt commented Jan 10, 2024

Followup to #290

This is the approach recommended by hyperfine's maintainer: sharkdp/hyperfine#576

else
hyperfine $HYPERFINE_OPTS "./calculate_average_$fork.sh 2>&1"
numactl --physcpubind=0-7 hyperfine $HYPERFINE_OPTS "timeout -v $RUN_TIME_LIMIT ./calculate_average_$fork.sh 2>&1"
else # MacOS
Copy link
Owner

Choose a reason for hiding this comment

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

Ah, very nice. So evaluate2.sh runs on MacOS too?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Yes, I've been testing on both Fedora Linux and my MacBook M2 Air

Copy link
Contributor

Choose a reason for hiding this comment

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

Do we need to check whether gtimeout command is available?

Copy link
Owner

Choose a reason for hiding this comment

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

I have timeout rather than gtimeout on MacOS. Should we just use that?

Copy link
Owner

Choose a reason for hiding this comment

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

LOL, nevermind, wrong console ;)

It is checked already, so LGTM. Will merge. Will only add log message for this case.

@hundredwatt
Copy link
Contributor Author

Since this has not been merged yet, I added a check that bc is installed (it was missing on a test VM I used)

@gunnarmorling
Copy link
Owner

Since this has not been merged yet, I added a check that bc is installed (it was missing on a test VM I used)

Nice; just ran into that too.

@gunnarmorling gunnarmorling merged commit 007298b into gunnarmorling:main Jan 11, 2024
1 check passed
numactl --physcpubind=0-7 hyperfine $HYPERFINE_OPTS "./calculate_average_$fork.sh 2>&1"
else
hyperfine $HYPERFINE_OPTS "./calculate_average_$fork.sh 2>&1"
numactl --physcpubind=0-7 hyperfine $HYPERFINE_OPTS "timeout -v $RUN_TIME_LIMIT ./calculate_average_$fork.sh 2>&1"
Copy link
Contributor

Choose a reason for hiding this comment

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

I get

timeout: invalid option -- 'v'
Try 'timeout --help' for more information.

It works without -v

Copy link
Contributor

Choose a reason for hiding this comment

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

I guess I have outdated version, I see -v here https://man7.org/linux/man-pages/man1/timeout.1.html

dmitry-midokura pushed a commit to dmitry-midokura/1brc that referenced this pull request Jan 13, 2024
* evaluate2.sh: Add Time Limit for Runs

* check that bc is installed

---------

Co-authored-by: Jason Nochlin <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants