Skip to content
GitLab
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
SWIFT
SWIFTsim
Commits
a1f2133c
Commit
a1f2133c
authored
Feb 25, 2017
by
Matthieu Schaller
Browse files
Added multipole communication tasks.
parent
3aec2f61
Changes
6
Hide whitespace changes
Inline
Side-by-side
src/part.c
View file @
a1f2133c
...
...
@@ -27,6 +27,7 @@
/* This object's header. */
#include
"error.h"
#include
"multipole.h"
#include
"part.h"
/**
...
...
@@ -233,6 +234,7 @@ MPI_Datatype part_mpi_type;
MPI_Datatype
xpart_mpi_type
;
MPI_Datatype
gpart_mpi_type
;
MPI_Datatype
spart_mpi_type
;
MPI_Datatype
multipole_mpi_type
;
/**
* @brief Registers MPI particle types.
...
...
@@ -265,5 +267,10 @@ void part_create_mpi_types() {
MPI_Type_commit
(
&
spart_mpi_type
)
!=
MPI_SUCCESS
)
{
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
src/part.h
View file @
a1f2133c
...
...
@@ -86,6 +86,7 @@ extern MPI_Datatype part_mpi_type;
extern
MPI_Datatype
xpart_mpi_type
;
extern
MPI_Datatype
gpart_mpi_type
;
extern
MPI_Datatype
spart_mpi_type
;
extern
MPI_Datatype
multipole_mpi_type
;
void
part_create_mpi_types
();
#endif
...
...
src/runner.c
View file @
a1f2133c
...
...
@@ -1786,6 +1786,8 @@ void *runner_main(void *data) {
runner_do_recv_gpart
(
r
,
ci
,
1
);
}
else
if
(
t
->
subtype
==
task_subtype_spart
)
{
runner_do_recv_spart
(
r
,
ci
,
1
);
}
else
if
(
t
->
subtype
==
task_subtype_multipole
)
{
ci
->
ti_old_multipole
=
e
->
ti_current
;
}
else
{
error
(
"Unknown/invalid task subtype (%d)."
,
t
->
subtype
);
}
...
...
src/scheduler.c
View file @
a1f2133c
...
...
@@ -1220,6 +1220,9 @@ void scheduler_enqueue(struct scheduler *s, struct task *t) {
}
else
if
(
t
->
subtype
==
task_subtype_spart
)
{
err
=
MPI_Irecv
(
t
->
ci
->
sparts
,
t
->
ci
->
scount
,
spart_mpi_type
,
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
{
error
(
"Unknown communication sub-type"
);
}
...
...
@@ -1257,6 +1260,9 @@ void scheduler_enqueue(struct scheduler *s, struct task *t) {
}
else
if
(
t
->
subtype
==
task_subtype_spart
)
{
err
=
MPI_Isend
(
t
->
ci
->
sparts
,
t
->
ci
->
scount
,
spart_mpi_type
,
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
{
error
(
"Unknown communication sub-type"
);
}
...
...
src/task.c
View file @
a1f2133c
...
...
@@ -69,9 +69,10 @@ const char *taskID_names[task_type_count] = {"none",
"cooling"
,
"sourceterms"
};
/* Sub-task type names. */
const
char
*
subtaskID_names
[
task_subtype_count
]
=
{
"none"
,
"density"
,
"gradient"
,
"force"
,
"grav"
,
"external_grav"
,
"tend"
,
"xv"
,
"rho"
,
"gpart"
,
"spart"
};
"none"
,
"density"
,
"gradient"
,
"force"
,
"grav"
,
"external_grav"
,
"tend"
,
"xv"
,
"rho"
,
"gpart"
,
"multipole"
,
"spart"
};
/**
* @brief Computes the overlap between the parts array of two given cells.
...
...
src/task.h
View file @
a1f2133c
...
...
@@ -74,6 +74,7 @@ enum task_subtypes {
task_subtype_xv
,
task_subtype_rho
,
task_subtype_gpart
,
task_subtype_multipole
,
task_subtype_spart
,
task_subtype_count
}
__attribute__
((
packed
));
...
...
Write
Preview
Supports
Markdown
0%
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!
Cancel
Please
register
or
sign in
to comment