return ret;
}
+bool MEDPARTITIONER::MEDPartitioner::HasMetisAlg()
+{
+#ifdef MED_ENABLE_METIS
+ return true;
+#else
+ return false;
+#endif
+}
+
+bool MEDPARTITIONER::MEDPartitioner::HasScotchAlg()
+{
+#ifdef MED_ENABLE_SCOTCH
+ return true;
+#else
+ return false;
+#endif
+}
+
+bool MEDPARTITIONER::MEDPartitioner::HasPTScotchAlg()
+{
+#ifdef MED_ENABLE_PTSCOTCH
+ return true;
+#else
+ return false;
+#endif
+}
+
std::vector<std::string> MEDPARTITIONER::MEDPartitioner::AllAlgorithms()
{
std::vector<std::string> ret;
static MEDPARTITIONER::Graph* Graph(MEDCoupling::MEDCouplingSkyLineArray* graph, Graph::splitter_type split=Graph::METIS, int* edgeweight=0, DataArrayInt* vlbloctab=0);
static std::vector<std::string> AvailableAlgorithms();
static std::vector<std::string> AllAlgorithms();
+ static bool HasMetisAlg();
+ static bool HasScotchAlg();
+ static bool HasPTScotchAlg();
void write(const std::string& filename);
MEDCoupling::MEDFileData* getMEDFileData();
~MEDPartitioner();
@unittest.skipUnless(HasPartitionerExt(),"Requires Partitioner activation")
def test3(self):
- algoSelected=eval("Graph.%s"%MEDPartitioner.AvailableAlgorithms()[0].upper())
+ for alg in MEDPartitioner.AvailableAlgorithms():
+ st="Graph.%s"%alg.upper()
+ print(st)
+ self.partitionerTesterHelper(eval(st))
+ pass
+ pass
+
+ @unittest.skipUnless(HasParallelInterpolatorExt(),"Requires // interpolator activated")
+ def test4(self):
+ interface=CommInterface()
+ pass
+
+ def partitionerTesterHelper(self,algoSelected):
arr=DataArrayDouble(10) ; arr.iota()
m=MEDCouplingCMesh() ; m.setCoords(arr,arr)
m=m.buildUnstructured() ; m.setName("mesh")
m0=m[procIdOnCells.findIdsEqual(0)] ; m0.setName("m0")
pass
- @unittest.skipUnless(HasParallelInterpolatorExt(),"Requires // interpolator activated")
- def test4(self):
- interface=CommInterface()
- pass
-
pass
if __name__ == "__main__":
#endif
}
+ bool HasScotchPartitionerAlg()
+ {
+#ifdef WITH_PARTITIONER
+ return MEDPartitioner::HasScotchAlg();
+#else
+ return false;
+#endif
+ }
+
+ bool HasPTScotchPartitionerAlg()
+ {
+#ifdef WITH_PARTITIONER
+ return MEDPartitioner::HasPTScotchAlg();
+#else
+ return false;
+#endif
+ }
+
+ bool HasMetisPartitionerAlg()
+ {
+#ifdef WITH_PARTITIONER
+ return MEDPartitioner::HasMetisAlg();
+#else
+ return false;
+#endif
+ }
+
bool HasParallelInterpolatorExt()
{
#ifdef WITH_PARALLEL_INTERPOLATOR