Skip to content

Commit

Permalink
move shuffle into tests
Browse files Browse the repository at this point in the history
  • Loading branch information
JaeseungYeom committed Feb 20, 2024
1 parent c691782 commit 96829f4
Show file tree
Hide file tree
Showing 8 changed files with 41 additions and 6 deletions.
1 change: 1 addition & 0 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -283,6 +283,7 @@ endfunction()
include(DYADUtils)
include_directories(${CMAKE_SOURCE_DIR}/include) # public header
add_subdirectory(src/dyad)
add_subdirectory(tests/shuffle)
#cmake_policy(SET CMP0079 NEW) # In case that we need more control over the target building order


Expand Down
2 changes: 1 addition & 1 deletion src/dyad/utils/read_all.h
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ ssize_t
read_all (int fd, void **bufp);

#if defined(__cplusplus)
};
}
#endif // defined(__cplusplus)

#endif /* DYAD_UTILS_READ_ALL_H */
34 changes: 34 additions & 0 deletions tests/shuffle/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
find_package(MPI)

if (MPI_FOUND)
set(DYAD_TEST_SHUFFLE_SRC ${CMAKE_CURRENT_SOURCE_DIR}/shuffle.cpp
${CMAKE_CURRENT_SOURCE_DIR}/worker.cpp)
set(DYAD_TEST_SHUFFLE_PRIVATE_HEADERS ${CMAKE_CURRENT_SOURCE_DIR}/worker.hpp
${CMAKE_CURRENT_SOURCE_DIR}/../src/dyad/utils/utils.h
${CMAKE_CURRENT_SOURCE_DIR}/../src/dyad/utils/read_all.h)
set(DYAD_TEST_SHUFFLE_PUBLIC_HEADERS)


add_executable(shuffle ${CMAKE_CURRENT_SOURCE_DIR}/shuffle.cpp
${CMAKE_CURRENT_SOURCE_DIR}/worker.cpp)
target_compile_definitions(shuffle PUBLIC DYAD_HAS_CONFIG)
target_include_directories(shuffle PUBLIC
$<BUILD_INTERFACE:${CMAKE_SOURCE_DIR}/src>
$<BUILD_INTERFACE:${CMAKE_BINARY_DIR}/src>
$<BUILD_INTERFACE:${CMAKE_BINARY_DIR}/include>
$<INSTALL_INTERFACE:${DYAD_INSTALL_INCLUDE_DIR}>)
target_link_libraries(shuffle PUBLIC ${PROJECT_NAME}_utils MPI::MPI_CXX)


if(DYAD_LOGGER STREQUAL "CPP_LOGGER")
target_link_libraries(shuffle PRIVATE ${CPP_LOGGER_LIBRARIES})
endif()
if(DYAD_PROFILER STREQUAL "DLIO_PROFILER")
target_link_libraries(shuffle PRIVATE ${DLIO_PROFILER_LIBRARIES})
endif()


if (TARGET DYAD_CXX_FLAGS_werror)
target_link_libraries(shuffle PRIVATE DYAD_CXX_FLAGS_werror)
endif ()
endif (MPI_FOUND)
File renamed without changes.
File renamed without changes.
4 changes: 2 additions & 2 deletions use_cases/shuffle/shuffle.cpp → tests/shuffle/shuffle.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -15,8 +15,8 @@
#include <sstream>
#include <vector>

#include "read_all.h"
#include "utils.h"
#include <dyad/utils/read_all.h>
#include <dyad/utils/utils.h>
#include "worker.hpp"

using std::cout;
Expand Down
File renamed without changes.
6 changes: 3 additions & 3 deletions use_cases/shuffle/worker.hpp → tests/shuffle/worker.hpp
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
#ifndef WORKER_HPP
#define WORKER_HPP
#ifndef DYAD_TEST_SHUFFLE_WORKER_HPP
#define DYAD_TEST_SHUFFLE_WORKER_HPP

#include <random>
#include <string>
Expand Down Expand Up @@ -51,4 +51,4 @@ class Worker
void set_file_list ();
};

#endif // WORKER_HPP
#endif // DYAD_TEST_SHUFFLE_WORKER_HPP

0 comments on commit 96829f4

Please sign in to comment.