@@ -24,8 +24,9 @@ template<typename CELL_TYPE>
24
24
class CollectingWriterPerfTest : public CPUBenchmark
25
25
{
26
26
public:
27
- explicit CollectingWriterPerfTest (const std::string& modelName) :
28
- modelName(modelName)
27
+ explicit CollectingWriterPerfTest (const std::string& modelName, const std::string& speciesName) :
28
+ modelName(modelName),
29
+ speciesName(speciesName)
29
30
{}
30
31
31
32
std::string family ()
@@ -34,7 +35,7 @@ class CollectingWriterPerfTest : public CPUBenchmark
34
35
}
35
36
std::string species ()
36
37
{
37
- return " gold " ;
38
+ return speciesName ;
38
39
}
39
40
40
41
double performance (std::vector<int > rawDim)
@@ -73,7 +74,6 @@ class CollectingWriterPerfTest : public CPUBenchmark
73
74
}
74
75
}
75
76
76
- // fixme: add test for cell with SoA
77
77
return gigaBytesPerSecond (dim, seconds);
78
78
}
79
79
@@ -84,6 +84,7 @@ class CollectingWriterPerfTest : public CPUBenchmark
84
84
85
85
private:
86
86
std::string modelName;
87
+ std::string speciesName;
87
88
88
89
double gigaBytesPerSecond (const Coord<3 >& dim, double seconds)
89
90
{
@@ -101,8 +102,9 @@ template<typename CELL_TYPE>
101
102
class PatchLinkPerfTest : public CPUBenchmark
102
103
{
103
104
public:
104
- explicit PatchLinkPerfTest (const std::string& modelName) :
105
- modelName(modelName)
105
+ explicit PatchLinkPerfTest (const std::string& modelName, const std::string& speciesName) :
106
+ modelName(modelName),
107
+ speciesName(speciesName)
106
108
{}
107
109
108
110
std::string family ()
@@ -112,7 +114,7 @@ class PatchLinkPerfTest : public CPUBenchmark
112
114
113
115
std::string species ()
114
116
{
115
- return " gold " ;
117
+ return speciesName ;
116
118
}
117
119
118
120
double performance (std::vector<int > rawDim)
@@ -139,7 +141,7 @@ class PatchLinkPerfTest : public CPUBenchmark
139
141
transmissionRegion,
140
142
1 ,
141
143
666 ,
142
- APITraits::SelectMPIDataType <CELL_TYPE>::value ());
144
+ SerializationBuffer <CELL_TYPE>::cellMPIDataType ());
143
145
provider.charge (1234 , maxNanoStep, 1000 );
144
146
145
147
{
@@ -155,15 +157,14 @@ class PatchLinkPerfTest : public CPUBenchmark
155
157
transmissionRegion,
156
158
0 ,
157
159
666 ,
158
- APITraits::SelectMPIDataType <CELL_TYPE>::value ());
160
+ SerializationBuffer <CELL_TYPE>::cellMPIDataType ());
159
161
accepter.charge (1234 , maxNanoStep, 1000 );
160
162
161
163
for (int i = 1234 ; i <= maxNanoStep; i += 1000 ) {
162
164
accepter.put (grid, wholeGridRegion, dim, i, 0 );
163
165
}
164
166
}
165
167
166
- // fixme: add test for cell with SoA
167
168
return gigaBytesPerSecond (transmissionBox.dimensions , repeats, seconds);
168
169
}
169
170
@@ -174,6 +175,7 @@ class PatchLinkPerfTest : public CPUBenchmark
174
175
175
176
private:
176
177
std::string modelName;
178
+ std::string speciesName;
177
179
178
180
double gigaBytesPerSecond (const Coord<3 >& dim, int repeats, double seconds)
179
181
{
@@ -294,12 +296,25 @@ int main(int argc, char **argv)
294
296
eval.print_header ();
295
297
}
296
298
297
- eval (CollectingWriterPerfTest<MySimpleCell>(" MySimpleCell" ), toVector (Coord<3 >::diagonal (256 )), output);
298
- eval (CollectingWriterPerfTest<TestCell<3 > >(" TestCell<3> " ), toVector (Coord<3 >::diagonal (64 )), output);
299
- eval (PatchLinkPerfTest<MySimpleCell>(" MySimpleCell" ), toVector (Coord<3 >::diagonal (200 )), output);
300
- eval (PatchLinkPerfTest<TestCell<3 > >(" TestCell<3> " ), toVector (Coord<3 >::diagonal (64 )), output);
301
- eval (PartitionManagerBig3DPerfTest<RecursiveBisectionPartition<3 > >(" RecursiveBisection" ), toVector (Coord<3 >::diagonal (100 )), output);
302
- eval (PartitionManagerBig3DPerfTest<ZCurvePartition<3 > >(" ZCurve" ), toVector (Coord<3 >::diagonal (100 )), output);
299
+ std::vector<int > diag64 = toVector (Coord<3 >::diagonal (64 ));
300
+ std::vector<int > diag100 = toVector (Coord<3 >::diagonal (100 ));
301
+ std::vector<int > diag200 = toVector (Coord<3 >::diagonal (200 ));
302
+ std::vector<int > diag256 = toVector (Coord<3 >::diagonal (256 ));
303
+
304
+ eval (CollectingWriterPerfTest<MySimpleCell>(" MySimpleCell" , " gold" ), diag256, output);
305
+ eval (CollectingWriterPerfTest<MySimpleCellSoA>(" MySimpleCell" , " platinum" ), diag256, output);
306
+
307
+ eval (CollectingWriterPerfTest<TestCell<3 > >(" TestCell<3> " , " gold" ), diag64, output);
308
+ eval (CollectingWriterPerfTest<TestCellSoA>( " TestCell<3> " , " platinum" ), diag64, output);
309
+
310
+ eval (PatchLinkPerfTest<MySimpleCell>(" MySimpleCell" , " gold" ), diag200, output);
311
+ eval (PatchLinkPerfTest<MySimpleCellSoA>(" MySimpleCell" , " platinum" ), diag200, output);
312
+
313
+ eval (PatchLinkPerfTest<TestCell<3 > >(" TestCell<3> " , " gold" ), diag64, output);
314
+ eval (PatchLinkPerfTest<TestCellSoA>( " TestCell<3> " , " platinum" ), diag64, output);
315
+
316
+ eval (PartitionManagerBig3DPerfTest<RecursiveBisectionPartition<3 > >(" RecursiveBisection" ), diag100, output);
317
+ eval (PartitionManagerBig3DPerfTest<ZCurvePartition<3 > >(" ZCurve" ), diag100, output);
303
318
304
319
MPI_Finalize ();
305
320
return 0 ;
0 commit comments