!13675 fixed the wait usage of shell script

From: @anancds
Reviewed-by: @limingqi107,@cristoval
Signed-off-by: @cristoval
This commit is contained in:
mindspore-ci-bot 2021-03-22 10:46:57 +08:00 committed by Gitee
commit b5af96af76
4 changed files with 59 additions and 8 deletions

View File

@ -42,13 +42,25 @@ do
done done
export MS_ROLE=MS_WORKER export MS_ROLE=MS_WORKER
process_pid=()
for((i=0;i<$MS_WORKER_NUM;i++)); for((i=0;i<$MS_WORKER_NUM;i++));
do do
rm -rf ${execute_path}/worker_$i/ rm -rf ${execute_path}/worker_$i/
mkdir ${execute_path}/worker_$i/ mkdir ${execute_path}/worker_$i/
cd ${execute_path}/worker_$i/ || exit cd ${execute_path}/worker_$i/ || exit
python ${self_path}/../test_cmp_sparse_embedding.py --device_target=$DEVICE_TARGET & python ${self_path}/../test_cmp_sparse_embedding.py --device_target=$DEVICE_TARGET &
process_pid[${i}]=`echo $!`
done done
wait $! for((i=0; i<${MS_WORKER_NUM}; i++)); do
exit $? 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

View File

@ -43,13 +43,25 @@ do
done done
export MS_ROLE=MS_WORKER export MS_ROLE=MS_WORKER
process_pid=()
for((i=0;i<$MS_WORKER_NUM;i++)); for((i=0;i<$MS_WORKER_NUM;i++));
do do
rm -rf ${execute_path}/worker_$i/ rm -rf ${execute_path}/worker_$i/
mkdir ${execute_path}/worker_$i/ mkdir ${execute_path}/worker_$i/
cd ${execute_path}/worker_$i/ || exit cd ${execute_path}/worker_$i/ || exit
python ${self_path}/../test_full_ps_lenet.py --device_target=$DEVICE_TARGET --dataset_path=$DATASET_PATH & python ${self_path}/../test_full_ps_lenet.py --device_target=$DEVICE_TARGET --dataset_path=$DATASET_PATH &
process_pid[${i}]=`echo $!`
done done
wait $! for((i=0; i<${MS_WORKER_NUM}; i++)); do
exit $? 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

View File

@ -44,6 +44,7 @@ do
done done
export MS_ROLE=MS_WORKER export MS_ROLE=MS_WORKER
process_pid=()
if [ $DEVICE_TARGET == "Ascend" ];then if [ $DEVICE_TARGET == "Ascend" ];then
for((i=0;i<$MS_WORKER_NUM;i++)); for((i=0;i<$MS_WORKER_NUM;i++));
do do
@ -53,14 +54,27 @@ do
export RANK_ID=$i export RANK_ID=$i
export DEVICE_ID=$i export DEVICE_ID=$i
python ${self_path}/../test_multi_full_ps.py --device_target=$DEVICE_TARGET & 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 done
fi fi
if [ $DEVICE_TARGET == "GPU" ];then if [ $DEVICE_TARGET == "GPU" ];then
rm -rf ${execute_path}/worker/ rm -rf ${execute_path}/worker/
mkdir ${execute_path}/worker/ mkdir ${execute_path}/worker/
cd ${execute_path}/worker/ || exit cd ${execute_path}/worker/ || exit
mpirun -n $MS_WORKER_NUM python ${self_path}/../test_multi_full_ps.py --device_target=$DEVICE_TARGET & mpirun -n $MS_WORKER_NUM python ${self_path}/../test_multi_full_ps.py --device_target=$DEVICE_TARGET &
wait $!
fi fi
wait $! exit 0
exit $?

View File

@ -43,13 +43,26 @@ do
done done
export MS_ROLE=MS_WORKER export MS_ROLE=MS_WORKER
process_pid=()
for((i=0;i<$MS_WORKER_NUM;i++)); for((i=0;i<$MS_WORKER_NUM;i++));
do do
rm -rf ${execute_path}/worker_$i/ rm -rf ${execute_path}/worker_$i/
mkdir ${execute_path}/worker_$i/ mkdir ${execute_path}/worker_$i/
cd ${execute_path}/worker_$i/ || exit cd ${execute_path}/worker_$i/ || exit
python ${self_path}/../test_ps_embedding_heterogeneous_conv2d_adam.py --device_target=$DEVICE_TARGET --dataset_path=$DATASET_PATH & python ${self_path}/../test_ps_embedding_heterogeneous_conv2d_adam.py --device_target=$DEVICE_TARGET --dataset_path=$DATASET_PATH &
process_pid[${i}]=`echo $!`
done 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