From 880e33e1299652f7a55ff47b8d65eb89f5578e5e Mon Sep 17 00:00:00 2001 From: schaerer Date: Tue, 5 Oct 2010 13:01:03 +0000 Subject: [PATCH] move clitkConfiguration.h out of clitkCommon to avoid costly recompilations fix harmless warning --- .vimrc | 2 +- common/clitkCommon.h | 2 +- fast_make.sh | 66 ++++++++++++++++++++--------------------- vv/vvImageReader.txx | 1 + vv/vvMainWindow.cxx | 1 + vv/vvMeshActor.cxx | 2 +- vv/vvThreadedFilter.cxx | 2 +- 7 files changed, 39 insertions(+), 37 deletions(-) diff --git a/.vimrc b/.vimrc index 216453c..97cf20f 100644 --- a/.vimrc +++ b/.vimrc @@ -6,5 +6,5 @@ set expandtab "set cino={.5s,e-.5s,^-.5s set shiftwidth=2 -set makeprg=${HOME}/clitk3/fast_make.sh +set makeprg=${HOME}/workspace/cvs/clitk3/fast_make.sh set grepprg=clgrep diff --git a/common/clitkCommon.h b/common/clitkCommon.h index 879d54f..52264cd 100644 --- a/common/clitkCommon.h +++ b/common/clitkCommon.h @@ -20,7 +20,7 @@ #define CLITKCOMMON_H // clitk include -#include "clitkConfiguration.h" +//#include "clitkConfiguration.h" #include "clitkPortability.h" #include "clitkExceptionObject.h" diff --git a/fast_make.sh b/fast_make.sh index 38d94a1..0ee2e4f 100755 --- a/fast_make.sh +++ b/fast_make.sh @@ -35,39 +35,39 @@ nice -n12 ionice -c3 make -j ${cpus} $@ & make_pid=$(jobs -p %nice) #watch memory use to avoid crashes -#while ps $make_pid >>/dev/null -#do -# if [ x"$(ps aux | grep cc1plus | grep -v grep | wc -l)" != x0 ] -# then -# ps ax -o vsize,comm | grep cc1plus | grep -o "\<[0-9]*\>" > mem_use -# used_mem=$(awk 'BEGIN {sum=0;} {sum+=$1;} END {print sum;}' mem_use) -# if (( "$used_mem"> ($available_mem - 300) )) -# then -# touch memory_exhausted_lock -# echo "Stopping due to exagerated memory use ( $used_mem )" -# handle_exit -# elif (( "$used_mem"> ($available_mem/2) )) -# then -# if [ x$high_mem != xtrue ] -# then -# echo "Warning, high memory use, not spawning any more compilation jobs... ( $used_mem )" -# killall -s SIGSTOP make -# killall -s SIGCONT cc1plus -# high_mem="true" -# date_mem=$(date +%s) -# fi -# echo mem $used_mem / $available_mem -# elif [ x$high_mem = xtrue ] && (( $(date +%s) > ( $date_mem + 5 ) )) -# then -# echo "Memory use back to normal" -# high_mem="" -# killall -s SIGCONT make -# fi -# rm mem_use -# fi -# sleep 1 -#done -#rm memory_exhausted_lock 2>>/dev/null +while ps $make_pid >>/dev/null +do + if [ x"$(ps aux | grep cc1plus | grep -v grep | wc -l)" != x0 ] + then + ps ax -o vsize,comm | grep cc1plus | grep -o "\<[0-9]*\>" > mem_use + used_mem=$(awk 'BEGIN {sum=0;} {sum+=$1;} END {print sum;}' mem_use) + if (( "$used_mem"> ($available_mem - 300) )) + then + touch memory_exhausted_lock + echo "Stopping due to exagerated memory use ( $used_mem )" + handle_exit + elif (( "$used_mem"> ($available_mem/2) )) + then + if [ x$high_mem != xtrue ] + then + echo "Warning, high memory use, not spawning any more compilation jobs... ( $used_mem )" + killall -s SIGSTOP make + killall -s SIGCONT cc1plus + high_mem="true" + date_mem=$(date +%s) + fi + echo mem $used_mem / $available_mem + elif [ x$high_mem = xtrue ] && (( $(date +%s) > ( $date_mem + 5 ) )) + then + echo "Memory use back to normal" + high_mem="" + killall -s SIGCONT make + fi + rm mem_use + fi + sleep 1 +done +rm memory_exhausted_lock 2>>/dev/null wait echo Done! echo diff --git a/vv/vvImageReader.txx b/vv/vvImageReader.txx index af11299..9393392 100644 --- a/vv/vvImageReader.txx +++ b/vv/vvImageReader.txx @@ -27,6 +27,7 @@ #include #include "clitkCommon.h" +#include "clitkConfiguration.h" #include "vvFromITK.h" #include "vvConstants.h" diff --git a/vv/vvMainWindow.cxx b/vv/vvMainWindow.cxx index 22d75be..aa5b5cc 100644 --- a/vv/vvMainWindow.cxx +++ b/vv/vvMainWindow.cxx @@ -44,6 +44,7 @@ #include "vvStructSelector.h" #include "vvMeshReader.h" #include "vvConstants.h" +#include "clitkConfiguration.h" // ITK include #include "itkImage.h" diff --git a/vv/vvMeshActor.cxx b/vv/vvMeshActor.cxx index e725871..cefd281 100644 --- a/vv/vvMeshActor.cxx +++ b/vv/vvMeshActor.cxx @@ -26,7 +26,7 @@ #include vvMeshActor::vvMeshActor() : - mCutDimension(NULL), mMesh(NULL), + mCutDimension(0), mMesh(NULL), mMarching(NULL), mMapper(NULL), mActor(NULL), mSuperpostionMode(false), mTimeSlice(0) diff --git a/vv/vvThreadedFilter.cxx b/vv/vvThreadedFilter.cxx index 0262126..0a074f3 100644 --- a/vv/vvThreadedFilter.cxx +++ b/vv/vvThreadedFilter.cxx @@ -70,7 +70,7 @@ void vvThreadedFilter::Update() } temp = m_FilterBase->GetCurrentStepName(); } - this->wait(200); // in milisecond + this->wait(200); // in miliseconds qApp->processEvents(); } } -- 2.45.1