Created
November 9, 2015 08:26
-
-
Save yohm/5daa2cfae26aaa9f1262 to your computer and use it in GitHub Desktop.
OACISでParameterSetQueryを指定して、配下のRunを一括replaceするスクリプト。
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
require './config/environment' | |
psq_id = ARGV[0] | |
psq = ParameterSetQuery.find(psq_id) | |
$stderr.puts "Number of found PS: #{psq.parameter_sets.count}" | |
def replace_runs(run) | |
run_attr = { submitted_to: run.submitted_to, | |
mpi_procs: run.mpi_procs, | |
omp_threads: run.omp_threads, | |
host_parameters: run.host_parameters } | |
new_run = run.parameter_set.runs.build(run_attr) | |
if new_run.save | |
run.destroy | |
end | |
end | |
psq.parameter_sets.each do |ps| | |
$stderr.puts "replacing PS: #{ps.id}" | |
ps.runs.each do |run| | |
$stderr.puts " replacing Run: #{run.id}" | |
replace_runs(run) | |
end | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
使用法
をOACISのリポジトリのディレクトリで実行する