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
ae21e481
Commit
ae21e481
authored
8 years ago
by
Matthieu Schaller
Browse files
Options
Downloads
Patches
Plain Diff
No need to discard particles any more. This is done at reading time.
parent
3f70533d
No related branches found
No related tags found
2 merge requests
!310
Star particles and gparts links over MPI
,
!304
Star particle infrastructure
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
examples/main.c
+4
-16
4 additions, 16 deletions
examples/main.c
src/single_io.c
+4
-2
4 additions, 2 deletions
src/single_io.c
with
8 additions
and
18 deletions
examples/main.c
+
4
−
16
View file @
ae21e481
...
...
@@ -404,30 +404,18 @@ int main(int argc, char *argv[]) {
fflush
(
stdout
);
}
/* Discard gparts if we don't have gravity
* (Better implementation of i/o will come)*/
if
(
!
with_external_gravity
&&
!
with_self_gravity
)
{
free
(
gparts
);
gparts
=
NULL
;
for
(
size_t
k
=
0
;
k
<
Ngas
;
++
k
)
parts
[
k
].
gpart
=
NULL
;
for
(
size_t
k
=
0
;
k
<
Nspart
;
++
k
)
sparts
[
k
].
gpart
=
NULL
;
Ngpart
=
0
;
}
#ifdef SWIFT_DEBUG_CHECKS
/* Check once and for all that we don't have unwanted links */
if
(
!
with_stars
)
{
free
(
sparts
);
sparts
=
NULL
;
for
(
size_t
k
=
0
;
k
<
Ngpart
;
++
k
)
if
(
gparts
[
k
].
type
==
swift_type_star
)
error
(
"Linking problem"
);
Nspart
=
0
;
}
if
(
!
with_hydro
)
{
free
(
parts
);
parts
=
NULL
;
for
(
size_t
k
=
0
;
k
<
Ngpart
;
++
k
)
if
(
gparts
[
k
].
type
==
swift_type_gas
)
error
(
"Linking problem"
);
Ngas
=
0
;
}
#endif
/* Get the total number of particles across all nodes. */
long
long
N_total
[
3
]
=
{
0
,
0
,
0
};
#if defined(WITH_MPI)
...
...
This diff is collapsed.
Click to expand it.
src/single_io.c
+
4
−
2
View file @
ae21e481
...
...
@@ -321,8 +321,10 @@ void writeArray(struct engine* e, hid_t grp, char* fileName, FILE* xmfFile,
* @param Nstars (output) The number of #spart read.
* @param periodic (output) 1 if the volume is periodic, 0 if not.
* @param flag_entropy (output) 1 if the ICs contained Entropy in the
* InternalEnergy
* field
* InternalEnergy field
* @param with_hydro Are we reading gas particles ?
* @param with_hydro Are we reading/creating #gpart arrays ?
* @param with_stars Are we reading star particles ?
* @param dry_run If 1, don't read the particle. Only allocates the arrays.
*
* Opens the HDF5 file fileName and reads the particles contained
...
...
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