Skip to content

Commit

Permalink
Set default cores to 2
Browse files Browse the repository at this point in the history
Despite usptream disregards this, it is currently the only way to cut
runtime to at least somehow reasonable duration
  • Loading branch information
judovana committed Jul 31, 2024
1 parent 624aea8 commit a15ad56
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 7 deletions.
13 changes: 8 additions & 5 deletions system/jcstress/Generate.java
Original file line number Diff line number Diff line change
Expand Up @@ -45,13 +45,16 @@ public class Generate {
private static final boolean SPLIT_BIG_BASES = parseSplitBigBases();

private static final String[] NOT_SPLIT_ABLE_GROUPS = parseSplitImsplittable();

private static final int DEFAULT_CORES = 2;

private static final String TEMPLATE = """
<test>
<testCaseName>-TARGET-</testCaseName>
<!-- -COMMENT- -->
-DISABLED-
<command>
if [ "x$${JC_CORES}" = "x" ] ; then JC_CORES="-CORES-" ; else JC_CORES="-c $${JC_CORES}" ;fi;\\
if [ "x$${JC_CORES}" = "x" ] ; then JC_CORES="-CORES-" ; else if [ "$${JC_CORES}" -eq "0" ] ; then JC_CORES="" ; else JC_CORES="-c $${JC_CORES}" ;fi;fi;\\
if [ "x$${JC_TIME_BUDGET}" = "x" ] ; then JC_TIME_BUDGET="-TB-" ; else JC_TIME_BUDGET="-tb $${JC_TIME_BUDGET}" ;fi;\\
$(JAVA_COMMAND) $(JVM_OPTIONS) -jar $(Q)$(LIB_DIR)$(D)-JARFILE-$(Q) $(APPLICATION_OPTIONS) $${JC_TIME_BUDGET} $${JC_CORES} -t "-REGEX-"; \\
$(TEST_STATUS)
Expand Down Expand Up @@ -182,8 +185,8 @@ private static void setAndPrintSetup() {
} else {
System.err.println("Only N from FQN will be used. This saves space, but risks duplicate matches");
}
if (getCoresForPlaylist() == 0) {
System.err.println("Cores limit for final playlist is not used");
if (getCoresForPlaylist() == DEFAULT_CORES) {
System.err.println("Cores limit stays on default (" + DEFAULT_CORES + "). 0 is all.");
} else {
System.err.println("Cores for final playlist are " + getCoresForPlaylist() + ". Intentional?");
}
Expand Down Expand Up @@ -364,11 +367,11 @@ private static String secondsToDays(long seconds) {


private static int getCoresForPlaylist() {
return getCores(0);
return getCores(DEFAULT_CORES);
}

private static int getCores(int def) {
return Integer.parseInt(System.getenv("CORES") == null ? "" + def : System.getenv("CORES"));
return Integer.parseInt(System.getenv("CORES") == null || System.getenv("CORES") == "" ? "" + def : System.getenv("CORES"));
}

/**
Expand Down
8 changes: 6 additions & 2 deletions system/jcstress/README.md
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
# AQA jcstress runner

This playlist runs by default all jcstress tests in minimal `time budget`. Currently it is just `-tb 1h` which is trying to squeeze all 11543 tests from jcstress-20240222 to 1hour. That is not going to work, but the suite should try to squeeze itself to absolute minimum. Another switch which can minimize runtime is `-c` - number of cores to use, but that was not recommended by upstream.
This playlist runs by default all jcstress tests in minimal `time budget`. Currently it is just `-tb 1h` which is trying to squeeze all 11543 tests from jcstress-20240222 to 1hour. That is not going to work, but the suite should try to squeeze itself to absolute minimum. Another switch which can minimize runtime is `-c` - number of cores to use, although it was not recommended by upstream, ve default to 2.

Other targets are generated subgroups to run targeted groups of tests in case that the affected area could do cause an issue. Dont forget you have to prefix such target by `disabled...` keyword. All those targets are run with all cores and no forced time budget.

Both main tests and generated subgroups can take `$JC_TIME_BUDGET` variable to set the time budget and `$JC_CORES` to set number of cores. In addition standard `$APPLICATION_OPTIONS` is honoured.
Both main tests and generated subgroups can take `$JC_TIME_BUDGET` variable to set the time budget and `$JC_CORES` to set number of cores. Set it to empty or 0 to override default 2. In addition standard `$APPLICATION_OPTIONS` is honoured.

# AQA jcstress playlist generator and tester
The generator is slightly over-engineered but do its job quite well. It takes only one argument - the file to jcstress.jar. The name of file maters - it is used in the command.
Expand Down Expand Up @@ -228,6 +228,10 @@ In order of importance and reasonability
* SMALL_GROUPS - true/false. **default is false**. After natural grouping is done, all remaining groups smaller then LIMIT are merged to artificial groups
* SPLIT_BIG_BASES - true/false. **default is false**. Each natural group group bigger then LIMIT is split once it reaches limit.
* MAX_NATURAL_ITERATIONS - number, usually 1-10, how many namespaces can be cut for natural grouping.
* CORES - number, **defaults to 2**. Set to 0 to use all cores (recomeded by upstream, but runing surprsingly long)
* TIME_BUDGET - string, **defaults to 1h**. set to anything you think your tests will fit. This is just best effort, not a strict cut. It is upstream bug.
* VERBOSE - set to true to see a lot of weird stuff
* FQN - set to true to use fully qualified names instead of shortened ones. This may casue soem targets to not fit to OS cmdline limit.
<details>
<summary>eg:</summary>
<pre>
Expand Down

0 comments on commit a15ad56

Please sign in to comment.