In addition to the interactive operations available through the web browser, OACIS provides a command line program (CLI) for creating Simulators, ParameterSets, and Runs from the command line. This is useful not only when you want to create a large number of ParameterSets or Runs at once (which is cumbersome through the interactive UI) but also when you want to operate OACIS from another program. This page explains the basic usage of the CLI.
The following operations are available through the CLI.
You specify the operation by passing an argument to bin/oacis_cli, which is located under the OACIS checkout directory.
For example,
./bin/oacis_cli usageThroughout this document, the command examples assume that they are executed from the OACIS checkout directory, but you may run them from any directory.
Print the usage of each CLI command.
./bin/oacis_cli usageGet the information of the registered hosts.
./bin/oacis_cli show_host -o host.json| Option | alias | description | required? |
|---|---|---|---|
| –output | -o | output file path | yes |
[
{
"id": "522fe89a899e53ec05000005",
"name": "localhost",
"hostname": "localhost",
"user": "murase"
}
]Create a template of the simulator.json file used by create_simulator.
./bin/oacis_cli simulator_template -o simulator.json| Option | alias | description | required? |
|---|---|---|---|
| –output | -o | output file path | yes |
Output a template of the attributes of a Simulator.
{
"name": "a_sample_simulator",
"command": "/Users/murase/program/oacis/lib/lib/samples/tutorial/simulator/simulator.out",
"support_input_json": false,
"support_mpi": false,
"support_omp": false,
"print_version_command": null,
"pre_process_script": null,
"executable_on_ids": [],
"parameter_definitions": [
{"key": "p1","type": "Integer","default": 0,"description": "parameter1"},
{"key": "p2","type": "Float","default": 5.0,"description": "parameter2"}
]
}Create a new Simulator.
./bin/oacis_cli create_simulator -h host.json -i simulator.json -o simulator_id.json| Option | alias | description | required? |
|---|---|---|---|
| –host | -h | executable hosts | no |
| –input | -i | input file path | yes |
| –output | -o | output file path | yes |
Output the id of the newly created simulator as an Object in JSON format.
{
"simulator_id": "52b3bcd7b93f964178000001"
}Create a template of the parameter_sets.json file used by create_parameter_sets.
./bin/oacis_cli parameter_sets_template -s 5361e421b93f96bbc500000e -o parameter_sets.json| Option | alias | description | required? |
|---|---|---|---|
| –simulator | -s | simulator | yes |
| –output | -o | output file path | yes |
For the simulator, either pass the ID of the Simulator or specify the JSON file output by create_simulator.
Output a template of the parameter file used when creating ParameterSets.
[
{"p1":0,"p2":5.0}
]Create new ParameterSets.
./bin/oacis_cli create_parameter_sets -s simulator_id.json -i parameter_sets.json -o parameter_set_ids.json./bin/oacis_cli create_parameter_sets -s 5361e421b93f96bbc500000e -i '{"p1":1,"p2":[2.0,3.0]}' -o parameter_set_ids.json| Option | alias | description | required? |
|---|---|---|---|
| –simulator | -s | simulator | yes |
| –input | -i | input json | yes |
| –run | -r | run-option json | yes |
| –output | -o | output file path | yes |
run when you want to create Runs for the given ParameterSets at the same time.
run is as follows.{
"num_runs":1,"mpi_procs":1,"omp_threads":1,"priority":1,
"submitted_to":"522fe89a899e53ec05000005",
"host_parameters":{"nodes":"1","ppn":"1","walltime":"10:00"}
}Output the ids of the newly created ParameterSets as an array of Objects in JSON format.
[
{"parameter_set_id":"52b3ddc7b93f969b8c000001"}
]If a ParameterSet with the same parameter values already exists, the id of the existing ParameterSet is returned as output without creating a new ParameterSet. This is not an error.
Destroy all the ParameterSets under the specified Simulator at once.
./bin/oacis_cli destroy_parameter_sets -s simulator_id.json./bin/oacis_cli destroy_parameter_sets -s 5361e421b93f96bbc500000e| Option | alias | description | required? |
|---|---|---|---|
| –simulator | -s | simulator | yes |
Create a template of the job_parameter.json file used by create_runs and create_analyses.
./bin/oacis_cli job_parameter_template -h host_id -o job_parameter.json| Option | alias | description | required? |
|---|---|---|---|
| –host_id | -h | host or host_group id (string) | no |
| –output | -o | output file path | yes |
For the host id, specify the id of the Host as a string. If it is not specified, jobs are submitted manually.
Output a template of the job parameter file used when creating Runs.
{
"submitted_to": "522fe89a899e53ec05000005",
"host_parameters": {
"nodes": "1",
"ppn": "1",
"walltime": "10:00"
},
"mpi_procs": 1,
"omp_threads": 1,
"priority": 1
}Create new Runs.
./bin/oacis_cli create_runs -p parameter_set_ids.json -j job_parameter.json -n 1 -o run_ids.json| Option | alias | description | required? |
|---|---|---|---|
| –parameter_sets | -p | parameter set id file | yes |
| –job_parameters | -j | job parameter file | yes |
| –number_of_runs | -n | number of runs (Integer) | no |
| –output | -o | output file path | yes |
Output the ids of the Runs as an array of Objects in JSON format. Even for Runs that were not newly created, the ids of as many Runs as the number specified by -n are output for each ParameterSet.
[
{"run_id":"52b3eaebb93f96933f000001"}
]If the specified number of Runs already exists, the ids of the existing Runs are returned as output without creating new Runs. This is not an error.
Check the execution status of Runs.
./bin/oacis_cli run_status -r run_ids.json| Option | alias | description | required? |
|---|---|---|---|
| –run_ids | -r | run id file | yes |
For the run_ids file, specify the JSON file output by create_runs.
Aggregate the status of the specified Runs and print it to the standard output.
{
"total": 1,
"created": 0,
"submitted": 0,
"running": 0,
"failed": 1,
"finished": 0
}Destroy Runs.
./bin/oacis_cli destroy_runs -s 5226f430899e532cf6000008 -q status:failed| Option | alias | description | required? |
|---|---|---|---|
| –simulator_id | -s | simulator id or path to simulator_id.json | yes |
| –query | -q | query for runs(Hash) | yes |
./bin/oacis_cli destroy_runs -s 5226f430899e532cf6000008 -q simulator_version:1.0.0./bin/oacis_cli destroy_runs -s 5226f430899e532cf6000008 -q simulator_version:./bin/oacis_cli destroy_runs -s 5226f430899e532cf6000008 -q status:createdDestroy Runs specified by IDs.
./bin/oacis_cli destroy_runs_by_ids 52f9c5b4b93f963b8f000021 52f9c53db93f96a22200001dNone
./bin/oacis_cli destroy_runs_by_ids 52f9c5b4b93f963b8f000021Destroy the specified Runs and re-create new Runs with the same settings.
This can be used, for example, when you have submitted a large number of jobs but a bug is found in the old code and the experiment needs to be re-run. The Runs are executed with the same job parameters as the previous Runs (the host to submit to, the number of MPI processes, the number of OMP threads, and the host parameters). However, the random number seed _seed is changed.
./bin/oacis_cli replace_runs -s 5226f430899e532cf6000008 -q simulator_version:0.0.1| Option | alias | description | required? |
|---|---|---|---|
| –simulator_id | -s | simulator id or path to simulator_id.json | yes |
| –query | -q | query for runs(Hash) | yes |
Destroy Runs whose simulator_version is “1.0.0” and re-create new Runs with the same settings.
./bin/oacis_cli replace_runs -s 5226f430899e532cf6000008 -q simulator_version:1.0.0Replace Runs specified by IDs.
./bin/oacis_cli replace_runs_by_ids 52f9c5b4b93f963b8f000021 52f9c53db93f96a22200001dNone
./bin/oacis_cli replace_runs_by_ids 52f9c5b4b93f963b8f000021Create a template of the analyzer.json file used by create_analyzer.
./bin/oacis_cli analyzer_template -o analyzer.json| Option | alias | description | required? |
|---|---|---|---|
| –output | -o | output file path | yes |
Output a template of the attributes of an Analyzer.
{
"name": "a_sample_analyzer",
"type": "on_run",
"auto_run": "no",
"files_to_copy": "*",
"description": "",
"command": "gnuplot /Users/murase/program/oacis/lib/samples/tutorial/analyzer/analyzer.plt",
"support_input_json": true,
"support_mpi": false,
"support_omp": false,
"print_version_command": null,
"pre_process_script": null,
"executable_on_ids": [],
"parameter_definitions": [
{"key": "p1","type": "Integer","default": 0,"description": "parameter1"},
{"key": "p2","type": "Float","default": 5.0,"description": "parameter2"}
]
}Create a new Analyzer.
./bin/oacis_cli create_analyzer -h host.json -s simulator_id.json -i analyzer.json -o analyzer_id.json| Option | alias | description | required? |
|---|---|---|---|
| –host | -h | executable hosts | no |
| –simulator | -s | analyzer’s simulator | yes |
| –input | -i | input file path | yes |
| –output | -o | output file path | yes |
Output the id of the newly created analyzer as an Object in JSON format.
{
"analyzer_id": "52b3bcd7b93f964178000002"
}Create a template of the analysis_parameters.json file used by create_analyses.
./bin/oacis_cli analyses_template -a 5226f430899e532cf6000009 -o analysis_parameters.json| Option | alias | description | required? |
|---|---|---|---|
| –analyzer_id | -a | analyzer id | yes |
| –output | -o | output file path | yes |
For analyzer_id, specify the ID string.
Output a template of the parameter file used when creating Analyses.
[
{"parameter1":50,"parametr2":1.0}
]Create new Analyses.
./bin/oacis_cli create_analyses -a 5226f430899e532cf6000009 -i analysis_parameters.json -j job_parameter.json -o analysis_ids.json| Option | alias | description | required? |
|---|---|---|---|
| –analyzer | -a | analyzer id | yes |
| –input | -i | input file path | no |
| –job_parameters | -j | job parameter file | yes |
| –output | -o | output file path | yes |
| –first_run_only | only on first runs | no | |
| –target | -t | on targets(parmeter_set_ids.json or run_ids.json) | no |
[
{"analysis_id":"52b3eaebb93f96933f00000d"}
]./bin/oacis_cli create_analyses -a 5226f430899e532cf6000009 -i analysis_parameters.json -j job_parameter.json -o analysis_ids.json --first_run_only./bin/oacis_cli create_analyses -a 5226f430899e532cf6000009 -i analysis_parameters.json -j job_parameter.json -o analysis_ids.json -t parameter_set_ids.json./bin/oacis_cli create_analyses -a 5226f430899e532cf6000009 -i analysis_parameters.json -j job_parameter.json -o analysis_ids.json -t run_ids.jsonCheck the execution status of Analyses.
./bin/oacis_cli analysis_status -a analysis_ids.json| Option | alias | description | required? |
|---|---|---|---|
| –analysis_ids | -a | analysis id file | yes |
For the analysis_ids file, specify the JSON file output by create_analyses.
Aggregate the status of the specified Analyses and print it to the standard output.
{
"total": 100,
"created": 50,
"running": 0,
"failed": 1,
"finished": 49
}Destroy Analyses.
./bin/oacis_cli destroy_analyses -a 5226f430899e532cf6000009 -q status:failed analyzer_version:v0.1.0| Option | alias | description | required? |
|---|---|---|---|
| –analyzer_id | -a | analyzer id | yes |
| –query | -q | query for analyses(Hash) | yes |
Destroy Analyses whose status is “failed” (analysis failed) and whose analyzer_version is “nil”.
./bin/oacis_cli destroy_analyses -a 5226f430899e532cf6000009 -q status:failed analyzer_version:Destroy Analyses specified by IDs.
./bin/oacis_cli destroy_analyses_by_ids 52f9c5b4b93f963b8f000021 52f9c53db93f96a22200001dNone
./bin/oacis_cli destroy_analyses_by_ids 52f9c5b4b93f963b8f000021Destroy the specified Analyses and re-create new Analyses with the same settings.
./bin/oacis_cli replace_analyses -a 5226f430899e532cf6000009 -q status:finished analyzer_version:v0.1.0| Option | alias | description | required? |
|---|---|---|---|
| –analzyer_id | -a | analyzer id | yes |
| –query | -q | query for analyses(Hash) | yes |
./bin/oacis_cli replace_analyses -a 5226f430899e532cf6000009 -q status:finishedReplace Analyses specified by IDs.
./bin/oacis_cli replace_analyses_by_ids 52f9c5b4b93f963b8f000021 52f9c53db93f96a22200001dNone
./bin/oacis_cli replace_analyses_by_ids 52f9c5b4b93f963b8f000021Append a new Parameter to the specified Simulator.
Use this when you want to extend an existing Simulator without discarding the existing data.
./bin/oacis_cli append_parameter_definition -s 522442de899e53dd8d000034 -n "new_param" -t Float -e 0.0| Option | alias | description | required? |
|---|---|---|---|
| –simulator_id | -s | simulator id or path to simulator_id.json | yes |
| –name | -n | name of the new parameter | yes |
| –type | -t | type of the new parameter | yes |
| –default | -e | default value of the new parameter | yes |
Append an Integer parameter named “p3” with a default value of 0.
./bin/oacis_cli append_parameter_definition -s 522442de899e53dd8d000034 -n p3 -t Integer -e 0Runs that have already been created are not updated.