Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
0 parents
commit 2e3e20c
Showing
72 changed files
with
12,214 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,45 @@ | ||
cmake_minimum_required(VERSION 3.1) | ||
|
||
project(external_sort) | ||
|
||
set(CMAKE_CXX_STANDARD 11) | ||
|
||
option(GPU_CUDA_SUPPORT "CUDA support." OFF) | ||
|
||
find_package(OpenMP) | ||
if (OpenMP_CXX_FOUND) | ||
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} ${OpenMP_CXX_FLAGS}") | ||
set(CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} ${OpenMP_EXE_LINKER_FLAGS}") | ||
else() | ||
message(WARNING "OpenMP not found!") | ||
endif() | ||
|
||
add_subdirectory(libs) | ||
|
||
convertIntoHeader(src/cl/merge_sort.cl src/cl/merge_sort_cl.h merge_sort_kernel) | ||
|
||
set(SOURCES | ||
src/cl/merge_sort_cl.h | ||
src/io_utils/buffer_reader.cpp | ||
src/io_utils/buffer_reader.h | ||
src/io_utils/buffer_writer.cpp | ||
src/io_utils/buffer_writer.h | ||
src/io_utils/file_reader.cpp | ||
src/io_utils/file_reader.h | ||
src/io_utils/file_writer.cpp | ||
src/io_utils/file_writer.h | ||
) | ||
|
||
add_executable(input_generator src/main_generator.cpp ${SOURCES}) | ||
target_link_libraries(input_generator libclew libgpu libutils) | ||
|
||
if (GPU_CUDA_SUPPORT) | ||
find_package(CUDA REQUIRED) | ||
add_definitions(-DCUDA_SUPPORT) | ||
set(SOURCES ${SOURCES} src/cu/merge_sort.cu) | ||
cuda_add_executable(${PROJECT_NAME} src/main_sorter.cpp ${SOURCES}) | ||
else() | ||
add_executable(${PROJECT_NAME} src/main_sorter.cpp ${SOURCES}) | ||
endif() | ||
|
||
target_link_libraries(${PROJECT_NAME} libclew libgpu libutils) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,34 @@ | ||
# Generating input data | ||
|
||
``` | ||
./input_generator 1000000000 input.data | ||
``` | ||
|
||
``` | ||
Saving 1000000000 random floats (3814 MB) to file input.data | ||
Done in 9.94176 seconds (383.704 MB/s) | ||
``` | ||
|
||
# Sorting | ||
|
||
``` | ||
./external_sort input.data output.data | ||
``` | ||
|
||
``` | ||
Values number: 1000000000 (3814 MB) | ||
Pass #0: sorting part by part in core... | ||
In core parts number: 60 | ||
Limit for values in core: 16777216 (64 MB) | ||
IO: 51.1294 MB/s | ||
Finished in 149.217 s (9% reading + 82% sorting + 10% writing) | ||
Pass #1: merging groups of 16 parts... | ||
Input parts: 60 with 16777216 values (64 MB) in each | ||
IO: 629.504 MB/s | ||
Finished in 12.1199 s | ||
Pass #2: merging groups of 16 parts... | ||
Input parts: 4 with 268435456 values (1024 MB) in each | ||
IO: 343.152 MB/s | ||
Finished in 22.2333 s | ||
Finished in 183.571 s | ||
``` |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
add_subdirectory(clew) | ||
add_subdirectory(gpu) | ||
add_subdirectory(utils) |
Oops, something went wrong.