textSortToSameCluster 2.4 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364
  1. #!/usr/bin/env bash
  2. # Licensed under the Apache License, Version 2.0 (the "License");
  3. # you may not use this file except in compliance with the License.
  4. # You may obtain a copy of the License at
  5. #
  6. # http://www.apache.org/licenses/LICENSE-2.0
  7. #
  8. # Unless required by applicable law or agreed to in writing, software
  9. # distributed under the License is distributed on an "AS IS" BASIS,
  10. # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  11. # See the License for the specific language governing permissions and
  12. # limitations under the License.
  13. GRID_DIR=`dirname "$0"`
  14. GRID_DIR=`cd "$GRID_DIR"; pwd`
  15. source $GRID_DIR/../gridmix-env
  16. PROCESSES=""
  17. for ((i=0; i < $NUM_OF_SMALL_JOBS_PER_CLASS; i++))
  18. do
  19. echo $i
  20. $GRID_MIX_HOME/pipesort/text-sort.small 2>&1 > pipesort.small.$i.out &
  21. PROCESSES="${PROCESSES} $!"
  22. $GRID_MIX_HOME/submissionScripts/sleep_if_too_busy
  23. $GRID_MIX_HOME/streamsort/text-sort.small 2>&1 > streamsort.small.$i.out &
  24. PROCESSES="${PROCESSES} $!"
  25. $GRID_MIX_HOME/submissionScripts/sleep_if_too_busy
  26. $GRID_MIX_HOME/javasort/text-sort.small 2>&1 > javasort.small.$i.out &
  27. PROCESSES="${PROCESSES} $!"
  28. $GRID_MIX_HOME/submissionScripts/sleep_if_too_busy
  29. done
  30. for ((i=0; i < $NUM_OF_MEDIUM_JOBS_PER_CLASS; i++))
  31. do
  32. echo $i
  33. $GRID_MIX_HOME/pipesort/text-sort.medium 2>&1 > pipesort.medium.$i.out &
  34. PROCESSES="${PROCESSES} $!"
  35. $GRID_MIX_HOME/submissionScripts/sleep_if_too_busy
  36. $GRID_MIX_HOME/streamsort/text-sort.medium 2>&1 > streamsort.medium.$i.out &
  37. PROCESSES="${PROCESSES} $!"
  38. $GRID_MIX_HOME/submissionScripts/sleep_if_too_busy
  39. $GRID_MIX_HOME/javasort/text-sort.medium 2>&1 > javasort.medium.$i.out &
  40. PROCESSES="${PROCESSES} $!"
  41. $GRID_MIX_HOME/submissionScripts/sleep_if_too_busy
  42. done
  43. for ((i=0; i < $NUM_OF_LARGE_JOBS_PER_CLASS; i++))
  44. do
  45. echo $i
  46. $GRID_MIX_HOME/pipesort/text-sort.large 2>&1 > pipesort.large.$i.out &
  47. PROCESSES="${PROCESSES} $!"
  48. $GRID_MIX_HOME/submissionScripts/sleep_if_too_busy
  49. $GRID_MIX_HOME/streamsort/text-sort.large 2>&1 > pipesort.large.$i.out &
  50. PROCESSES="${PROCESSES} $!"
  51. $GRID_MIX_HOME/submissionScripts/sleep_if_too_busy
  52. $GRID_MIX_HOME/javasort/text-sort.large 2>&1 > pipesort.large.$i.out &
  53. PROCESSES="${PROCESSES} $!"
  54. $GRID_MIX_HOME/submissionScripts/sleep_if_too_busy
  55. done
  56. for APROC in ${PROCESSES}; do
  57. wait ${APROC}
  58. done