Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
fem
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Model registry
Operate
Environments
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
GitLab community forum
Contribute to GitLab
Provide feedback
Terms and privacy
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
gmsh
fem
Commits
d041a05e
Commit
d041a05e
authored
3 months ago
by
Boris Martin
Browse files
Options
Downloads
Patches
Plain Diff
Preparing for splitting of the two cases
parent
2137c323
No related branches found
No related tags found
No related merge requests found
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
src/field/DistributedField.cpp
+16
-14
16 additions, 14 deletions
src/field/DistributedField.cpp
with
16 additions
and
14 deletions
src/field/DistributedField.cpp
+
16
−
14
View file @
d041a05e
...
...
@@ -261,15 +261,27 @@ namespace gmshfem::field
void
DistributedField
<
T_Scalar
,
T_Form
>::
_computeToSend
(
const
std
::
optional
<
std
::
vector
<
int
>>&
neighborRanks
)
{
#ifdef HAVE_MPI
// What I have to send is what others have to read
// Create temporary MPI Type for the struct
const
int
nitems
=
2
;
int
blocklengths
[
2
]
=
{
1
,
1
};
MPI_Datatype
types
[
2
]
=
{
MPI_INT
,
MPI_UNSIGNED_LONG
};
MPI_Datatype
mpi_struct_type
;
MPI_Aint
offsets
[
2
];
offsets
[
0
]
=
0
;
offsets
[
1
]
=
sizeof
(
int
);
MPI_Type_create_struct
(
nitems
,
blocklengths
,
offsets
,
types
,
&
mpi_struct_type
);
MPI_Type_commit
(
&
mpi_struct_type
);
// Send all owned interfaces and inner dofs that are read by someone else
std
::
vector
<
DofGlobalIndex
>
local
,
global
;
local
.
reserve
(
_sharedDofs
.
size
());
unsigned
commSize
=
gmshfem
::
common
::
GmshFem
::
getMPISize
();
// Fill the local list
// Fill the local list
of what I read
for
(
dofs
::
Dof
*
dof
:
_toRead
)
{
local
.
push_back
({
dof
->
numType
(),
dof
->
entity
()});
}
...
...
@@ -285,19 +297,7 @@ namespace gmshfem::field
total_size
+=
sizes
[
i
];
}
// Create temporary MPI Type for the struct
const
int
nitems
=
2
;
int
blocklengths
[
2
]
=
{
1
,
1
};
MPI_Datatype
types
[
2
]
=
{
MPI_INT
,
MPI_UNSIGNED_LONG
};
MPI_Datatype
mpi_struct_type
;
MPI_Aint
offsets
[
2
];
//offsets[0] = offsetof(DofGlobalIndex, type);
//offsets[1] = offsetof(DofGlobalIndex, entity);
offsets
[
0
]
=
0
;
offsets
[
1
]
=
sizeof
(
int
);
MPI_Type_create_struct
(
nitems
,
blocklengths
,
offsets
,
types
,
&
mpi_struct_type
);
MPI_Type_commit
(
&
mpi_struct_type
);
// Synchronize the full array
global
.
resize
(
total_size
);
...
...
@@ -306,7 +306,6 @@ namespace gmshfem::field
MPI_COMM_WORLD
);
// Free the type
MPI_Type_free
(
&
mpi_struct_type
);
_toSend
.
clear
();
// Global is the list of dof indices someone is reading
...
...
@@ -321,6 +320,9 @@ namespace gmshfem::field
_toSend
.
insert
(
dof
);
}
}
MPI_Type_free
(
&
mpi_struct_type
);
#else
throw
common
::
Exception
(
"MPI is not available"
);
#endif
...
...
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