EmpowerOperations / singularity

A testing application designed to emulate the behaviour of various simulation softwares, such as ANSYS and MATLAB
Apache License 2.0
0 stars 0 forks source link

1 create command line testing tool #2

Closed Groostav closed 8 years ago

Groostav commented 8 years ago

This is a PR for #1, empoweroperations/OASIS#708

This is the first commit for this new repo. It contains the build system and initial implementation in kotlin for singularity.exe.

It contains:

Check out the branch, and poke around at these run configs. I want to make sure they work on other peoples machines, because a lot of my time was spent avoiding dependencies on hard-coded paths.

This build system uses exe4j, which I haven't properly configured to download and install through gradle, you need to have it installed before hand. Similarly, I was hoping to do some clever publishing of artifacts to maven or a local maven repo or something, but ultimately I'm just copy-pasting exe files around (read; copying the singularity.exe file from the build output here into /.build in OASIS).

Usages:

Sample output from singularity.exe --help:

Usage: <main class> [options]
  Options:
    -e, --exit
      executable behaiviour distribution, repeated once for each possible
      outcome eg '-e 10% code:2 -e 30% hang'
      Default: [--exit 100.0% code:0]
    -g, --generator
      generator function to create result values
      Default: RosenbrockAdaptiveN
    -h, --help
      Prints a description and this usage summary
      Default: false
    -i, --input
      path read input values from
      Default: .\input.properties
    -o, --output
      path to write simulation result values to
      Default: .\output.properties
    -t, --time
      time to execute for in millis
      Default: 200

Thus, if you wanted to get the tool to run instantly, rosenbrock 10, with hard-coded checks against the names (ie "x1" through "x10"), you can do this:

singularity.exe --generator RosenbrockX1ThroughX10 --time 0

This would use the following defaults:

default value description
input file ./input.properties causes singularity to attempt to read from workingDir/input.properties for key-value pairs in the form x1=1.2
output file ./output.properties singularity will put its generators output in this file. Right now only rosenbrock is supported, so it would put the result f1=1.234 in workingDir/output.properties
exit type & code --exit 100% code:0 causes singularity to exit with exit-code 0 always

We can change the return type to something like exit with exit-code 7 for 5% of the time like this:

singularity.exe --generator RosenbrockX1ThroughX10 --exit 95% code:0 --exit 5% code:7

And so on. I'm hoping its fairly descriptive.

from the commit message:

[Issue #1] Create command line testing tool

  • this is a surrogate commit/issue for empoweropations/OASIS#708
  • this commit represents a skeletal implementation of a command line tool for use as a stand-in for simulation programs like MATLAB and ANSYS.
  • theres a reasonably good help message, but at this point most of the functionality is around which files you want to modify, and how long the tool should take to execute
  • no follow-up issues yet, but if you read the source, there's a lot of obvious directions we could go
blui commented 8 years ago

October 31, 2016

Looking over this pull request.

Basic test cases:

Random test cases:

Issue-specific test cases:

blui commented 8 years ago

November 01, 2016

Confirmed with Geoff that the exit command option should be entered as:

-e // 100% // code:2 (split into 3 parts)