This function is passed to the test framework and executes the scheduling method repeatedly.
| 121 | /// This function is passed to the test framework and executes the scheduling method |
| 122 | /// repeatedly. |
| 123 | void BenchmarkFunction(int num_iterations, void* data) { |
| 124 | TestCtx* test_ctx = static_cast<TestCtx*>(data); |
| 125 | for (int i = 0; i < num_iterations; ++i) { |
| 126 | test_ctx->result->Reset(); |
| 127 | Status status = test_ctx->scheduler_wrapper->Compute(test_ctx->result.get()); |
| 128 | if (!status.ok()) LOG(FATAL) << status.GetDetail(); |
| 129 | } |
| 130 | } |
| 131 | |
| 132 | /// Build and run a benchmark suite for various cluster sizes with the default number of |
| 133 | /// blocks. Scheduling will be done according to the parameter 'replica_preference'. |