From 0a9b74185fe49b28d96960a88838487b3bc91242 Mon Sep 17 00:00:00 2001 From: Joachim Schoeberl Date: Thu, 5 Feb 2015 22:53:17 +0000 Subject: [PATCH] metis partition --- ng/ngpkg.cpp | 23 +++++++++++++++++++++-- 1 file changed, 21 insertions(+), 2 deletions(-) diff --git a/ng/ngpkg.cpp b/ng/ngpkg.cpp index 953fb4ab..f22add78 100644 --- a/ng/ngpkg.cpp +++ b/ng/ngpkg.cpp @@ -2650,14 +2650,33 @@ namespace netgen Tcl_Interp * interp, int argc, tcl_const char *argv[]) { -#ifdef METISold - +#ifdef PARALLEL if (!mesh) { Tcl_SetResult (interp, err_needsmesh, TCL_STATIC); return TCL_ERROR; } + int nparts = atoi (argv[1]); + ntasks = nparts+1; + cout << "calling metis ... " << flush; + mesh->ParallelMetis(); + cout << "done" << endl; + ntasks = 1; + for (ElementIndex ei = 0; ei < mesh->GetNE(); ei++) + (*mesh)[ei].SetIndex ( (*mesh)[ei].GetPartition() ); + + return TCL_OK; + +#else + Tcl_SetResult (interp, (char*)"metis not available", TCL_STATIC); + return TCL_ERROR; + +#endif + + + +#ifdef OLDOLD // METIS Partitioning if (mesh->GetDimension() == 3)