In [1]:
import numpy as np
import os
from codeStore import support_fun as spf
import importlib
PWD = os.getcwd()
In [4]:
importlib.reload(spf)
ini_psi_type = 'rand'
def comm_do_calculate(ini_theta, ini_phi, ini_psi, max_t, rtol, atol, eval_dt,
calculate_fun, update_fun, table_name, omega_tail, i0):
ts = ''
ts = ts + 'mpirun -np 1 --slot-list %d python ../../do_calculate.py ' % i0
ts = ts + ' -ini_theta %f -ini_phi %f -ini_psi %f' % (ini_theta, ini_phi, ini_psi)
ts = ts + ' -max_t %f -rtol %e -atol %e -eval_dt %e' % (max_t, rtol, atol, eval_dt)
ts = ts + ' -calculate_fun %s -update_fun %s -table_name %s' % (calculate_fun, update_fun, table_name)
ts = ts + ' -omega_tail %f' % omega_tail
ts = ts + ' & \n\n'
return ts
# max_t, rtol, atol, eval_dt, update_fun = 2000, 1e-6, 1e-9, 1e-3, '5bs'
# calculate_fun = 'do_calculate_ecoli_Petsc4n'
# table_name = 'planeShearRatex_1d'
# omega_tail = 193.66659814
# n_theta, n_phi = 24, 48 # num of cpus and num of jobs
# job_dir = 'ecoliB01_a'
# write_pbs_head = spf.write_pbs_head_newturb
# phi_list = np.linspace(0, 2 * np.pi, n_phi)
# theta_list = np.linspace(0, np.pi, n_theta)
# max_t, rtol, atol, eval_dt, update_fun = 2000, 1e-6, 1e-9, 1e-3, '5bs'
# calculate_fun = 'do_calculate_ecoli_AvrPetsc4n'
# table_name = 'planeShearRatex_1d_avr'
# omega_tail = 193.66659814
# n_theta, n_phi = 24, 48 # num of cpus and num of jobs
# job_dir = 'ecoliB01Avr_a'
# write_pbs_head = spf.write_pbs_head_newturb
# phi_list = np.linspace(0, 2 * np.pi, n_phi)
# theta_list = np.linspace(0, np.pi, n_theta)
# max_t, rtol, atol, eval_dt, update_fun = 10000, 1e-9, 1e-12, 1e-3, '5bs'
# calculate_fun = 'do_calculate_helix_Petsc4n'
# table_name = 'hlxB01_tau1a'
# omega_tail = 0
# n_theta, n_phi = 24, 48 # num of cpus and num of jobs
# job_dir = 'helixB01_a'
# write_pbs_head = spf.write_pbs_head_newturb
# phi_list = np.linspace(0, 2 * np.pi, n_phi)
# theta_list = np.linspace(0, np.pi, n_theta)
# max_t, rtol, atol, eval_dt, update_fun = 10000, 1e-9, 1e-12, 1e-3, '5bs'
# calculate_fun = 'do_calculate_helix_AvrPetsc4n'
# table_name = 'hlxB01_tau1a_avr'
# omega_tail = 0
# n_theta, n_phi = 24, 48 # num of cpus and num of jobs
# job_dir = 'helixB01Avr_a'
# write_pbs_head = spf.write_pbs_head_newturb
# phi_list = np.linspace(0, 2 * np.pi, n_phi)
# theta_list = np.linspace(0, np.pi, n_theta)
# max_t, rtol, atol, eval_dt, update_fun = 10000, 1e-9, 1e-12, 1e-3, '5bs'
# calculate_fun = 'do_calculate_ecoli_passive_Petsc4n'
# table_name = 'planeShearRatex_1d_passive'
# omega_tail = 0
# n_theta, n_phi = 24, 48 # num of cpus and num of jobs
# job_dir = 'ecoliB01_passive_a'
# write_pbs_head = spf.write_pbs_head_newturb
# phi_list = np.linspace(0, 2 * np.pi, n_phi)
# theta_list = np.linspace(0, np.pi, n_theta)
# max_t, rtol, atol, eval_dt, update_fun = 10000, 1e-9, 1e-12, 1e-3, '5bs'
# calculate_fun = 'do_calculate_ecoli_passive_AvrPetsc4n'
# table_name = 'planeShearRatex_1d_passive_avr'
# omega_tail = 0
# n_theta, n_phi = 24, 48 # num of cpus and num of jobs
# job_dir = 'ecoliB01Avr_passive_a'
# write_pbs_head = spf.write_pbs_head_newturb
# phi_list = np.linspace(0, 2 * np.pi, n_phi)
# theta_list = np.linspace(0, np.pi, n_theta)
# max_t, rtol, atol, eval_dt, update_fun = 2000, 1e-6, 1e-9, 1e-3, '5bs'
# calculate_fun = 'do_calculate_ecoli_Petsc4n'
# table_name = 'planeShearRatex_1d_passive_avr'
# omega_tail = 0
# n_theta, n_phi = 24, 48 # num of cpus and num of jobs
# job_dir = 'ecoliB01Avr_passive_a'
# write_pbs_head = spf.write_pbs_head_newturb
# phi_list = np.linspace(0, 2 * np.pi, n_phi)
# theta_list = np.linspace(0, np.pi, n_theta)
# max_t, rtol, atol, eval_dt, update_fun = 10000, 1e-6, 1e-9, 1e-3, '5bs'
# calculate_fun = 'do_calculate_helix_Petsc4n'
# table_name = 'hlxC01_tau1a'
# omega_tail = 0
# n_theta, n_phi = 24, 48 # num of cpus and num of jobs
# job_dir = 'hlxC01_a_psi-0'
# write_pbs_head = spf.write_pbs_head
# ini_psi_type = 0
# phi_list = np.linspace(0, 2 * np.pi, n_phi)
# theta_list = np.linspace(0, np.pi, n_theta)
# max_t, rtol, atol, eval_dt, update_fun = 10000, 1e-12, 1e-15, 1e-3, '5bs'
# calculate_fun = 'do_calculate_helix_Petsc4n'
# table_name = 'hlxC01_tau1a'
# omega_tail = 0
# n_theta, n_phi = 24, 48 # num of cpus and num of jobs
# job_dir = 'hlxC01_a_psi-1.57'
# write_pbs_head = spf.write_pbs_head_newturb
# ini_psi_type = np.pi / 2
# phi_list = np.linspace(0, 2 * np.pi, n_phi)
# theta_list = np.linspace(0, np.pi, n_theta)
# max_t, rtol, atol, eval_dt, update_fun = 10000, 1e-12, 1e-15, 1e-3, '5bs'
# calculate_fun = 'do_calculate_helix_Petsc4n'
# table_name = 'hlxC01_tau1a'
# omega_tail = 0
# job_dir = 'hlxC01_a_psi-0b'
# write_pbs_head = spf.write_pbs_head_newturb
# ini_psi_type = 0
# phi_list = np.linspace(0, 2 * np.pi, 200)[0::2]
# theta_list = np.linspace(0, np.pi, 10)
# max_t, rtol, atol, eval_dt, update_fun = 10000, 1e-12, 1e-15, 1e-3, '5bs'
# calculate_fun = 'do_calculate_helix_Petsc4n'
# table_name = 'hlxC01_tau1a'
# omega_tail = 0
# job_dir = 'hlxC01_a_psi-0c'
# write_pbs_head = spf.write_pbs_head_newturb
# ini_psi_type = 0
# phi_list = np.linspace(0, 2 * np.pi, 200)[1::2]
# theta_list = np.linspace(0, np.pi, 10)
# max_t, rtol, atol, eval_dt, update_fun = 20000, 1e-12, 1e-15, 1e-3, '5bs'
# calculate_fun = 'do_calculate_helix_Petsc4n'
# table_name = 'hlxC01_tau1a'
# omega_tail = 0
# job_dir = 'hlxC01_a_psi-0d'
# write_pbs_head = spf.write_pbs_head_newturb
# ini_psi_type = 0
# phi_list = np.linspace(14 / 8 * np.pi, 18 / 8 * np.pi, 100) % (2 * np.pi)
# print(phi_list)
# theta_list = np.linspace(0, np.pi, 24)
# max_t, rtol, atol, eval_dt, update_fun = 1000, 1e-6, 1e-9, 1e-3, '5bs'
# calculate_fun = 'do_calculate_helix_Petsc4n'
# table_name = 'ecoC01B05_tau1c_passive'
# omega_tail = 0
# job_dir = 'ecoC01B05_passive_psi-0a'
# write_pbs_head = spf.write_pbs_head_newturb
# ini_psi_type = 0
# phi_list = np.linspace(0 * np.pi, 2 * np.pi, 24, endpoint=False) % (2 * np.pi)
# theta_list = np.linspace(0, np.pi, 23)
# max_t, rtol, atol, eval_dt, update_fun = 1000, 1e-6, 1e-9, 1e-3, '5bs'
# calculate_fun = 'do_calculate_ecoli_Petsc4n'
# table_name = 'ecoC01B05_tau1c'
# omega_tail = 193.66659814
# job_dir = 'ecoC01B05_psi-0a'
# write_pbs_head = spf.write_pbs_head_newturb
# ini_psi_type = 0
# phi_list = np.linspace(0 * np.pi, 2 * np.pi, 24, endpoint=False) % (2 * np.pi)
# theta_list = np.linspace(0, np.pi, 23)
# max_t, rtol, atol, eval_dt, update_fun = 2000, 1e-9, 1e-12, 1e-3, '5bs'
# calculate_fun = 'do_calculate_helix_Petsc4n'
# table_name = 'ecoC01B05_tau1c_passive'
# omega_tail = 0
# job_dir = 'ecoC01B05_passive_psi-0b'
# write_pbs_head = spf.write_pbs_head_newturb
# ini_psi_type = 0
# phi_list = np.linspace(0 * np.pi, 2 * np.pi, 24, endpoint=False) % (2 * np.pi)
# theta_list = np.linspace(0, np.pi, 23)
# max_t, rtol, atol, eval_dt, update_fun = 2000, 1e-12, 1e-15, 1e-3, '5bs'
# calculate_fun = 'do_calculate_helix_Petsc4n'
# table_name = 'ecoC01B05_tau1c_passive'
# omega_tail = 0
# job_dir = 'ecoC01B05_passive_psi-0c'
# write_pbs_head = spf.write_pbs_head_newturb
# ini_psi_type = 0
# phi_list = np.linspace(0 * np.pi, 2 * np.pi, 24, endpoint=False) % (2 * np.pi)
# theta_list = np.linspace(0, np.pi, 23)
# max_t, rtol, atol, eval_dt, update_fun = 4000, 1e-12, 1e-15, 1e-3, '5bs'
# calculate_fun = 'do_calculate_helix_Petsc4n'
# table_name = 'ecoC01B05_tau1c_passive'
# omega_tail = 0
# n_theta, n_phi = 24, 48 # num of cpus and num of jobs
# job_dir = 'ecoC01B05_passive_psi-0d'
# write_pbs_head = spf.write_pbs_head_newturb
# ini_psi_type = 0
# phi_list = np.linspace(0, 2 * np.pi, n_phi)
# theta_list = np.linspace(0, np.pi, n_theta)
# max_t, rtol, atol, eval_dt, update_fun = 20000, 1e-9, 1e-12, 1e-3, '5bs'
# calculate_fun = 'do_calculate_helix_Petsc4n'
# table_name = 'hlxC01_tau1a'
# omega_tail = 0
# n_theta, n_phi = 24, 48 # num of cpus and num of jobs
# job_dir = 'hlxC01_a_psi-0e'
# write_pbs_head = spf.write_pbs_head_newturb
# ini_psi_type = 0
# phi_list = np.linspace(0, 2 * np.pi, n_phi)
# theta_list = np.linspace(0, np.pi, n_theta)
# max_t, rtol, atol, eval_dt, update_fun = 2000, 1e-12, 1e-15, 1e-3, '5bs'
# calculate_fun = 'do_calculate_ecoli_Petsc4n'
# table_name = 'ecoC01B03_tau1c'
# omega_tail = 193.66659814
# n_theta, n_phi = 24, 48 # num of cpus and num of jobs
# job_dir = 'ecoC01B03_psi-0a'
# write_pbs_head = spf.write_pbs_head_newturb
# ini_psi_type = 0
# phi_list = np.linspace(0, 2 * np.pi, n_phi)
# theta_list = np.linspace(0, np.pi, n_theta)
# max_t, rtol, atol, eval_dt, update_fun = 2000, 1e-9, 1e-12, 1e-3, '4'
# calculate_fun = 'do_calculate_helix_Petsc4n'
# table_name = 'hlxC01_tau1a'
# omega_tail = 0
# n_theta, n_phi = 24, 20 # num of cpus and num of jobs
# job_dir = 'hlxC01_a_psi-0f'
# write_pbs_head = spf.write_pbs_head
# ini_psi_type = 0
# theta_list = np.linspace(0, np.pi, n_theta)[::2]
# phi_list = np.linspace(0, 2 * np.pi, n_phi)
# max_t, rtol, atol, eval_dt, update_fun = 2000, 1e-9, 1e-12, 1e-4, '4'
# calculate_fun = 'do_calculate_helix_Petsc4n'
# table_name = 'hlxC01_tau1a'
# omega_tail = 0
# n_theta, n_phi = 24, 20 # num of cpus and num of jobs
# job_dir = 'hlxC01_a_psi-0g'
# write_pbs_head = spf.write_pbs_head
# ini_psi_type = 0
# theta_list = np.linspace(0, np.pi, n_theta)[::2]
# phi_list = np.linspace(0, 2 * np.pi, n_phi)[::2]
# max_t, rtol, atol, eval_dt, update_fun = 2000, 1e-12, 1e-15, 1e-3, '5bs'
# calculate_fun = 'do_calculate_ecoli_Petsc4n'
# table_name = 'ecoC01B01_tau1c'
# job_dir = 'ecoC01B01_psi-0a'
# omega_tail = 193.66659814
# n_theta, n_phi = 24, 48 # num of cpus and num of jobs
# write_pbs_head = spf.write_pbs_head_newturb
# ini_psi_type = 0
# phi_list = np.linspace(0, 2 * np.pi, n_phi)
# theta_list = np.linspace(0, np.pi, n_theta)
# max_t, rtol, atol, eval_dt, update_fun = 3000, 1e-12, 1e-15, 1e-3, '5bs'
# calculate_fun = 'do_calculate_ecoli_Petsc4n'
# table_name = 'ecoC01B05_T10'
# job_dir = 'ecoC01B05_T10_psi-0a'
# omega_tail = 10
# n_theta, n_phi = 24, 48 # num of cpus and num of jobs
# write_pbs_head = spf.write_pbs_head
# ini_psi_type = 0
# phi_list = np.linspace(0, 2 * np.pi, n_phi)
# theta_list = np.linspace(0, np.pi, n_theta)
# max_t, rtol, atol, eval_dt, update_fun = 2000, 1e-12, 1e-15, 1e-3, '5bs'
# calculate_fun = 'do_calculate_ecoli_Petsc4n'
# table_name = 'ecoC01B05_T1'
# job_dir = 'ecoC01B05_T1_psi-0a'
# omega_tail = 1
# n_theta, n_phi = 24, 48 # num of cpus and num of jobs
# write_pbs_head = spf.write_pbs_head_newturb
# ini_psi_type = 0
# phi_list = np.linspace(0, 2 * np.pi, n_phi)
# theta_list = np.linspace(0, np.pi, n_theta)
# max_t, rtol, atol, eval_dt, update_fun = 1000, 1e-12, 1e-15, 1e-3, '5bs'
# calculate_fun = 'do_calculate_ecoli_Petsc4n'
# table_name = 'ecoC01B05_T0.001.pickle'
# job_dir = 'ecoC01B05_T0.001_psi-0a'
# omega_tail = 0.001
# n_theta, n_phi = 24, 48 # num of cpus and num of jobs
# write_pbs_head = spf.write_pbs_head_newturb
# ini_psi_type = 0
# phi_list = np.linspace(0, 2 * np.pi, n_phi)
# theta_list = np.linspace(0, np.pi, n_theta)
# max_t, rtol, atol, eval_dt, update_fun = 1000, 1e-12, 1e-15, 1e-3, '5bs'
# calculate_fun = 'do_calculate_ecoli_Petsc4n'
# table_name = 'ecoC01B05_T0.01.pickle'
# job_dir = 'ecoC01B05_T0.01_psi-0a'
# omega_tail = 0.01
# n_theta, n_phi = 24, 48 # num of cpus and num of jobs
# write_pbs_head = spf.write_pbs_head_newturb
# ini_psi_type = 0
# phi_list = np.linspace(0, 2 * np.pi, n_phi)
# theta_list = np.linspace(0, np.pi, n_theta)
# max_t, rtol, atol, eval_dt, update_fun = 3000, 1e-12, 1e-15, 1e-3, '5bs'
# calculate_fun = 'do_calculate_ecoli_Petsc4n'
# table_name = 'ecoC01B05_T0.01.pickle'
# job_dir = 'ecoC01B05_T0.01_psi-0b'
# omega_tail = 0.01
# n_theta, n_phi = 24, 48 # num of cpus and num of jobs
# write_pbs_head = spf.write_pbs_head
# ini_psi_type = 0
# phi_list = np.linspace(0, 2 * np.pi, n_phi)
# theta_list = np.linspace(0, np.pi, n_theta)
# max_t, rtol, atol, eval_dt, update_fun = 5000, 1e-12, 1e-15, 1e-3, '5bs'
# calculate_fun = 'do_calculate_ecoli_Petsc4n'
# table_name = 'ecoC01B05_T0.1.pickle'
# job_dir = 'ecoC01B05_T0.1_psi-0a'
# omega_tail = 0.1
# n_theta, n_phi = 24, 48 # num of cpus and num of jobs
# write_pbs_head = spf.write_pbs_head
# ini_psi_type = 0
# phi_list = np.linspace(0, 2 * np.pi, n_phi)
# theta_list = np.linspace(0, np.pi, n_theta)
# max_t, rtol, atol, eval_dt, update_fun = 1000, 1e-12, 1e-15, 1e-3, '5bs'
# calculate_fun = 'do_calculate_ecoli_Petsc4n'
# table_name = 'ecoC01B05_T0.5.pickle'
# job_dir = 'ecoC01B05_T0.5_psi-0a'
# omega_tail = 0.5
# n_theta, n_phi = 24, 48 # num of cpus and num of jobs
# write_pbs_head = spf.write_pbs_head_newturb
# ini_psi_type = 0
# phi_list = np.linspace(0, 2 * np.pi, n_phi)
# theta_list = np.linspace(0, np.pi, n_theta)
# max_t, rtol, atol, eval_dt, update_fun = 3000, 1e-12, 1e-15, 1e-3, '5bs'
# calculate_fun = 'do_calculate_ecoli_Petsc4n'
# table_name = 'ecoC01B05_T0.5.pickle'
# job_dir = 'ecoC01B05_T0.5_psi-0b'
# omega_tail = 0.5
# n_theta, n_phi = 24, 48 # num of cpus and num of jobs
# write_pbs_head = spf.write_pbs_head
# ini_psi_type = 0
# phi_list = np.linspace(0, 2 * np.pi, n_phi)
# theta_list = np.linspace(0, np.pi, n_theta)
# max_t, rtol, atol, eval_dt, update_fun = 3000, 1e-12, 1e-15, 1e-3, '5bs'
# calculate_fun = 'do_calculate_ecoli_Petsc4n'
# table_name = 'ecoC01B05_tao1_wm0.25.pickle'
# job_dir = 'ecoC01B05_T0.25_psi-0a'
# omega_tail = 0.25
# n_theta, n_phi = 24, 48 # num of cpus and num of jobs
# write_pbs_head = spf.write_pbs_head
# ini_psi_type = 0
# phi_list = np.linspace(0, 2 * np.pi, n_phi)
# theta_list = np.linspace(0, np.pi, n_theta)
# max_t, rtol, atol, eval_dt, update_fun = 3000, 1e-12, 1e-15, 1e-3, '5bs'
# calculate_fun = 'do_calculate_ecoli_Petsc4n'
# table_name = 'ecoC01B05_tao1_wm0.75.pickle'
# job_dir = 'ecoC01B05_T0.75_psi-0a'
# omega_tail = 0.75
# n_theta, n_phi = 24, 48 # num of cpus and num of jobs
# write_pbs_head = spf.write_pbs_head
# ini_psi_type = 0
# phi_list = np.linspace(0, 2 * np.pi, n_phi)
# theta_list = np.linspace(0, np.pi, n_theta)
# max_t, rtol, atol, eval_dt, update_fun = 10000, 1e-12, 1e-15, 1e-3, '5bs'
# calculate_fun = 'do_calculate_ecoli_Petsc4n'
# table_name = 'ecoC01B05_tao1_wm0.75.pickle'
# job_dir = 'ecoC01B05_T0.75_psi-0b'
# omega_tail = 0.75
# n_theta, n_phi = 24, 48 # num of cpus and num of jobs
# write_pbs_head = spf.write_pbs_head_newturb
# ini_psi_type = 0
# phi_list = np.linspace(0, 2 * np.pi, n_phi)
# theta_list = np.linspace(0, np.pi, n_theta)
max_t, rtol, atol, eval_dt, update_fun = 10000, 1e-12, 1e-15, 1e-3, '5bs'
calculate_fun = 'do_calculate_ecoli_Petsc4nPsi'
table_name = 'ecoC01B05_tao1_wm0.75.pickle'
job_dir = 'ecoC01B05_T0.75_psi-0c'
omega_tail = 0.75
n_theta, n_phi = 24, 48 # num of cpus and num of jobs
write_pbs_head = spf.write_pbs_head
ini_psi_type = 0
phi_list = np.linspace(0, 2 * np.pi, n_phi)
theta_list = np.linspace(0, np.pi, n_theta)
# max_t, rtol, atol, eval_dt, update_fun = 5000, 1e-12, 1e-15, 1e-3, '5bs'
# calculate_fun = 'do_calculate_ecoli_Petsc4n'
# table_name = 'ecoC01B05_tao1_wm0.8.pickle'
# job_dir = 'ecoC01B05_T0.8_psi-0a'
# omega_tail = 0.8
# n_theta, n_phi = 24, 48 # num of cpus and num of jobs
# write_pbs_head = spf.write_pbs_head
# ini_psi_type = 0
# phi_list = np.linspace(0, 2 * np.pi, n_phi)
# theta_list = np.linspace(0, np.pi, n_theta)
# max_t, rtol, atol, eval_dt, update_fun = 5000, 1e-12, 1e-15, 1e-3, '5bs'
# calculate_fun = 'do_calculate_ecoli_Petsc4n'
# table_name = 'ecoC01B05_tao1_wm0.9.pickle'
# job_dir = 'ecoC01B05_T0.9_psi-0a'
# omega_tail = 0.9
# n_theta, n_phi = 24, 48 # num of cpus and num of jobs
# write_pbs_head = spf.write_pbs_head
# ini_psi_type = 0
# phi_list = np.linspace(0, 2 * np.pi, n_phi)
# theta_list = np.linspace(0, np.pi, n_theta)
# max_t, rtol, atol, eval_dt, update_fun = 5000, 1e-12, 1e-15, 1e-3, '5bs'
# calculate_fun = 'do_calculate_ecoli_Petsc4n'
# table_name = 'ecoC01B05_tao1_wm0.2.pickle'
# job_dir = 'ecoC01B05_T0.2_psi-0a'
# omega_tail = 0.2
# n_theta, n_phi = 24, 48 # num of cpus and num of jobs
# write_pbs_head = spf.write_pbs_head
# ini_psi_type = 0
# phi_list = np.linspace(0, 2 * np.pi, n_phi)
# theta_list = np.linspace(0, np.pi, n_theta)
# max_t, rtol, atol, eval_dt, update_fun = 5000, 1e-12, 1e-15, 1e-3, '5bs'
# calculate_fun = 'do_calculate_ecoli_Petsc4n'
# table_name = 'ecoC01B05_tao1_wm0.3.pickle'
# job_dir = 'ecoC01B05_T0.3_psi-0a'
# omega_tail = 0.3
# n_theta, n_phi = 24, 48 # num of cpus and num of jobs
# write_pbs_head = spf.write_pbs_head
# ini_psi_type = 0
# phi_list = np.linspace(0, 2 * np.pi, n_phi)
# theta_list = np.linspace(0, np.pi, n_theta)
# max_t, rtol, atol, eval_dt, update_fun = 5000, 1e-12, 1e-15, 1e-3, '5bs'
# calculate_fun = 'do_calculate_ecoli_Petsc4n'
# table_name = 'ecoC01B05_tao1_wm0.4.pickle'
# job_dir = 'ecoC01B05_T0.4_psi-0a'
# omega_tail = 0.4
# n_theta, n_phi = 24, 48 # num of cpus and num of jobs
# write_pbs_head = spf.write_pbs_head
# ini_psi_type = 0
# phi_list = np.linspace(0, 2 * np.pi, n_phi)
# theta_list = np.linspace(0, np.pi, n_theta)
# max_t, rtol, atol, eval_dt, update_fun = 5000, 1e-12, 1e-15, 1e-3, '5bs'
# calculate_fun = 'do_calculate_ecoli_Petsc4n'
# table_name = 'ecoC01B05_tao1_wm0.6.pickle'
# job_dir = 'ecoC01B05_T0.6_psi-0a'
# omega_tail = 0.6
# n_theta, n_phi = 24, 48 # num of cpus and num of jobs
# write_pbs_head = spf.write_pbs_head
# ini_psi_type = 0
# phi_list = np.linspace(0, 2 * np.pi, n_phi)
# theta_list = np.linspace(0, np.pi, n_theta)
# max_t, rtol, atol, eval_dt, update_fun = 5000, 1e-12, 1e-15, 1e-3, '5bs'
# calculate_fun = 'do_calculate_ecoli_Petsc4n'
# table_name = 'ecoC01B05_tao1_wm0.7.pickle'
# job_dir = 'ecoC01B05_T0.7_psi-0a'
# omega_tail = 0.7
# n_theta, n_phi = 24, 48 # num of cpus and num of jobs
# write_pbs_head = spf.write_pbs_head
# ini_psi_type = 0
# phi_list = np.linspace(0, 2 * np.pi, n_phi)
# theta_list = np.linspace(0, np.pi, n_theta)
# max_t, rtol, atol, eval_dt, update_fun = 3000, 1e-12, 1e-15, 1e-3, '5bs'
# calculate_fun = 'do_calculate_ecoli_Petsc4n'
# table_name = 'ecoC01B05_tao1_wm100.pickle'
# job_dir = 'ecoC01B05_T100_psi-0a'
# omega_tail = 100
# n_theta, n_phi = 24, 48 # num of cpus and num of jobs
# write_pbs_head = spf.write_pbs_head
# ini_psi_type = 0
# phi_list = np.linspace(0, 2 * np.pi, n_phi)
# theta_list = np.linspace(0, np.pi, n_theta)
# max_t, rtol, atol, eval_dt, update_fun = 2000, 1e-9, 1e-12, 1e-3, '5bs'
# calculate_fun = 'do_calculate_ecoli_Petsc4n'
# table_name = 'ecoC01B05_tao1_wm100.pickle'
# job_dir = 'ecoC01B05_T100_psi-0b'
# omega_tail = 100
# n_theta, n_phi = 24, 48 # num of cpus and num of jobs
# write_pbs_head = spf.write_pbs_head
# ini_psi_type = 0
# phi_list = np.linspace(0, 2 * np.pi, n_phi)
# theta_list = np.linspace(0, np.pi, n_theta)
# max_t, rtol, atol, eval_dt, update_fun = 2000, 1e-9, 1e-12, 1e-3, '5bs'
# calculate_fun = 'do_calculate_ecoli_Petsc4n'
# table_name = 'ecoC01B05_tao1_wm100.pickle'
# job_dir = 'ecoC01B05_T100_psi-0b'
# omega_tail = 100
# n_theta, n_phi = 24, 48 # num of cpus and num of jobs
# write_pbs_head = spf.write_pbs_head
# ini_psi_type = 0
# phi_list = np.linspace(0, 2 * np.pi, n_phi)
# theta_list = np.linspace(0, np.pi, n_theta)
t_path = os.path.join(PWD, job_dir)
if not os.path.exists(t_path):
os.makedirs(t_path)
t_name0 = os.path.join(t_path, 'run.sh')
n_pbs = 0
with open(t_name0, 'w') as frun:
frun.write('t_dir=$PWD \n')
for ini_phi in phi_list:
job_name = 'ph%5.3f' % ini_phi
t_name = os.path.join(t_path, '%s.pbs' % job_name)
with open(t_name, 'w') as fpbs:
write_pbs_head(fpbs, job_name)
for i0, ini_theta in enumerate(theta_list):
ini_psi = np.random.sample(1) if ini_psi_type is 'rand' else ini_psi_type
ts = comm_do_calculate(ini_theta, ini_phi, ini_psi, max_t, rtol, atol, eval_dt,
calculate_fun, update_fun, table_name, omega_tail, i0)
fpbs.write(ts)
fpbs.write('wait \n\n')
frun.write('qsub %s.pbs\n\n' % job_name)
n_pbs = n_pbs + 1
frun.write('\n')
print(t_path)
print('n_pbs = ', n_pbs)
In [4]:
10000/12
Out[4]:
In [6]:
61*12/10000
Out[6]: