[cig-commits] r7642 - cs/Exchanger/trunk/lib
tan2 at geodynamics.org
tan2 at geodynamics.org
Wed Jul 11 13:08:03 PDT 2007
Author: tan2
Date: 2007-07-11 13:08:02 -0700 (Wed, 11 Jul 2007)
New Revision: 7642
Modified:
cs/Exchanger/trunk/lib/Sink.cc
cs/Exchanger/trunk/lib/Sink.h
cs/Exchanger/trunk/lib/Source.cc
Log:
Added some comments
Modified: cs/Exchanger/trunk/lib/Sink.cc
===================================================================
--- cs/Exchanger/trunk/lib/Sink.cc 2007-07-11 06:24:16 UTC (rev 7641)
+++ cs/Exchanger/trunk/lib/Sink.cc 2007-07-11 20:08:02 UTC (rev 7642)
@@ -29,16 +29,23 @@
MPI_Comm_rank(comm, &me);
+ // append the rank of all sources into sourceRanks array
sourceRanks.reserve(nsrc);
for(int i=0; i<nsrc+1; i++)
if(i != me)
sourceRanks.push_back(i);
+ // send mesh to all sources, each source will find out which
+ // mesh nodes are inside the source proc.
sendMesh(mesh);
+ // sources report back
recvMeshNode();
+
+ // assert all mesh nodes are reported
testMeshNode(mesh);
+ // keep a copy of the coordinates of mesh nodes
initX(mesh);
}
Modified: cs/Exchanger/trunk/lib/Sink.h
===================================================================
--- cs/Exchanger/trunk/lib/Sink.h 2007-07-11 06:24:16 UTC (rev 7641)
+++ cs/Exchanger/trunk/lib/Sink.h 2007-07-11 20:08:02 UTC (rev 7642)
@@ -18,6 +18,7 @@
namespace Exchanger {
+ // forward declaration
class BoundedMesh;
Modified: cs/Exchanger/trunk/lib/Source.cc
===================================================================
--- cs/Exchanger/trunk/lib/Source.cc 2007-07-11 06:24:16 UTC (rev 7641)
+++ cs/Exchanger/trunk/lib/Source.cc 2007-07-11 20:08:02 UTC (rev 7642)
@@ -31,12 +31,19 @@
void Source::init(BoundedMesh& mesh, const BoundedBox& mybbox)
{
+ // receive mesh nodes from sink
recvMesh(mesh, mybbox);
+
+ // using interpolator to find out which nodes are inside this proc
if(isOverlapped(mesh.bbox(), mybbox)) {
createInterpolator(mesh);
meshNode_.print("Exchanger-Source-meshNode");
}
+
+ // report which nodes are inside this proc to sink
sendMeshNode();
+
+ // keep a copy of the coordinates of mesh nodes
initX(mesh);
}
@@ -48,6 +55,7 @@
mesh.broadcast(comm, sinkRank);
#else
+ // a more efficient approach, but not finished
BoundedBox bbox = mybbox;
util::exchange(comm, sinkRank, bbox);
More information about the cig-commits
mailing list