Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
SWIFTsim
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Deploy
Releases
Model registry
Monitor
Incidents
Analyze
Value stream analytics
Contributor 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
SWIFT
SWIFTsim
Commits
aa3fc5f1
Commit
aa3fc5f1
authored
7 years ago
by
Matthieu Schaller
Browse files
Options
Downloads
Patches
Plain Diff
Use e->snapshotOutputCount everywhere and not the static variable anymore.
parent
3f4324e6
No related branches found
No related tags found
1 merge request
!497
Parallel io improvements
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
src/parallel_io.c
+5
-8
5 additions, 8 deletions
src/parallel_io.c
with
5 additions
and
8 deletions
src/parallel_io.c
+
5
−
8
View file @
aa3fc5f1
...
...
@@ -808,8 +808,7 @@ void read_ic_parallel(char* fileName, const struct unit_system* internal_units,
H5Fclose
(
h_file
);
}
void
prepare_file
(
struct
engine
*
e
,
const
char
*
baseName
,
int
outputCount
,
long
long
N_total
[
6
],
void
prepare_file
(
struct
engine
*
e
,
const
char
*
baseName
,
long
long
N_total
[
6
],
const
struct
unit_system
*
internal_units
,
const
struct
unit_system
*
snapshot_units
)
{
...
...
@@ -821,7 +820,7 @@ void prepare_file(struct engine* e, const char* baseName, int outputCount,
int
numFiles
=
1
;
/* First time, we need to create the XMF file */
if
(
o
utputCount
==
0
)
xmf_create_file
(
baseName
);
if
(
e
->
snapshotO
utputCount
==
0
)
xmf_create_file
(
baseName
);
/* Prepare the XMF file for the new entry */
xmfFile
=
xmf_prepare_file
(
baseName
);
...
...
@@ -987,7 +986,7 @@ void prepare_file(struct engine* e, const char* baseName, int outputCount,
}
/* Write LXMF file descriptor */
xmf_write_outputfooter
(
xmfFile
,
o
utputCount
,
e
->
time
);
xmf_write_outputfooter
(
xmfFile
,
e
->
snapshotO
utputCount
,
e
->
time
);
/* Close the file for now */
H5Fclose
(
h_file
);
...
...
@@ -1027,7 +1026,6 @@ void write_output_parallel(struct engine* e, const char* baseName,
struct
gpart
*
gparts
=
e
->
s
->
gparts
;
struct
gpart
*
dmparts
=
NULL
;
struct
spart
*
sparts
=
e
->
s
->
sparts
;
static
int
outputCount
=
0
;
/* Number of unassociated gparts */
const
size_t
Ndm
=
Ntot
>
0
?
Ntot
-
(
Ngas
+
Nstars
)
:
0
;
...
...
@@ -1053,8 +1051,7 @@ void write_output_parallel(struct engine* e, const char* baseName,
/* Rank 0 prepares the file */
if
(
mpi_rank
==
0
)
prepare_file
(
e
,
baseName
,
outputCount
,
N_total
,
internal_units
,
snapshot_units
);
prepare_file
(
e
,
baseName
,
N_total
,
internal_units
,
snapshot_units
);
MPI_Barrier
(
MPI_COMM_WORLD
);
...
...
@@ -1069,7 +1066,7 @@ void write_output_parallel(struct engine* e, const char* baseName,
/* HDF5 File name */
char
fileName
[
FILENAME_BUFFER_SIZE
];
snprintf
(
fileName
,
FILENAME_BUFFER_SIZE
,
"%s_%04i.hdf5"
,
baseName
,
o
utputCount
);
e
->
snapshotO
utputCount
);
/* Prepare some file-access properties */
hid_t
plist_id
=
H5Pcreate
(
H5P_FILE_ACCESS
);
...
...
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