This is an automated email from the ASF dual-hosted git repository.

aherbert pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/commons-rng.git


The following commit(s) were added to refs/heads/master by this push:
     new 0755e4f  Added trial offset to the stress test application.
0755e4f is described below

commit 0755e4f85a77f500ae9b5fadc1786dc8b0bf9a87
Author: aherbert <[email protected]>
AuthorDate: Fri May 10 10:52:15 2019 +0100

    Added trial offset to the stress test application.
---
 .../commons/rng/examples/stress/StressTestCommand.java | 18 +++++++++++++-----
 1 file changed, 13 insertions(+), 5 deletions(-)

diff --git 
a/commons-rng-examples/examples-stress/src/main/java/org/apache/commons/rng/examples/stress/StressTestCommand.java
 
b/commons-rng-examples/examples-stress/src/main/java/org/apache/commons/rng/examples/stress/StressTestCommand.java
index 975bd8a..f001d58 100644
--- 
a/commons-rng-examples/examples-stress/src/main/java/org/apache/commons/rng/examples/stress/StressTestCommand.java
+++ 
b/commons-rng-examples/examples-stress/src/main/java/org/apache/commons/rng/examples/stress/StressTestCommand.java
@@ -77,7 +77,7 @@ class StressTestCommand implements Callable<Void> {
             description = "Results file prefix (default: ${DEFAULT-VALUE}).")
     private File fileOutputPrefix = new File("test_");
 
-    /** The file output prefix. */
+    /** The stop file. */
     @Option(names = {"--stop-file"},
             description = {"Stop file (default: <Results file prefix>.stop).",
                            "When created it will prevent new tasks from 
starting " +
@@ -103,6 +103,12 @@ class StressTestCommand implements Callable<Void> {
                            "Used only for the default list (default: 
${DEFAULT-VALUE})."})
     private int trials = 1;
 
+    /** The trial offset. */
+    @Option(names = {"--trial-offset"},
+            description = {"Offset to add to the trial number for output files 
(default: ${DEFAULT-VALUE}).",
+                           "Use for parallel tests with the same output 
prefix."})
+    private int trialOffset;
+
     /** The number of concurrent tasks. */
     @Option(names = {"-n", "--tasks"},
             description = {"Number of concurrent tasks (default: 
${DEFAULT-VALUE}).",
@@ -313,15 +319,17 @@ class StressTestCommand implements Callable<Void> {
     /**
      * Creates the named output file.
      *
+     * <p>Note: The trial will be combined with the trial offset to create the 
filename.
+     *
      * @param basePath The base path to the output results files.
      * @param testData The test data.
      * @param trial The trial.
      * @return the file
      */
-    private static File createOutputFile(final String basePath,
-                                         final StressTestData testData,
-                                         final int trial) {
-        return new File(String.format("%s%s_%d", basePath, testData.getId(), 
trial));
+    private File createOutputFile(final String basePath,
+                                  final StressTestData testData,
+                                  final int trial) {
+        return new File(String.format("%s%s_%d", basePath, testData.getId(), 
trial + trialOffset));
     }
 
     /**

Reply via email to