Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
D
dADP
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package registry
Container registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
GitLab community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Luca Tornatore
dADP
Commits
cc6ed30a
Commit
cc6ed30a
authored
Mar 19, 2024
by
lykos98
Browse files
Options
Downloads
Patches
Plain Diff
added diagnostic print
parent
ad26df1f
Branches
Branches containing commit
Tags
Tags containing commit
No related merge requests found
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
src/tree/tree.c
+35
-3
35 additions, 3 deletions
src/tree/tree.c
with
35 additions
and
3 deletions
src/tree/tree.c
+
35
−
3
View file @
cc6ed30a
...
@@ -17,6 +17,7 @@
...
@@ -17,6 +17,7 @@
#include
<stdlib.h>
#include
<stdlib.h>
#include
<string.h>
#include
<string.h>
#include
<omp.h>
#include
<omp.h>
#include
<sys/sysinfo.h>
#define WRITE_NGBH
#define WRITE_NGBH
#define WRITE_TOP_NODES
#define WRITE_TOP_NODES
...
@@ -1289,11 +1290,42 @@ void convert_heap_idx_to_global(global_context_t* ctx, heap* H)
...
@@ -1289,11 +1290,42 @@ void convert_heap_idx_to_global(global_context_t* ctx, heap* H)
}
}
}
}
void
print_diagnositcs
(
global_context_t
*
ctx
,
int
k
)
{
MPI_Comm
shmcomm
;
MPI_Comm_split_type
(
MPI_COMM_WORLD
,
MPI_COMM_TYPE_SHARED
,
0
,
MPI_INFO_NULL
,
&
shmcomm
);
int
shm_world_size
;
MPI_Comm_size
(
shmcomm
,
&
shm_world_size
);
MPI_DB_PRINT
(
"[INFO] Got %d ranks per node
\n
"
,
shm_world_size
);
/* data */
float_t
memory_use
=
(
float_t
)
ctx
->
local_n_points
*
ctx
->
dims
*
sizeof
(
float_t
);
memory_use
+=
(
float_t
)
sizeof
(
datapoint_info_t
)
*
(
float_t
)(
ctx
->
local_n_points
);
/* ngbh */
memory_use
+=
(
float_t
)
sizeof
(
heap_node
)
*
(
float_t
)
k
*
(
float_t
)(
ctx
->
local_n_points
);
memory_use
=
memory_use
/
1e9
*
shm_world_size
;
MPI_DB_PRINT
(
" Got ~%d points per node and %d ngbh per points
\n
"
,
ctx
->
local_n_points
*
shm_world_size
,
k
);
MPI_DB_PRINT
(
" Expected to use ~%.2lfGB of memory for each node, plus memory required to communicate ngbh
\n
"
,
memory_use
);
struct
sysinfo
info
;
sysinfo
(
&
info
);
if
(
memory_use
>
0
.
5
*
(
float_t
)
info
.
freeram
/
1e9
)
MPI_DB_PRINT
(
"/!
\\
Projected memory usage is more than half of the node memory, may go into troubles while communicating ngbh
\n
"
);
MPI_Barrier
(
ctx
->
mpi_communicator
);
}
void
mpi_ngbh_search
(
global_context_t
*
ctx
,
datapoint_info_t
*
dp_info
,
top_kdtree_t
*
top_tree
,
kdtree_v2
*
local_tree
,
float_t
*
data
,
int
k
)
void
mpi_ngbh_search
(
global_context_t
*
ctx
,
datapoint_info_t
*
dp_info
,
top_kdtree_t
*
top_tree
,
kdtree_v2
*
local_tree
,
float_t
*
data
,
int
k
)
{
{
/* local search */
/* local search */
/* print diagnostics */
print_diagnositcs
(
ctx
,
k
);
MPI_DB_PRINT
(
"[MASTER] Local ngbh search "
);
MPI_DB_PRINT
(
"[MASTER] Local ngbh search "
);
MPI_Barrier
(
ctx
->
mpi_communicator
);
#pragma omp parallel for
#pragma omp parallel for
for
(
int
p
=
0
;
p
<
ctx
->
local_n_points
;
++
p
)
for
(
int
p
=
0
;
p
<
ctx
->
local_n_points
;
++
p
)
{
{
...
@@ -1842,7 +1874,7 @@ void simulate_master_read_and_scatter(int dims, size_t n, global_context_t *ctx)
...
@@ -1842,7 +1874,7 @@ void simulate_master_read_and_scatter(int dims, size_t n, global_context_t *ctx)
// std_g0163178_Me14_091_0000
// std_g0163178_Me14_091_0000
/* 10^6 points ca.*/
/* 10^6 points ca.*/
data
=
read_data_file
(
ctx
,
"../norm_data/std_LR_091_0001"
,
MY_TRUE
);
//
data = read_data_file(ctx,"../norm_data/std_LR_091_0001",MY_TRUE);
/* 10^7 ~ 8M points */
/* 10^7 ~ 8M points */
...
@@ -1853,7 +1885,7 @@ void simulate_master_read_and_scatter(int dims, size_t n, global_context_t *ctx)
...
@@ -1853,7 +1885,7 @@ void simulate_master_read_and_scatter(int dims, size_t n, global_context_t *ctx)
//
//
//34 M
//34 M
//
data = read_data_file(ctx,"../norm_data/std_g1212639_091_0001",MY_TRUE);
data
=
read_data_file
(
ctx
,
"../norm_data/std_g1212639_091_0001"
,
MY_TRUE
);
ctx
->
dims
=
5
;
ctx
->
dims
=
5
;
// ctx -> n_points = 48*5*2000;
// ctx -> n_points = 48*5*2000;
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment