Commit 3f03c2b5 authored by incardon's avatar incardon

Adding update and upgrade option

parent c211117f
...@@ -22,8 +22,10 @@ install_req=1 ...@@ -22,8 +22,10 @@ install_req=1
i_dir=" " i_dir=" "
sq=0 sq=0
nomake=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 case $FLAG in
d) d)
echo "Disable depencencies installation" echo "Disable depencencies installation"
...@@ -45,6 +47,14 @@ while getopts :di:smhc: FLAG; do ...@@ -45,6 +47,14 @@ while getopts :di:smhc: FLAG; do
echo "Skip to make the testing" echo "Skip to make the testing"
nomake=1 nomake=1
;; ;;
u)
echo "Updating openfpm"
update_openfpm=1
;;
n)
echo "Upgrading openfpm"
upgrade_openfpm=1
;;
h) #show help h) #show help
HELP HELP
;; ;;
...@@ -67,6 +77,21 @@ remove_old $i_dir ...@@ -67,6 +77,21 @@ remove_old $i_dir
pre_req 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 ## clone the dependencies
git submodule init git submodule init
......
#! /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
}
#! /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
}
...@@ -614,6 +614,17 @@ public: ...@@ -614,6 +614,17 @@ public:
{ {
return parmetis_graph.get_ndec(); 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_ */ #endif /* SRC_DECOMPOSITION_PARMETISDISTRIBUTION_HPP_ */
...@@ -544,6 +544,17 @@ public: ...@@ -544,6 +544,17 @@ public:
{ {
return n_dec; 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 #endif
...@@ -1545,7 +1545,7 @@ public: ...@@ -1545,7 +1545,7 @@ public:
for (size_t i = 0 ; i < n_part ; i++) for (size_t i = 0 ; i < n_part ; i++)
{ {
dec.getDistribution().setDistributionTol(i,md.setDistributionTol()); dec.getDistribution().setDistTol(i,md.distributionTol(i));
} }
} }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment