Loading src/TNL/Meshes/DistributedGrid.h +14 −6 Original line number Diff line number Diff line Loading @@ -23,7 +23,7 @@ namespace Meshes { typename Real >*/ template<typename GridType, int meshDimensions= GridType::meshDimension> int meshDimensions= GridType::getMeshDimension()> class DistributedGrid { Loading Loading @@ -86,7 +86,7 @@ class DistributedGrid <GridType,1> public: //compute everithing DistributedGrid(GridType globalGrid) DistributedGrid(GridType globalGrid, int *distribution=NULL) { //fuj Loading Loading @@ -229,7 +229,7 @@ class DistributedGrid <GridType,2> public: //compute everithing DistributedGrid(GridType globalGrid) DistributedGrid(GridType globalGrid,int *distribution=NULL) { //fuj Loading @@ -239,7 +239,7 @@ class DistributedGrid <GridType,2> for (int i=0;i<8;i++) neighbors[i]=-1; Dimensions= GridType::meshDimension; Dimensions= GridType::getMeshDimension(); GlobalGrid=globalGrid; //Detect MPI and number of process mpiInUse=false; Loading Loading @@ -270,8 +270,16 @@ class DistributedGrid <GridType,2> { //With MPI //compute node distribution if(distribution!=NULL) { procsdistr[0]=distribution[0]; procsdistr[1]=distribution[1]; } else { procsdistr[0]=0; procsdistr[1]=0; } MPI_Dims_create(nproc, 2, procsdistr); myproccoord[0]=rank%procsdistr[0]; // CO je X a co Y? --x je 0 a je to sloupec myproccoord[1]=rank/procsdistr[0]; Loading tests/mpi/MeshFunctionEvauateTest.cpp +3 −2 Original line number Diff line number Diff line Loading @@ -18,7 +18,7 @@ using namespace std; #include <TNL/Timer.h> //#define OUTPUT #define OUTPUT #include "Functions.h" Loading Loading @@ -73,7 +73,8 @@ int main ( int argc, char *argv[]) globalGrid.setDimensions(size,size); globalGrid.setDomain(globalOrigin,globalProportions); DistributedGrid<MeshType> distrgrid(globalGrid); int distr[2]={0,1}; DistributedGrid<MeshType> distrgrid(globalGrid, distr); SharedPointer<MeshType> gridptr; SharedPointer<MeshFunctionType> meshFunctionptr; Loading Loading
src/TNL/Meshes/DistributedGrid.h +14 −6 Original line number Diff line number Diff line Loading @@ -23,7 +23,7 @@ namespace Meshes { typename Real >*/ template<typename GridType, int meshDimensions= GridType::meshDimension> int meshDimensions= GridType::getMeshDimension()> class DistributedGrid { Loading Loading @@ -86,7 +86,7 @@ class DistributedGrid <GridType,1> public: //compute everithing DistributedGrid(GridType globalGrid) DistributedGrid(GridType globalGrid, int *distribution=NULL) { //fuj Loading Loading @@ -229,7 +229,7 @@ class DistributedGrid <GridType,2> public: //compute everithing DistributedGrid(GridType globalGrid) DistributedGrid(GridType globalGrid,int *distribution=NULL) { //fuj Loading @@ -239,7 +239,7 @@ class DistributedGrid <GridType,2> for (int i=0;i<8;i++) neighbors[i]=-1; Dimensions= GridType::meshDimension; Dimensions= GridType::getMeshDimension(); GlobalGrid=globalGrid; //Detect MPI and number of process mpiInUse=false; Loading Loading @@ -270,8 +270,16 @@ class DistributedGrid <GridType,2> { //With MPI //compute node distribution if(distribution!=NULL) { procsdistr[0]=distribution[0]; procsdistr[1]=distribution[1]; } else { procsdistr[0]=0; procsdistr[1]=0; } MPI_Dims_create(nproc, 2, procsdistr); myproccoord[0]=rank%procsdistr[0]; // CO je X a co Y? --x je 0 a je to sloupec myproccoord[1]=rank/procsdistr[0]; Loading
tests/mpi/MeshFunctionEvauateTest.cpp +3 −2 Original line number Diff line number Diff line Loading @@ -18,7 +18,7 @@ using namespace std; #include <TNL/Timer.h> //#define OUTPUT #define OUTPUT #include "Functions.h" Loading Loading @@ -73,7 +73,8 @@ int main ( int argc, char *argv[]) globalGrid.setDimensions(size,size); globalGrid.setDomain(globalOrigin,globalProportions); DistributedGrid<MeshType> distrgrid(globalGrid); int distr[2]={0,1}; DistributedGrid<MeshType> distrgrid(globalGrid, distr); SharedPointer<MeshType> gridptr; SharedPointer<MeshFunctionType> meshFunctionptr; Loading