Changeset 126 for trunk/IPs/systemC
- Timestamp:
- Jun 17, 2009, 8:10:41 PM (16 years ago)
- Location:
- trunk/IPs/systemC/processor/Morpheo/Script
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/IPs/systemC/processor/Morpheo/Script/distexe.sh
r124 r126 7 7 VERSION="1.0" 8 8 9 # Need : test, echo, cd, dirname, basename, ssh 9 # Need : test, echo, cd, dirname, basename, ssh, ps aux 10 10 11 11 #-----[ distexe_usage ]------------------------------------- … … 103 103 fi; 104 104 105 local FILE_CPT="${PATH_EXE}/control-"$(basename ${FILE_CMD}); 106 105 107 header; 106 108 echo " * {"$(my_date)"} <${HOSTNAME}> file : ${FILE_CMD}"; … … 108 110 109 111 local hosts="${DISTEXE_HOSTS}"; 112 local -a commands; 113 local -i cpt=0; 110 114 111 115 for line in ${hosts}; do … … 116 120 117 121 # lunch service 118 local cmd="export MORPHEO_SCRIPT=${MORPHEO_SCRIPT};${MORPHEO_SCRIPT}/execute_n.sh ${PATH_EXE} ${FILE_CMD} ${ nb_process};";122 local cmd="export MORPHEO_SCRIPT=${MORPHEO_SCRIPT};${MORPHEO_SCRIPT}/execute_n.sh ${PATH_EXE} ${FILE_CMD} ${FILE_CPT} ${nb_process};"; 119 123 ssh ${host} ${cmd} & 124 125 commands[${cpt}]="${cmd}"; 126 cpt=$((${cpt}+1)); 120 127 done; 121 128 122 129 echo " * {"$(my_date)"} <${HOSTNAME}> all hosts working"; 123 130 131 cpt=0; 132 while test ${cpt} -lt ${#commands[*]}; do 133 local -i res=1 134 135 while test ${res} -ne 0; do 136 res=$(ps aux | grep -c "${commands[${cpt}]}"); 137 done 138 139 cpt=$((${cpt}+1)); 140 done; 141 142 echo " * {"$(my_date)"} <${HOSTNAME}> all hosts is done"; 143 rm ${FILE_CPT}; 124 144 } 125 145 -
trunk/IPs/systemC/processor/Morpheo/Script/execute.sh
r124 r126 127 127 # Test if command is empty ! 128 128 if test ! -z "${COMMAND[${CPT}]}"; then 129 # echo " * {"$(my_date)"} <${ID}> execute command [${CPT}] : ${COMMAND[${CPT}]}"; 130 echo " * {"$(my_date)"} <${ID}> command [${CPT}] : execute"; 129 131 local PATH_CURRENT=${PWD}; 130 132 cd ${PATH_WORK} &> /dev/null; 131 133 mkdir "Task_${CPT}" &> /dev/null; 132 134 cd "Task_${CPT}" &> /dev/null; 133 # echo " * {"$(my_date)"} <${ID}> execute command [${CPT}] : ${COMMAND[${CPT}]}";134 echo " * {"$(my_date)"} <${ID}> execute command [${CPT}]";135 135 echo "id : ${ID}" > ${OUTPUT_FILE_INFO}; 136 136 echo "host : ${HOSTNAME}" >> ${OUTPUT_FILE_INFO}; … … 143 143 ./${OUTPUT_FILE_CMD} &> ${OUTPUT_FILE_OUT}; 144 144 cd ${PATH_CURRENT} &> /dev/null; 145 echo " * {"$(my_date)"} <${ID}> command [${CPT}] : done"; 145 146 fi; 146 147 done; -
trunk/IPs/systemC/processor/Morpheo/Script/execute_n.sh
r124 r126 27 27 function execute_n_usage () 28 28 { 29 echo "Usage : ${0} path_word file [ nb_process ]";29 echo "Usage : ${0} path_word file_cmd file_cpt [ nb_process ]"; 30 30 echo "Arguments : "; 31 31 echo " * path_work : directory to execute command"; 32 echo " * file : list of command"; 32 echo " * file_cmd : list of command"; 33 echo " * file_cpt : file to control"; 33 34 echo " * nb_process : number of process (default (and maximum) is the number of processor)"; 34 35 echo ""; … … 45 46 function execute_n_test_usage () 46 47 { 47 if test ${#} -ne 2 -a ${#} -ne 3; then48 if test ${#} -ne 3 -a ${#} -ne 4; then 48 49 execute_n_usage; 49 50 fi; … … 76 77 local PATH_WORK=${1}; 77 78 local FILE_CMD=${2}; 78 local FILE_CPT ;79 local FILE_CPT=${3}; 79 80 local FILE_CPU; 80 81 local ID="cpu-${HOSTNAME}-$$" … … 82 83 execute_n_test_usage ${*}; 83 84 84 if test ${#} -eq 3; then85 if test ${ 3} -lt ${NB_PROCESS}; then86 NB_PROCESS=${ 3};85 if test ${#} -eq 4; then 86 if test ${4} -lt ${NB_PROCESS}; then 87 NB_PROCESS=${4}; 87 88 fi; 88 89 fi; 89 90 90 FILE_CPT="${PATH_WORK}/control-"$(basename ${FILE_CMD});91 91 FILE_CPU="${PATH_WORK}/${ID}"; 92 92
Note: See TracChangeset
for help on using the changeset viewer.