Skip to content

Instantly share code, notes, and snippets.

View yohm's full-sized avatar

Yohsuke Murase yohm

View GitHub Profile
@yohm
yohm / how_to_use_host_group.md
Last active November 16, 2016 03:41
HostGroup機能の使い方

目的

OACISにHostGroupという機能を導入した。 ジョブの作成時にHostを個別に指定するのではなく、HostGroupというHostの集団を指定できるようにする。 ジョブの投入先としてHostGroupを指定した場合、workerがジョブの投入時にGroupの中の空いているHostに投入する。

仕様

  • Runの作成時にHostだけではなくHostGroupに投入先として指定できるようにする
  • HostGroupに投入する際にはHostParameterはすべてデフォルトの値で投入される
@yohm
yohm / .gitignore
Last active November 16, 2023 11:14
Ruby and Python samples of MessagePack-RPC.
Gemfile.lock
@yohm
yohm / OACIS_API_primer_Python.ipynb
Last active February 14, 2017 14:06
An introductory sample of OACIS Python APIs.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@yohm
yohm / README.md
Last active December 26, 2016 06:14
A sample of parameter optimization using OACIS and Differential Evolution algorithm.

A sample of optimzation of parameters

This is a sample of optimizing parameters using OACIS watcher. This program iteratively search for parameters which minimizes the results of the simulations. For the optimization, we adopted a differential evolutiion algorithm.

Prerequisites

Register simulator as follows.

@yohm
yohm / README.md
Last active January 6, 2017 07:06
A sample of iterative selection of parameters using OACIS.

Iterative Trial of Candidate Parameters

Some simulations, such as convergence calculations, need trials and errors for selecting appropriate parameters until an expected result is obtained.

In this sample, we demonstrate how to automate this kind of iterations. This sample tries candidate parameters, which are given by us in advance, one by one until an expected result is obtained.

Prerequisites

Register simulator as follows.

@yohm
yohm / de_optimizer.py
Last active January 6, 2017 08:27
Optimize function using a differential evolution algorithm
import random
class Domain():
def __init__(self, minimum, maximum):
self.min = minimum
self.max = maximum
assert self.min < self.max
def scale(self, r):
"""
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@yohm
yohm / init.lua
Created February 2, 2017 00:06
My configuration of hammerspoon
local function disableAllHotkeys()
for k, v in pairs(hs.hotkey.getHotkeys()) do
v['_hk']:disable()
end
end
local function enableAllHotkeys()
for k, v in pairs(hs.hotkey.getHotkeys()) do
v['_hk']:enable()
end
@yohm
yohm / wrapper_sample.py
Created March 7, 2017 06:01
wrapper_sample.py
import os, sys, json, subprocess
# Load JSON file
fp = open( '_input.json' )
params = json.load( fp )
# Prepare input file
f = open('configuration.xml', 'w')
param_txt = """<configuration>
<input>
@yohm
yohm / system_with_timeout_redirect_tempdir.cpp
Created May 2, 2017 08:06
invoking a subprocess using fork&exec in a temporal working directory with redirected stdout and stderr and timeout
#include <iostream>
#include <cstdlib>
#include <ctime>
#include <unistd.h>
#include <sys/stat.h>
#include <sys/types.h>
#include <sys/wait.h>
#include <fcntl.h>
#include <signal.h>
#include <vector>