Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
What's new
10
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Open sidebar
CrayzeeWulf
Xdmf
Commits
c8b356a6
Commit
c8b356a6
authored
Oct 18, 2013
by
Andrew J. Burns (Cont
Browse files
Options
Browse Files
Download
Plain Diff
Merge branch 'ajb-dev' of /data/Repository/Xdmf2
parents
dda62b58
9499b32c
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
37 additions
and
9 deletions
+37
-9
core/dsm/XdmfDSMBuffer.cpp
core/dsm/XdmfDSMBuffer.cpp
+5
-5
core/dsm/XdmfDSMCommMPI.cpp
core/dsm/XdmfDSMCommMPI.cpp
+31
-2
core/dsm/XdmfDSMCommMPI.hpp
core/dsm/XdmfDSMCommMPI.hpp
+1
-0
examples/Cxx/DSMLoopTest.cpp
examples/Cxx/DSMLoopTest.cpp
+0
-2
No files found.
core/dsm/XdmfDSMBuffer.cpp
View file @
c8b356a6
...
...
@@ -837,9 +837,9 @@ XdmfDSMBuffer::ReceiveInfo()
infoStatus
=
1
;
}
int
groupInfoStatus
[
this
->
Comm
->
GetInterSize
()];
int
*
groupInfoStatus
=
new
int
[
this
->
Comm
->
GetInterSize
()]
()
;
MPI_Allgather
(
&
infoStatus
,
1
,
MPI_INT
,
&
groupInfoStatus
,
1
,
MPI_INT
,
this
->
Comm
->
GetInterComm
());
MPI_Allgather
(
&
infoStatus
,
1
,
MPI_INT
,
&
(
groupInfoStatus
[
0
])
,
1
,
MPI_INT
,
this
->
Comm
->
GetInterComm
());
int
sendCore
=
0
;
...
...
@@ -874,7 +874,7 @@ void
XdmfDSMBuffer
::
SendAccept
(
unsigned
int
numConnections
)
{
for
(
int
i
=
this
->
StartServerId
;
i
<=
this
->
EndServerId
;
++
i
)
{
if
(
i
!=
this
->
Comm
->
GetId
()){
if
(
i
!=
this
->
Comm
->
GetI
nterI
d
()){
this
->
SendCommandHeader
(
XDMF_DSM_ACCEPT
,
i
,
0
,
0
,
XDMF_DSM_INTER_COMM
);
this
->
SendAcknowledgment
(
i
,
numConnections
,
XDMF_DSM_EXCHANGE_TAG
,
XDMF_DSM_INTER_COMM
);
}
...
...
@@ -1053,12 +1053,12 @@ XdmfDSMBuffer::SendInfo()
infoStatus
=
2
;
}
int
groupInfoStatus
[
this
->
Comm
->
GetInterSize
()];
int
*
groupInfoStatus
=
new
int
[
this
->
Comm
->
GetInterSize
()]
()
;
MPI_Allgather
(
&
infoStatus
,
1
,
MPI_INT
,
&
groupInfoStatus
,
&
(
groupInfoStatus
[
0
])
,
1
,
MPI_INT
,
this
->
Comm
->
GetInterComm
());
...
...
core/dsm/XdmfDSMCommMPI.cpp
View file @
c8b356a6
...
...
@@ -70,6 +70,7 @@ XdmfDSMCommMPI::XdmfDSMCommMPI()
// This is the default file name for the config file.
DsmFileName
=
"dsmconnect.cfg"
;
InterCommType
=
XDMF_DSM_COMM_MPI
;
HasOpenedPort
=
false
;
}
XdmfDSMCommMPI
::~
XdmfDSMCommMPI
()
...
...
@@ -107,7 +108,20 @@ XdmfDSMCommMPI::Accept(unsigned int numConnections)
if
(
InterComm
==
MPI_COMM_NULL
)
{
// If there is no InterComm, then accept from IntraComm and merge into InterComm
MPI_Comm
tempComm
;
int
status
=
MPI_Comm_accept
(
DsmPortName
,
MPI_INFO_NULL
,
0
,
IntraComm
,
&
tempComm
);
int
*
portCheck
=
new
int
[
GetInterSize
()]();
int
portStatus
;
portStatus
=
0
;
if
(
HasOpenedPort
)
{
portStatus
=
1
;
}
MPI_Allgather
(
&
portStatus
,
1
,
MPI_INT
,
&
(
portCheck
[
0
]),
1
,
MPI_INT
,
InterComm
);
unsigned
int
index
=
0
;
for
(
index
=
0
;
index
<
GetInterSize
();
++
index
)
{
if
(
portCheck
[
index
]
==
1
)
{
break
;
}
}
int
status
=
MPI_Comm_accept
(
DsmPortName
,
MPI_INFO_NULL
,
index
,
IntraComm
,
&
tempComm
);
if
(
status
!=
MPI_SUCCESS
)
{
try
{
std
::
string
message
=
"Failed to accept port "
;
...
...
@@ -136,7 +150,20 @@ XdmfDSMCommMPI::Accept(unsigned int numConnections)
else
{
// If there is an InterComm, accept into the InterComm and merge
MPI_Comm
tempComm
;
int
status
=
MPI_Comm_accept
(
DsmPortName
,
MPI_INFO_NULL
,
0
,
InterComm
,
&
tempComm
);
int
*
portCheck
=
new
int
[
GetInterSize
()]();
int
portStatus
;
portStatus
=
0
;
if
(
HasOpenedPort
)
{
portStatus
=
1
;
}
MPI_Allgather
(
&
portStatus
,
1
,
MPI_INT
,
&
(
portCheck
[
0
]),
1
,
MPI_INT
,
InterComm
);
unsigned
int
index
=
0
;
for
(
index
=
0
;
index
<
GetInterSize
();
++
index
)
{
if
(
portCheck
[
index
]
==
1
)
{
break
;
}
}
int
status
=
MPI_Comm_accept
(
DsmPortName
,
MPI_INFO_NULL
,
index
,
InterComm
,
&
tempComm
);
if
(
status
!=
MPI_SUCCESS
)
{
try
{
std
::
string
message
=
"Failed to accept port "
;
...
...
@@ -184,6 +211,7 @@ XdmfDSMCommMPI::ClosePort()
}
}
}
HasOpenedPort
=
false
;
}
int
...
...
@@ -455,6 +483,7 @@ XdmfDSMCommMPI::OpenPort()
throw
e
;
}
}
HasOpenedPort
=
true
;
}
MPI_Bcast
(
DsmPortName
,
MPI_MAX_PORT_NAME
,
MPI_CHAR
,
0
,
IntraComm
);
}
...
...
core/dsm/XdmfDSMCommMPI.hpp
View file @
c8b356a6
...
...
@@ -1046,6 +1046,7 @@ private:
int
InterCommType
;
char
DsmPortName
[
MPI_MAX_PORT_NAME
];
std
::
string
DsmFileName
;
bool
HasOpenedPort
;
};
#endif
/* XDMFDSMCOMMMPI_HPP_ */
...
...
examples/Cxx/DSMLoopTest.cpp
View file @
c8b356a6
#include <mpi.h>
#include <H5FDdsm.h>
#include <H5FDdsmManager.h>
#include <stdlib.h>
#include <iostream>
#include "XdmfArray.hpp"
...
...
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