-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathcreate_pysubmit.py
More file actions
49 lines (46 loc) · 2.89 KB
/
Copy pathcreate_pysubmit.py
File metadata and controls
49 lines (46 loc) · 2.89 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
import os
interno = 600
maxno = 6652
i_range = int(maxno/interno)
strnomax = str(i_range+1)
for i in range(i_range):
strno = str(i+1)
f = open('pysubmit_v'+strno+'.sh','w')
print('#!/bin/bash', file = f)
print('', file = f)
print('#SBATCH -J v'+strno+'_samp_cluster', file = f)
print('#SBATCH --mail-user=shiye2015@u.northwestern.edu', file = f)
print('#SBATCH --error=pyerror_v'+strno+'.out', file = f)
print('#SBATCH --output=pyoutput_v'+strno+'.out', file = f)
print('#SBATCH --nodes=1', file = f)
print('#SBATCH --ntasks-per-node=6', file = f)
print('#SBATCH --mem=100G', file = f)
print('#SBATCH --time=48:00:00', file = f)
print('#SBATCH --account=b1094', file = f)
print('#SBATCH --partition=ciera-std', file = f)
print('', file = f)
print('module load python/anaconda3.6', file = f)
start = str(i*interno); end = str((i+1)*interno)
#print('python -c \"import cluster_sampling_v1 as csv1; csv1.main(5000,'+start+','+end+', \'cluster_sample_initial_M_RG_dissol0_fcl0.012_ffa0.006_xcut3.0_xmin0.01_massive_small\', \'cluster_sample_disrupt_M_RG_dissol0_fcl0.012_ffa0.006_xcut3.0_xmin0.01_massive_small\', \'_v'+str(i)+'\')\"', file = f)
print('python -c \"import cluster_sampling_v1 as csv1; csv1.read_property_all('+start+', '+end+', \'cluster_sample_disrupt_M_RG_dissol0_fcl0.012_ffa0.006_xcut3.0_xmin0.01_massive_small\', \'cluster_sample_property_M_RG_dissol0_fcl0.012_ffa0.006_xcut3.0_xmin0.01_massive_small\', \'_v'+str(i)+'\')\"', file = f)
f.close()
os.system('sbatch '+'pysubmit_v'+strno+'.sh')
f = open('pysubmit_v'+strnomax+'.sh','w')
print('#!/bin/bash', file = f)
print('', file = f)
print('#SBATCH -J v'+strnomax+'_samp_cluster', file = f)
print('#SBATCH --mail-user=shiye2015@u.northwestern.edu', file = f)
print('#SBATCH --error=pyerror_v'+strnomax+'.out', file = f)
print('#SBATCH --output=pyoutput_v'+strnomax+'.out', file = f)
print('#SBATCH --nodes=1', file = f)
print('#SBATCH --ntasks-per-node=6', file = f)
print('#SBATCH --mem=100G', file = f)
print('#SBATCH --time=48:00:00', file = f)
print('#SBATCH --account=b1094', file = f)
print('#SBATCH --partition=ciera-std', file = f)
print('', file = f)
print('module load python/anaconda3.6', file = f)
#print('python -c \"import cluster_sampling_v1 as csv1; csv1.main(5000,'+end+','+str(maxno)+', \'cluster_sample_initial_M_RG_dissol0_fcl0.012_ffa0.006_xcut3.0_xmin0.01_massive_small\', \'cluster_sample_disrupt_M_RG_dissol0_fcl0.012_ffa0.006_xcut3.0_xmin0.01_massive_small\', \'_v'+str(i+1)+'\')\"', file = f)
print('python -c \"import cluster_sampling_v1 as csv1; csv1.read_property_all('+end+', '+str(maxno)+', \'cluster_sample_disrupt_M_RG_dissol0_fcl0.012_ffa0.006_xcut3.0_xmin0.01_massive_small\', \'cluster_sample_property_M_RG_dissol0_fcl0.012_ffa0.006_xcut3.0_xmin0.01_massive_small\', \'_v'+str(i+1)+'\')\"', file = f)
f.close()
os.system('sbatch '+'pysubmit_v'+strnomax+'.sh')