Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
openfoam
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
Contributor 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
Development
openfoam
Commits
1a4190e7
Commit
1a4190e7
authored
14 years ago
by
mattijs
Browse files
Options
Downloads
Patches
Plain Diff
ENH: IOdictionary : tree distribution of master dictionary
parent
a17c3f96
Branches
Branches containing commit
Tags
Tags containing commit
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
src/OpenFOAM/db/IOobjects/IOdictionary/IOdictionary.C
+39
-26
39 additions, 26 deletions
src/OpenFOAM/db/IOobjects/IOdictionary/IOdictionary.C
src/OpenFOAM/db/regIOobject/regIOobjectRead.C
+44
-30
44 additions, 30 deletions
src/OpenFOAM/db/regIOobject/regIOobjectRead.C
with
83 additions
and
56 deletions
src/OpenFOAM/db/IOobjects/IOdictionary/IOdictionary.C
+
39
−
26
View file @
1a4190e7
...
@@ -55,46 +55,59 @@ void Foam::IOdictionary::readFile(const bool masterOnly)
...
@@ -55,46 +55,59 @@ void Foam::IOdictionary::readFile(const bool masterOnly)
close
();
close
();
}
}
if
(
masterOnly
)
if
(
masterOnly
&&
Pstream
::
parRun
()
)
{
{
// Scatter master data
// Scatter master data using communication scheme
if
(
Pstream
::
master
())
const
List
<
Pstream
::
commsStruct
>&
comms
=
(
(
Pstream
::
nProcs
()
<
Pstream
::
nProcsSimpleSum
)
?
Pstream
::
linearCommunication
()
:
Pstream
::
treeCommunication
()
);
// Get my communication order
const
Pstream
::
commsStruct
&
myComm
=
comms
[
Pstream
::
myProcNo
()];
// Reveive from up
if
(
myComm
.
above
()
!=
-
1
)
{
{
for
if
(
debug
)
(
int
slave
=
Pstream
::
firstSlave
();
slave
<=
Pstream
::
lastSlave
();
slave
++
)
{
{
// Note: use ASCII for now - binary IO of dictionaries is
Pout
<<
"IOdictionary : Reading "
<<
objectPath
()
// not currently supported
<<
" from processor "
<<
myComm
.
above
()
<<
endl
;
OPstream
toSlave
(
Pstream
::
scheduled
,
slave
,
0
,
UPstream
::
msgType
(),
IOstream
::
ASCII
);
IOdictionary
::
writeData
(
toSlave
);
}
}
// Note: use ASCII for now - binary IO of dictionaries is
// not currently supported
IPstream
fromAbove
(
Pstream
::
scheduled
,
myComm
.
above
(),
0
,
IOstream
::
ASCII
);
IOdictionary
::
readData
(
fromAbove
);
}
}
else
// Send to my downstairs neighbours
forAll
(
myComm
.
below
(),
belowI
)
{
{
if
(
debug
)
if
(
debug
)
{
{
Pout
<<
"IOdictionary :
Rea
ding "
<<
objectPath
()
Pout
<<
"IOdictionary :
Sen
ding "
<<
objectPath
()
<<
"
from master
processor "
<<
Pstream
::
masterNo
()
<<
endl
;
<<
"
to
processor "
<<
myComm
.
below
()[
belowI
]
<<
endl
;
}
}
I
Pstream
fromMaster
O
Pstream
toBelow
(
(
Pstream
::
scheduled
,
Pstream
::
scheduled
,
Pstream
::
masterNo
()
,
myComm
.
below
()[
belowI
]
,
0
,
0
,
Pstream
::
msgType
(),
IOstream
::
ASCII
IOstream
::
ASCII
);
);
IOdictionary
::
readData
(
fromMaster
);
IOdictionary
::
writeData
(
toBelow
);
}
}
}
}
}
}
...
...
This diff is collapsed.
Click to expand it.
src/OpenFOAM/db/regIOobject/regIOobjectRead.C
+
44
−
30
View file @
1a4190e7
...
@@ -177,55 +177,69 @@ bool Foam::regIOobject::read()
...
@@ -177,55 +177,69 @@ bool Foam::regIOobject::read()
regIOobject
::
fileModificationChecking
==
timeStampMaster
regIOobject
::
fileModificationChecking
==
timeStampMaster
||
regIOobject
::
fileModificationChecking
==
inotifyMaster
;
||
regIOobject
::
fileModificationChecking
==
inotifyMaster
;
bool
ok
;
bool
ok
=
true
;
if
(
Pstream
::
master
()
||
!
masterOnly
)
if
(
Pstream
::
master
()
||
!
masterOnly
)
{
{
if
(
IFstream
::
debug
)
{
Pout
<<
"regIOobject::read() : "
<<
"reading object "
<<
name
()
<<
" from file "
<<
endl
;
}
ok
=
readData
(
readStream
(
type
()));
ok
=
readData
(
readStream
(
type
()));
close
();
close
();
}
}
if
(
masterOnly
)
if
(
masterOnly
&&
Pstream
::
parRun
()
)
{
{
// Scatter master data
// Scatter master data using communication scheme
if
(
Pstream
::
master
())
{
const
List
<
Pstream
::
commsStruct
>&
comms
=
for
(
(
(
Pstream
::
nProcs
()
<
Pstream
::
nProcsSimpleSum
)
int
slave
=
Pstream
::
firstSlave
();
?
Pstream
::
linearCommunication
()
slave
<=
Pstream
::
lastSlave
();
:
Pstream
::
treeCommunication
()
slave
++
);
)
{
// Note: use ASCII for now - binary IO of dictionaries is
// Get my communication order
// not currently supported
const
Pstream
::
commsStruct
&
myComm
=
comms
[
Pstream
::
myProcNo
()];
OPstream
toSlave
(
// Reveive from up
Pstream
::
scheduled
,
if
(
myComm
.
above
()
!=
-
1
)
slave
,
0
,
UPstream
::
msgType
(),
IOstream
::
ASCII
);
writeData
(
toSlave
);
}
}
else
{
{
if
(
IFstream
::
debug
)
if
(
IFstream
::
debug
)
{
{
Pout
<<
"regIOobject::read() : "
Pout
<<
"regIOobject::read() : "
<<
"reading object "
<<
name
()
<<
"reading object "
<<
name
()
<<
" from
master
processor "
<<
Pstream
::
masterNo
()
<<
" from processor "
<<
myComm
.
above
()
<<
endl
;
<<
endl
;
}
}
IPstream
fromMaster
// Note: use ASCII for now - binary IO of dictionaries is
// not currently supported
IPstream
fromAbove
(
Pstream
::
scheduled
,
myComm
.
above
(),
0
,
IOstream
::
ASCII
);
ok
=
readData
(
fromAbove
);
}
// Send to my downstairs neighbours
forAll
(
myComm
.
below
(),
belowI
)
{
OPstream
toBelow
(
(
Pstream
::
scheduled
,
Pstream
::
scheduled
,
Pstream
::
masterNo
()
,
myComm
.
below
()[
belowI
]
,
0
,
0
,
Pstream
::
msgType
(),
IOstream
::
ASCII
IOstream
::
ASCII
);
);
ok
=
readData
(
fromMaster
);
writeData
(
toBelow
);
}
}
}
}
return
ok
;
return
ok
;
...
...
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