Compare commits

..

No commits in common. "297d9c53f3d6323197bdc94873b0b88391fbcd1b" and "a7d977210e4b121758744f36afb8b87fa362e912" have entirely different histories.

3 changed files with 52 additions and 14 deletions

View File

@ -1,6 +1,4 @@
.cache .cache
.vscode
.idea
compile_commands.json compile_commands.json
count_and_distances count_and_distances
pairs.json pairs.json

42
haversine_02/.vscode/launch.json vendored Normal file
View File

@ -0,0 +1,42 @@
{
"configurations": [
{
"name": "Debug clustered generator",
"type": "cppdbg",
"request": "launch",
"cwd": "${workspaceFolder}",
"program": "${workspaceFolder}/genhavr",
"args": [
"--cluster",
"10"
]
},
{
"name": "Debug uniform generator",
"type": "cppdbg",
"request": "launch",
"cwd": "${workspaceFolder}",
"program": "${workspaceFolder}/genhavr",
"args": [
"10"
]
},
{
"name": "Debug processor",
"type": "cppdbg",
"request": "launch",
"cwd": "${workspaceFolder}",
"program": "${workspaceFolder}/prochavr",
"args": [
"${workspaceFolder}/pairs.json"
]
},
{
"name": "Debug timer test",
"type": "cppdbg",
"request": "launch",
"cwd": "${workspaceFolder}",
"program": "${workspaceFolder}/timer_test"
}
]
}

View File

@ -63,11 +63,9 @@ int main(int argc, char *argv[]) {
return -1; return -1;
} }
func_data funcs[] = { func_data funcs[] = {{{"WRITE", "WRITE WITH MALLOC"}, test_write},
{{"WRITE", "WRITE WITH MALLOC"}, test_write}, {{"READ", "READ WITH MALLOC"}, test_read},
{{"READ", "READ WITH MALLOC"}, test_read}, {{"FREAD", "FREAD WITH MALLOC"}, test_fread}};
{{"FREAD", "FREAD WITH MALLOC"}, test_fread},
};
tester.params.read_size = get_file_length(fp); tester.params.read_size = get_file_length(fp);
tester.params.read_count = 1; tester.params.read_count = 1;
@ -95,11 +93,11 @@ void test_fread(reptester *tester, alloc_type type) {
return; return;
} }
handle_alloc(tester, type);
u64 start = read_cpu_timer(); u64 start = read_cpu_timer();
u64 fault_count_start = page_fault_count(); u64 fault_count_start = page_fault_count();
handle_alloc(tester, type);
u64 obj_count = fread(tester->params.buffer, tester->params.read_size, u64 obj_count = fread(tester->params.buffer, tester->params.read_size,
tester->params.read_count, fp); tester->params.read_count, fp);
@ -128,13 +126,13 @@ void test_read(reptester *tester, alloc_type type) {
return; return;
} }
u64 start = read_cpu_timer();
u64 fault_count_start = page_fault_count();
handle_alloc(tester, type); handle_alloc(tester, type);
i32 fd = fileno(fp); i32 fd = fileno(fp);
u64 start = read_cpu_timer();
u64 fault_count_start = page_fault_count();
u64 bytes_read = read(fd, tester->params.buffer, u64 bytes_read = read(fd, tester->params.buffer,
tester->params.read_size * tester->params.read_count); tester->params.read_size * tester->params.read_count);
@ -156,11 +154,11 @@ void test_read(reptester *tester, alloc_type type) {
} }
void test_write(reptester *tester, alloc_type type) { void test_write(reptester *tester, alloc_type type) {
handle_alloc(tester, type);
u64 start = read_cpu_timer(); u64 start = read_cpu_timer();
u64 fault_count_start = page_fault_count(); u64 fault_count_start = page_fault_count();
handle_alloc(tester, type);
u64 total_size = tester->params.read_size * tester->params.read_count; u64 total_size = tester->params.read_size * tester->params.read_count;
for (u64 i = 0; i < total_size; ++i) { for (u64 i = 0; i < total_size; ++i) {