Loading binarycpython/utils/grid.py +30 −0 Original line number Diff line number Diff line Loading @@ -2211,5 +2211,35 @@ class Population: # Function to join the result dictionaries # """ def _check_binary_c_error(self, binary_c_output, argstring): """ Function to check whether binary_c throws an error and handle accordingly. TODO: build mechanism to stop the run if too many failing systems found """ # print(binary_c_output) # print(argstring) if binary_c_output.startswith("SYSTEM_ERROR"): # print('error found') # Write arglines to file with open(os.path.join(self.grid_options['tmp_dir'], 'failed_systems.txt'), 'a+') as f: f.write(argstring) try: error_code = int(binary_c_output.splitlines()[0].split("with error code")[-1].split(":")[0].strip()) print(int(error_code)) # print(binary_c_output.splitlines()[0].split("with error code")[-1].split(":")[0]) if not error_code in self.grid_options['failing_systems_error_codes']: self.grid_options['failing_systems_error_codes'].apppend(error_code) except ValueError: print("failed to extract the error-code") self.grid_options['failed_count'] += 1 self.grid_options[''] ################################################################################################ binarycpython/utils/grid_options_defaults.py +1 −0 Original line number Diff line number Diff line Loading @@ -83,6 +83,7 @@ grid_options_defaults_dict = { "error": 0, # error? "failed_count": 0, # amt of failed systems "failed_prob": 0, # Summed probability of failed systems "failed_systems_error_codes": [], "id": 0, # Random id of this grid/population run, "modulo": 1, # run modulo n of the grid. ## Grid type evolution Loading Loading
binarycpython/utils/grid.py +30 −0 Original line number Diff line number Diff line Loading @@ -2211,5 +2211,35 @@ class Population: # Function to join the result dictionaries # """ def _check_binary_c_error(self, binary_c_output, argstring): """ Function to check whether binary_c throws an error and handle accordingly. TODO: build mechanism to stop the run if too many failing systems found """ # print(binary_c_output) # print(argstring) if binary_c_output.startswith("SYSTEM_ERROR"): # print('error found') # Write arglines to file with open(os.path.join(self.grid_options['tmp_dir'], 'failed_systems.txt'), 'a+') as f: f.write(argstring) try: error_code = int(binary_c_output.splitlines()[0].split("with error code")[-1].split(":")[0].strip()) print(int(error_code)) # print(binary_c_output.splitlines()[0].split("with error code")[-1].split(":")[0]) if not error_code in self.grid_options['failing_systems_error_codes']: self.grid_options['failing_systems_error_codes'].apppend(error_code) except ValueError: print("failed to extract the error-code") self.grid_options['failed_count'] += 1 self.grid_options[''] ################################################################################################
binarycpython/utils/grid_options_defaults.py +1 −0 Original line number Diff line number Diff line Loading @@ -83,6 +83,7 @@ grid_options_defaults_dict = { "error": 0, # error? "failed_count": 0, # amt of failed systems "failed_prob": 0, # Summed probability of failed systems "failed_systems_error_codes": [], "id": 0, # Random id of this grid/population run, "modulo": 1, # run modulo n of the grid. ## Grid type evolution Loading