From f95c22b5cc7aa3e7c1dd641af5c23627069f271d Mon Sep 17 00:00:00 2001 From: Chenhan Yu Date: Wed, 6 Mar 2019 12:31:20 -0600 Subject: [PATCH] chg: change naming rules --- frame/base/util.cpp | 21 ++++++++++++--- frame/base/util.hpp | 2 +- gofmm/gofmm.hpp | 64 ++++++++++++++++++++++---------------------- gofmm/gofmm_mpi.hpp | 16 +++++------ gofmm/igofmm.hpp | 32 +++++++++++----------- gofmm/igofmm_mpi.hpp | 8 +++--- gofmm/tree.hpp | 63 +++++++++++++++---------------------------- gofmm/tree_mpi.hpp | 29 +++++++++++--------- 8 files changed, 117 insertions(+), 118 deletions(-) diff --git a/frame/base/util.cpp b/frame/base/util.cpp index 60fdfde..a01215e 100644 --- a/frame/base/util.cpp +++ b/frame/base/util.cpp @@ -32,12 +32,26 @@ const char* getErrorString( hmlpError_t error ) */ void handleError( hmlpError_t error, const char* file, int line ) { - if ( error == HMLP_ERROR_SUCCESS ) return; - /** Otherwise, handle the error and provide information. */ - printf( "Error: %s in %s at line %d\n", getErrorString( error ), file, line ); + if ( error == HMLP_ERROR_SUCCESS ) + { + return; + } + if ( error < HMLP_ERROR_MPI_ERROR ) + { + /** Otherwise, handle the error and provide information. */ + fprintf( stderr, "Error: HMLP_ERROR_MPI_ERROR %d in %s at line %d\n", + error, file, line ); + } + else + { + /** Otherwise, handle the error and provide information. */ + fprintf( stderr, "Error: %s in %s at line %d\n", + getErrorString( error ), file, line ); + } throw std::invalid_argument( "Program encounters hmlp error." ); }; + hmlpError_t returnIfError( hmlpError_t error, const char* file, int line ) { if ( error == HMLP_ERROR_SUCCESS ) @@ -59,5 +73,4 @@ hmlpError_t returnIfError( hmlpError_t error, const char* file, int line ) return error; }; - }; /* end namespace hmlp */ diff --git a/frame/base/util.hpp b/frame/base/util.hpp index 5d110a2..0a63642 100644 --- a/frame/base/util.hpp +++ b/frame/base/util.hpp @@ -39,7 +39,7 @@ #include -#define HANDLE_ERROR( err ) (hmlp::handleError( err, __FILE__, __LINE__ )) +#define HANDLE_ERROR( err ) (hmlp::handleError( (hmlpError_t)err, __FILE__, __LINE__ )) #define RETURN_IF_ERROR( err ) { auto hmlp_err = hmlp::returnIfError( (hmlpError_t)err, __FILE__, __LINE__ );\ if ( hmlp_err != HMLP_ERROR_SUCCESS ) return hmlp_err; } diff --git a/gofmm/gofmm.hpp b/gofmm/gofmm.hpp index ac3ac4d..9ac7ff1 100644 --- a/gofmm/gofmm.hpp +++ b/gofmm/gofmm.hpp @@ -3057,7 +3057,7 @@ Data Evaluate( TREE &tree, Data &weights ) double forward_permute_time, backward_permute_time; /** clean up all r/w dependencies left on tree nodes */ - tree.DependencyCleanUp(); + HANDLE_ERROR( tree.dependencyClean() ); /** n-by-nrhs initialize potentials */ size_t n = weights.row(); @@ -3139,10 +3139,10 @@ Data Evaluate( TREE &tree, Data &weights ) // if ( USE_OMP_TASK ) // { // assert( !USE_RUNTIME ); -// tree.template TraverseLeafs( leaftoleaftask1 ); -// tree.template TraverseLeafs( leaftoleaftask2 ); -// tree.template TraverseLeafs( leaftoleaftask3 ); -// tree.template TraverseLeafs( leaftoleaftask4 ); +// tree.template traverseLeafs( leaftoleaftask1 ); +// tree.template traverseLeafs( leaftoleaftask2 ); +// tree.template traverseLeafs( leaftoleaftask3 ); +// tree.template traverseLeafs( leaftoleaftask4 ); // tree.template UpDown( nodetoskeltask, skeltoskeltask, skeltonodetask ); // } // else @@ -3150,19 +3150,19 @@ Data Evaluate( TREE &tree, Data &weights ) // assert( !USE_OMP_TASK ); // //#ifdef HMLP_USE_CUDA -// tree.template TraverseLeafs( leaftoleafver2task ); +// tree.template traverseLeafs( leaftoleafver2task ); //#else -// tree.template TraverseLeafs( leaftoleaftask1 ); -// tree.template TraverseLeafs( leaftoleaftask2 ); -// tree.template TraverseLeafs( leaftoleaftask3 ); -// tree.template TraverseLeafs( leaftoleaftask4 ); +// tree.template traverseLeafs( leaftoleaftask1 ); +// tree.template traverseLeafs( leaftoleaftask2 ); +// tree.template traverseLeafs( leaftoleaftask3 ); +// tree.template traverseLeafs( leaftoleaftask4 ); //#endif // // /** check scheduler */ // //hmlp_get_runtime_handle()->scheduler->ReportRemainingTime(); -// tree.template TraverseUp ( nodetoskeltask ); -// tree.template TraverseUnOrdered( skeltoskeltask ); -// tree.template TraverseDown ( skeltonodetask ); +// tree.template traverseUp ( nodetoskeltask ); +// tree.template traverseUnOrdered( skeltoskeltask ); +// tree.template traverseDown ( skeltonodetask ); // /** check scheduler */ // //hmlp_get_runtime_handle()->scheduler->ReportRemainingTime(); // @@ -3184,16 +3184,16 @@ Data Evaluate( TREE &tree, Data &weights ) /** CPU-GPU hybrid uses a different kind of L2L task */ #ifdef HMLP_USE_CUDA - tree.TraverseLeafs( leaftoleafver2task ); + tree.traverseLeafs( leaftoleafver2task ); #else - tree.TraverseLeafs( leaftoleaftask1 ); - tree.TraverseLeafs( leaftoleaftask2 ); - tree.TraverseLeafs( leaftoleaftask3 ); - tree.TraverseLeafs( leaftoleaftask4 ); + tree.traverseLeafs( leaftoleaftask1 ); + tree.traverseLeafs( leaftoleaftask2 ); + tree.traverseLeafs( leaftoleaftask3 ); + tree.traverseLeafs( leaftoleaftask4 ); #endif - tree.TraverseUp( nodetoskeltask ); - tree.TraverseUnOrdered( skeltoskeltask ); - tree.TraverseDown( skeltonodetask ); + tree.traverseUp( nodetoskeltask ); + tree.traverseUnOrdered( skeltoskeltask ); + tree.traverseDown( skeltonodetask ); tree.ExecuteAllTasks(); //if ( USE_RUNTIME ) hmlp_run(); @@ -3297,7 +3297,7 @@ Data Evaluate( TREE &tree, Data &weights ) /** clean up all r/w dependencies left on tree nodes */ - tree.DependencyCleanUp(); + HANDLE_ERROR( tree.dependencyClean() ); /** return nrhs-by-N outputs */ return potentials; @@ -3393,10 +3393,10 @@ tree::Tree< gofmm::Setup, gofmm::NodeData> if ( REPORT_COMPRESS_STATUS ) { - printf( "TreePartitioning ...\n" ); fflush( stdout ); + printf( "partitioning ...\n" ); fflush( stdout ); } beg = omp_get_wtime(); - HANDLE_ERROR( tree.TreePartition() ); + HANDLE_ERROR( tree.partition() ); tree_time = omp_get_wtime() - beg; @@ -3422,9 +3422,9 @@ tree::Tree< gofmm::Setup, gofmm::NodeData> /** Build near interaction lists. */ NearSamplesTask NEARSAMPLEStask; - tree.DependencyCleanUp(); + HANDLE_ERROR( tree.dependencyClean() ); printf( "Dependency clean up\n" ); fflush( stdout ); - tree.TraverseLeafs( NEARSAMPLEStask ); + tree.traverseLeafs( NEARSAMPLEStask ); tree.ExecuteAllTasks(); //hmlp_run(); printf( "Finish NearSamplesTask\n" ); fflush( stdout ); @@ -3442,13 +3442,13 @@ tree::Tree< gofmm::Setup, gofmm::NodeData> gofmm::SkeletonKIJTask GETMTXtask; gofmm::SkeletonizeTask SKELtask; gofmm::InterpolateTask PROJtask; - tree.DependencyCleanUp(); - tree.TraverseUp( GETMTXtask, SKELtask ); - tree.TraverseUnOrdered( PROJtask ); + HANDLE_ERROR( tree.dependencyClean() ); + tree.traverseUp( GETMTXtask, SKELtask ); + tree.traverseUnOrdered( PROJtask ); if ( CACHE ) { gofmm::CacheNearNodesTask KIJtask; - tree.template TraverseLeafs( KIJtask ); + tree.template traverseLeafs( KIJtask ); } other_time += omp_get_wtime() - beg; hmlp_run(); @@ -3490,7 +3490,7 @@ tree::Tree< gofmm::Setup, gofmm::NodeData> printf( "GOFMM compression phase\n" ); printf( "========================================================\n"); printf( "NeighborSearch ------------------------ %5.2lfs (%5.1lf%%)\n", ann_time, ann_time * time_ratio ); - printf( "TreePartitioning ---------------------- %5.2lfs (%5.1lf%%)\n", tree_time, tree_time * time_ratio ); + printf( "partitioning ---------------------- %5.2lfs (%5.1lf%%)\n", tree_time, tree_time * time_ratio ); printf( "Skeletonization ----------------------- %5.2lfs (%5.1lf%%)\n", skel_time, skel_time * time_ratio ); printf( "MergeFarNodes ------------------------- %5.2lfs (%5.1lf%%)\n", mergefarnodes_time, mergefarnodes_time * time_ratio ); printf( "CacheFarNodes ------------------------- %5.2lfs (%5.1lf%%)\n", cachefarnodes_time, cachefarnodes_time * time_ratio ); @@ -3501,7 +3501,7 @@ tree::Tree< gofmm::Setup, gofmm::NodeData> } /** Clean up all r/w dependencies left on tree nodes. */ - tree_ptr->DependencyCleanUp(); + HANDLE_ERROR( tree_ptr->dependencyClean() ); /** Return the hierarhical compreesion of K as a binary tree. */ return tree_ptr; } diff --git a/gofmm/gofmm_mpi.hpp b/gofmm/gofmm_mpi.hpp index 3c4f5f4..bf117bf 100644 --- a/gofmm/gofmm_mpi.hpp +++ b/gofmm/gofmm_mpi.hpp @@ -3805,7 +3805,7 @@ DistData Evaluate( TREE &tree, DistData &weights ) double forward_permute_time, backward_permute_time; /** Clean up all r/w dependencies left on tree nodes. */ - tree.DependencyCleanUp(); + HANDLE_ERROR( tree.dependencyClean() ); /** n-by-nrhs, initialize potentials. */ size_t n = weights.row(); @@ -3891,7 +3891,7 @@ DistData Evaluate( TREE &tree, DistData &weights ) /** Stage 1: TreeView and upward telescoping */ beg = omp_get_wtime(); - tree.DependencyCleanUp(); + HANDLE_ERROR( tree.dependencyClean() ); tree.DistTraverseDown( mpiVIEWtask ); tree.LocaTraverseDown( seqVIEWtask ); tree.ExecuteAllTasks(); @@ -4122,8 +4122,8 @@ mpitree::Tree, gofmm::NodeData> mpi::PrintProgress( "[BEG] Skeletonization ...", tree.GetComm() ); /** Skeletonization */ - beg = omp_get_wtime(); - tree.DependencyCleanUp(); + beg = omp_get_wtime(); + HANDLE_ERROR( tree.dependencyClean() ); /** Gather sample rows and skeleton columns, then ID */ gofmm::SkeletonKIJTask seqGETMTXtask; mpigofmm::DistSkeletonKIJTask mpiGETMTXtask; @@ -4141,7 +4141,7 @@ mpitree::Tree, gofmm::NodeData> tree.ExecuteAllTasks(); skel_time = omp_get_wtime() - beg; - beg = omp_get_wtime(); + beg = omp_get_wtime(); tree.DistTraverseUp( mpiGETMTXtask, mpiSKELtask ); tree.DistTraverseUnOrdered( mpiPROJtask ); tree.ExecuteAllTasks(); @@ -4155,7 +4155,7 @@ mpitree::Tree, gofmm::NodeData> /** Find and merge far interactions. */ mpi::PrintProgress( "[BEG] MergeFarNodes ...", tree.GetComm() ); beg = omp_get_wtime(); - tree.DependencyCleanUp(); + HANDLE_ERROR( tree.dependencyClean() ); MergeFarNodesTask seqMERGEtask; DistMergeFarNodesTask mpiMERGEtask; tree.LocaTraverseUp( seqMERGEtask ); @@ -4256,8 +4256,8 @@ mpitree::Tree, gofmm::NodeData> printf( "========================================================\n\n"); } - /** Cleanup all w/r dependencies on tree nodes */ - tree_ptr->DependencyCleanUp(); + /* Cleanup all w/r dependencies on tree nodes */ + HANDLE_ERROR( tree_ptr->dependencyClean() ); /** Global barrier to make sure all processes have completed */ mpi::Barrier( tree.GetComm() ); diff --git a/gofmm/igofmm.hpp b/gofmm/igofmm.hpp index cdacb88..fc37fec 100644 --- a/gofmm/igofmm.hpp +++ b/gofmm/igofmm.hpp @@ -1549,29 +1549,29 @@ hmlpError_t Solve( TREE &tree, Data &input ) if ( tree.setup.do_ulv_factorization ) { /** clean up all dependencies on tree nodes */ - tree.DependencyCleanUp(); - tree.TraverseDown( treeviewtask ); - tree.TraverseLeafs( forwardpermutetask ); - tree.TraverseUp( ulvforwardsolvetask ); - tree.TraverseDown( ulvbackwardsolvetask ); + RETURN_IF_ERROR( tree.dependencyClean() ); + tree.traverseDown( treeviewtask ); + tree.traverseLeafs( forwardpermutetask ); + tree.traverseUp( ulvforwardsolvetask ); + tree.traverseDown( ulvbackwardsolvetask ); if ( USE_RUNTIME ) hmlp_run(); /** clean up all dependencies on tree nodes */ - tree.DependencyCleanUp(); - tree.TraverseLeafs( inversepermutetask ); + RETURN_IF_ERROR( tree.dependencyClean() ); + tree.traverseLeafs( inversepermutetask ); if ( USE_RUNTIME ) hmlp_run(); } else { /** clean up all dependencies on tree nodes */ - tree.DependencyCleanUp(); - tree.TraverseDown( treeviewtask ); - tree.TraverseLeafs( forwardpermutetask ); - tree.TraverseUp( solvetask1 ); + RETURN_IF_ERROR( tree.dependencyClean() ); + tree.traverseDown( treeviewtask ); + tree.traverseLeafs( forwardpermutetask ); + tree.traverseUp( solvetask1 ); if ( USE_RUNTIME ) hmlp_run(); /** clean up all dependencies on tree nodes */ - tree.DependencyCleanUp(); - tree.TraverseLeafs( inversepermutetask ); + RETURN_IF_ERROR( tree.dependencyClean() ); + tree.traverseLeafs( inversepermutetask ); if ( USE_RUNTIME ) hmlp_run(); } @@ -1859,7 +1859,7 @@ hmlpError_t Factorize( TREE &tree, T lambda ) using NODE = typename TREE::NODE; /** Clean up all dependencies on tree nodes. */ - tree.DependencyCleanUp(); + RETURN_IF_ERROR( tree.dependencyClean() ); /** Regularization parameter lambda. */ tree.setup.lambda = lambda; @@ -1869,12 +1869,12 @@ hmlpError_t Factorize( TREE &tree, T lambda ) /** Setup */ SetupFactorTask setupfactortask; - tree.TraverseUp( setupfactortask ); + tree.traverseUp( setupfactortask ); tree.ExecuteAllTasks(); /** Factorization */ FactorizeTask factorizetask; - tree.TraverseUp( factorizetask ); + tree.traverseUp( factorizetask ); tree.ExecuteAllTasks(); return HMLP_ERROR_SUCCESS; diff --git a/gofmm/igofmm_mpi.hpp b/gofmm/igofmm_mpi.hpp index 329a782..9a84c4d 100644 --- a/gofmm/igofmm_mpi.hpp +++ b/gofmm/igofmm_mpi.hpp @@ -352,7 +352,7 @@ class DistULVBackwardSolveTask : public Task /** @biref Top-level factorization routine. */ template -void DistFactorize( TREE &tree, T lambda ) +hmlpError_t DistFactorize( TREE &tree, T lambda ) { using NODE = typename TREE::NODE; using MPINODE = typename TREE::MPINODE; @@ -367,7 +367,7 @@ void DistFactorize( TREE &tree, T lambda ) DistSetupFactorTask parSETUPFACTORtask; mpi::PrintProgress( "[BEG] DistFactorize setup ...\n", tree.GetComm() ); - tree.DependencyCleanUp(); + RETURN_IF_ERROR( tree.dependencyClean() ); tree.LocaTraverseUp( seqSETUPFACTORtask ); tree.DistTraverseUp( parSETUPFACTORtask ); tree.ExecuteAllTasks(); @@ -381,7 +381,9 @@ void DistFactorize( TREE &tree, T lambda ) tree.ExecuteAllTasks(); mpi::PrintProgress( "[END] DistFactorize ...\n", tree.GetComm() ); -}; /** end DistFactorize() */ + /* Return with no error. */ + return HMLP_ERROR_SUCCESS; +}; /* end DistFactorize() */ template diff --git a/gofmm/tree.hpp b/gofmm/tree.hpp index aa636f8..51c8b2b 100644 --- a/gofmm/tree.hpp +++ b/gofmm/tree.hpp @@ -1067,7 +1067,7 @@ class Tree }; /** - * \return the local tree height + * \returns the local tree height */ depthType getLocalHeight() const noexcept { @@ -1075,7 +1075,7 @@ class Tree }; /** - * \return the global tree height + * \returns the global tree height */ depthType getGlobalHeight() const noexcept { @@ -1122,25 +1122,6 @@ class Tree return *(treelist_.begin() + n_nodes - 1 + i); } - - //NODE* getFirstNodeAtLocalDepth( depthType depth ) noexcept - //{ - // if ( depth > getLocalHeight() ) - // { - // throw std::out_of_range( "accessing invalid local tree depth" ); - // } - // int n_nodes = 1 << depth; - // //auto level_beg = this->treelist_.begin() + n_nodes - 1; - - // //return getLocalRoot() + ( n_nodes - 1 ); - // return *(treelist_.begin() + n_nodes - 1); - //}; - - //NODE *getFirstLeafNode() noexcept - //{ - // return getFirstNodeAtLocalDepth( getLocalHeight() ); - //}; - std::vector & getOwnedIndices() { if ( getLocalNodeSize() == 0 ) @@ -1194,7 +1175,7 @@ class Tree * \brief Parition and create a complete binary tree in shared memory tree. * \return the error code */ - hmlpError_t TreePartition() + hmlpError_t partition() { double beg, alloc_time, split_time, morton_time, permute_time; @@ -1222,7 +1203,7 @@ class Tree /** Recursive spliting (topdown). */ beg = omp_get_wtime(); SplitTask splittask; - RETURN_IF_ERROR( TraverseDown( splittask ) ); + RETURN_IF_ERROR( traverseDown( splittask ) ); RETURN_IF_ERROR( ExecuteAllTasks() ); split_time = omp_get_wtime() - beg; @@ -1243,12 +1224,12 @@ class Tree /** Adgust gids to the appropriate order. */ IndexPermuteTask indexpermutetask; - RETURN_IF_ERROR( TraverseUp( indexpermutetask ) ); + RETURN_IF_ERROR( traverseUp( indexpermutetask ) ); RETURN_IF_ERROR( ExecuteAllTasks() ); /* Return with no error. */ return HMLP_ERROR_SUCCESS; - }; /* end TreePartition() */ + }; /* end partition() */ @@ -1309,10 +1290,8 @@ class Tree for ( sizeType t = 0; t < n_tree; t ++ ) { /** Randomize metric tree and exhausted search for each leaf node. */ - RETURN_IF_ERROR( TreePartition() ); - printf( "TreePartition\n" ); fflush( stdout ); - RETURN_IF_ERROR( TraverseLeafs( dummy ) ); - printf( "TraverseLeaf\n" ); fflush( stdout ); + RETURN_IF_ERROR( partition() ); + RETURN_IF_ERROR( traverseLeafs( dummy ) ); RETURN_IF_ERROR( ExecuteAllTasks() ); } @@ -1390,7 +1369,7 @@ class Tree template - hmlpError_t TraverseLeafs( TASK &dummy, Args&... args ) + hmlpError_t traverseLeafs( TASK &dummy, Args&... args ) { /* Return with no error. */ if ( getLocalNodeSize() == 0 ) @@ -1423,14 +1402,14 @@ class Tree } /* Return with no error. */ return HMLP_ERROR_SUCCESS; - }; /** end TraverseLeafs() */ + }; /** end traverseLeafs() */ template - hmlpError_t TraverseUp( TASK &dummy, Args&... args ) + hmlpError_t traverseUp( TASK &dummy, Args&... args ) { /* Return with no error. */ if ( getLocalNodeSize() == 0 ) @@ -1478,7 +1457,7 @@ class Tree } /* Return with no error. */ return HMLP_ERROR_SUCCESS; - }; /** end TraverseUp() */ + }; /** end traverseUp() */ @@ -1486,7 +1465,7 @@ class Tree template - hmlpError_t TraverseDown( TASK &dummy, Args&... args ) + hmlpError_t traverseDown( TASK &dummy, Args&... args ) { /* Return with no error. */ if ( getLocalNodeSize() == 0 ) @@ -1531,7 +1510,7 @@ class Tree } /* Return with no error. */ return HMLP_ERROR_SUCCESS; - }; /** end TraverseDown() */ + }; /** end traverseDown() */ @@ -1540,10 +1519,10 @@ class Tree * downward traversal. */ template - hmlpError_t TraverseUnOrdered( TASK &dummy, Args&... args ) + hmlpError_t traverseUnOrdered( TASK &dummy, Args&... args ) { - return TraverseDown( dummy, args... ); - }; /** end TraverseUnOrdered() */ + return traverseDown( dummy, args... ); + }; /** end traverseUnOrdered() */ /** @@ -1551,7 +1530,7 @@ class Tree * and local essential tree (LET) nodes. * \returns the error code. */ - hmlpError_t DependencyCleanUp() + hmlpError_t dependencyClean() { /* Remove dependencies of each owned nodes. */ for ( auto node : treelist_ ) @@ -1566,7 +1545,7 @@ class Tree } /* Return with no error. */ return HMLP_ERROR_SUCCESS; - }; /* end DependencyCleanUp() */ + }; /* end dependencyClean() */ /** * \brief Enter a runtime epoch to consume all tasks starting from all @@ -1578,7 +1557,7 @@ class Tree /* Invoke the runtime scheduler. */ RETURN_IF_ERROR( hmlp_run() ); /* Clean up all the in and out set of each read/write object. */ - RETURN_IF_ERROR( DependencyCleanUp() ); + RETURN_IF_ERROR( dependencyClean() ); /* Return with no error. */ return HMLP_ERROR_SUCCESS; }; /* end ExecuteAllTasks() */ @@ -1657,7 +1636,7 @@ class Tree }; /** * \brief Allocate the local tree using the local root with n points and depth l. - * \details This routine will be called in two situations: 1) called by Tree::TreePartition(), + * \details This routine will be called in two situations: 1) called by Tree::partition(), * or 2) called by MPITree::TreePartition(). * \param [in,out] root: the root of the local tree * \returns the error code diff --git a/gofmm/tree_mpi.hpp b/gofmm/tree_mpi.hpp index 8c5f60c..134fe1c 100644 --- a/gofmm/tree_mpi.hpp +++ b/gofmm/tree_mpi.hpp @@ -886,8 +886,11 @@ class Tree : public tree::Tree, - /** @brief partition n points using a distributed binary tree. */ - void TreePartition() + /** + * \brief partition n points using a distributed binary tree. + * \returns the error code + */ + hmlpError_t TreePartition() { mpi::PrintProgress( "[BEG] TreePartitioning ...", this->GetComm() ); @@ -904,12 +907,12 @@ class Tree : public tree::Tree, } /* Local problem size (assuming Round-Robin). */ num_points_owned = this->global_index_distribution_.size(); - /* Allocate distributed tree nodes in advance. */ - allocateNodes_( this->global_index_distribution_ ); + /* Allocate distributed and local tree nodes in advance. */ + RETURN_IF_ERROR( allocateNodes_( this->global_index_distribution_ ) ); - DependencyCleanUp(); + RETURN_IF_ERROR( dependencyClean() ); @@ -954,8 +957,10 @@ class Tree : public tree::Tree, if ( node->getGlobalDepth() ) this->morton2node[ sibling->getMortonID() ] = sibling; } - this->Barrier(); + RETURN_IF_ERROR( this->Barrier() ); mpi::PrintProgress( "[END] TreePartitioning ...", this->GetComm() ); + /* Return with no error. */ + return HMLP_ERROR_SUCCESS; }; /** end TreePartition() */ @@ -1295,7 +1300,7 @@ class Tree : public tree::Tree, - void DependencyCleanUp() + hmlpError_t dependencyClean() { for ( auto node : mpitreelists ) node->DependencyCleanUp(); //for ( size_t i = 0; i < mpitreelists.size(); i ++ ) @@ -1303,7 +1308,7 @@ class Tree : public tree::Tree, // mpitreelists[ i ]->DependencyCleanUp(); //} - tree::Tree::DependencyCleanUp(); + RETURN_IF_ERROR( LOCALTREE::dependencyClean() ); @@ -1313,9 +1318,9 @@ class Tree : public tree::Tree, for ( auto p : NearRecvFrom ) p.DependencyCleanUp(); for ( auto p : FarRecvFrom ) p.DependencyCleanUp(); - /** TODO also clean up the LET node */ - - }; /** end DependencyCleanUp() */ + /* Return with no error. */ + return HMLP_ERROR_SUCCESS; + }; /* end dependencyClean() */ /** @brief */ @@ -1323,7 +1328,7 @@ class Tree : public tree::Tree, { hmlp_run(); this->Barrier(); - DependencyCleanUp(); + dependencyClean(); }; /** end ExecuteAllTasks() */ /** @brief */