Skip to content

Commit

Permalink
More debug output.
Browse files Browse the repository at this point in the history
  • Loading branch information
oehmke committed Dec 11, 2024
1 parent de422af commit 57223ef
Show file tree
Hide file tree
Showing 2 changed files with 95 additions and 2 deletions.
83 changes: 82 additions & 1 deletion src/Infrastructure/Mesh/src/Legacy/ESMCI_GeomRendezvous.C
Original file line number Diff line number Diff line change
Expand Up @@ -1600,6 +1600,12 @@ void GeomRend::build_dst_mig_all_overlap(ZoltanUD &zud) {

void GeomRend::Build(UInt nsrcF, MEField<> **srcF, UInt ndstF, MEField<> **dstF, struct Zoltan_Struct **zzp, bool free_zz) {
Trace __trace("GeomRend::Build()");

{
char buff[1024];
sprintf(buff,"BOB: GR::Build Beg");
ESMC_LogDefault.Write(buff, ESMC_LOGMSG_INFO);
}

ThrowRequire(built == false);
built = true;
Expand All @@ -1610,6 +1616,14 @@ void GeomRend::Build(UInt nsrcF, MEField<> **srcF, UInt ndstF, MEField<> **dstF,
return;
}



{
char buff[1024];
sprintf(buff,"BOB: GR::Build H1");
ESMC_LogDefault.Write(buff, ESMC_LOGMSG_INFO);
}


MEField<> *src_coordField_ptr, *dst_coordField_ptr;
if (srcmesh != NULL)
Expand All @@ -1622,9 +1636,23 @@ void GeomRend::Build(UInt nsrcF, MEField<> **srcF, UInt ndstF, MEField<> **dstF,
else
dst_coordField_ptr = NULL;



{
char buff[1024];
sprintf(buff,"BOB: GR::Build H2");
ESMC_LogDefault.Write(buff, ESMC_LOGMSG_INFO);
}


ZoltanUD zud(sdim, src_coordField_ptr, dst_coordField_ptr, srcplist, dstplist, iter_is_obj);

{
char buff[1024];
sprintf(buff,"BOB: GR::Build H3");
ESMC_LogDefault.Write(buff, ESMC_LOGMSG_INFO);
}

// Gather the destination points. Also get a min/max
int num_dst_local=0;
double cmin[3], cmax[3];
Expand All @@ -1638,6 +1666,12 @@ void GeomRend::Build(UInt nsrcF, MEField<> **srcF, UInt ndstF, MEField<> **dstF,

BBox dstBound = BBoxParUnion(BBox(sdim, cmin, cmax));

{
char buff[1024];
sprintf(buff,"BOB: GR::Build H4");
ESMC_LogDefault.Write(buff, ESMC_LOGMSG_INFO);
}

// Get src mesh (within dst bounding box)
int num_src_local=0;
if (srcplist == NULL) {
Expand All @@ -1647,13 +1681,25 @@ void GeomRend::Build(UInt nsrcF, MEField<> **srcF, UInt ndstF, MEField<> **dstF,
num_src_local=srcplist->get_curr_num_pts();
}

{
char buff[1024];
sprintf(buff,"BOB: GR::Build H5");
ESMC_LogDefault.Write(buff, ESMC_LOGMSG_INFO);
}

// Compute global sums
int local[2];
int global_tot[2];
local[0]=num_dst_local;
local[1]=num_src_local;
MPI_Allreduce(local,global_tot,2,MPI_INT,MPI_SUM,Par::Comm());

{
char buff[1024];
sprintf(buff,"BOB: GR::Build H6");
ESMC_LogDefault.Write(buff, ESMC_LOGMSG_INFO);
}

// Leave if there are no destination points
if (global_tot[0] == 0) {
status=GEOMREND_STATUS_NO_DST;
Expand All @@ -1668,13 +1714,24 @@ void GeomRend::Build(UInt nsrcF, MEField<> **srcF, UInt ndstF, MEField<> **dstF,
}


{
char buff[1024];
sprintf(buff,"BOB: GR::Build H7");
ESMC_LogDefault.Write(buff, ESMC_LOGMSG_INFO);
}

float ver;
int rc = Zoltan_Initialize(0, NULL, &ver);

int rank = Par::Rank();
int csize = Par::Size();


{
char buff[1024];
sprintf(buff,"BOB: GR::Build H8 %d out of %d",rank,csize);
ESMC_LogDefault.Write(buff, ESMC_LOGMSG_INFO);
}

struct Zoltan_Struct * zz = Zoltan_Create(Par::Comm());
*zzp = zz;

Expand Down Expand Up @@ -1703,11 +1760,28 @@ void GeomRend::Build(UInt nsrcF, MEField<> **srcF, UInt ndstF, MEField<> **dstF,
Zoltan_Set_Num_Geom_Fn(zz, GetNumGeom, (void*) &zud);
Zoltan_Set_Geom_Multi_Fn(zz, GetObject, (void*) &zud);



{
char buff[1024];
sprintf(buff,"BOB: GR::Build H9");
ESMC_LogDefault.Write(buff, ESMC_LOGMSG_INFO);
}


// Call zoltan
rc = Zoltan_LB_Partition(zz, &changes, &numGidEntries, &numLidEntries,
&numImport, &importGlobalids, &importLocalids, &importProcs, &importToPart,
&numExport, &exportGlobalids, &exportLocalids, &exportProcs, &exportToPart);


{
char buff[1024];
sprintf(buff,"BOB: GR::Build H10");
ESMC_LogDefault.Write(buff, ESMC_LOGMSG_INFO);
}


//for (int xx=0; xx<numImport; xx++) {
//for (int xx=0; xx<numExport; xx++) {

Expand Down Expand Up @@ -1783,6 +1857,13 @@ void GeomRend::Build(UInt nsrcF, MEField<> **srcF, UInt ndstF, MEField<> **dstF,
Zoltan_Destroy(&zz);
}

{
char buff[1024];
sprintf(buff,"BOB: GR::Build End");
ESMC_LogDefault.Write(buff, ESMC_LOGMSG_INFO);
}


// Set status before leaving
status=GEOMREND_STATUS_COMPLETE;
}
Expand Down
14 changes: 13 additions & 1 deletion src/Infrastructure/Mesh/src/Regridding/ESMCI_Interp.C
Original file line number Diff line number Diff line change
Expand Up @@ -2939,14 +2939,26 @@ interp_method(imethod)
}

if (is_parallel) {


{
char buff[1024];
sprintf(buff,"BOB: Interp H1 sf.size=%d dF.size=%d",srcF.size(),dstF.size());
ESMC_LogDefault.Write(buff, ESMC_LOGMSG_INFO);
}

// Form the parallel rendezvous meshes/specs
// if (Par::Rank() == 0)
//std::cout << "Building rendezvous..." << std::endl;
grend.Build(srcF.size(), (srcF.size()>0)?(&srcF[0]):NULL,
dstF.size(), (dstF.size()>0)?(&dstF[0]):NULL,
&zz, midmesh==0? true:false);

{
char buff[1024];
sprintf(buff,"BOB: Interp H2 grend.status=%d",grend.status);
ESMC_LogDefault.Write(buff, ESMC_LOGMSG_INFO);
}

// Check grend status, if it's not complete
if (grend.status != GEOMREND_STATUS_COMPLETE) {
if (grend.status == GEOMREND_STATUS_NO_DST) {
Expand Down

0 comments on commit 57223ef

Please sign in to comment.