Mentions légales du service
Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
S
ScalFMM
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package registry
Container registry
Model registry
Operate
Environments
Terraform modules
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
solverstack
ScalFMM
Commits
95094e4b
Commit
95094e4b
authored
9 years ago
by
BRAMAS Berenger
Browse files
Options
Downloads
Patches
Plain Diff
update mpi packing
parent
f60f896f
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
Src/Containers/FMpiBufferReader.hpp
+4
-4
4 additions, 4 deletions
Src/Containers/FMpiBufferReader.hpp
Src/Containers/FMpiBufferWriter.hpp
+4
-4
4 additions, 4 deletions
Src/Containers/FMpiBufferWriter.hpp
Src/Utils/FMpi.hpp
+27
-3
27 additions, 3 deletions
Src/Utils/FMpi.hpp
with
35 additions
and
11 deletions
Src/Containers/FMpiBufferReader.hpp
+
4
−
4
View file @
95094e4b
...
...
@@ -101,7 +101,7 @@ public :
FAssertLF
(
currentIndex
<
std
::
numeric_limits
<
int
>::
max
());
int
previousIndex
=
int
(
currentIndex
);
ClassType
value
;
FMpi
::
Assert
(
MPI_Unpack
(
array
.
get
(),
int
(
arrayCapacity
),
&
previousIndex
,
&
value
,
1
,
FMpi
::
GetType
(
value
),
comm
),
__LINE__
);
FMpi
::
Assert
(
MPI_Unpack
(
array
.
get
(),
int
(
arrayCapacity
),
&
previousIndex
,
&
value
,
FMpi
::
GetTypeCount
(
value
)
,
FMpi
::
GetType
(
value
),
comm
),
__LINE__
);
seek
(
FSize
(
sizeof
(
value
)
+
currentIndex
));
FAssertLF
(
previousIndex
==
currentIndex
);
return
value
;
...
...
@@ -114,7 +114,7 @@ public :
FAssertLF
(
arrayCapacity
<
std
::
numeric_limits
<
int
>::
max
());
FAssertLF
(
ind
<
std
::
numeric_limits
<
int
>::
max
());
int
previousIndex
=
int
(
ind
);
FMpi
::
Assert
(
MPI_Unpack
(
array
.
get
(),
int
(
arrayCapacity
),
&
previousIndex
,
&
value
,
1
,
FMpi
::
GetType
(
value
),
comm
),
__LINE__
);
FMpi
::
Assert
(
MPI_Unpack
(
array
.
get
(),
int
(
arrayCapacity
),
&
previousIndex
,
&
value
,
FMpi
::
GetTypeCount
(
value
)
,
FMpi
::
GetType
(
value
),
comm
),
__LINE__
);
seek
(
FSize
(
sizeof
(
value
)
+
ind
));
FAssertLF
(
previousIndex
==
currentIndex
);
return
value
;
...
...
@@ -126,7 +126,7 @@ public :
FAssertLF
(
arrayCapacity
<
std
::
numeric_limits
<
int
>::
max
());
FAssertLF
(
currentIndex
<
std
::
numeric_limits
<
int
>::
max
());
int
previousIndex
=
int
(
currentIndex
);
FMpi
::
Assert
(
MPI_Unpack
(
array
.
get
(),
int
(
arrayCapacity
),
&
previousIndex
,
inValue
,
1
,
FMpi
::
GetType
(
*
inValue
),
comm
),
__LINE__
);
FMpi
::
Assert
(
MPI_Unpack
(
array
.
get
(),
int
(
arrayCapacity
),
&
previousIndex
,
inValue
,
FMpi
::
GetTypeCount
(
*
inValue
)
,
FMpi
::
GetType
(
*
inValue
),
comm
),
__LINE__
);
seek
(
FSize
(
sizeof
(
ClassType
)
+
currentIndex
));
FAssertLF
(
previousIndex
==
currentIndex
);
}
...
...
@@ -138,7 +138,7 @@ public :
FAssertLF
(
currentIndex
<
std
::
numeric_limits
<
int
>::
max
());
FAssertLF
(
inSize
<
std
::
numeric_limits
<
int
>::
max
());
int
previousIndex
=
int
(
currentIndex
);
FMpi
::
Assert
(
MPI_Unpack
(
array
.
get
(),
int
(
arrayCapacity
),
&
previousIndex
,
inArray
,
int
(
inSize
),
FMpi
::
GetType
(
*
inArray
),
comm
),
__LINE__
);
FMpi
::
Assert
(
MPI_Unpack
(
array
.
get
(),
int
(
arrayCapacity
),
&
previousIndex
,
inArray
,
int
(
inSize
)
*
FMpi
::
GetTypeCount
(
*
inArray
)
,
FMpi
::
GetType
(
*
inArray
),
comm
),
__LINE__
);
seek
(
FSize
(
sizeof
(
ClassType
)
*
inSize
+
currentIndex
));
FAssertLF
(
previousIndex
==
currentIndex
);
}
...
...
This diff is collapsed.
Click to expand it.
Src/Containers/FMpiBufferWriter.hpp
+
4
−
4
View file @
95094e4b
...
...
@@ -100,7 +100,7 @@ public:
expandIfNeeded
(
sizeof
(
ClassType
));
FAssertLF
(
currentIndex
<
std
::
numeric_limits
<
int
>::
max
());
int
intCurrentIndex
=
int
(
currentIndex
);
FMpi
::
Assert
(
MPI_Pack
(
const_cast
<
ClassType
*>
(
&
object
),
1
,
FMpi
::
GetType
(
object
),
array
.
get
(),
int
(
arrayCapacity
),
&
intCurrentIndex
,
mpiComm
),
__LINE__
);
FMpi
::
Assert
(
MPI_Pack
(
const_cast
<
ClassType
*>
(
&
object
),
FMpi
::
GetTypeCount
(
object
)
,
FMpi
::
GetType
(
object
),
array
.
get
(),
int
(
arrayCapacity
),
&
intCurrentIndex
,
mpiComm
),
__LINE__
);
currentIndex
=
intCurrentIndex
;
}
...
...
@@ -112,7 +112,7 @@ public:
expandIfNeeded
(
sizeof
(
ClassType
));
FAssertLF
(
arrayCapacity
<
std
::
numeric_limits
<
int
>::
max
());
int
intCurrentIndex
=
int
(
currentIndex
);
FMpi
::
Assert
(
MPI_Pack
(
const_cast
<
ClassType
*>
(
&
object
),
1
,
FMpi
::
GetType
(
object
),
array
.
get
(),
int
(
arrayCapacity
),
&
intCurrentIndex
,
mpiComm
),
__LINE__
);
FMpi
::
Assert
(
MPI_Pack
(
const_cast
<
ClassType
*>
(
&
object
),
FMpi
::
GetTypeCount
(
object
)
,
FMpi
::
GetType
(
object
),
array
.
get
(),
int
(
arrayCapacity
),
&
intCurrentIndex
,
mpiComm
),
__LINE__
);
currentIndex
=
intCurrentIndex
;
}
...
...
@@ -123,7 +123,7 @@ public:
FAssertLF
(
arrayCapacity
<
std
::
numeric_limits
<
int
>::
max
());
FAssertLF
(
position
<
std
::
numeric_limits
<
int
>::
max
());
int
noConstPosition
=
int
(
position
);
FMpi
::
Assert
(
MPI_Pack
(
const_cast
<
ClassType
*>
(
&
object
),
1
,
FMpi
::
GetType
(
object
),
array
.
get
(),
int
(
arrayCapacity
),
&
noConstPosition
,
mpiComm
),
__LINE__
);
FMpi
::
Assert
(
MPI_Pack
(
const_cast
<
ClassType
*>
(
&
object
),
FMpi
::
GetTypeCount
(
object
)
,
FMpi
::
GetType
(
object
),
array
.
get
(),
int
(
arrayCapacity
),
&
noConstPosition
,
mpiComm
),
__LINE__
);
}
/** Write an array
...
...
@@ -135,7 +135,7 @@ public:
FAssertLF
(
arrayCapacity
<
std
::
numeric_limits
<
int
>::
max
());
FAssertLF
(
inSize
<
std
::
numeric_limits
<
int
>::
max
());
int
intCurrentIndex
=
int
(
currentIndex
);
FMpi
::
Assert
(
MPI_Pack
(
const_cast
<
ClassType
*>
(
objects
),
int
(
inSize
),
FMpi
::
GetType
(
*
objects
),
array
.
get
(),
int
(
arrayCapacity
),
&
intCurrentIndex
,
mpiComm
),
__LINE__
);
FMpi
::
Assert
(
MPI_Pack
(
const_cast
<
ClassType
*>
(
objects
),
int
(
inSize
)
*
FMpi
::
GetTypeCount
(
*
objects
)
,
FMpi
::
GetType
(
*
objects
),
array
.
get
(),
int
(
arrayCapacity
),
&
intCurrentIndex
,
mpiComm
),
__LINE__
);
currentIndex
=
intCurrentIndex
;
}
...
...
This diff is collapsed.
Click to expand it.
Src/Utils/FMpi.hpp
+
27
−
3
View file @
95094e4b
...
...
@@ -315,43 +315,67 @@ public:
static
MPI_Datatype
GetType
(
const
long
long
&
){
return
MPI_LONG_LONG
;
}
static
int
GetTypeCount
(
const
long
long
&
){
return
1
;
}
/// Get the MPI datatype corresponding to a variable.
static
MPI_Datatype
GetType
(
const
long
int
&
){
return
MPI_LONG
;
}
static
int
GetTypeCount
(
const
long
int
&
){
return
1
;
}
/// Get the MPI datatype corresponding to a variable.
static
MPI_Datatype
GetType
(
const
double
&
){
return
MPI_DOUBLE
;
}
static
int
GetTypeCount
(
const
double
&
){
return
1
;
}
/// Get the MPI datatype corresponding to a variable.
static
MPI_Datatype
GetType
(
const
float
&
){
return
MPI_FLOAT
;
}
static
int
GetTypeCount
(
const
float
&
){
return
1
;
}
/// Get the MPI datatype corresponding to a variable.
static
MPI_Datatype
GetType
(
const
int
&
){
return
MPI_INT
;
}
static
int
GetTypeCount
(
const
int
&
){
return
1
;
}
/// Get the MPI datatype corresponding to a variable.
static
MPI_Datatype
GetType
(
const
char
&
){
return
MPI_CHAR
;
}
static
int
GetTypeCount
(
const
char
&
){
return
1
;
}
/// Get the MPI datatype corresponding to a variable.
static
MPI_Datatype
GetType
(
const
unsigned
char
&
){
return
MPI_UNSIGNED_CHAR
;
}
static
int
GetTypeCount
(
const
unsigned
char
&
){
return
1
;
}
/// Get the MPI datatype corresponding to a variable.
template
<
class
FReal
>
static
MPI_Datatype
GetType
(
const
FComplex
<
FReal
>&
a
){
MPI_Datatype
FMpiComplexe
;
MPI_Type_contiguous
(
2
,
GetType
(
a
.
getReal
())
,
&
FMpiComplexe
);
return
FMpiComplexe
;
return
GetType
(
a
.
getReal
());
}
template
<
class
FReal
>
static
int
GetTypeCount
(
const
FComplex
<
FReal
>&
a
){
return
2
;
}
////////////////////////////////////////////////////////////
...
...
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