⚠ Archived content — this site is no longer maintained.   Current WebKit documentation is at docs.webkit.org.

Changeset 179931 in webkit


Ignore:
Timestamp:
Feb 11, 2015, 9:11:22 AM (12 years ago)
Author:
Csaba Osztrogonác
Message:

run-jsc-stress tests should detect the number of processors on the remote machine too
https://bugs.webkit.org/show_bug.cgi?id=141196

Reviewed by Darin Adler.

  • Scripts/run-javascriptcore-tests:

(runJSCStressTests): Pass through the --child-processes argument.

  • Scripts/run-jsc-stress-tests: Added determineNumberOfProcessors function

to detect the number of local and remote processors with the same algorithm.
Additionally introduced $numChildProcesses to emphasize it isn't necessarily
same as $numProcessors.

Location:
trunk/Tools
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • trunk/Tools/ChangeLog

    r179930 r179931  
     12015-02-11  Csaba Osztrogonác  <ossy@webkit.org>
     2
     3        run-jsc-stress tests should detect the number of processors on the remote machine too
     4        https://bugs.webkit.org/show_bug.cgi?id=141196
     5
     6        Reviewed by Darin Adler.
     7
     8        * Scripts/run-javascriptcore-tests:
     9        (runJSCStressTests): Pass through the --child-processes argument.
     10        * Scripts/run-jsc-stress-tests: Added determineNumberOfProcessors function
     11        to detect the number of local and remote processors with the same algorithm.
     12        Additionally introduced $numChildProcesses to emphasize it isn't necessarily
     13        same as $numProcessors.
     14
    1152015-02-11  Csaba Osztrogonác  <ossy@webkit.org>
    216
  • trunk/Tools/Scripts/run-javascriptcore-tests

    r179479 r179931  
    4848my $extraTests;
    4949my $jsDriverArgs;
     50my $childProcesses;
    5051
    5152my $buildJSC = 1;
     
    8182  --remote=                     Run the JSC stress tests on the specified remote host. Implies --tarball.
    8283  --extra-tests=                Path to a file containing extra tests
     84  --child-processes=            Specify the number of child processes.
    8385
    8486EOF
     
    9496    'tarball!' => \$createTarball,
    9597    'remote=s' => \$remoteHost,
     98    'child-processes=s' => \$childProcesses,
    9699    'help' => \$showHelp
    97100);
     
    277280        push(@jscStressDriverCmd, "--remote");
    278281        push(@jscStressDriverCmd, $remoteHost);
     282    }
     283
     284    if ($childProcesses) {
     285        push(@jscStressDriverCmd, "--child-processes");
     286        push(@jscStressDriverCmd, $childProcesses);
    279287    }
    280288
  • trunk/Tools/Scripts/run-jsc-stress-tests

    r179930 r179931  
    8888end
    8989
    90 begin
    91     $numProcessors = `sysctl -n hw.activecpu 2>/dev/null`.to_i
    92 rescue
    93     $numProcessors = 0
    94 end
    95 
    96 if $numProcessors == 0
    97     $numProcessors = `nproc --all 2>/dev/null`.to_i
    98 end
    99 if $numProcessors == 0
    100     $numProcessors = 1
    101 end
    102 
    103 if ENV["WEBKIT_TEST_CHILD_PROCESSES"]
    104     $numProcessors = ENV["WEBKIT_TEST_CHILD_PROCESSES"].to_i
    105 end
    10690
    10791$jscPath = nil
     
    200184        $remoteUser, $remoteHost, $remotePort = uri.user, uri.host, uri.port
    201185    when '--child-processes'
    202         $numProcessors = arg.to_i
     186        $numChildProcesses = arg.to_i
    203187    when '--arch'
    204188        $architecture = arg
     
    543527    $didAddRunCommand = true
    544528    plan = Plan.new($benchmarkDirectory, command, baseOutputName(kind), outputHandler, errorHandler)
    545     if $numProcessors > 1 and $runCommandOptions[:isSlow]
     529    if $numChildProcesses > 1 and $runCommandOptions[:isSlow]
    546530        $runlist.unshift plan
    547531    else
     
    12501234end
    12511235
    1252 if $enableFTL and ENV["JSC_timeout"]
    1253     # Currently, using the FTL is a performance regression particularly in real
    1254     # (i.e. non-loopy) benchmarks. Account for this in the timeout.
    1255     ENV["JSC_timeout"] = (ENV["JSC_timeout"].to_i * 2).to_s
    1256 end
    1257 
    1258 if ENV["JSC_timeout"]
    1259     # In the worst case, the processors just interfere with each other.
    1260     # Increase the timeout proportionally to the number of processors.
    1261     ENV["JSC_timeout"] = (ENV["JSC_timeout"].to_i.to_f * Math.sqrt($numProcessors)).to_i.to_s
    1262 end
    12631236   
    12641237puts
     
    12971270    raise "#{$?}" unless $?.success?
    12981271    result
     1272end
     1273
     1274def runCommandOnTester(cmd)
     1275    if $remote
     1276        result = sshRead(cmd)
     1277    else
     1278        result = `#{cmd}`
     1279    end
     1280end
     1281
     1282def numberOfProcessors
     1283    begin
     1284        numProcessors = runCommandOnTester("sysctl -n hw.activecpu 2>/dev/null").to_i
     1285    rescue
     1286        numProcessors = 0
     1287    end
     1288
     1289    if numProcessors == 0
     1290        begin
     1291            numProcessors = runCommandOnTester("nproc --all 2>/dev/null").to_i
     1292        rescue
     1293            numProcessors == 0
     1294        end
     1295    end
     1296
     1297    if numProcessors == 0
     1298        numProcessors = 1
     1299    end
     1300    return numProcessors
    12991301end
    13001302
     
    13901392    raise if $remote
    13911393    Dir.chdir($runnerDir) {
    1392         runAndMonitorTestRunnerCommand("make", "-j", $numProcessors.to_s, "-s", "-f", "Makefile")
     1394        runAndMonitorTestRunnerCommand("make", "-j", $numChildProcesses.to_s, "-s", "-f", "Makefile")
    13931395    }
    13941396end
     
    14341436$outputDir = $outputDir.realpath
    14351437$runnerDir = $outputDir + ".runner"
     1438
     1439if !$numChildProcesses
     1440    if ENV["WEBKIT_TEST_CHILD_PROCESSES"]
     1441        $numChildProcesses = ENV["WEBKIT_TEST_CHILD_PROCESSES"].to_i
     1442    else
     1443        $numChildProcesses = numberOfProcessors
     1444    end
     1445end
     1446
     1447if $enableFTL and ENV["JSC_timeout"]
     1448    # Currently, using the FTL is a performance regression particularly in real
     1449    # (i.e. non-loopy) benchmarks. Account for this in the timeout.
     1450    ENV["JSC_timeout"] = (ENV["JSC_timeout"].to_i * 2).to_s
     1451end
     1452
     1453if ENV["JSC_timeout"]
     1454    # In the worst case, the processors just interfere with each other.
     1455    # Increase the timeout proportionally to the number of processors.
     1456    ENV["JSC_timeout"] = (ENV["JSC_timeout"].to_i.to_f * Math.sqrt($numChildProcesses)).to_i.to_s
     1457end
    14361458
    14371459def runBundle
Note: See TracChangeset for help on using the changeset viewer.