-
Notifications
You must be signed in to change notification settings - Fork 54
Tutorial 1 Running a simple experiment
In the installation guide, you ran the executable Experiments/demo.cpp. But what actually happens in this file?
Line 4 sets up the configuration parameters for the SSD and the OS. This includes:
- the SSD hardware, (e.g. number of channels, number of pages per block, etc)
- the controller logic (e.g. scheduling scheme, page allocation strategy, etc)
- OS logic (e.g. scheduling scheme, etc) Click here for a tutorial about configuration parameters.
Lines 5 and 6 create a folder within the EagleTree folder in which output and temporary files pertaining to an experiment will be saved. The folder in this case will be called "demo_output".
Lines 7-10 create a calibration file. A workload definition is first created. Workload definitions in EagleTree are abstractions that can be used for convenience by the programmer to design a workload in fine details. The Init_Workload definition involves a sequential write over the entire logical address space followed by a random formatting of the logical address space. This workload definition is ran on an empty SSD to create an initial state on which a real experiment will later run. Click here for a tutorial about workload definitions. Click here for a tutorial about calibration.
Line 11 creates an experiment object. The experiment class is designed to assist in all aspects regarding running experiments, from calibration, to varying variables and generating data, to outputing results and graphs.
In line 12, the calibration file created earlier is set as the initial state of the new experiment.
Lines 13-14 creates the workload that will target the SSD during the experiment. The Asynch_Random_Workload is a workload definition that creates a thread that submits Ios asynchronously to the SSD. It is per-configured to submits 50% reads and 50% writes in a random order.
Line 15 sets how many IOs will be submitted to the SSD before the experiment is over.
Line 16 runs the experiment, giving it the name test.
Line 17 prints graphs and data in the output folder.
1 int main()
2 {
3 printf("Running EagleTree\n");
4 set_small_SSD_config();
5 string name = "/demo_output/";
6 Experiment::create_base_folder(name.c_str());
7 Workload_Definition* init = new Init_Workload();
8 string calibration_file = "calib.txt";
9 Experiment::calibrate_and_save(init, calibration_file);
10 delete init;
11 Experiment* e = new Experiment();
12 e->set_calibration_file(calibration_file);
13 Workload_Definition* workload = new Asynch_Random_Workload();
14 e->set_workload(workload);
15 e->set_io_limit(100000);
16 e->run("test");
17 e->draw_graphs();
18 delete workload;
19 return 0;
20 }