Commit d7217797 authored by Kirill Terekhov's avatar Kirill Terekhov

Update for Zoltan partitioner

Zoltan partitioner now works. Please refer to wiki for compilation with
Zoltan on windows.
parent bab084e8
...@@ -120,6 +120,7 @@ if(USE_PARTITIONER_ZOLTAN) ...@@ -120,6 +120,7 @@ if(USE_PARTITIONER_ZOLTAN)
set(USE_PARTITIONER_ZOLTAN OFF) set(USE_PARTITIONER_ZOLTAN OFF)
message("ZOLTAN NOT FOUND") message("ZOLTAN NOT FOUND")
else() else()
include_directories(${ZOLTAN_INCLUDE_DIR})
include_directories(${ZOLTAN_INCLUDE_DIRS}) include_directories(${ZOLTAN_INCLUDE_DIRS})
set(USE_PARTITIONER_ZOLTAN ON) set(USE_PARTITIONER_ZOLTAN ON)
message("ZOLTAN FOUND") message("ZOLTAN FOUND")
......
...@@ -154,6 +154,7 @@ namespace INMOST ...@@ -154,6 +154,7 @@ namespace INMOST
if( !sparse_data[etypenum].empty() ) ret += sizeof(sparse_sub_type); //size needed to support sparse data if( !sparse_data[etypenum].empty() ) ret += sizeof(sparse_sub_type); //size needed to support sparse data
} }
//Any additional impact of supporting huge structures over all elements may be added later //Any additional impact of supporting huge structures over all elements may be added later
return ret;
} }
else return 0; else return 0;
} }
......
...@@ -58,7 +58,7 @@ namespace INMOST ...@@ -58,7 +58,7 @@ namespace INMOST
globalID[i] = it->GlobalID(); globalID[i] = it->GlobalID();
localID[i] = i; localID[i] = i;
for(int j = 0; j < wgt_dim; j++) for(int j = 0; j < wgt_dim; j++)
obj_wgts[i] = it->RealArray(p->GetWeight())[j]; obj_wgts[i] = static_cast<float>(it->RealArray(p->GetWeight())[j]);
i++; i++;
} }
} }
...@@ -120,11 +120,11 @@ namespace INMOST ...@@ -120,11 +120,11 @@ namespace INMOST
if( it->GetStatus() != Element::Ghost ) if( it->GetStatus() != Element::Ghost )
{ {
numEdges[i] = 0; numEdges[i] = 0;
adjacent<Face> faces = it->getFaces(); ElementArray<Face> faces = it->getFaces();
for(adjacent<Face>::iterator jt = faces.begin(); jt != faces.end(); jt++) for(ElementArray<Face>::iterator jt = faces.begin(); jt != faces.end(); jt++)
{ {
Cell * n = it->Neighbour(&*jt); Cell n = it->Neighbour(jt->self());
if( n != NULL ) numEdges[i]++; if( n.isValid() ) numEdges[i]++;
} }
i++; i++;
} }
...@@ -161,16 +161,16 @@ namespace INMOST ...@@ -161,16 +161,16 @@ namespace INMOST
for(Mesh::iteratorCell it = m->BeginCell(); it != m->EndCell(); it++) for(Mesh::iteratorCell it = m->BeginCell(); it != m->EndCell(); it++)
if( it->GetStatus() != Element::Ghost ) if( it->GetStatus() != Element::Ghost )
{ {
adjacent<Face> faces = it->getFaces(); ElementArray<Face> faces = it->getFaces();
for(adjacent<Face>::iterator jt = faces.begin(); jt != faces.end(); jt++) for(ElementArray<Face>::iterator jt = faces.begin(); jt != faces.end(); jt++)
{ {
Cell * n = it->Neighbour(&*jt); Cell n = it->Neighbour(jt->self());
if( n != NULL ) if( n.isValid() )
{ {
*nextNbor++ = n->GlobalID(); *nextNbor++ = n->GlobalID();
*nextProc++ = n->Integer(m->OwnerTag()); *nextProc++ = n->Integer(m->OwnerTag());
for(int j = 0; j < wgt_dim; j++) for(int j = 0; j < wgt_dim; j++)
*nextWgt++ = jt->RealArray(p->GetWeight())[j]; *nextWgt++ = static_cast<float>(jt->RealArray(p->GetWeight())[j]);
} }
} }
i++; i++;
...@@ -380,7 +380,7 @@ namespace INMOST ...@@ -380,7 +380,7 @@ namespace INMOST
ZOLTAN_ID_PTR importGlobalGids, importLocalGids, exportGlobalGids, exportLocalGids; ZOLTAN_ID_PTR importGlobalGids, importLocalGids, exportGlobalGids, exportLocalGids;
int *importProcs, *importToPart, *exportProcs, *exportToPart; int *importProcs, *importToPart, *exportProcs, *exportToPart;
int rc; int rc;
if( m->Integer(m->LayersTag()) == 0 ) m->ExchangeGhost(1,FACE); if( m->Integer(m->GetHandle(),m->LayersTag()) == 0 ) m->ExchangeGhost(1,FACE);
rc = Zoltan_LB_Partition(static_cast<struct Zoltan_Struct *>(pzz), /* input (all remaining fields are output) */ rc = Zoltan_LB_Partition(static_cast<struct Zoltan_Struct *>(pzz), /* input (all remaining fields are output) */
&changes, /* 1 if partitioning was changed, 0 otherwise */ &changes, /* 1 if partitioning was changed, 0 otherwise */
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment