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
e746e94c
Verified
Commit
e746e94c
authored
3 years ago
by
raphael.bach
Browse files
Options
Downloads
Patches
Plain Diff
Add `fmpi_mpi_type()`
parent
a12c4aac
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/internal/fmpi_mpi.h
+6
-1
6 additions, 1 deletion
include/internal/fmpi_mpi.h
src/fmpi_mpi.c
+21
-0
21 additions, 0 deletions
src/fmpi_mpi.c
with
27 additions
and
1 deletion
include/internal/fmpi_mpi.h
+
6
−
1
View file @
e746e94c
...
...
@@ -27,9 +27,10 @@
INCLUDE
==============================================================================*/
// External
#include
<mpi.h>
// MPI_MAX_PROCESSOR_NAME
#include
<mpi.h>
// MPI_MAX_PROCESSOR_NAME
, MPI_Datatype
// Internal
#include
"fmpi_error.h"
#include
"internal/fmpi_type.h"
/*==============================================================================
STRUCT
==============================================================================*/
...
...
@@ -203,6 +204,10 @@ void fmpi_mpi_abort(const struct fmpi_mpi_ctx * ctx);
fmpi_mpi_world_barrier()
------------------------------------------------------------------------------*/
int
fmpi_mpi_world_barrier
(
const
struct
fmpi_mpi_ctx
*
ctx
);
/*------------------------------------------------------------------------------
fmpi_mpi_type()
------------------------------------------------------------------------------*/
MPI_Datatype
fmpi_mpi_type
(
enum
fmpi_type_base
type
);
/*==============================================================================
GUARD
==============================================================================*/
...
...
This diff is collapsed.
Click to expand it.
src/fmpi_mpi.c
+
21
−
0
View file @
e746e94c
...
...
@@ -32,6 +32,7 @@
#include
<mpi.h>
// Internal
#include
"internal/fmpi_error.h"
#include
"internal/fmpi_type.h"
/*==============================================================================
DEFINE
==============================================================================*/
...
...
@@ -185,3 +186,23 @@ int fmpi_mpi_world_barrier(const struct fmpi_mpi_ctx * const ctx)
}
return
err_id
;
}
/*------------------------------------------------------------------------------
fmpi_mpi_type()
------------------------------------------------------------------------------*/
MPI_Datatype
fmpi_mpi_type
(
const
enum
fmpi_type_base
type
)
{
const
static
MPI_Datatype
fmpi_mpi_type_list
[]
=
{
[
FMPI_TYPE_i8
]
=
MPI_INT8_T
,
[
FMPI_TYPE_i16
]
=
MPI_INT16_T
,
[
FMPI_TYPE_i32
]
=
MPI_INT32_T
,
[
FMPI_TYPE_i64
]
=
MPI_INT64_T
,
[
FMPI_TYPE_u8
]
=
MPI_UINT8_T
,
[
FMPI_TYPE_u16
]
=
MPI_UINT16_T
,
[
FMPI_TYPE_u32
]
=
MPI_UINT32_T
,
[
FMPI_TYPE_u64
]
=
MPI_UINT64_T
,
[
FMPI_TYPE_f32
]
=
MPI_FLOAT
,
[
FMPI_TYPE_f64
]
=
MPI_DOUBLE
,
[
FMPI_TYPE_bool
]
=
MPI_C_BOOL
};
return
fmpi_mpi_type_list
[
type
];
}
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