39 if (Parallelisation
is 'Hybrid_Socket' or Parallelisation
is 'Hybrid_Node'):
43 if (Parallelisation
is 'Modal'):
44 PROC_Z = [2, 4, 5, 8, 10, 20]
45 PROC_XY = [1, 1, 1, 1, 1, 1]
48 if (Parallelisation
is 'Elemental'):
49 PROC_Z = [1, 1, 1, 1, 1, 1, 1, 1, 1, 1]
50 PROC_XY = [2, 4, 6, 8, 10, 12, 14, 16, 18, 20]
69 for i
in range(0, len(PROC_Z)):
72 Communication_Count = 0.0
75 Simulation =
Topology(PROC_Z[i], PROC_XY[i], Num_Core_Per_Socket, Num_Sock_Per_Node, Scheme)
78 (Num_Element_Msg, Num_Elements) =
Partition(Mesh_File, PROC_XY[i])
81 Simulation.Input_Communication(BW_Node_To_Node, LAT_Node_To_Node, BW_Socket_To_Socket, LAT_Socket_To_Socket, BW_Core_To_Core, LAT_Core_To_Core)
84 Simulation.Distribute_Modes(Num_Modes);
85 Simulation.Distribute_Elements(Num_Element_Msg, Num_Elements);
88 Simulation.CG_Iterations(Pressure, Velocity_1, Velocity_2, Velocity_3)
91 Simulation.Data_Size(P)
94 Simulation.Hardware_Constant(Num_Constants, Fit)
97 Pairwise.append(Simulation.Communication_Pairwise_Exchange())
98 Communication_Count += Pairwise[i]
101 Allreduce.append(Simulation.Communication_Allreduce())
102 Communication_Count += Allreduce[i]
105 Alltoall.append(Simulation.Communication_Alltoall())
106 Communication_Count += Alltoall[i]
109 Serial.append(Simulation.Serial_Compute())
112 Serial_Pairwise.append(Serial[i] + Pairwise[i])
113 Serial_Allreduce.append(Serial[i] + Allreduce[i])
114 Serial_Alltoall.append(Serial[i] + Alltoall[i])
117 Communication.append(Communication_Count)
120 Total.append(Communication[i] + Serial[i])
122 if (Parallelisation ==
'Hybrid'):
123 fig, ax = plt.subplots()
124 ax.plot(PROC_Z, Total, label =
'Model')
125 ax.set_xlabel(
'$ R_Z $')
126 ax.set_ylabel(
'Timestep (s)')
127 ax.set_title(
'Length of Single Timestep: Model')
129 fig.savefig(
"Output/Figures/Model_Hybrid.png")
131 if (Parallelisation ==
'Modal'):
132 fig, ax = plt.subplots()
133 ax.plot(PROC_Z, Total, label =
'Model')
134 ax.set_xlabel(
'$ R_Z $')
135 ax.set_ylabel(
'Timestep (s)')
136 ax.set_title(
'Length of Single Timestep: Model')
138 fig.savefig(
"Output/Figures/Model_Modal.png")
140 if (Parallelisation ==
'Elemental'):
141 fig, ax = plt.subplots()
142 ax.plot(PROC_XY, Total, label =
'Model')
143 ax.set_xlabel(
'$ R_{XY} $')
144 ax.set_ylabel(
'Timestep (s)')
145 ax.set_title(
'Length of Single Timestep: Model')
147 fig.savefig(
"Output/Figures/Model_Elemental.png")
149 return(PROC_Z, PROC_XY, Total)