From f5f3c79edcd449fabd464e397318337aea603ca9 Mon Sep 17 00:00:00 2001 From: James E McClure Date: Sat, 26 May 2018 07:30:10 -0400 Subject: [PATCH] lbpm_serial decomp refactor --- tests/lbpm_serial_decomp.cpp | 53 ++++++++++++++++++++++++++++++++---- 1 file changed, 47 insertions(+), 6 deletions(-) diff --git a/tests/lbpm_serial_decomp.cpp b/tests/lbpm_serial_decomp.cpp index b7a86d5b..15dcf955 100644 --- a/tests/lbpm_serial_decomp.cpp +++ b/tests/lbpm_serial_decomp.cpp @@ -18,7 +18,7 @@ int main(int argc, char **argv) int rank=0; - bool MULTINPUT=false; +/* bool MULTINPUT=false; int NWP,SOLID,rank_offset; SOLID=atoi(argv[1]); @@ -35,7 +35,13 @@ int main(int argc, char **argv) MULTINPUT=true; rank_offset=0; } - + */ + if (argc > 1) + filename=argv[1]; + else{ + ERROR("lbpm_serial_decomp: no in put database provided \n"); + } + //....................................................................... // Reading the domain information file //....................................................................... @@ -48,11 +54,36 @@ int main(int argc, char **argv) int64_t xStart,yStart,zStart; // char fluidValue,solidValue; - std::vector solidValues; - std::vector nwpValues; - std::string line; + // read the input database + db = std::make_shared( filename ); + domain_db = db->getDatabase( "Domain" ); - if (rank==0){ + // Read domain parameters + auto L = domain_db->getVector( "L" ); + auto size = domain_db->getVector( "n" ); + auto nproc = domain_db->getVector( "nproc" ); + auto ReadValues = domain_db->getVector( "ReadValues" ); + auto WriteValues = domain_db->getVector( "WriteValues" ); + + BoundaryCondition = domain_db->getScalar( "BC" ); + nx = size[0]; + ny = size[1]; + nz = size[2]; + nx = L[0]; + ny = L[1]; + nz = L[2]; + nprocx = nproc[0]; + nprocy = nproc[1]; + nprocz = nproc[2]; + + printf("Relabeling %i values\n",ReadValues.size()); + for (int idx=0; idx> nprocx; domain >> nprocy; @@ -75,6 +106,7 @@ int main(int argc, char **argv) image >> zStart; } + */ nprocs=nprocx*nprocy*nprocz; char *SegData = NULL; @@ -136,6 +168,15 @@ int main(int argc, char **argv) for (j=0;j