Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
D
dune-istl
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Model registry
Operate
Environments
Monitor
Incidents
Service Desk
Analyze
Value stream analytics
Contributor analytics
CI/CD 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
Core Modules
dune-istl
Commits
a03ae3f6
Commit
a03ae3f6
authored
19 years ago
by
Markus Blatt
Browse files
Options
Downloads
Patches
Plain Diff
Introduced generic MPI_Datatype generation for bigunsignedint and FieldVector.
[[Imported from SVN: r538]]
parent
27a43baf
No related branches found
No related tags found
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
istl/mpitraits.hh
+45
-9
45 additions, 9 deletions
istl/mpitraits.hh
with
45 additions
and
9 deletions
istl/mpitraits.hh
+
45
−
9
View file @
a03ae3f6
...
...
@@ -64,15 +64,14 @@ namespace Dune
template
<
class
K
,
int
n
>
struct
MPITraits
<
FieldVector
<
K
,
n
>
>
{
static
MPI_Datatype
*
datatype
;
static
MPI_Datatype
*
vectortype
;
static
MPI_Datatype
datatype
;
static
MPI_Datatype
vectortype
;
static
inline
MPI_Datatype
getType
()
{
if
(
datatype
==
0
)
{
vectortype
=
new
MPI_Datatype
();
MPI_Type_contiguous
(
n
,
MPITraits
<
K
>::
getType
(),
vectortype
);
datatype
=
new
MPI_Datatype
();
if
(
datatype
==
MPI_DATATYPE_NULL
)
{
MPI_Type_contiguous
(
n
,
MPITraits
<
K
>::
getType
(),
&
vectortype
);
MPI_Type_commit
(
&
vectortype
);
FieldVector
<
K
,
n
>
fvector
;
MPI_Aint
base
;
MPI_Aint
displ
;
...
...
@@ -81,8 +80,8 @@ namespace Dune
displ
-=
base
;
int
length
[
1
]
=
{
1
};
MPI_Type_
struct
(
1
,
length
,
&
displ
,
vectortype
,
datatype
);
MPI_Type_struct
(
1
,
length
,
&
displ
,
&
vectortype
,
&
datatype
);
MPI_Type_
commit
(
&
datatype
);
}
return
datatype
;
}
...
...
@@ -90,8 +89,45 @@ namespace Dune
};
template
<
class
K
,
int
n
>
MPI_Datatype
*
MPITraits
<
FieldVector
<
K
,
n
>
>::
datatype
=
0
;
MPI_Datatype
MPITraits
<
FieldVector
<
K
,
n
>
>::
datatype
=
MPI_DATATYPE_NULL
;
template
<
class
K
,
int
n
>
MPI_Datatype
MPITraits
<
FieldVector
<
K
,
n
>
>::
vectortype
=
{
MPI_DATATYPE_NULL
};
template
<
int
k
>
class
bigunsignedint
;
template
<
int
k
>
struct
MPITraits
<
bigunsignedint
<
k
>
>
{
static
MPI_Datatype
datatype
;
static
MPI_Datatype
vectortype
;
static
inline
MPI_Datatype
getType
()
{
if
(
datatype
==
0
)
{
MPI_Type_contiguous
(
bigunsignedint
<
k
>::
n
,
MPITraits
<
unsigned
short
>::
getType
(),
&
vectortype
);
//MPI_Type_commit(&vectortype);
bigunsignedint
<
k
>
data
;
MPI_Aint
base
;
MPI_Aint
displ
;
MPI_Address
(
&
data
,
&
base
);
MPI_Address
(
&
(
data
.
digit
),
&
displ
);
displ
-=
base
;
int
length
[
1
]
=
{
1
};
MPI_Type_struct
(
1
,
length
,
&
displ
,
&
vectortype
,
&
datatype
);
MPI_Type_commit
(
&
datatype
);
}
return
datatype
;
}
};
template
<
int
k
>
MPI_Datatype
MPITraits
<
bigunsignedint
<
k
>
>::
datatype
=
MPI_DATATYPE_NULL
;
template
<
int
k
>
MPI_Datatype
MPITraits
<
bigunsignedint
<
k
>
>::
vectortype
=
MPI_DATATYPE_NULL
;
/** @} */
}
...
...
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