Nektar++
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
Functions
error_main Namespace Reference

Functions

def Primary_Error_Out
 
def Error_Check_Proc_Input
 
def Error_Check_Comm_Input
 

Function Documentation

def error_main.Error_Check_Comm_Input (   BW_Node_To_Node,
  LAT_Node_To_Node,
  BW_Socket_To_Socket,
  LAT_Socket_To_Socket,
  BW_Core_To_Core,
  LAT_Core_To_Core 
)

Definition at line 122 of file error_main.py.

123 def Error_Check_Comm_Input(BW_Node_To_Node, LAT_Node_To_Node, BW_Socket_To_Socket, LAT_Socket_To_Socket, BW_Core_To_Core, LAT_Core_To_Core):
124 
125  # Default no errors
126  check = True
127 
128  # Check for file path and create if necessary
129  error_path = 'Error'
130  if not os.path.exists(error_path):
131  os.mkdir(error_path)
132 
133  # Open file to write errors to.
134  error_txt = open('Error/error_comm_input.txt', 'w')
135 
136  # BW_Node_To_Node must be an float
137  if(type(BW_Node_To_Node) is not float):
138  error_txt.write("Please input an float for Bandwith Node To Node")
139  error_txt.write('\n')
140  check = False
141 
142  # BW_Node_To_Node must be a positive number
143  if(BW_Node_To_Node <= 0):
144  error_txt.write("Please give a positive number for Bandwith Node To Node")
145  error_txt.write('\n')
146  check = False
147 
148  # LAT_Node_To_Node must be an float
149  if(type(LAT_Node_To_Node) is not float):
150  error_txt.write("Please input an float for Latency Node To Node")
151  error_txt.write('\n')
152  check = False
153 
154  # LAT_Node_To_Node must be a positive number
155  if(LAT_Node_To_Node <= 0):
156  error_txt.write("Please give a positive number for Latency Node To Node")
157  error_txt.write('\n')
158  check = False
159 
160  # BW_Socket_To_Socket must be an float
161  if(type(BW_Socket_To_Socket) is not float):
162  error_txt.write("Please input an float for Bandwith Socket To Socket")
163  error_txt.write('\n')
164  check = False
165 
166  # BW_Socket_To_Socket must be a positive number
167  if(BW_Socket_To_Socket <= 0):
168  error_txt.write("Please give a positive number for Bandwith Socket To Socket")
169  error_txt.write('\n')
170  check = False
171 
172  # LAT_Socket_To_Socket must be an float
173  if(type(LAT_Socket_To_Socket) is not float):
174  error_txt.write("Please input an float for Latency Socket To Socket")
175  error_txt.write('\n')
176  check = False
177 
178  # LAT_Socket_To_Socket must be a positive number
179  if(LAT_Socket_To_Socket <= 0):
180  error_txt.write("Please give a positive number for Latency Socket To Socket")
181  error_txt.write('\n')
182  check = False
183 
184  # BW_Core_To_Core must be an float
185  if(type(BW_Core_To_Core) is not float):
186  error_txt.write("Please input an float for Bandwith Core To Core")
187  error_txt.write('\n')
188  check = False
189 
190  # BW_Socket_To_Socket must be a positive number
191  if(BW_Core_To_Core <= 0):
192  error_txt.write("Please give a positive number for Bandwith Core To Core")
193  error_txt.write('\n')
194  check = False
195 
196  # LAT_Core_To_Core must be an float
197  if(type(LAT_Core_To_Core) is not float):
198  error_txt.write("Please input an float for Latency Core To Core")
199  error_txt.write('\n')
200  check = False
201 
202  # LAT_Core_To_Core must be a positive number
203  if(LAT_Core_To_Core <= 0):
204  error_txt.write("Please give a positive number for Latency Core To Core")
205  error_txt.write('\n')
206  check = False
207 
208  if(check is True):
209  return(check, 'No errors in Processor, Element and Mode inputs')
210  if(check is False):
211  return(check, 'Errors found in Communication inputs - Please see Error/error_comm_input.txt')
212 
213 
214 
215 
def Error_Check_Comm_Input
Definition: error_main.py:122
def error_main.Error_Check_Proc_Input (   PROC_TOT,
  Num_Core_Per_Socket,
  Num_Sock_Per_Node,
  N_Modes 
)

Definition at line 42 of file error_main.py.

42 
43 def Error_Check_Proc_Input(PROC_TOT, Num_Core_Per_Socket, Num_Sock_Per_Node, N_Modes):
44 
45  # Default no errors
46  check = True
47 
48  # Check for file path and create if necessary
49  error_path = 'Error'
50  if not os.path.exists(error_path):
51  os.mkdir(error_path)
52 
53  # Open file to write errors to.
54  error_txt = open('Error/error_proc_input.txt', 'w')
55 
56  # PROC_TOT must be an int
57  if(type(PROC_TOT) is not int):
58  error_txt.write("Please input an integer for the number of Processors")
59  error_txt.write('\n')
60  check = False
61 
62  # PROC_TOT must be a positive number
63  if(PROC_TOT <= 0):
64  error_txt.write("Please give a positive number of Processors")
65  error_txt.write('\n')
66  check = False
67 
68  # PROC_TOT does not allow for an odd number of cores to be used.
69  if(PROC_TOT % 2 != 0):
70  error_txt.write("Odd Number of Processors Provided, Povide an Even Number")
71  error_txt.write('\n')
72  check = False
73 
74  # Num_Core_Per_Socket must be an int
75  if(type(Num_Core_Per_Socket) is not int):
76  error_txt.write("Please input an integer for the number of Cores Per Socket")
77  error_txt.write('\n')
78  check = False
79 
80  # Num_Core_Per_Socket must be a positive number
81  if(Num_Core_Per_Socket <= 0):
82  error_txt.write("Please give a positive number of Cores Per Socket")
83  error_txt.write('\n')
84  check = False
85 
86  # Num_Core_Per_Socket must be an int
87  if(type(Num_Sock_Per_Node) is not int):
88  error_txt.write("Please input an integer for the number of Sockets Per Node")
89  error_txt.write('\n')
90  check = False
91 
92  # Num_Core_Per_Socket must be a positive number
93  if(Num_Sock_Per_Node <= 0):
94  error_txt.write("Please give a positive number of Sockets Per Node")
95  error_txt.write('\n')
96  check = False
97 
98  # Num_Core_Per_Socket must be an int
99  if(type(N_Modes) is not int):
100  error_txt.write("Please input an integer for the number of Modes")
101  error_txt.write('\n')
102  check = False
103 
104  # Num_Core_Per_Socket must be a positive number
105  if(N_Modes <= 0):
106  error_txt.write("Please give a positive number of Modes")
107  error_txt.write('\n')
108  check = False
109 
110  # Close the file and return result
111  error_txt.close()
112 
113  if(check is True):
114  return(check, 'No errors in Processor, Element and Mode inputs')
115  if(check is False):
116  return(check, 'Errors found in Processor, Element and Mode inputs - Please see Error/error_proc_input.txt')
117 
118 #------------------------------------
119 # New Function
120 #------------------------------------
121 
# Check that the bandwidth and latency input are valid
def Error_Check_Proc_Input
Definition: error_main.py:42
def error_main.Primary_Error_Out (   Message)

Definition at line 21 of file error_main.py.

21 
22 def Primary_Error_Out(Message):
23 
24  # Check for file path and create if necessary
25  error_path = 'Error'
26  if not os.path.exists(error_path):
27  os.mkdir(error_path)
28 
29  error_txt = open('Error/error_proc_input.txt', 'w')
30 
31  for i in range(0, len(Message)):
32  error_txt.write(Message[i])
33  error_txt.write("\n")
34 
35  error_txt.close()
36 
37 #------------------------------------
38 # New Function
39 #------------------------------------
40 
41 # Check the Processor, Element and Mode inputs for Errors
# Run this whenever using find_topologies from function_main.py
def Primary_Error_Out
Definition: error_main.py:21