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
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Claudio Gheller
HPC_Imaging
Commits
99500eb4
Commit
99500eb4
authored
2 years ago
by
Emanuele De Rubeis
Browse files
Options
Downloads
Patches
Plain Diff
Full working parallel fits writing with CFITSIO
parent
736c2f2a
No related branches found
No related tags found
1 merge request
!3
CFITSIO and parallel images writing implementation
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
w-stacking-fftw.c
+45
-6
45 additions, 6 deletions
w-stacking-fftw.c
with
45 additions
and
6 deletions
w-stacking-fftw.c
+
45
−
6
View file @
99500eb4
...
...
@@ -986,13 +986,52 @@ if(rank == 0){
long
*
fpixel
=
(
long
*
)
malloc
(
sizeof
(
long
)
*
naxis
);
long
*
lpixel
=
(
long
*
)
malloc
(
sizeof
(
long
)
*
naxis
);
#ifdef USE_MPI
MPI_Barrier
(
MPI_COMM_WORLD
);
#endif
#ifdef PARALLEL_FITS
#ifdef FITSIO
fpixel
[
0
]
=
1
;
fpixel
[
1
]
=
rank
*
yaxis
+
1
;
lpixel
[
0
]
=
xaxis
;
lpixel
[
1
]
=
(
rank
+
1
)
*
yaxis
;
status
=
0
;
fits_open_image
(
&
fptreal
,
testfitsreal
,
READWRITE
,
&
status
);
fits_write_subset
(
fptreal
,
TDOUBLE
,
fpixel
,
lpixel
,
image_real
,
&
status
);
fits_close_file
(
fptreal
,
&
status
);
status
=
0
;
fits_open_image
(
&
fptrimg
,
testfitsimag
,
READWRITE
,
&
status
);
fits_write_subset
(
fptrimg
,
TDOUBLE
,
fpixel
,
lpixel
,
image_imag
,
&
status
);
fits_close_file
(
fptrimg
,
&
status
);
#endif
pFilereal
=
fopen
(
fftfile2
,
"ab"
);
pFileimg
=
fopen
(
fftfile3
,
"ab"
);
long
global_index
=
rank
*
(
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
#else
for
(
int
isector
=
0
;
isector
<
size
;
isector
++
)
{
#ifdef USE_MPI
MPI_Barrier
(
MPI_COMM_WORLD
);
#endif
if
(
isector
==
rank
)
//if(rank == 0)
{
#ifdef FITSIO
...
...
@@ -1004,8 +1043,6 @@ if(rank == 0){
fpixel
[
1
]
=
isector
*
yaxis
+
1
;
lpixel
[
0
]
=
xaxis
;
lpixel
[
1
]
=
(
isector
+
1
)
*
yaxis
;
//printf("fpixel %d, %d\n", fpixel[0], fpixel[1]);
//printf("lpixel %d, %d\n", lpixel[0], lpixel[1]);
status
=
0
;
fits_open_image
(
&
fptreal
,
testfitsreal
,
READWRITE
,
&
status
);
...
...
@@ -1033,10 +1070,12 @@ if(rank == 0){
fclose
(
pFileimg
);
}
}
#endif
#ifdef USE_MPI
MPI_Barrier
(
MPI_COMM_WORLD
);
#endif
#endif //WRITE_IMAGE
...
...
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