Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in / Register
Toggle navigation
I
idg
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Locked Files
Issues
7
Issues
7
List
Boards
Labels
Service Desk
Milestones
Iterations
Merge Requests
8
Merge Requests
8
Requirements
Requirements
List
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Test Cases
Security & Compliance
Security & Compliance
Dependency List
License Compliance
Operations
Operations
Incidents
Environments
Packages & Registries
Packages & Registries
Container Registry
Analytics
Analytics
CI / CD
Code Review
Insights
Issue
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
ResearchAndDevelopment
idg
Commits
7a7924da
Commit
7a7924da
authored
Jan 08, 2021
by
Bram Veenboer
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Move idg-distributed.x to cpu-optimized-mp.x
parent
56eac32e
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
59 additions
and
45 deletions
+59
-45
idg-bin/examples/cxx/distributed/CMakeLists.txt
idg-bin/examples/cxx/distributed/CMakeLists.txt
+2
-37
idg-bin/examples/cxx/distributed/CPU/CMakeLists.txt
idg-bin/examples/cxx/distributed/CPU/CMakeLists.txt
+39
-0
idg-bin/examples/cxx/distributed/CPU/main.cpp
idg-bin/examples/cxx/distributed/CPU/main.cpp
+14
-0
idg-bin/examples/cxx/distributed/common.h
idg-bin/examples/cxx/distributed/common.h
+4
-8
No files found.
idg-bin/examples/cxx/distributed/CMakeLists.txt
View file @
7a7924da
# Copyright (C) 202
0
ASTRON (Netherlands Institute for Radio Astronomy)
# Copyright (C) 202
1
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
idg-bin/examples/cxx/distributed/CPU/CMakeLists.txt
0 → 100644
View file @
7a7924da
# 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
)
idg-bin/examples/cxx/distributed/CPU/main.cpp
0 → 100644
View file @
7a7924da
// 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
idg-bin/examples/cxx/distributed/
main.cpp
→
idg-bin/examples/cxx/distributed/
common.h
View file @
7a7924da
...
...
@@ -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
();
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment