Skip to content
This repository has been archived by the owner on Aug 5, 2022. It is now read-only.

Commit

Permalink
Don't use ssh in local test
Browse files Browse the repository at this point in the history
Change-Id: I422da80110793afa8cd1a7f732f9d4f324114ca5
  • Loading branch information
daisyden committed Jan 29, 2019
1 parent 484f4bb commit 7dc778b
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 9 deletions.
3 changes: 0 additions & 3 deletions scripts/run_benchmark.py
Original file line number Diff line number Diff line change
Expand Up @@ -85,7 +85,6 @@ def detect_cpu(self):
knm_pattern = re.compile(".*72.*")
skx_pattern = re.compile(".*[86543]1.*")
bdw_pattern = re.compile(".*(E5-[421]6|E7-[84]8|E3-12|D-?15).*")
clx_pattern = re.compile(".*Genuine.*")
if re.match(knl_pattern, model_string):
self.cpu_model = "knl"
elif re.match(knm_pattern, model_string):
Expand All @@ -94,8 +93,6 @@ def detect_cpu(self):
self.cpu_model = "skx"
elif re.match(bdw_pattern, model_string):
self.cpu_model = "bdw"
elif re.match(clx_pattern, model_string):
self.cpu_model = "clx"
else:
self.unknown_cpu = True
logging.info("Can't detect which cpu model currently using, will use default settings, which may not be the optimal one.")
Expand Down
2 changes: 0 additions & 2 deletions scripts/run_intelcaffe.sh
Original file line number Diff line number Diff line change
Expand Up @@ -157,8 +157,6 @@ function detect_cpu
else
cpu_model_="unknown"
fi
elif [[ $model_string == *"Genuine"* ]]; then
cpu_model_="clx"
else
model_num=`echo $model_string | awk '{print $4}'`
if [[ $model_num =~ ^[8|6|5|4|3]1 ]]; then
Expand Down
18 changes: 14 additions & 4 deletions scripts/set_env.sh
Original file line number Diff line number Diff line change
Expand Up @@ -113,15 +113,21 @@ function clear_shm
min_shm_size=40
shm_unit="G"

localhost=$(hostname)

for node in "${nodenames[@]}"
do
if [ "${node}" == "" ]; then
echo "Warning: empty node name."
continue
fi

ssh ${node} "$clear_command"
shm_line=`ssh ${node} "$check_shm_command"`
if [ $localhost == $node ];then
`$clear_command`
shm_line=$(eval $check_shm_command)
else
ssh ${node} "$clear_command"
shm_line=`ssh ${node} "$check_shm_command"`
fi
shm_string=`echo $shm_line | awk -F ' ' '{print $(NF-2)}'`
unit="${shm_string:(-1)}"
shm_size=${shm_string::-1}
Expand All @@ -140,7 +146,11 @@ function kill_zombie_processes
kill_command="for process in ep_server caffe mpiexec.hydra; do for i in \$(ps -e | grep -w \$process | awk -F ' ' '{print \$1}'); do kill -9 \$i; echo \"\$process \$i killed.\"; done done"
for node in "${nodenames[@]}"
do
ssh ${node} "$kill_command"
if [ $localhost == $node ];then
eval "$kill_command"
else
ssh ${node} "$kill_command"
fi
done
}

Expand Down

0 comments on commit 7dc778b

Please sign in to comment.