Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
S
ScalFMM
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
5
Issues
5
List
Boards
Labels
Service Desk
Milestones
Operations
Operations
Incidents
Packages & Registries
Packages & Registries
Container Registry
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
solverstack
ScalFMM
Commits
8fc0a545
Commit
8fc0a545
authored
Nov 07, 2013
by
BRAMAS Berenger
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
remove MPI loading file bug
parent
27bef454
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
25 additions
and
12 deletions
+25
-12
Src/Files/FMpiFmaLoader.hpp
Src/Files/FMpiFmaLoader.hpp
+11
-10
Tests/Utils/testFmmAlgorithmProc.cpp
Tests/Utils/testFmmAlgorithmProc.cpp
+14
-2
No files found.
Src/Files/FMpiFmaLoader.hpp
View file @
8fc0a545
...
...
@@ -81,7 +81,7 @@ public:
MPI_Status
status
;
if
(
MPI_File_read
(
file
,
&
sizeOfElement
,
1
,
MPI_INT
,
&
status
)
==
MPI_SUCCESS
&&
MPI_File_read
(
file
,
&
this
->
totalNbParticles
,
1
,
MPI_LONG_LONG
,
&
status
)
==
MPI_SUCCESS
&&
MPI_File_read
(
file
,
xyzBoxWidth
,
4
,
MPI_FLOAT
,
&
status
)
==
MPI_SUCCESS
){
&&
MPI_File_read
(
file
,
xyzBoxWidth
,
4
,
FMpi
::
GetType
(
xyzBoxWidth
[
0
])
,
&
status
)
==
MPI_SUCCESS
){
FLOG
(
if
(
sizeOfElement
!=
sizeof
(
FReal
)){)
FLOG
(
FLog
::
Controller
.
writeFromLine
(
"Warning type size between file and FReal are differents
\n
"
,
__LINE__
,
__FILE__
);
)
...
...
@@ -110,13 +110,7 @@ public:
// local number to read
particles
=
new
FReal
[
bufsize
];
if
(
sizeof
(
FReal
)
==
sizeof
(
float
)
){
MPI_File_read_at
(
file
,
headDataOffSet
+
startPart
*
4
*
sizeof
(
FReal
),
particles
,
int
(
bufsize
),
MPI_FLOAT
,
&
status
);
}
else
{
MPI_File_read_at
(
file
,
headDataOffSet
+
startPart
*
4
*
sizeof
(
FReal
),
particles
,
int
(
bufsize
),
MPI_DOUBLE
,
&
status
);
}
MPI_File_read_at
(
file
,
headDataOffSet
+
startPart
*
4
*
sizeof
(
FReal
),
particles
,
int
(
bufsize
),
FMpi
::
GetType
(
xyzBoxWidth
[
0
]),
&
status
);
// check if needed
int
count
(
0
);
...
...
@@ -142,7 +136,6 @@ public:
FLOG
(
FLog
::
Controller
.
writeFromLine
(
"Warning type size between file and FReal are differents
\n
"
,
__LINE__
,
__FILE__
);
)
FLOG
(})
removeWarning
+=
fread
(
&
this
->
totalNbParticles
,
sizeof
(
FSize
),
1
,
file
);
removeWarning
+=
fread
(
&
this
->
boxWidth
,
sizeof
(
FReal
),
1
,
file
);
this
->
boxWidth
*=
2
;
...
...
@@ -160,6 +153,7 @@ public:
if
(
filesize
/
4
!=
this
->
totalNbParticles
){
printf
(
"Error fileSize %ld, nbPart %lld
\n
"
,
filesize
/
4
,
this
->
totalNbParticles
);
exit
(
0
);
}
// in number of floats
...
...
@@ -172,7 +166,10 @@ public:
fseek
(
file
,
long
(
headDataOffSet
+
startPart
*
4
*
sizeof
(
FReal
)),
SEEK_SET
);
removeWarning
+=
fread
(
particles
,
sizeof
(
FReal
),
int
(
bufsize
),
file
);
if
(
fread
(
particles
,
sizeof
(
FReal
),
int
(
bufsize
),
file
)
!=
unsigned
(
bufsize
)){
printf
(
"Error when reading file.
\n
"
);
exit
(
0
);
}
fclose
(
file
);
}
...
...
@@ -226,6 +223,10 @@ public:
* @param the particle to fill
*/
void
fillParticle
(
FPoint
*
const
inParticlePositions
,
FReal
*
const
inPhysicalValue
){
if
(
nbParticles
*
4
<=
idxParticles
){
printf
(
"Error you're loading too much particles.
\n
"
);
exit
(
0
);
}
inParticlePositions
->
setPosition
(
particles
[
idxParticles
],
particles
[
idxParticles
+
1
],
particles
[
idxParticles
+
2
]);
(
*
inPhysicalValue
)
=
(
particles
[
idxParticles
+
3
]);
idxParticles
+=
4
;
...
...
Tests/Utils/testFmmAlgorithmProc.cpp
View file @
8fc0a545
...
...
@@ -327,6 +327,11 @@ int main(int argc, char ** argv){
return
1
;
}
std
::
cout
<<
"Simulation properties :
\n
"
;
std
::
cout
<<
"Nb Particles "
<<
loader
.
getNumberOfParticles
()
<<
"
\n
"
;
std
::
cout
<<
"Box Width : "
<<
loader
.
getBoxWidth
()
<<
"
\n
"
;
std
::
cout
<<
"Box Center : "
<<
loader
.
getCenterOfBox
()
<<
"
\n
"
;
// The real tree to work on
OctreeClass
realTree
(
NbLevels
,
SizeSubLevels
,
loader
.
getBoxWidth
(),
loader
.
getCenterOfBox
());
...
...
@@ -371,7 +376,8 @@ int main(int argc, char ** argv){
else
{
FPoint
position
;
FReal
physicalValue
;
for
(
FSize
idxPart
=
0
;
idxPart
<
loader
.
getNumberOfParticles
()
;
++
idxPart
){
const
FSize
nbParticles
=
loader
.
getNumberOfParticles
();
for
(
FSize
idxPart
=
0
;
idxPart
<
nbParticles
;
++
idxPart
){
loader
.
fillParticle
(
&
position
,
&
physicalValue
);
realTree
.
insert
(
position
);
}
...
...
@@ -384,10 +390,16 @@ int main(int argc, char ** argv){
OctreeClass
treeValide
(
NbLevels
,
SizeSubLevels
,
loader
.
getBoxWidth
(),
loader
.
getCenterOfBox
());
{
FFmaBinLoader
loaderSeq
(
filename
);
std
::
cout
<<
"Simulation properties :
\n
"
;
std
::
cout
<<
"Nb Particles "
<<
loaderSeq
.
getNumberOfParticles
()
<<
"
\n
"
;
std
::
cout
<<
"Box Width : "
<<
loaderSeq
.
getBoxWidth
()
<<
"
\n
"
;
std
::
cout
<<
"Box Center : "
<<
loaderSeq
.
getCenterOfBox
()
<<
"
\n
"
;
FPoint
position
;
FReal
physicalValue
;
for
(
FSize
idxPart
=
0
;
idxPart
<
loaderSeq
.
getNumberOfParticles
()
;
++
idxPart
){
loader
.
fillParticle
(
&
position
,
&
physicalValue
);
loader
Seq
.
fillParticle
(
&
position
,
&
physicalValue
);
treeValide
.
insert
(
position
);
}
}
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment