Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
fmpi
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Deploy
Releases
Model registry
Analyze
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
raphael.bach
fmpi
Commits
3a4ec19c
Verified
Commit
3a4ec19c
authored
2 years ago
by
raphael.bach
Browse files
Options
Downloads
Patches
Plain Diff
Add `fmpi_domain_set_inner()`
parent
0f013a72
No related branches found
No related tags found
No related merge requests found
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
include/fmpi_domain.h
+7
-0
7 additions, 0 deletions
include/fmpi_domain.h
src/fmpi_domain.c
+13
-0
13 additions, 0 deletions
src/fmpi_domain.c
src/fmpi_task.c
+5
-10
5 additions, 10 deletions
src/fmpi_task.c
with
25 additions
and
10 deletions
include/fmpi_domain.h
+
7
−
0
View file @
3a4ec19c
...
@@ -58,6 +58,13 @@ struct fmpi_domain fmpi_new_domain(
...
@@ -58,6 +58,13 @@ struct fmpi_domain fmpi_new_domain(
const
struct
fmpi_ctx
*
ctx
,
const
struct
fmpi_data
*
data
,
const
struct
fmpi_ctx
*
ctx
,
const
struct
fmpi_data
*
data
,
struct
fmpi_stencil
stencil
struct
fmpi_stencil
stencil
);
);
/*------------------------------------------------------------------------------
fmpi_domain_set_inner()
------------------------------------------------------------------------------*/
void
fmpi_domain_set_inner
(
const
struct
fmpi_ctx
*
ctx
,
const
struct
fmpi_domain
*
domain
,
const
void
*
data
);
/*==============================================================================
/*==============================================================================
GUARD
GUARD
==============================================================================*/
==============================================================================*/
...
...
This diff is collapsed.
Click to expand it.
src/fmpi_domain.c
+
13
−
0
View file @
3a4ec19c
...
@@ -73,9 +73,22 @@ struct fmpi_domain fmpi_new_domain(
...
@@ -73,9 +73,22 @@ struct fmpi_domain fmpi_new_domain(
domain
.
inner
=
fmpi_partition_block_1d
(
ctx
,
data
);
domain
.
inner
=
fmpi_partition_block_1d
(
ctx
,
data
);
if
(
stencil
.
type
!=
FMPI_STENCIL_NONE
)
{
if
(
stencil
.
type
!=
FMPI_STENCIL_NONE
)
{
domain
.
halo
=
fmpi_halo_1d
(
ctx
,
domain
.
inner
,
stencil
);
domain
.
halo
=
fmpi_halo_1d
(
ctx
,
domain
.
inner
,
stencil
);
domain
.
inner
.
raw
=
(
char
*
)
domain
.
halo
.
raw
+
(
data
->
type
.
size
*
stencil
.
length
);
}
}
return
domain
;
return
domain
;
}
}
/*------------------------------------------------------------------------------
fmpi_domain_set_inner()
------------------------------------------------------------------------------*/
void
fmpi_domain_set_inner
(
const
struct
fmpi_ctx
*
const
ctx
,
const
struct
fmpi_domain
*
const
domain
,
const
void
*
const
data
){
assert
(
ctx
!=
NULL
);
assert
(
domain
!=
NULL
);
assert
(
data
!=
NULL
);
memcpy
(
domain
->
inner
.
raw
,
data
,
domain
->
inner
.
size
);
}
/*==============================================================================
/*==============================================================================
PRIVATE FUNCTION DEFINITION
PRIVATE FUNCTION DEFINITION
==============================================================================*/
==============================================================================*/
...
...
This diff is collapsed.
Click to expand it.
src/fmpi_task.c
+
5
−
10
View file @
3a4ec19c
...
@@ -116,7 +116,7 @@ int fmpi_task_run_sync(
...
@@ -116,7 +116,7 @@ int fmpi_task_run_sync(
"fmpi_futhark_get_data_sync() failed!"
"fmpi_futhark_get_data_sync() failed!"
);
);
}
}
const
int
err
=
fmpi_futhark_free_data_sync
(
int
err
=
fmpi_futhark_free_data_sync
(
ctx
->
fut
,
task
->
args
.
out
.
gpu
,
task
->
args
.
out
.
type
.
base
,
ctx
->
fut
,
task
->
args
.
out
.
gpu
,
task
->
args
.
out
.
type
.
base
,
task
->
args
.
out
.
dim_cnt
task
->
args
.
out
.
dim_cnt
);
);
...
@@ -127,16 +127,11 @@ int fmpi_task_run_sync(
...
@@ -127,16 +127,11 @@ int fmpi_task_run_sync(
}
}
}
}
if
(
task
->
stencil
.
type
!=
FMPI_STENCIL_NONE
)
{
if
(
task
->
stencil
.
type
!=
FMPI_STENCIL_NONE
)
{
const
int
rank
=
ctx
->
mpi
->
rank
;
fmpi_domain_set_inner
(
ctx
,
&
task
->
domains
[
0
],
task
->
args
.
out
.
raw
);
size_t
type_size
=
task
->
domains
[
0
].
halo
.
type
.
size
;
void
*
const
halo
=
task
->
domains
[
0
].
halo
.
raw
;
const
void
*
const
inner
=
task
->
args
.
out
.
raw
;
void
*
const
dest
=
(
rank
==
0
)
?
((
char
*
)
halo
+
type_size
)
:
halo
;
const
void
*
const
src
=
(
rank
!=
0
)
?
((
const
char
*
)
inner
-
type_size
)
:
inner
;
const
size_t
inner_size
=
task
->
domains
[
0
].
inner
.
size
;
const
size_t
size
=
(
rank
!=
(
ctx
->
mpi
->
size
-
1
))
?
(
inner_size
+
type_size
)
:
inner_size
;
memcpy
(
dest
,
src
,
size
);
const
int
rank
=
ctx
->
mpi
->
rank
;
size_t
type_size
=
task
->
domains
[
0
].
inner
.
type
.
size
;
const
size_t
idx_1
=
type_size
;
const
size_t
idx_1
=
type_size
;
const
size_t
idx_nm2
=
(
task
->
domains
[
0
].
halo
.
cnt
-
2
)
*
type_size
;
const
size_t
idx_nm2
=
(
task
->
domains
[
0
].
halo
.
cnt
-
2
)
*
type_size
;
const
size_t
idx_nm1
=
idx_nm2
+
idx_1
;
const
size_t
idx_nm1
=
idx_nm2
+
idx_1
;
...
...
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