l how to submit your jobs using OACIS l Hands-on session 2 l how to integrate your program (such as jupyter notebook) into OACIS l Hands-on session 3 l how to automate your workflow We are not telling you how to install OACIS today. The official document is available at http://crest-cassia.github.io/oacis/
instances on AWS, where OACIS is pre- installed. l We are going to distribute IP addresses to each of you. Access the following URLs with a browser. l http://[your IP]:3000 l http://[your IP]:8888 https://console.aws.amazon.com/ec2/v2/home?region=ap-northeast- 1#LaunchInstanceWizard:ami=ami-00aab2fcf2a9b6d87 The image is available at this URL.
code() write a script for analysis() while ( necessary ) { select a suitable parameter set() execute simulation run() take a note to remember what we are doing() wait for completion of the simulation run() transfer the simulation results to suitable folders() keep a note to remember what is done() analyze results() create a graph() } write a paper() present in a meeting() tend to be a bottleneck l comparison of many models, parameters, jobs… l prone to human-errors l iteration can be longer as the amount of computation grows essential in research activities
ti mes to submit jobs we must repeat what we ha ve done when we find a bug in our code After a few months, the sim ulation results are no longer traceable.
See Results can’t submit a job OACIS on Cloud (Read-Only mode) Each simulation result and plot has an URL. To share the data, we provide “read-only” mode. To share data, you may prepare another read-only instance.
HTTP Web browser XSUB Host B XSUB Host A XSUB File Storage CLI Job Scheudler Job Scheudler server side • Ruby • Ruby on Rails • MongoDB front-end • D3.js • jQuery • twitter-bootstrap ~ 12,000 lines for app ~ 12,000 lines for unit tests
cite the following article when you publish your research using OACIS. l Y. Murase, T. Uchitane, and N. Ito, "An open-source job management framework for parameter-space exploration: OACIS", Journal of Physics: Conference Series, 921, 012001 (2017)
traffic congestion, proposed in 1990s. l See [Wikipedia](https://en.wikipedia.org/wiki/Nagel%E2%80%93Schreckenberg_model) Key Description l Road length v Maximum velocity rho Car density p deceleration probability t_init thermalization steps t_measure measurement steps http://www.civil.iitb.ac.in/tvm/1111_nptel/544_TrCA/plain/ plain.html
flow phase and the congestion phase. l Source code of this simulator l https://github.com/yohm/si m_ns_model l Output files of this simulator l a JSON file containing average velocity and flow l a snapshot PNG file. position time
Figures (bmp,jpg,png…) are displayed inline. List of output files. Click it to access. Contents of “_output.json” file is saved in OACIS DB. File path to the results.
ParameterSets l fill in the values of parameters as comma-separated values l v = “1,3,5” l rho = “0.05,0.1,0.15,0.2,0.25,0.3,0.35,0.4,0.45,0.5” fill in values in a CSV form Click
BA model. l Node has an initial attractiveness A. The probability of making a link is proportional to (A+ki ). http://networksciencebook.com/chapter/6#evolving-networks
OACIS l selecting the Simulator l creating ParameterSets and Runs l accessing the results l output files l plots ⇒ In the next hands-on we will instruct how to implement YOUR simulator
OACIS Computational Host qsub SSH login sh execute in the work directory the work directory is compressed into a single file. tar download (scp) & expand parse job status & update the record 1. Work directory and shell script are created. Jobs are submitted to the scheduler. 2. Jobs are executed by the job scheduler. Current directory is set to the work directory. 3. Results are downloaded to OACIS. The log files are parsed and the records are updated.
as command line arguments or by a JSON file (Details are shown in the next slide.) l Output files must be created under the current directory. l These files are created by OACIS. Simulator must not conflict with these files. l _status.json, _time.txt, _version.txt, _log.txt, _stdout.txt, _stderr.txt l Returns 0 when it finished successfully. Returns a non zero code when it failed.
l Input parameters and the random number seed are appended to the command. l ~/simulator.out <p1> <p2> <p3> ... <seed> l By a JSON file l When running the command, a file “_input.json” is created, in which input parameters are written. l {"p1": 30,"p2": 10,"_seed":12345}
are created in the current directory, you have nothing to do. l If you would like to plot scalar values in OACIS, the values should be written in “_output.json” file. l If you would like to use "figure viewer", write files in bmp, png, jpg and other figure format. (eps files are not supported.) {"flow": 0.235, "velocity": 1.245 }
l name: echo l definition of parameters: l (p1, Integer, 0), (p2, Float, 1.0) l Command: echo l Input type: Argument l Executable_on: localhost l Run a job, and see “_stdout.txt"
a simulation model which is slightly different from the current one. In such case, you can create a new simulator based on an existing one. Duplicating Simulator
a prototype in jupyter notebook. l We use `papermill` to make jupyter batch executable. https://github.com/nteract/papermill $ papermill mynote.ipynb out.ipynb -f parameters.yml execute a notebook from Terminal specifying parameters
To parameterize your notebook designate a cell with the tag parameters. l After you executed `papermill in.ipynb out.ipynb -f parameters.yml`, youʼll find “injected-parameters” in out.ipynb. parameters.yml
it accepts parameters. https://github.com/yohm/sim_BA_model/blob/master/BA.ipynb Use ”_seed” to specify th e random number seed. Set ”parameters” tag. 2. (optional) `plt.savefig` to save figure to a file. Save a png file. 3. (optional) write “_output.json” file. Write a JSON file.
part is an idiom to use pipenv. Specify your note as an input. (optional) you might want to convert ipynb to html. https://github.com/yohm/sim_BA_model/blob/master/run_BA.sh
your simulator on OACIS, create a script which makes your simulator conform to the input format of OACIS. l Register the script as a Simulator of OACIS. wrap script simulation program run.py _input.json a.out 1. Input parameters given by OACIS 2. parse command line args and make an XML file 3. launch the simulation program as a subprocess
conduct any operations on OACIS. OACIS web-UI is implemented based on these methods. • creating • finding • getting info • deleting • Simulator • ParameterSet • Run • Host • Analyzer • Analysis x
the path where OACIS is installed. $ export OACIS_ROOT="$HOME/oacis" $ python3 my_script.py import os,sys sys.path.append( os.environ['OACIS_ROOT'] ) import oacis Load "oacis" module. (In the docker container, PYTHON_PATH is already set. You can skip the first two lines.) •Our sample is available at https://github.com/yohm/sim_ns_model/blob/master/oacis_find_optimum_r ho.ipynb
parameters based on the results of finished jobs. (2) is executed when “ps1” have finished Use “OacisWatcher” class for asynchronous calls start an event-loop to monitor the completion of jobs “f1” and “f2” are asynchronously executed (4) is executed when all PS in “ps_list” have finished http://crest-cassia.github.io/oacis/en/api_watcher.html
Simulators on OACIS. l This might be a bit complicated, but once you have done the registration, the remaining workflow becomes much more productive and reproducible. l What we skipped includes l APIs l installation l Host and HostGroup l Analyzers l backup http://crest-cassia.github.io/oacis/
[email protected] l or @yohm13 l OACIS is still an on-going project. l Try using it in your research. Your feedbacks are really appreciated. l We are looking for users, collaborators and contributors.