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

[SPARK-13358][SQL] Retrieve grep path when do benchmark #11231

Closed
wants to merge 2 commits into from

Conversation

viirya
Copy link
Member

@viirya viirya commented Feb 17, 2016

JIRA: https://issues.apache.org/jira/browse/SPARK-13358

When trying to run a benchmark, I found that on my Ubuntu linux grep is not in /usr/bin/ but /bin/. So wondering if it is better to use which to retrieve grep path.

cc @davies

@@ -93,7 +93,8 @@ private[spark] object Benchmark {
if (SystemUtils.IS_OS_MAC_OSX) {
Utils.executeAndGetOutput(Seq("/usr/sbin/sysctl", "-n", "machdep.cpu.brand_string"))
} else if (SystemUtils.IS_OS_LINUX) {
Utils.executeAndGetOutput(Seq("/usr/bin/grep", "-m", "1", "\"model name\"", "/proc/cpuinfo"))
val grepPath = Utils.executeAndGetOutput(Seq("which", "grep"))
Utils.executeAndGetOutput(Seq(grepPath, "-m", "1", "model name", "/proc/cpuinfo"))
Copy link
Member Author

Choose a reason for hiding this comment

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

""model name"" doesn't work on my linux. "model name" works. Don't know if it is special case or general.

Copy link
Contributor

Choose a reason for hiding this comment

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

Same here.

@viirya
Copy link
Member Author

viirya commented Feb 17, 2016

retest this please.

@SparkQA
Copy link

SparkQA commented Feb 17, 2016

Test build #51406 has finished for PR 11231 at commit cacd652.

  • This patch passes all tests.
  • This patch merges cleanly.
  • This patch adds no public classes.

@@ -93,7 +93,8 @@ private[spark] object Benchmark {
if (SystemUtils.IS_OS_MAC_OSX) {
Utils.executeAndGetOutput(Seq("/usr/sbin/sysctl", "-n", "machdep.cpu.brand_string"))
} else if (SystemUtils.IS_OS_LINUX) {
Utils.executeAndGetOutput(Seq("/usr/bin/grep", "-m", "1", "\"model name\"", "/proc/cpuinfo"))
Copy link
Member Author

Choose a reason for hiding this comment

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

Or just make it "grep" without specified path?

@hvanhovell
Copy link
Contributor

I guess there isn't a way to test this... Lemme try this locally.

@hvanhovell
Copy link
Contributor

This works on my linux machine (Ubuntu 15.10).

@hvanhovell
Copy link
Contributor

I guess the whole mechanism is a bit brittle, shall we add a somekind of error handling (like in #11209) so Benchmarking won't fail just because it is done on some unknown architecture.

@nongli (nice talk today BTW) You added this. On which linux platform did you test this?

@SparkQA
Copy link

SparkQA commented Feb 18, 2016

Test build #51466 has finished for PR 11231 at commit 763daad.

  • This patch passes all tests.
  • This patch merges cleanly.
  • This patch adds no public classes.

@viirya
Copy link
Member Author

viirya commented Feb 23, 2016

ping @davies do you think this is useful? Thanks.

@davies
Copy link
Contributor

davies commented Feb 23, 2016

LGTM, merging into master, thanks!

@asfgit asfgit closed this in 87d7f89 Feb 23, 2016
@viirya viirya deleted the benchmark-grep-path branch December 27, 2023 18:33
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
4 participants