Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
H
HPC_Imaging
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
Claudio Gheller
HPC_Imaging
Commits
aed8d315
Commit
aed8d315
authored
May 24, 2024
by
Claudio Gheller
Browse files
Options
Downloads
Patches
Plain Diff
toward SPIE paper
parent
1741abb1
No related branches found
No related tags found
No related merge requests found
Changes
6
Show whitespace changes
Inline
Side-by-side
Showing
6 changed files
gridding.c
+3
-3
3 additions, 3 deletions
gridding.c
gridding_cpu.c
+1
-1
1 addition, 1 deletion
gridding_cpu.c
gridding_nccl.cu
+52
-24
52 additions, 24 deletions
gridding_nccl.cu
init.c
+15
-1
15 additions, 1 deletion
init.c
main.c
+2
-1
2 additions, 1 deletion
main.c
proto.h
+4
-4
4 additions, 4 deletions
proto.h
with
77 additions
and
34 deletions
gridding.c
+
3
−
3
View file @
aed8d315
...
...
@@ -6,11 +6,11 @@
void
free_array
(
uint
*
,
uint
**
,
int
);
void
initialize_array
(
void
);
void
gridding_data
(
void
);
void
gridding_data
(
int
);
void
gridding
()
void
gridding
(
int
ifiles
)
{
if
(
rank
==
0
)
...
...
@@ -90,7 +90,7 @@ void gridding()
timing_wt
.
init
+=
CPU_TIME_wt
-
start
;
//Sector and Gridding data
gridding_data
();
gridding_data
(
ifiles
);
timing_wt
.
gridding
+=
CPU_TIME_wt
-
start
;
...
...
This diff is collapsed.
Click to expand it.
gridding_cpu.c
+
1
−
1
View file @
aed8d315
...
...
@@ -14,7 +14,7 @@ int reduce_ring (int);
// .....................................................................
//
void
gridding_data
()
void
gridding_data
(
int
ifiles
)
//
// actually performs the gridding of the data
//
...
...
This diff is collapsed.
Click to expand it.
gridding_nccl.cu
+
52
−
24
View file @
aed8d315
...
...
@@ -48,7 +48,7 @@ static void getHostName(char* hostname, int maxlen) {
void
gridding_data
(){
void
gridding_data
(
int
ifiles
){
double
shift
=
(
double
)(
dx
*
yaxis
);
...
...
@@ -98,11 +98,14 @@ void gridding_data(){
long
long
unsigned
size_finta
=
(
long
long
unsigned
)(
2
*
(
long
long
unsigned
)
param
.
num_w_planes
*
(
long
long
unsigned
)
xaxis
*
(
long
long
unsigned
)
yaxis
);
if
(
ifiles
==
0
)
{
nnn
=
cudaMalloc
(
&
grid_gpu
,
(
size_t
)(
size_finta
*
sizeof
(
double
)));
if
(
nnn
!=
cudaSuccess
)
{
printf
(
"!!! gridding_nccl.cu cudaMalloc &grid_gpu ERROR %d !!!
\n
"
,
nnn
);}
nnn
=
cudaMalloc
(
&
gridss_gpu
,
(
size_t
)(
size_finta
*
sizeof
(
double
)));
if
(
nnn
!=
cudaSuccess
)
{
printf
(
"!!! gridding_nccl.cu cudaMalloc &gridss_gpu ERROR %d !!!
\n
"
,
nnn
);}
}
nnn
=
cudaStreamCreate
(
&
stream_reduce
);
if
(
nnn
!=
cudaSuccess
)
{
printf
(
"!!! gridding_nccl.cu cudaStreamCreate &stream_reduce ERROR %d !!!
\n
"
,
nnn
);}
...
...
@@ -206,6 +209,7 @@ void gridding_data(){
//We have to call different GPUs per MPI task!!! [GL]
#ifdef CUDACC
if
(
size
>
1
)
{
wstack
((
long
long
unsigned
)
param
.
num_w_planes
,
Nsec
,
metaData
.
freq_per_chan
,
...
...
@@ -225,6 +229,29 @@ void gridding_data(){
param
.
num_threads
,
rank
,
stream_stacking
);
}
else
{
wstack
((
long
long
unsigned
)
param
.
num_w_planes
,
Nsec
,
metaData
.
freq_per_chan
,
metaData
.
polarisations
,
uus
,
vvs
,
wws
,
visreals
,
visimgs
,
weightss
,
dx
,
dw
,
param
.
w_support
,
(
long
long
unsigned
)
xaxis
,
(
long
long
unsigned
)
yaxis
,
grid_gpu
,
param
.
num_threads
,
rank
,
stream_stacking
);
}
#else
wstack
(
param
.
num_w_planes
,
Nsec
,
...
...
@@ -296,6 +323,7 @@ void gridding_data(){
cudaFree
(
gridss_gpu
);
#endif
cudaStreamDestroy
(
stream_reduce
);
cudaStreamDestroy
(
stream_stacking
);
...
...
This diff is collapsed.
Click to expand it.
init.c
+
15
−
1
View file @
aed8d315
...
...
@@ -55,7 +55,8 @@ void init(int index)
MPI_Barrier
(
MPI_COMM_WORLD
);
timing_wt
.
setup
=
CPU_TIME_wt
-
begin
;
if
(
index
==
0
)
timing_wt
.
setup
=
0
.
0
;
timing_wt
.
setup
+=
CPU_TIME_wt
-
begin
;
return
;
}
...
...
@@ -113,9 +114,12 @@ void op_filename() {
strcat
(
buf
,
outparam
.
extension
);
strcpy
(
out
.
extension
,
buf
);
strcpy
(
out
.
timingfile
,
outparam
.
timingfile
);
/*
strcpy(buf, num_buf);
strcat(buf, outparam.timingfile);
strcpy(out.timingfile, buf);
*/
}
/* Communicating the relevent parameters to the other process */
...
...
@@ -364,6 +368,16 @@ void allocate_memory(int index) {
// all the sizes are rescaled by the number of MPI tasks
// Allocate arrays
if
(
data
.
uu
!=
NULL
)
{
printf
(
"Freeing input data
\n
"
);
free
(
data
.
uu
);
free
(
data
.
vv
);
free
(
data
.
ww
);
free
(
data
.
weights
);
free
(
data
.
visreal
);
free
(
data
.
visimg
);
}
data
.
uu
=
(
double
*
)
calloc
(
metaData
.
Nmeasures
,
sizeof
(
double
));
data
.
vv
=
(
double
*
)
calloc
(
metaData
.
Nmeasures
,
sizeof
(
double
));
data
.
ww
=
(
double
*
)
calloc
(
metaData
.
Nmeasures
,
sizeof
(
double
));
...
...
This diff is collapsed.
Click to expand it.
main.c
+
2
−
1
View file @
aed8d315
...
...
@@ -143,11 +143,12 @@ int main(int argc, char * argv[])
if
(
rank
==
0
)
printf
(
"
\n
Dataset %d
\n
"
,
ifiles
);
// CLAAAAAAA
/*INIT function */
init
(
ifiles
);
/* GRIDDING function */
gridding
();
gridding
(
ifiles
);
}
/* WRITE_GRIDDED_DATA function */
...
...
This diff is collapsed.
Click to expand it.
proto.h
+
4
−
4
View file @
aed8d315
...
...
@@ -24,16 +24,16 @@ void shutdown_wstacking( int, char *, char *, int);
#ifdef __cplusplus
extern
"C"
{
void
gridding
(
void
);
void
gridding_data
(
void
);
void
gridding
(
int
);
void
gridding_data
(
int
);
void
write_gridded_data
(
void
);
}
#else
/* gridding.c */
void
gridding
(
void
);
void
gridding_data
(
void
);
void
gridding
(
int
);
void
gridding_data
(
int
);
void
write_gridded_data
(
void
);
#endif
...
...
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