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
a1f2133c
Commit
a1f2133c
authored
8 years ago
by
Matthieu Schaller
Browse files
Options
Downloads
Patches
Plain Diff
Added multipole communication tasks.
parent
3aec2f61
No related branches found
No related tags found
No related merge requests found
Changes
6
Hide whitespace changes
Inline
Side-by-side
Showing
6 changed files
src/part.c
+7
-0
7 additions, 0 deletions
src/part.c
src/part.h
+1
-0
1 addition, 0 deletions
src/part.h
src/runner.c
+2
-0
2 additions, 0 deletions
src/runner.c
src/scheduler.c
+6
-0
6 additions, 0 deletions
src/scheduler.c
src/task.c
+3
-2
3 additions, 2 deletions
src/task.c
src/task.h
+1
-0
1 addition, 0 deletions
src/task.h
with
20 additions
and
2 deletions
src/part.c
+
7
−
0
View file @
a1f2133c
...
@@ -27,6 +27,7 @@
...
@@ -27,6 +27,7 @@
/* This object's header. */
/* This object's header. */
#include
"error.h"
#include
"error.h"
#include
"multipole.h"
#include
"part.h"
#include
"part.h"
/**
/**
...
@@ -233,6 +234,7 @@ MPI_Datatype part_mpi_type;
...
@@ -233,6 +234,7 @@ MPI_Datatype part_mpi_type;
MPI_Datatype
xpart_mpi_type
;
MPI_Datatype
xpart_mpi_type
;
MPI_Datatype
gpart_mpi_type
;
MPI_Datatype
gpart_mpi_type
;
MPI_Datatype
spart_mpi_type
;
MPI_Datatype
spart_mpi_type
;
MPI_Datatype
multipole_mpi_type
;
/**
/**
* @brief Registers MPI particle types.
* @brief Registers MPI particle types.
...
@@ -265,5 +267,10 @@ void part_create_mpi_types() {
...
@@ -265,5 +267,10 @@ void part_create_mpi_types() {
MPI_Type_commit
(
&
spart_mpi_type
)
!=
MPI_SUCCESS
)
{
MPI_Type_commit
(
&
spart_mpi_type
)
!=
MPI_SUCCESS
)
{
error
(
"Failed to create MPI type for sparts."
);
error
(
"Failed to create MPI type for sparts."
);
}
}
if
(
MPI_Type_contiguous
(
sizeof
(
struct
multipole
)
/
sizeof
(
unsigned
char
),
MPI_BYTE
,
&
multipole_mpi_type
)
!=
MPI_SUCCESS
||
MPI_Type_commit
(
&
multipole_mpi_type
)
!=
MPI_SUCCESS
)
{
error
(
"Failed to create MPI type for multipole."
);
}
}
}
#endif
#endif
This diff is collapsed.
Click to expand it.
src/part.h
+
1
−
0
View file @
a1f2133c
...
@@ -86,6 +86,7 @@ extern MPI_Datatype part_mpi_type;
...
@@ -86,6 +86,7 @@ extern MPI_Datatype part_mpi_type;
extern
MPI_Datatype
xpart_mpi_type
;
extern
MPI_Datatype
xpart_mpi_type
;
extern
MPI_Datatype
gpart_mpi_type
;
extern
MPI_Datatype
gpart_mpi_type
;
extern
MPI_Datatype
spart_mpi_type
;
extern
MPI_Datatype
spart_mpi_type
;
extern
MPI_Datatype
multipole_mpi_type
;
void
part_create_mpi_types
();
void
part_create_mpi_types
();
#endif
#endif
...
...
This diff is collapsed.
Click to expand it.
src/runner.c
+
2
−
0
View file @
a1f2133c
...
@@ -1786,6 +1786,8 @@ void *runner_main(void *data) {
...
@@ -1786,6 +1786,8 @@ void *runner_main(void *data) {
runner_do_recv_gpart
(
r
,
ci
,
1
);
runner_do_recv_gpart
(
r
,
ci
,
1
);
}
else
if
(
t
->
subtype
==
task_subtype_spart
)
{
}
else
if
(
t
->
subtype
==
task_subtype_spart
)
{
runner_do_recv_spart
(
r
,
ci
,
1
);
runner_do_recv_spart
(
r
,
ci
,
1
);
}
else
if
(
t
->
subtype
==
task_subtype_multipole
)
{
ci
->
ti_old_multipole
=
e
->
ti_current
;
}
else
{
}
else
{
error
(
"Unknown/invalid task subtype (%d)."
,
t
->
subtype
);
error
(
"Unknown/invalid task subtype (%d)."
,
t
->
subtype
);
}
}
...
...
This diff is collapsed.
Click to expand it.
src/scheduler.c
+
6
−
0
View file @
a1f2133c
...
@@ -1220,6 +1220,9 @@ void scheduler_enqueue(struct scheduler *s, struct task *t) {
...
@@ -1220,6 +1220,9 @@ void scheduler_enqueue(struct scheduler *s, struct task *t) {
}
else
if
(
t
->
subtype
==
task_subtype_spart
)
{
}
else
if
(
t
->
subtype
==
task_subtype_spart
)
{
err
=
MPI_Irecv
(
t
->
ci
->
sparts
,
t
->
ci
->
scount
,
spart_mpi_type
,
err
=
MPI_Irecv
(
t
->
ci
->
sparts
,
t
->
ci
->
scount
,
spart_mpi_type
,
t
->
ci
->
nodeID
,
t
->
flags
,
MPI_COMM_WORLD
,
&
t
->
req
);
t
->
ci
->
nodeID
,
t
->
flags
,
MPI_COMM_WORLD
,
&
t
->
req
);
}
else
if
(
t
->
subtype
==
task_subtype_multipole
)
{
err
=
MPI_Irecv
(
t
->
ci
->
multipole
,
1
,
multipole_mpi_type
,
t
->
ci
->
nodeID
,
t
->
flags
,
MPI_COMM_WORLD
,
&
t
->
req
);
}
else
{
}
else
{
error
(
"Unknown communication sub-type"
);
error
(
"Unknown communication sub-type"
);
}
}
...
@@ -1257,6 +1260,9 @@ void scheduler_enqueue(struct scheduler *s, struct task *t) {
...
@@ -1257,6 +1260,9 @@ void scheduler_enqueue(struct scheduler *s, struct task *t) {
}
else
if
(
t
->
subtype
==
task_subtype_spart
)
{
}
else
if
(
t
->
subtype
==
task_subtype_spart
)
{
err
=
MPI_Isend
(
t
->
ci
->
sparts
,
t
->
ci
->
scount
,
spart_mpi_type
,
err
=
MPI_Isend
(
t
->
ci
->
sparts
,
t
->
ci
->
scount
,
spart_mpi_type
,
t
->
cj
->
nodeID
,
t
->
flags
,
MPI_COMM_WORLD
,
&
t
->
req
);
t
->
cj
->
nodeID
,
t
->
flags
,
MPI_COMM_WORLD
,
&
t
->
req
);
}
else
if
(
t
->
subtype
==
task_subtype_multipole
)
{
err
=
MPI_Isend
(
t
->
ci
->
multipole
,
1
,
multipole_mpi_type
,
t
->
cj
->
nodeID
,
t
->
flags
,
MPI_COMM_WORLD
,
&
t
->
req
);
}
else
{
}
else
{
error
(
"Unknown communication sub-type"
);
error
(
"Unknown communication sub-type"
);
}
}
...
...
This diff is collapsed.
Click to expand it.
src/task.c
+
3
−
2
View file @
a1f2133c
...
@@ -69,9 +69,10 @@ const char *taskID_names[task_type_count] = {"none",
...
@@ -69,9 +69,10 @@ const char *taskID_names[task_type_count] = {"none",
"cooling"
,
"cooling"
,
"sourceterms"
};
"sourceterms"
};
/* Sub-task type names. */
const
char
*
subtaskID_names
[
task_subtype_count
]
=
{
const
char
*
subtaskID_names
[
task_subtype_count
]
=
{
"none"
,
"density"
,
"gradient"
,
"force"
,
"grav"
,
"external_grav"
,
"none"
,
"density"
,
"gradient"
,
"force"
,
"grav"
,
"external_grav"
,
"tend"
,
"xv"
,
"rho"
,
"gpart"
,
"spart"
};
"tend"
,
"xv"
,
"rho"
,
"gpart"
,
"multipole"
,
"spart"
};
/**
/**
* @brief Computes the overlap between the parts array of two given cells.
* @brief Computes the overlap between the parts array of two given cells.
...
...
This diff is collapsed.
Click to expand it.
src/task.h
+
1
−
0
View file @
a1f2133c
...
@@ -74,6 +74,7 @@ enum task_subtypes {
...
@@ -74,6 +74,7 @@ enum task_subtypes {
task_subtype_xv
,
task_subtype_xv
,
task_subtype_rho
,
task_subtype_rho
,
task_subtype_gpart
,
task_subtype_gpart
,
task_subtype_multipole
,
task_subtype_spart
,
task_subtype_spart
,
task_subtype_count
task_subtype_count
}
__attribute__
((
packed
));
}
__attribute__
((
packed
));
...
...
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