You can not select more than 25 topics Topics must start with a chinese character,a letter or number, can include dashes ('-') and can be up to 35 characters long.

shell_run_test.sh 1.8 kB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556
  1. #!/bin/bash
  2. # Copyright 2020 Huawei Technologies Co., Ltd
  3. #
  4. # Licensed under the Apache License, Version 2.0 (the "License");
  5. # you may not use this file except in compliance with the License.
  6. # You may obtain a copy of the License at
  7. #
  8. # http://www.apache.org/licenses/LICENSE-2.0
  9. #
  10. # Unless required by applicable law or agreed to in writing, software
  11. # distributed under the License is distributed on an "AS IS" BASIS,
  12. # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  13. # See the License for the specific language governing permissions and
  14. # limitations under the License.
  15. # ============================================================================
  16. execute_path=$(pwd)
  17. self_path=$(dirname "${script_self}")
  18. export MS_COMM_TYPE=zmq
  19. export MS_SCHED_NUM=1
  20. DEVICE_TARGET=$1
  21. DATASET_PATH=$2
  22. export MS_WORKER_NUM=$3
  23. export MS_SERVER_NUM=$4
  24. export MS_SCHED_HOST=$5
  25. export MS_SCHED_PORT=$6
  26. export MS_ROLE=MS_SCHED
  27. for((i=0;i<1;i++));
  28. do
  29. rm -rf ${execute_path}/sched_$i/
  30. mkdir ${execute_path}/sched_$i/
  31. cd ${execute_path}/sched_$i/ || exit
  32. python ${self_path}/../test_full_ps_lenet.py --device_target=$DEVICE_TARGET --dataset_path=$DATASET_PATH &
  33. done
  34. export MS_ROLE=MS_PSERVER
  35. for((i=0;i<$MS_SERVER_NUM;i++));
  36. do
  37. rm -rf ${execute_path}/server_$i/
  38. mkdir ${execute_path}/server_$i/
  39. cd ${execute_path}/server_$i/ || exit
  40. python ${self_path}/../test_full_ps_lenet.py --device_target=$DEVICE_TARGET --dataset_path=$DATASET_PATH &
  41. done
  42. export MS_ROLE=MS_WORKER
  43. for((i=0;i<$MS_WORKER_NUM;i++));
  44. do
  45. rm -rf ${execute_path}/worker_$i/
  46. mkdir ${execute_path}/worker_$i/
  47. cd ${execute_path}/worker_$i/ || exit
  48. python ${self_path}/../test_full_ps_lenet.py --device_target=$DEVICE_TARGET --dataset_path=$DATASET_PATH &
  49. done
  50. wait $!
  51. exit $?