In [1]:
import matplotlib.pyplot as plt
import matplotlib.cm as cm
%matplotlib inline
%load_ext autoreload
%autoreload 2
import h5py
import multiprocessing as mp
import seaborn as sns
sns.set(style="ticks", color_codes=True, font_scale=1.5)
sns.set_style({"xtick.direction": "in", "ytick.direction": "in"})

In [2]:
import numpy as np
import itertools
from scipy.stats import norm
import time
import cossio
import kinetics

In [3]:
def cossio_runner(inp):
    np.random.seed()
    kl = inp[0]
    sc = inp[1]
    numsteps = inp[2]
    
    Dq = sc*Dx
    x, q = [5., 5.]

    tt, xk, qk = cossio.run_brownian(x0=x, barrier=5., kl=kl, \
                            Dx=Dx, Dq=Dq, numsteps=numsteps, \
                                     fwrite=int(1./dt))
    data = np.column_stack((tt,xk,qk))

    h5file = "data/cossio_kl%g_Dx%g_Dq%g.h5"%(kl, Dx, Dq)
    with h5py.File(h5file, "w") as hf:
        hf.create_dataset("data", data=data)

    return h5file

In [4]:
# Globals
dt = 5e-4
Dx = 1. # Diffusion coefficient for molecular coordinate

In [5]:
kl = 1.3
input = [[kl, 10, 5e8],\
    [kl, 20, 5e8],\
    [kl, 50, 5e8],\
    [kl, 1, 5e8],\
    [kl, 2, 5e8],\
    [kl, 5, 5e8],\
    [kl, 0.1, 5e8],\
    [kl, 0.2, 5e8],\
    [kl, 0.5, 5e8],\
    [kl, 0.01, 2e9],\
    [kl, 0.02, 1e9],\
    [kl, 0.05, 1e9],\
    [kl, 0.001, 2e9],\
    [kl, 0.002, 2e9],\
    [kl, 0.005, 2e9]]

nproc = 4
pool = mp.Pool(processes=nproc)
output = pool.map(cossio_runner, input)
pool.close()
pool.join()

In [ ]: