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
f1c0f89c
Commit
f1c0f89c
authored
8 years ago
by
Matthieu Schaller
Browse files
Options
Downloads
Patches
Plain Diff
Only read star particles if the correct runtime flag is passed to the code.
parent
0a053c45
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
README
+1
-0
1 addition, 0 deletions
README
examples/main.c
+13
-4
13 additions, 4 deletions
examples/main.c
with
14 additions
and
4 deletions
README
+
1
−
0
View file @
f1c0f89c
...
...
@@ -28,6 +28,7 @@ Valid options are:
-G Run with self-gravity
-n {int} Execute a fixed number of time steps. When unset use the time_end parameter to stop.
-s Run with SPH
-S Run with stars
-t {int} The number of threads to use on each MPI rank. Defaults to 1 if not specified.
-v [12] Increase the level of verbosity
1: MPI-rank 0 writes
...
...
This diff is collapsed.
Click to expand it.
examples/main.c
+
13
−
4
View file @
f1c0f89c
...
...
@@ -83,6 +83,7 @@ void print_help_message() {
"Execute a fixed number of time steps. When unset use the time_end "
"parameter to stop."
);
printf
(
" %2s %8s %s
\n
"
,
"-s"
,
""
,
"Run with SPH"
);
printf
(
" %2s %8s %s
\n
"
,
"-S"
,
""
,
"Run with stars"
);
printf
(
" %2s %8s %s
\n
"
,
"-t"
,
"{int}"
,
"The number of threads to use on each MPI rank. Defaults to 1 if not "
"specified."
);
...
...
@@ -156,6 +157,7 @@ int main(int argc, char *argv[]) {
int
with_cooling
=
0
;
int
with_self_gravity
=
0
;
int
with_hydro
=
0
;
int
with_stars
=
0
;
int
with_fp_exceptions
=
0
;
int
with_drift_all
=
0
;
int
verbose
=
0
;
...
...
@@ -165,7 +167,7 @@ int main(int argc, char *argv[]) {
/* Parse the parameters */
int
c
;
while
((
c
=
getopt
(
argc
,
argv
,
"acCdDef:FgGhn:st:v:y:"
))
!=
-
1
)
switch
(
c
)
{
while
((
c
=
getopt
(
argc
,
argv
,
"acCdDef:FgGhn:s
S
t:v:y:"
))
!=
-
1
)
switch
(
c
)
{
case
'a'
:
with_aff
=
1
;
break
;
...
...
@@ -213,6 +215,9 @@ int main(int argc, char *argv[]) {
case
's'
:
with_hydro
=
1
;
break
;
case
'S'
:
with_stars
=
1
;
break
;
case
't'
:
if
(
sscanf
(
optarg
,
"%d"
,
&
nr_threads
)
!=
1
)
{
if
(
myrank
==
0
)
...
...
@@ -406,11 +411,17 @@ int main(int argc, char *argv[]) {
for
(
size_t
k
=
0
;
k
<
Nspart
;
++
k
)
sparts
[
k
].
gpart
=
NULL
;
Ngpart
=
0
;
}
if
(
!
with_stars
)
{
free
(
sparts
);
sparts
=
NULL
;
for
(
size_t
k
=
0
;
k
<
Nspart
;
++
k
)
if
(
gparts
[
k
].
type
==
swift_type_star
)
error
(
"Linking problem"
);
}
if
(
!
with_hydro
)
{
free
(
parts
);
parts
=
NULL
;
for
(
size_t
k
=
0
;
k
<
Ngpart
;
++
k
)
if
(
gparts
[
k
].
id_or_neg_offset
<
0
)
error
(
"Linking problem"
);
if
(
gparts
[
k
].
type
==
swift_type_gas
)
error
(
"Linking problem"
);
Ngas
=
0
;
}
...
...
@@ -536,8 +547,6 @@ int main(int argc, char *argv[]) {
return
0
;
}
engine_dump_snapshot
(
&
e
);
#ifdef WITH_MPI
/* Split the space. */
engine_split
(
&
e
,
&
initial_partition
);
...
...
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