Ignore:
Timestamp:
Jun 17, 2009, 8:10:41 PM (15 years ago)
Author:
rosiere
Message:

modif distexe script

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/IPs/systemC/processor/Morpheo/Script/distexe.sh

    r124 r126  
    77VERSION="1.0"
    88
    9 # Need : test, echo, cd, dirname, basename, ssh
     9# Need : test, echo, cd, dirname, basename, ssh, ps aux
    1010
    1111#-----[ distexe_usage ]-------------------------------------
     
    103103    fi;
    104104
     105    local FILE_CPT="${PATH_EXE}/control-"$(basename ${FILE_CMD});
     106   
    105107    header;
    106108    echo "  * {"$(my_date)"} <${HOSTNAME}> file : ${FILE_CMD}";
     
    108110
    109111    local hosts="${DISTEXE_HOSTS}";
     112    local -a commands;
     113    local -i cpt=0;
    110114
    111115    for line in ${hosts}; do
     
    116120
    117121        # 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};";
    119123        ssh ${host} ${cmd} &
     124
     125        commands[${cpt}]="${cmd}";
     126        cpt=$((${cpt}+1));
    120127    done;
    121128
    122129    echo "  * {"$(my_date)"} <${HOSTNAME}> all hosts working";
    123130
     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};
    124144}
    125145
Note: See TracChangeset for help on using the changeset viewer.