diff --git a/install b/install index 1ffa3094c291cffe85d6fd64029fe7bad323c70c..f2d56166f14ca0cfdf48e24080b51a08aed59a16 100755 --- a/install +++ b/install @@ -22,8 +22,10 @@ install_req=1 i_dir=" " sq=0 nomake=0 +update_openfpm=0 +upgrade_openfpm=0 -while getopts :di:smhc: FLAG; do +while getopts :di:smhc:nu FLAG; do case $FLAG in d) echo "Disable depencencies installation" @@ -45,6 +47,14 @@ while getopts :di:smhc: FLAG; do echo "Skip to make the testing" nomake=1 ;; + u) + echo "Updating openfpm" + update_openfpm=1 + ;; + n) + echo "Upgrading openfpm" + upgrade_openfpm=1 + ;; h) #show help HELP ;; @@ -67,6 +77,21 @@ remove_old $i_dir pre_req +if [ $update_openfpm -eq 1 -a $upgrade_openfpm -eq 1 ]; then + echo -e "\033[1;5;31m It is not possible to update and upgrade at the same time \033[0m" + exit 1 +fi + +if [ $update_openfpm -eq 1 ]; then + update_openfpm +fi + +if [ $upgrade_openfpm -eq 1 ]; then + upgrade_openfpm +fi + +exit 1 + ## clone the dependencies git submodule init diff --git a/script/update_openfpm b/script/update_openfpm new file mode 100755 index 0000000000000000000000000000000000000000..c7427d059fe8ae60456018b5a3f893dd332d267e --- /dev/null +++ b/script/update_openfpm @@ -0,0 +1,48 @@ +#! /bin/bash + +source script/show_solutions + +function update_openfpm() +{ + echo -e "\033[1;5;31m WARNING: the update will destroy any changes in the OpenFPM source code \033[0m" + + commands[0]="Continue" + commands[0]="${commands[@]}" + possible_solutions "${commands[@]}" + + ## Get the name of the updating branch + + url_update=$(cat update) + echo "Checking for update from $url_update" + branch=$(wget $url_update) + if [ x"$branch" == x"" ]; then + echo -e "\033[1m There are no-updates \033[0m" + return + fi + + actual_branch=git branch | grep \* | cut -d ' ' -f2 + + if [ x"$branch" == x"actual_branch" ]; then + + git remote update + git status -uno | grep "nothing to commit" + + if [ $? -eq 0 ]; then + echo -e "\033[1m There are no-updates \033[0m" + return + fi + fi + +# git stash +# git submodule foreach 'git stash' + +# git pull origin +# git checkout $branch +# git submodule update + +# sh autogen.sh +# make install + +} + + diff --git a/script/upgrade_openfpm b/script/upgrade_openfpm new file mode 100755 index 0000000000000000000000000000000000000000..fd9ff8589f5a4e8f4f95283e1544d7cff3a0811e --- /dev/null +++ b/script/upgrade_openfpm @@ -0,0 +1,48 @@ +#! /bin/bash + +source script/show_solutions + +function upgrade_openfpm() +{ + echo -e "\033[1;5;31m WARNING: the update will destroy any changes in the OpenFPM source code \033[0m" + + commands[0]="Continue" + commands[0]="${commands[@]}" + possible_solutions "${commands[@]}" + + ## Get the name of the updating branch + + url_upgrade=$(cat upgrade) + echo "Checking for update from $url_update" + branch=$(wget $url_upgrade) + if [ x"$branch" == x"" ]; then + echo -e "\033[1m There are no-updates \033[0m" + return + fi + + actual_branch=git branch | grep \* | cut -d ' ' -f2 + + if [ x"$branch" == x"actual_branch" ]; then + +# git remote update +# git status -uno | grep "nothing to commit" + + if [ $? -eq 0 ]; then + echo -e "\033[1m There are no-updates \033[0m" + return + fi + fi + +# git stash +# git submodule foreach 'git stash' + +# git pull origin +# git checkout $branch +# git submodule update + +# sh autogen.sh +# make install + +} + + diff --git a/src/Decomposition/Distribution/ParMetisDistribution.hpp b/src/Decomposition/Distribution/ParMetisDistribution.hpp index de2f34c77e4c6f387898501758bcea75479e1462..3bed97f0d6c2b5f7ff3370a27059ca1ea41b0d08 100644 --- a/src/Decomposition/Distribution/ParMetisDistribution.hpp +++ b/src/Decomposition/Distribution/ParMetisDistribution.hpp @@ -614,6 +614,17 @@ public: { return parmetis_graph.get_ndec(); } + + /*! \brief Set the tollerance for each partition + * + * \param i partition + * \param tol tollerance + * + */ + void setDistTol(size_t i, double tol) + { + parmetis_graph.setDistTol(i,tol); + } }; #endif /* SRC_DECOMPOSITION_PARMETISDISTRIBUTION_HPP_ */ diff --git a/src/Decomposition/Distribution/parmetis_util.hpp b/src/Decomposition/Distribution/parmetis_util.hpp index c1e51a0b411cdc6a166704bc457ca2e558394742..11e543a50bebf5738f2cbc69e4d9f2be5897fefa 100755 --- a/src/Decomposition/Distribution/parmetis_util.hpp +++ b/src/Decomposition/Distribution/parmetis_util.hpp @@ -544,6 +544,17 @@ public: { return n_dec; } + + /*! \brief Distribution tolerance + * + * \param i partition id + * \param tol tollerance + * + */ + const void setDistTol(size_t i, real_t tol) + { + Mg.ubvec[i] = tol; + } }; #endif diff --git a/src/Vector/vector_dist.hpp b/src/Vector/vector_dist.hpp index 20864ef39edffe0776c320384cc62636a4cbe421..a27da7c848ddc853aea988267395e5c0e827c2ab 100644 --- a/src/Vector/vector_dist.hpp +++ b/src/Vector/vector_dist.hpp @@ -1545,7 +1545,7 @@ public: for (size_t i = 0 ; i < n_part ; i++) { - dec.getDistribution().setDistributionTol(i,md.setDistributionTol()); + dec.getDistribution().setDistTol(i,md.distributionTol(i)); } }