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
3e1ae396
Verified
Commit
3e1ae396
authored
3 years ago
by
raphael.bach
Browse files
Options
Downloads
Patches
Plain Diff
Change `data` member of `struct fmpi_domain` to a pointer
parent
fe5f2420
No related branches found
No related tags found
No related merge requests found
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
include/fmpi_domain.h
+4
-2
4 additions, 2 deletions
include/fmpi_domain.h
src/fmpi_domain.c
+4
-3
4 additions, 3 deletions
src/fmpi_domain.c
with
8 additions
and
5 deletions
include/fmpi_domain.h
+
4
−
2
View file @
3e1ae396
...
@@ -42,7 +42,7 @@ struct fmpi_ctx;
...
@@ -42,7 +42,7 @@ struct fmpi_ctx;
* TODO
* TODO
*/
*/
typedef
struct
fmpi_domain
{
typedef
struct
fmpi_domain
{
struct
fmpi_data
data
;
//!< Data composing the domain.
const
struct
fmpi_data
*
data
;
//!< Data composing the domain.
struct
fmpi_data
*
parts
;
//!< Partitions of the domain after decomposition.
struct
fmpi_data
*
parts
;
//!< Partitions of the domain after decomposition.
size_t
part_cnt
;
//!< Number of partitions.
size_t
part_cnt
;
//!< Number of partitions.
}
fmpi_domain
;
}
fmpi_domain
;
...
@@ -52,7 +52,9 @@ typedef struct fmpi_domain {
...
@@ -52,7 +52,9 @@ typedef struct fmpi_domain {
/*------------------------------------------------------------------------------
/*------------------------------------------------------------------------------
fmpi_new_domain()
fmpi_new_domain()
------------------------------------------------------------------------------*/
------------------------------------------------------------------------------*/
struct
fmpi_domain
fmpi_new_domain
(
const
struct
fmpi_ctx
*
ctx
,
struct
fmpi_data
data
);
struct
fmpi_domain
fmpi_new_domain
(
const
struct
fmpi_ctx
*
ctx
,
const
struct
fmpi_data
*
data
);
/*==============================================================================
/*==============================================================================
GUARD
GUARD
==============================================================================*/
==============================================================================*/
...
...
This diff is collapsed.
Click to expand it.
src/fmpi_domain.c
+
4
−
3
View file @
3e1ae396
...
@@ -25,7 +25,8 @@
...
@@ -25,7 +25,8 @@
#include
"fmpi_domain.h"
#include
"fmpi_domain.h"
// C Standard Library
// C Standard Library
#include
<assert.h>
#include
<assert.h>
#include
<stdlib.h>
// size_t, NULL, malloc()
#include
<stdlib.h>
// size_t, NULL, malloc(), free()
#include
<string.h>
// memcpy()
// Internal
// Internal
#include
"fmpi_data.h"
#include
"fmpi_data.h"
#include
"internal/fmpi_ctx.h"
#include
"internal/fmpi_ctx.h"
...
@@ -51,7 +52,7 @@ static struct fmpi_data * fmpi_partition_block_1d(
...
@@ -51,7 +52,7 @@ static struct fmpi_data * fmpi_partition_block_1d(
fmpi_new_domain()
fmpi_new_domain()
------------------------------------------------------------------------------*/
------------------------------------------------------------------------------*/
struct
fmpi_domain
fmpi_new_domain
(
struct
fmpi_domain
fmpi_new_domain
(
const
struct
fmpi_ctx
*
const
ctx
,
const
struct
fmpi_data
data
)
const
struct
fmpi_ctx
*
const
ctx
,
const
struct
fmpi_data
*
const
data
)
{
{
assert
(
ctx
!=
NULL
);
assert
(
ctx
!=
NULL
);
const
size_t
proc_cnt
=
(
size_t
)
ctx
->
mpi
->
size
;
const
size_t
proc_cnt
=
(
size_t
)
ctx
->
mpi
->
size
;
...
@@ -60,7 +61,7 @@ struct fmpi_domain fmpi_new_domain(
...
@@ -60,7 +61,7 @@ struct fmpi_domain fmpi_new_domain(
.
parts
=
NULL
,
.
parts
=
NULL
,
.
part_cnt
=
proc_cnt
.
part_cnt
=
proc_cnt
};
};
domain
.
parts
=
fmpi_partition_block_1d
(
ctx
,
&
data
);
domain
.
parts
=
fmpi_partition_block_1d
(
ctx
,
data
);
if
(
domain
.
parts
==
NULL
)
{
if
(
domain
.
parts
==
NULL
)
{
FMPI_RAISE_ERROR
(
ctx
->
err_handler
,
"FMPI"
,
"fmpi_partition_block_1d() failed!"
);
FMPI_RAISE_ERROR
(
ctx
->
err_handler
,
"FMPI"
,
"fmpi_partition_block_1d() failed!"
);
}
}
...
...
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