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
26b99d75
Commit
26b99d75
authored
8 years ago
by
Peter W. Draper
Browse files
Options
Downloads
Patches
Plain Diff
Formatting
parent
02a50a86
Branches
Branches containing commit
Tags
Tags containing commit
1 merge request
!290
Only repartition when required
This commit is part of merge request
!290
. Comments created here will be created in the context of that merge request.
Changes
5
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
examples/main.c
+3
-4
3 additions, 4 deletions
examples/main.c
src/clocks.c
+3
-3
3 additions, 3 deletions
src/clocks.c
src/clocks.h
+1
-2
1 addition, 2 deletions
src/clocks.h
src/engine.c
+1
-1
1 addition, 1 deletion
src/engine.c
src/partition.c
+4
-4
4 additions, 4 deletions
src/partition.c
with
12 additions
and
14 deletions
examples/main.c
+
3
−
4
Edit
View file @
26b99d75
...
...
@@ -322,7 +322,7 @@ int main(int argc, char *argv[]) {
MPI_Bcast
(
params
,
sizeof
(
struct
swift_params
),
MPI_BYTE
,
0
,
MPI_COMM_WORLD
);
#endif
/* Prepare the domain decomposition scheme */
/* Prepare the domain decomposition scheme */
struct
repartition
repartition
;
#ifdef WITH_MPI
struct
partition
initial_partition
;
...
...
@@ -489,9 +489,8 @@ int main(int argc, char *argv[]) {
if
(
myrank
==
0
)
clocks_gettime
(
&
tic
);
struct
engine
e
;
engine_init
(
&
e
,
&
s
,
params
,
nr_nodes
,
myrank
,
nr_threads
,
N_total
[
0
],
N_total
[
1
],
with_aff
,
engine_policies
,
talking
,
&
us
,
&
prog_const
,
&
hydro_properties
,
&
potential
,
&
cooling_func
,
&
sourceterms
);
N_total
[
1
],
with_aff
,
engine_policies
,
talking
,
&
us
,
&
prog_const
,
&
hydro_properties
,
&
potential
,
&
cooling_func
,
&
sourceterms
);
if
(
myrank
==
0
)
{
clocks_gettime
(
&
toc
);
message
(
"engine_init took %.3f %s."
,
clocks_diff
(
&
tic
,
&
toc
),
...
...
This diff is collapsed.
Click to expand it.
src/clocks.c
+
3
−
3
Edit
View file @
26b99d75
...
...
@@ -259,7 +259,7 @@ const char *clocks_get_timesincestart() {
*/
double
clocks_get_cputime_used
()
{
struct
tms
tmstic
;
times
(
&
tmstic
);
return
(
double
)(
tmstic
.
tms_utime
+
tmstic
.
tms_cutime
);
struct
tms
tmstic
;
times
(
&
tmstic
);
return
(
double
)(
tmstic
.
tms_utime
+
tmstic
.
tms_cutime
);
}
This diff is collapsed.
Click to expand it.
src/clocks.h
+
1
−
2
Edit
View file @
26b99d75
...
...
@@ -19,8 +19,8 @@
#ifndef SWIFT_CLOCKS_H
#define SWIFT_CLOCKS_H
#include
<time.h>
#include
<sys/times.h>
#include
<time.h>
#include
"cycle.h"
/* Struct to record a time for the clocks functions. */
...
...
@@ -44,5 +44,4 @@ const char *clocks_get_timesincestart();
double
clocks_get_cputime_used
();
#endif
/* SWIFT_CLOCKS_H */
This diff is collapsed.
Click to expand it.
src/engine.c
+
1
−
1
Edit
View file @
26b99d75
...
...
@@ -3277,7 +3277,7 @@ void engine_init(struct engine *e, struct space *s,
fprintf
(
e
->
file_timesteps
,
"# %6s %14s %14s %10s %10s %16s [%s]
\n
"
,
"Step"
,
"Time"
,
"Time-step"
,
"Updates"
,
"g-Updates"
,
"Wall-clock time"
,
clocks_getunit
());
clocks_getunit
());
fflush
(
e
->
file_timesteps
);
}
...
...
This diff is collapsed.
Click to expand it.
src/partition.c
+
4
−
4
Edit
View file @
26b99d75
...
...
@@ -722,8 +722,7 @@ void partition_repartition(enum repartition_type reparttype, int nodeID,
#if defined(WITH_MPI) && defined(HAVE_METIS)
if
(
reparttype
==
REPART_METIS_BOTH
||
reparttype
==
REPART_METIS_EDGE
||
if
(
reparttype
==
REPART_METIS_BOTH
||
reparttype
==
REPART_METIS_EDGE
||
reparttype
==
REPART_METIS_VERTEX_EDGE
)
{
int
partweights
;
...
...
@@ -1006,9 +1005,10 @@ void partition_init(struct partition *partition,
/* Get the fraction time difference between nodes. If larger than
* this when a repartition is being considered it will be allowed. */
repartition
->
fractionaltime
=
parser_get_opt_param_float
(
params
,
"DomainDecomposition:fractionaltime"
,
0
.
1
);
params
,
"DomainDecomposition:fractionaltime"
,
0
.
1
);
if
(
repartition
->
fractionaltime
<
0
||
repartition
->
fractionaltime
>
1
)
error
(
"Invalid DomainDecomposition:fractionaltime, must be in range 0 to 1"
);
error
(
"Invalid DomainDecomposition:fractionaltime, must be in range 0 to 1"
);
#else
error
(
"SWIFT was not compiled with MPI support"
);
...
...
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