Skip to content

Commit c3faec4

Browse files
committed
Add "Error code step over" - Not permanent just a quick fix
1 parent 6d82e94 commit c3faec4

File tree

3 files changed

+18
-5
lines changed

3 files changed

+18
-5
lines changed

BOLSIG/bolsigminus

692 KB
Binary file not shown.

MCMU.inp

+2-2
Original file line numberDiff line numberDiff line change
@@ -11,11 +11,11 @@ Program = 2 #(1:Monte-Carlo, 2:Morris)
1111
Relative_Path_to_data = data/He
1212
Data_filename = biagi8.txt
1313
Array_with_uncertainty_values = 0.01 0.3 0.3 0.3 0.3 0.3 0.3 0.3 0.3 0.3 0.3 0.3 0.3 0.3 0.3 0.3 0.3 0.3 0.3 0.3 0.3 0.3 0.3 0.3 0.3 0.3 0.3 0.3 0.3 0.3 0.3 0.3 0.3 0.3 0.3 0.3 0.3 0.3 0.3 0.3 0.3 0.3 0.3 0.3 0.3 0.3 0.3 0.3 0.3 0.3 0.05
14-
Runs = 10000
14+
Runs = 100
1515
Species = He
1616
Num_E/N_Values = 7
1717
BOLSIG_location = /home/rdoyle/MCMU/BOLSIG/bolsigminus
18-
Num_CPUs = 4 #(Default=max)
18+
Num_CPUs = max #(Default=max)
1919

2020
###### Morris Program Only ######
2121
p_values = 10

MCMU.py

+16-3
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
import re
12
from os import getcwd, chdir, makedirs, listdir, remove
23
from os.path import join, exists
34
from numpy import random as rd, empty, format_float_scientific as f_f, zeros, nonzero, divide, sqrt, seterr
@@ -1246,6 +1247,7 @@ def morris_stats(file_list, inputdir, sample_set, delta, num_EN_val, num_params)
12461247
mean = {}
12471248
std = {}
12481249
energy = zeros(num_EN_val)
1250+
flag = False
12491251

12501252
# Interating through each created directory in Input Files
12511253
for keys, num in zip(file_list, sample_set):
@@ -1275,6 +1277,16 @@ def morris_stats(file_list, inputdir, sample_set, delta, num_EN_val, num_params)
12751277
file_1 = open(filename_1, 'r', encoding='utf8').read().splitlines()
12761278
file_2 = open(filename_2, 'r', encoding='utf8').read().splitlines()
12771279

1280+
for line in file_1:
1281+
if re.search("Error code", line):
1282+
logging.debug('Error code in ' + filename_1 + ", unable to calculate stats.")
1283+
flag = True
1284+
for line in file_2:
1285+
if re.search("Error code", line):
1286+
logging.debug('Error code in ' + filename_2 + ", unable to calculate stats.")
1287+
flag = True
1288+
if flag:
1289+
continue
12781290
# Searching the first file for the location of mobility data
12791291
# This is only done once as each file is of the exact same format
12801292
if mob_start == 0:
@@ -1295,14 +1307,15 @@ def morris_stats(file_list, inputdir, sample_set, delta, num_EN_val, num_params)
12951307
continue
12961308

12971309
for stat, stat_name in zip([mob_start, diff_start, ion_start, excite_rate, ion_rate], ['mob', 'dif', 'ion', 'excite_rate', 'ion_rate']):
1298-
1310+
print("File1=", filename_1)
1311+
print("File2=", filename_2)
12991312
if isinstance(stat, list):
13001313
stat_list = stat
13011314
stat_list_name = stat_name
13021315
for i in range(len(stat_list)):
13031316
stat_name = stat_list_name + "_{}".format(i)
13041317
stat = stat_list[i]
1305-
1318+
print("Line=",stat)
13061319
# Iterating through each line of mobility data
13071320
for k in range(num_EN_val):
13081321

@@ -1372,7 +1385,7 @@ def morris_stats(file_list, inputdir, sample_set, delta, num_EN_val, num_params)
13721385
else:
13731386
# Iterating through each line of mobility data
13741387
for k in range(num_EN_val):
1375-
1388+
print("Line=", stat)
13761389
# extracting energy and mobility values
13771390
E, stat_1 = file_1[stat + k + 1].split('\t')
13781391
E, stat_2 = file_2[stat + k + 1].split('\t')

0 commit comments

Comments
 (0)