diff --git a/libsrc/interface/nginterface.cpp b/libsrc/interface/nginterface.cpp index cf04bb1a..d1522172 100644 --- a/libsrc/interface/nginterface.cpp +++ b/libsrc/interface/nginterface.cpp @@ -72,7 +72,7 @@ { bool parthread = netgen::mparam.parthread; - if (netgen::id > 0) parthread = true; + if (netgen::id > 0) parthread = false; // if (netgen::ntasks > 1) parthread = false; if (parthread) diff --git a/libsrc/meshing/paralleltop.cpp b/libsrc/meshing/paralleltop.cpp index 1087eaac..b297c868 100644 --- a/libsrc/meshing/paralleltop.cpp +++ b/libsrc/meshing/paralleltop.cpp @@ -103,7 +103,7 @@ namespace netgen // overlap = 0; } - + /* int ParallelMeshTopology :: Glob2Loc_Vert (int globnum) { for (int i = 1; i <= nv; i++) @@ -138,7 +138,7 @@ namespace netgen locnum = i+1; return locnum; } - + */ void ParallelMeshTopology :: Print() const @@ -856,10 +856,72 @@ namespace netgen NgProfiler::StartTimer (timere); + // exchange edges + int maxedge = 0; + for (int edge = 1; edge <= ned; edge++) + maxedge = max (maxedge, GetDistantEdgeNum (0, edge)); + + glob2loc.SetSize (maxedge); + glob2loc = -1; + + for (int edge = 1; edge <= ned; edge++) + glob2loc[GetDistantEdgeNum(0, edge)] = edge; + + cnt_send = 0; + int v1, v2; + for (int edge = 1; edge <= ned; edge++) + { + topology.GetEdgeVertices (edge, v1, v2); + for (int dest = 1; dest < ntasks; dest++) + if (IsExchangeVert (dest, v1) && + IsExchangeVert (dest, v2)) + { + cnt_send[dest-1]+=2; + } + } + + TABLE send_edges(cnt_send); + for (int edge = 1; edge <= ned; edge++) + { + topology.GetEdgeVertices (edge, v1, v2); + for (int dest = 1; dest < ntasks; dest++) + { + if (IsExchangeVert (dest, v1) && + IsExchangeVert (dest, v2)) + { + send_edges.Add (dest-1, GetDistantEdgeNum(0, edge)); + send_edges.Add (dest-1, edge); + } + } + } + TABLE recv_edges(ntasks-1); + MyMPI_ExchangeTable (send_edges, recv_edges, MPI_TAG_MESH+8, MPI_HIGHORDER_COMM); + + *testout << "send exchange edges: " << send_edges << endl; + *testout << "recv exchange edges: " << recv_edges << endl; + + for (int sender = 1; sender < ntasks; sender ++) + if (id != sender) + { + FlatArray recvarray = recv_edges[sender-1]; + + for (int ii = 0; ii < recvarray.Size(); ) + { + int globe = recvarray[ii++]; + int diste = recvarray[ii++]; + int loce = glob2loc[globe]; + + // *testout << "set distant face, sender = " << sender << ", locf = " << locf << "; distf = " << distf << endl; + if (loce != -1) + SetDistantEdgeNum (sender, loce, diste); + } + } + + + /* sendarray.SetSize (0); recvarray.SetSize (0); - // exchange edges int maxedge = 0; for (int edge = 1; edge <= ned; edge++) @@ -897,8 +959,9 @@ namespace netgen } } } - + */ NgProfiler::StopTimer (timere); + NgProfiler::StartTimer (timerf); glob2loc.SetSize (nfaglob); @@ -1157,6 +1220,7 @@ namespace netgen void ParallelMeshTopology :: UpdateTopology () { +#ifdef OLD const MeshTopology & topology = mesh.GetTopology(); int nfa = topology.GetNFaces(); int ned = topology.GetNEdges(); @@ -1189,6 +1253,7 @@ namespace netgen } } */ +#endif } diff --git a/libsrc/meshing/paralleltop.hpp b/libsrc/meshing/paralleltop.hpp index 9edf9339..dc945fe0 100644 --- a/libsrc/meshing/paralleltop.hpp +++ b/libsrc/meshing/paralleltop.hpp @@ -62,10 +62,12 @@ namespace netgen void GetVertNeighbours ( int vnum, Array & dests ) const; + /* int Glob2Loc_SurfEl ( int globnum ); int Glob2Loc_VolEl ( int globnum ); int Glob2Loc_Segm ( int globnum ); int Glob2Loc_Vert ( int globnum ); + */ int GetNDistantPNums ( int locpnum ) const { return loc2distvert[locpnum].Size() / 2 + 1; } diff --git a/libsrc/meshing/topology.cpp b/libsrc/meshing/topology.cpp index 67b538f2..5f46d553 100644 --- a/libsrc/meshing/topology.cpp +++ b/libsrc/meshing/topology.cpp @@ -1080,7 +1080,6 @@ namespace netgen #ifdef PARALLEL (*testout) << " RESET Paralleltop" << endl; - paralleltop.Reset (); #endif @@ -1207,26 +1206,15 @@ namespace netgen ; // cout << "p" << id << ": " << "Partition " << id << " is totally local" << endl; #endif - } #ifdef PARALLEL - if ( isparallel ) { paralleltop.Update(); if ( paralleltop.DoCoarseUpdate() ) - { - paralleltop.UpdateCoarseGrid(); - } - else - { - // paralleltop.UpdateRefinement(); - } - // paralleltop.Print(); + paralleltop.UpdateCoarseGrid(); } - - #endif diff --git a/ng/acisgeom.tcl b/ng/acisgeom.tcl index 9ec6523c..fab80aa4 100644 --- a/ng/acisgeom.tcl +++ b/ng/acisgeom.tcl @@ -1,4 +1,3 @@ - if { [Ng_ACISCommand isACISavailable] == "yes" } { .ngmenu.geometry add command -label "ACIS Topology Explorer..." \ -command { acisdialog; } diff --git a/ng/ng.tcl b/ng/ng.tcl index 85444604..328efcbb 100644 --- a/ng/ng.tcl +++ b/ng/ng.tcl @@ -1,11 +1,11 @@ if {[catch {package require Tix } result ]} { - puts "cannot find package Tix" + puts "cannot load package Tix" puts "error : $result" } # if {[catch {package require Togl 2.0 } result ]} { -# puts "cannot find package Togl 2.0" -# puts "error : $result" +# puts "cannot load package Togl 2.0" +# puts "error : $result" # } @@ -43,7 +43,8 @@ if { [string length $nguserdir] == 0 } { set batchmode [Ng_GetCommandLineParameter batchmode] set solvemode 0 -if { [Ng_GetCommandLineParameter solve] != "undefined" || [Ng_GetCommandLineParameter recent] == "defined" } { +if { [Ng_GetCommandLineParameter solve] != "undefined" || \ + [Ng_GetCommandLineParameter recent] == "defined" } { set solvemode defined } @@ -98,21 +99,10 @@ catch { source ${ngdir}/occgeom.tcl } source ${ngdir}/acisgeom.tcl - -catch { - source ${ngdir}/nghelp.tcl -} -catch { - source ${ngdir}/ngvisual.tcl -} - -catch { - source ${ngdir}/sockets.tcl -} - -catch { - source ${ngdir}/acis.tcl -} +catch { source ${ngdir}/nghelp.tcl } +catch { source ${ngdir}/ngvisual.tcl } +catch { source ${ngdir}/sockets.tcl } +catch { source ${ngdir}/acis.tcl } @@ -286,25 +276,13 @@ if { [Ng_GetCommandLineParameter help]=="defined" } { } } + if { [file exists startup.tcl] } { source startup.tcl } -################################################## -# catch { source ${ngdir}/trafo/trafo.tcl } - -# catch { source ${ngdir}/trafoapp/smallmodels.tcl } - -# catch { -# source ${ngdir}/ngshell.tcl -# source ${ngdir}/ngtesting.tcl -# } - - - - catch { source ${ngdir}/demoapp.tcl } catch { source ${ngdir}/dropsexp.tcl }