Commit 7a7924da authored by Bram Veenboer's avatar Bram Veenboer

Move idg-distributed.x to cpu-optimized-mp.x

parent 56eac32e
# Copyright (C) 2020 ASTRON (Netherlands Institute for Radio Astronomy)
# Copyright (C) 2021 ASTRON (Netherlands Institute for Radio Astronomy)
# SPDX-License-Identifier: GPL-3.0-or-later
project(idg-distributed.x)
# Set sources
set (${PROJECT_NAME}_sources
main.cpp
)
# Set build target
add_executable (${PROJECT_NAME} ${${PROJECT_NAME}_sources})
# Set include directories
target_include_directories(
${PROJECT_NAME} PRIVATE
${MPI_C_COMPILER_INCLUDE_DIRS}
)
# Set link libaries
set(LINK_LIBRARIES
idg-util
idg-cpu
idg-cuda
${MPI_mpi_LIBRARY}
${MPI_mpi_cxx_LIBRARY}
)
target_link_libraries (
${PROJECT_NAME}
${LINK_LIBRARIES}
)
# install
install(TARGETS ${PROJECT_NAME}
RUNTIME DESTINATION bin/examples/cxx
LIBRARY DESTINATION lib
ARCHIVE DESTINATION lib/static
)
add_subdirectory(CPU)
\ No newline at end of file
# Copyright (C) 2021 ASTRON (Netherlands Institute for Radio Astronomy)
# SPDX-License-Identifier: GPL-3.0-or-later
project(cpu-optimized-mp.x)
# Set sources
set (${PROJECT_NAME}_sources
main.cpp
)
# Set build target
add_executable (${PROJECT_NAME} ${${PROJECT_NAME}_sources})
# Set include directories
target_include_directories(
${PROJECT_NAME} PRIVATE
${MPI_C_COMPILER_INCLUDE_DIRS}
)
# Set link libaries
set(LINK_LIBRARIES
idg-util
idg-cpu
idg-cuda
${MPI_mpi_LIBRARY}
${MPI_mpi_cxx_LIBRARY}
)
target_link_libraries (
${PROJECT_NAME}
${LINK_LIBRARIES}
)
# install
install(TARGETS ${PROJECT_NAME}
RUNTIME DESTINATION bin/examples/cxx
LIBRARY DESTINATION lib
ARCHIVE DESTINATION lib/static
)
// Copyright (C) 2021 ASTRON (Netherlands Institute for Radio Astronomy)
// SPDX-License-Identifier: GPL-3.0-or-later
#include "idg-cpu.h"
using ProxyType = idg::proxy::cpu::Optimized;
#include "../common.h"
int main(int argc, char *argv[]) {
run();
return 0;
}
\ No newline at end of file
......@@ -15,8 +15,6 @@
#include <mpi.h>
#include "idg-cpu.h"
#include "idg-cuda.h"
#include "idg-util.h" // Data init routines
using namespace std;
......@@ -26,9 +24,6 @@ using namespace std;
// initialize their own data, taking their baseline offset into account.
#define DISTRIBUTE_INPUT 0
// using ProxyType = idg::proxy::cuda::Generic;
using ProxyType = idg::proxy::cpu::Optimized;
std::tuple<int, int, int, int, int, int, int, int> read_parameters() {
const unsigned int DEFAULT_NR_STATIONS = 52; // all LOFAR LBA stations
const unsigned int DEFAULT_NR_CHANNELS = 16 * 4; // 16 channels, 4 subbands
......@@ -379,7 +374,7 @@ void send_visibilities(
requests.wait();
}
void run_master(int argc, char *argv[]) {
void run_master() {
idg::auxiliary::print_version();
// Constants
......@@ -753,7 +748,8 @@ void run_worker() {
}
} // end run_worker
int main(int argc, char *argv[]) {
void run() {
// Initialize the MPI environment
MPI_Init(NULL, NULL);
......@@ -764,7 +760,7 @@ int main(int argc, char *argv[]) {
std::thread master_thread, worker_thread;
if (rank == 0) {
print(rank, ">>> Running master");
run_master(argc, argv);
run_master();
} else {
print(rank, ">>> Running worker");
run_worker();
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment