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
9acc1346
Commit
9acc1346
authored
3 years ago
by
Claudio Gheller
Browse files
Options
Downloads
Patches
Plain Diff
added support for w phase correction
parent
9bf1af25
No related branches found
No related tags found
No related merge requests found
Changes
5
Show whitespace changes
Inline
Side-by-side
Showing
5 changed files
.gitignore
+7
-0
7 additions, 0 deletions
.gitignore
Makefile
+18
-10
18 additions, 10 deletions
Makefile
phase_correction.cu
+30
-0
30 additions, 0 deletions
phase_correction.cu
w-stacking-fftw.c
+50
-2
50 additions, 2 deletions
w-stacking-fftw.c
w-stacking.h
+12
-0
12 additions, 0 deletions
w-stacking.h
with
117 additions
and
12 deletions
.gitignore
0 → 100644
+
7
−
0
View file @
9acc1346
*.o
phase_correction.c
w-stacking.c
w-stackingCfftw
w-stackingfftw
w-stackingCfftw_serial
w-stackingfftw_serial
This diff is collapsed.
Click to expand it.
Makefile
+
18
−
10
View file @
9acc1346
OPT
+=
-DUSE_MPI
OPT
+=
-DUSE_MPI
OPT
+=
-DUSE_FFTW
OPT
+=
-DUSE_FFTW
OPT
+=
-DONE_SIDE
OPT
+=
-DONE_SIDE
OPT
+=
-DWRITE_DATA
OPT
+=
-DNOWRITE_DATA
OPT
+=
-DWRITE_IMAGE
CC
=
gcc
CC
=
gcc
CXX
=
g++
CXX
=
g++
MPICC
=
mpicc
MPICC
=
mpicc
MPICXX
=
mpiCC
MPICXX
=
mpiCC
#OMP = -fopenmp
OMP
=
CFLAGS
+=
-O3
-mcpu
=
native
CFLAGS
+=
-O3
-mcpu
=
native
CFLAGS
+=
-I
.
CFLAGS
+=
-I
.
LIBS
=
-L
$(
FFTW_LIB
)
-lfftw3_mpi
-lfftw3
-lm
LIBS
=
-L
$(
FFTW_LIB
)
-lfftw3_mpi
-lfftw3
-lm
...
@@ -17,31 +21,35 @@ NVFLAGS = -arch=sm_70 -c w-stacking.cu -Xcompiler -mno-float128 -std=c++11
...
@@ -17,31 +21,35 @@ NVFLAGS = -arch=sm_70 -c w-stacking.cu -Xcompiler -mno-float128 -std=c++11
NVLIB
=
-L
/cineca/prod/opt/compilers/cuda/10.1/none/lib64/
-lcudart
-lcuda
NVLIB
=
-L
/cineca/prod/opt/compilers/cuda/10.1/none/lib64/
-lcudart
-lcuda
DEPS
=
w-stacking.h
DEPS
=
w-stacking.h
COBJ
=
w-stacking.o w-stacking-fftw.o
COBJ
=
w-stacking.o w-stacking-fftw.o
phase_correction.o
w-stacking.c
:
w-stacking.c
:
cp
w-stacking.cu w-stacking.c
cp
w-stacking.cu w-stacking.c
phase_correction.c
:
cp
phase_correction.cu phase_correction.c
%.o
:
%.c $(DEPS)
%.o
:
%.c $(DEPS)
$(
CC
)
-c
-o
$@
$<
$(
CFLAGS
)
$(
OPT
)
$(
CC
)
$(
OMP
)
-c
-o
$@
$<
$(
CFLAGS
)
$(
OPT
)
serial
:
$(COBJ)
serial
:
$(COBJ)
$(
CC
)
-o
w-stackingCfftw_serial
$(
CFLAGS
)
$^
-lm
$(
CC
)
$(
OMP
)
-o
w-stackingCfftw_serial
$(
CFLAGS
)
$^
-lm
serial_cuda
:
serial_cuda
:
$(
NVCC
)
$(
NVFLAGS
)
-c
w-stacking.cu
$(
NVLIB
)
$(
NVCC
)
$(
NVFLAGS
)
-c
w-stacking.cu
$(
NVLIB
)
$(
CC
)
$(
CFLAGS
)
$(
OPT
)
-c
w-stacking-fftw.c
$(
CC
)
$(
CFLAGS
)
$(
OPT
)
-c
w-stacking-fftw.c
phase_correction.c
$(
CXX
)
$(
CFLAGS
)
$(
OPT
)
-o
w-stackingfftw_serial w-stacking-fftw.o w-stacking.o
$(
NVLIB
)
-lm
$(
CXX
)
$(
CFLAGS
)
$(
OPT
)
-o
w-stackingfftw_serial w-stacking-fftw.o w-stacking.o
phase_correction.o
$(
NVLIB
)
-lm
mpi
:
$(COBJ)
mpi
:
$(COBJ)
$(
MPICC
)
-o
w-stackingCfftw
$(
CFLAGS
)
$^
$(
LIBS
)
$(
MPICC
)
$(
OMP
)
-o
w-stackingCfftw
$(
CFLAGS
)
$^
$(
LIBS
)
mpi_cuda
:
mpi_cuda
:
$(
NVCC
)
$(
NVFLAGS
)
-c
w-stacking.cu
$(
NVLIB
)
$(
NVCC
)
$(
NVFLAGS
)
-c
w-stacking.cu
$(
NVLIB
)
$(
MPICC
)
$(
CFLAGS
)
$(
OPT
)
-c
w-stacking-fftw.c
$(
MPICC
)
$(
CFLAGS
)
$(
OPT
)
-c
w-stacking-fftw.c
phase_correction.c
$(
MPICXX
)
$(
CFLAGS
)
$(
OPT
)
-o
w-stackingfftw w-stacking-fftw.o w-stacking.o
$(
NVLIB
)
$(
LIBS
)
-lm
$(
MPICXX
)
$(
CFLAGS
)
$(
OPT
)
-o
w-stackingfftw w-stacking-fftw.o w-stacking.o
phase_correction.o
$(
NVLIB
)
$(
LIBS
)
-lm
clean
:
clean
:
rm
*
.o
rm
*
.o
rm
w-stacking.c
rm
w-stacking.c
rm
phase_correction.c
This diff is collapsed.
Click to expand it.
phase_correction.cu
0 → 100644
+
30
−
0
View file @
9acc1346
#ifdef _OPENMP
#include
<omp.h>
#endif
#include
"w-stacking.h"
#include
<math.h>
#include
<stdlib.h>
#include
<stdio.h>
#define NWORKERS -1 //100
#define NTHREADS 32
#ifdef __CUDACC__
#endif
void
phase_correction
(
double
*
gridss
,
double
*
image_real
,
double
*
image_imag
,
int
xaxis
,
int
yaxis
,
int
num_w_planes
)
{
for
(
int
iw
=
0
;
iw
<
num_w_planes
;
iw
++
)
{
for
(
int
iv
=
0
;
iw
<
yaxis
;
iv
++
)
for
(
int
iu
=
0
;
iu
<
xaxis
;
iu
++
)
{
long
index
=
2
*
(
iu
+
iv
*
xaxis
+
xaxis
*
yaxis
*
iw
);
long
img_index
=
iu
+
iv
*
xaxis
;
image_real
[
img_index
]
+=
gridss
[
index
];
image_imag
[
img_index
]
+=
gridss
[
index
];
}
}
}
This diff is collapsed.
Click to expand it.
w-stacking-fftw.c
+
50
−
2
View file @
9acc1346
...
@@ -99,7 +99,7 @@ int main(int argc, char * argv[])
...
@@ -99,7 +99,7 @@ int main(int argc, char * argv[])
int
local_grid_size_y
;
// = 100;
int
local_grid_size_y
;
// = 100;
int
xaxis
;
int
xaxis
;
int
yaxis
;
int
yaxis
;
int
num_w_planes
=
1
;
int
num_w_planes
=
1
0
;
// DAV: the corresponding KernelLen is calculated within the wstack function. It can be anyway hardcoded for optimization
// DAV: the corresponding KernelLen is calculated within the wstack function. It can be anyway hardcoded for optimization
int
w_support
=
7
;
int
w_support
=
7
;
int
num_threads
;
// = 4;
int
num_threads
;
// = 4;
...
@@ -151,7 +151,7 @@ int main(int argc, char * argv[])
...
@@ -151,7 +151,7 @@ int main(int argc, char * argv[])
start
=
clock
();
start
=
clock
();
// CLAAAAAA
// CLAAAAAA
int
ndatasets
=
2
;
int
ndatasets
=
1
;
strcpy
(
datapath_multi
[
0
],
"/m100_scratch/userexternal/cgheller/gridding/Lofar/L798046_SB244_uv.uncorr_130B27932t_146MHz.pre-cal.binMS/"
);
strcpy
(
datapath_multi
[
0
],
"/m100_scratch/userexternal/cgheller/gridding/Lofar/L798046_SB244_uv.uncorr_130B27932t_146MHz.pre-cal.binMS/"
);
strcpy
(
datapath_multi
[
1
],
"/m100_scratch/userexternal/cgheller/gridding/Lofar/L798046_SB244_uv.uncorr_130B27932t_134MHz.pre-cal.binMS/"
);
strcpy
(
datapath_multi
[
1
],
"/m100_scratch/userexternal/cgheller/gridding/Lofar/L798046_SB244_uv.uncorr_130B27932t_134MHz.pre-cal.binMS/"
);
...
@@ -821,6 +821,54 @@ int main(int argc, char * argv[])
...
@@ -821,6 +821,54 @@ int main(int argc, char * argv[])
fftw_free
(
fftwgrid
);
fftw_free
(
fftwgrid
);
// Phase correction
if
(
rank
==
0
)
printf
(
"PHASE CORRECTION
\n
"
);
double
*
image_real
=
(
double
*
)
calloc
(
xaxis
*
yaxis
,
sizeof
(
double
));
double
*
image_imag
=
(
double
*
)
calloc
(
xaxis
*
yaxis
,
sizeof
(
double
));
phase_correction
(
gridss
,
image_real
,
image_imag
,
xaxis
,
yaxis
,
num_w_planes
);
#ifdef WRITE_IMAGE
if
(
rank
==
0
)
{
pFilereal
=
fopen
(
fftfile2
,
"wb"
);
pFileimg
=
fopen
(
fftfile3
,
"wb"
);
fclose
(
pFilereal
);
fclose
(
pFileimg
);
}
#ifdef USE_MPI
MPI_Barrier
(
MPI_COMM_WORLD
);
#endif
if
(
rank
==
0
)
printf
(
"WRITING IMAGE
\n
"
);
for
(
int
isector
=
0
;
isector
<
size
;
isector
++
)
{
#ifdef USE_MPI
MPI_Barrier
(
MPI_COMM_WORLD
);
#endif
if
(
isector
==
rank
)
{
printf
(
"%d writing
\n
"
,
isector
);
pFilereal
=
fopen
(
fftfile2
,
"ab"
);
pFileimg
=
fopen
(
fftfile3
,
"ab"
);
long
global_index
=
isector
*
(
xaxis
*
yaxis
)
*
sizeof
(
double
);
fseek
(
pFilereal
,
global_index
,
SEEK_SET
);
fwrite
(
image_real
,
xaxis
*
yaxis
,
sizeof
(
double
),
pFilereal
);
fseek
(
pFileimg
,
global_index
,
SEEK_SET
);
fwrite
(
image_imag
,
xaxis
*
yaxis
,
sizeof
(
double
),
pFileimg
);
fclose
(
pFilereal
);
fclose
(
pFileimg
);
}
}
#ifdef USE_MPI
MPI_Barrier
(
MPI_COMM_WORLD
);
#endif
#endif //WRITE_IMAGE
#endif //USE_FFTW
#endif //USE_FFTW
end
=
clock
();
end
=
clock
();
...
...
This diff is collapsed.
Click to expand it.
w-stacking.h
+
12
−
0
View file @
9acc1346
...
@@ -24,9 +24,21 @@ void wstack(
...
@@ -24,9 +24,21 @@ void wstack(
int
,
int
,
double
*
,
double
*
,
int
);
int
);
#ifdef __CUDACC__
#ifdef __CUDACC__
extern
"C"
extern
"C"
#endif
#endif
int
test
(
int
nnn
);
int
test
(
int
nnn
);
#ifdef __CUDACC__
extern
"C"
#endif
void
phase_correction
(
double
*
,
double
*
,
double
*
,
int
,
int
,
int
);
#endif
#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