void partitionInfo(agi::binGraph* g) { lid_t total_verts = g->numTotalVtxs(); lid_t global_verts = g->numGlobalVtxs(); lid_t edges = g->numLocalEdges()+g->numLocalEdges(SPLIT_TYPE); lid_t min = PCU_Min_Int(total_verts); lid_t max = PCU_Max_Int(total_verts); lid_t tot = PCU_Add_Long(total_verts); double avg = ((double)tot)/PCU_Comm_Peers(); double imb = max/avg; double inc = ((double)(tot-global_verts))/global_verts*100; if (!PCU_Comm_Self()) printf("Vertices: Min %lu Max %lu Tot %lu Inc %1.4f Avg %1.4f Imb %1.3f\n",min,max,tot,inc,avg,imb); min = PCU_Min_Int(edges); max = PCU_Max_Int(edges); tot = PCU_Add_Long(edges); avg = ((double)tot)/PCU_Comm_Peers(); imb = max/avg; if (!PCU_Comm_Self()) printf("Edges: Min %lu Max %lu Tot %lu Avg %1.4f Imb %1.3f\n",min,max,tot,avg,imb); lid_t edge_cut =0; agi::EdgeIterator* eitr = g->begin(0); for (int i=0;i<g->numLocalEdges();i++) { agi::GraphEdge* e = g->iterate(eitr); if (g->owner(g->v(e))!=PCU_Comm_Self()) edge_cut++; } edge_cut+=g->numLocalEdges(SPLIT_TYPE); edge_cut = PCU_Add_Long(edge_cut); if (!PCU_Comm_Self()) printf("Edge Cut: %lu\n",edge_cut); }
static Gid getMax(const GlobalToVert& globalToVert) { Gid max = -1; APF_CONST_ITERATE(GlobalToVert, globalToVert, it) max = std::max(max, it->first); return PCU_Max_Int(max); // this is type-dependent }