fixed the wait usage of shell script
This commit is contained in:
parent
d436b9ee98
commit
9aa05b177f
|
@ -42,13 +42,25 @@ do
|
|||
done
|
||||
|
||||
export MS_ROLE=MS_WORKER
|
||||
process_pid=()
|
||||
for((i=0;i<$MS_WORKER_NUM;i++));
|
||||
do
|
||||
rm -rf ${execute_path}/worker_$i/
|
||||
mkdir ${execute_path}/worker_$i/
|
||||
cd ${execute_path}/worker_$i/ || exit
|
||||
python ${self_path}/../test_cmp_sparse_embedding.py --device_target=$DEVICE_TARGET &
|
||||
process_pid[${i}]=`echo $!`
|
||||
done
|
||||
|
||||
wait $!
|
||||
exit $?
|
||||
for((i=0; i<${MS_WORKER_NUM}; i++)); do
|
||||
wait ${process_pid[i]}
|
||||
status=`echo $?`
|
||||
if [ "${status}" != "0" ]; then
|
||||
echo "[ERROR] test_cmp_sparse_embedding failed. status: ${status}"
|
||||
exit 1
|
||||
else
|
||||
echo "[INFO] test_cmp_sparse_embedding success."
|
||||
fi
|
||||
done
|
||||
|
||||
exit 0
|
||||
|
|
|
@ -43,13 +43,25 @@ do
|
|||
done
|
||||
|
||||
export MS_ROLE=MS_WORKER
|
||||
process_pid=()
|
||||
for((i=0;i<$MS_WORKER_NUM;i++));
|
||||
do
|
||||
rm -rf ${execute_path}/worker_$i/
|
||||
mkdir ${execute_path}/worker_$i/
|
||||
cd ${execute_path}/worker_$i/ || exit
|
||||
python ${self_path}/../test_full_ps_lenet.py --device_target=$DEVICE_TARGET --dataset_path=$DATASET_PATH &
|
||||
process_pid[${i}]=`echo $!`
|
||||
done
|
||||
|
||||
wait $!
|
||||
exit $?
|
||||
for((i=0; i<${MS_WORKER_NUM}; i++)); do
|
||||
wait ${process_pid[i]}
|
||||
status=`echo $?`
|
||||
if [ "${status}" != "0" ]; then
|
||||
echo "[ERROR] test_full_ps_lenet failed. status: ${status}"
|
||||
exit 1
|
||||
else
|
||||
echo "[INFO] test_full_ps_lenet success."
|
||||
fi
|
||||
done
|
||||
|
||||
exit 0
|
||||
|
|
|
@ -44,6 +44,7 @@ do
|
|||
done
|
||||
|
||||
export MS_ROLE=MS_WORKER
|
||||
process_pid=()
|
||||
if [ $DEVICE_TARGET == "Ascend" ];then
|
||||
for((i=0;i<$MS_WORKER_NUM;i++));
|
||||
do
|
||||
|
@ -53,14 +54,27 @@ do
|
|||
export RANK_ID=$i
|
||||
export DEVICE_ID=$i
|
||||
python ${self_path}/../test_multi_full_ps.py --device_target=$DEVICE_TARGET &
|
||||
process_pid[${i}]=`echo $!`
|
||||
done
|
||||
|
||||
for((i=0; i<${MS_WORKER_NUM}; i++)); do
|
||||
wait ${process_pid[i]}
|
||||
status=`echo $?`
|
||||
if [ "${status}" != "0" ]; then
|
||||
echo "[ERROR] test_multi_full_ps failed. status: ${status}"
|
||||
exit 1
|
||||
else
|
||||
echo "[INFO] test_multi_full_ps success."
|
||||
fi
|
||||
done
|
||||
fi
|
||||
|
||||
if [ $DEVICE_TARGET == "GPU" ];then
|
||||
rm -rf ${execute_path}/worker/
|
||||
mkdir ${execute_path}/worker/
|
||||
cd ${execute_path}/worker/ || exit
|
||||
mpirun -n $MS_WORKER_NUM python ${self_path}/../test_multi_full_ps.py --device_target=$DEVICE_TARGET &
|
||||
wait $!
|
||||
fi
|
||||
|
||||
wait $!
|
||||
exit $?
|
||||
exit 0
|
||||
|
|
|
@ -43,13 +43,26 @@ do
|
|||
done
|
||||
|
||||
export MS_ROLE=MS_WORKER
|
||||
process_pid=()
|
||||
for((i=0;i<$MS_WORKER_NUM;i++));
|
||||
do
|
||||
rm -rf ${execute_path}/worker_$i/
|
||||
mkdir ${execute_path}/worker_$i/
|
||||
cd ${execute_path}/worker_$i/ || exit
|
||||
python ${self_path}/../test_ps_embedding_heterogeneous_conv2d_adam.py --device_target=$DEVICE_TARGET --dataset_path=$DATASET_PATH &
|
||||
process_pid[${i}]=`echo $!`
|
||||
done
|
||||
|
||||
wait $!
|
||||
exit $?
|
||||
|
||||
for((i=0; i<${MS_WORKER_NUM}; i++)); do
|
||||
wait ${process_pid[i]}
|
||||
status=`echo $?`
|
||||
if [ "${status}" != "0" ]; then
|
||||
echo "[ERROR] test_ps_embedding_heterogeneous_conv2d_adam failed. status: ${status}"
|
||||
exit 1
|
||||
else
|
||||
echo "[INFO] test_ps_embedding_heterogeneous_conv2d_adam success."
|
||||
fi
|
||||
done
|
||||
|
||||
exit 0
|
||||
|
|
Loading…
Reference in New Issue