IPP Software Navigation Tools IPP Links Communication Pan-STARRS Links

Ignore:
Timestamp:
Aug 29, 2023, 9:11:20 AM (3 years ago)
Author:
eugene
Message:

making rebalance scripts a little easier to modify for different machines

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/tools/eam/rebalance/launch.insert.sh

    r42485 r42534  
    11#!/bin/csh
    22
    3 set srclist = (ipp100 ipp101 ipp102 ipp104 ipp105 ipp108 ipp112 ipp114 ipp115 ipp117 ipp123 ipp124 ipp125 ipp126 ipp134 ipp136 ipp137 ipp139)
    4 set tgtlist = (ipp153 ipp153 ipp154 ipp154 ipp155 ipp155 ipp156 ipp156 ipp157 ipp157 ipp153 ipp154 ipp155 ipp156 ipp157 ipp154 ipp155 ipp157)
     3set program = `basename $0`
    54
    6 set mydir = /data/ipphome1.0/home/eugene/rebalance.20220922
     5set run = v0
     6set version = 20230802
    77
    8 # manually set these values:
    9 set run = v0
    10 set version = 20220922
     8# set to 'insert' first, then run with 'insert.check'
     9# set mode = insert
    1110set mode = insert.check
    1211
    13 if ($#argv < 1) then
    14   echo "USAGE: launch.insert.sh launch"
    15   echo "USAGE: launch.insert.sh (src) (tgt)"
     12set srchost = (ipp100 ipp108 ipp112 ipp114)
     13set srcvol  = (     0      0      1      0)
     14set tgthost = (ipp161 ipp161 ipp162 ipp162)
     15set tgtvol  = (     0      1      0      1)
     16
     17set mydir = /data/ipphome1.0/home/eugene/rebalance.20230802
     18
     19if ($#argv == 0) then
     20  echo "USAGE: $program launch"
     21  echo "USAGE: $program run (Nentry)"
     22  echo "   eg: $program run 1"
    1623  exit 2
    1724endif
    1825
    19 if ($#argv == 1) then
    20   if ("$1" != "launch") then
    21     echo "USAGE: launch.insert.sh launch"
    22     echo "USAGE: launch.insert.sh (src) (tgt)"
    23     exit 2
    24   endif
     26if ("$1" == "launch") then
     27
     28  # NOTE: the insert jobs run on the target machines, not source machines
    2529
    2630  set i = 1
    27   while ($i <= $#srclist)
    28     set src = $srclist[$i]
    29     set tgt = $tgtlist[$i]
    30     echo ssh -f $tgt "cd $mydir && ./launch.insert.sh $src $tgt"
    31          ssh -f $tgt "cd $mydir && ./launch.insert.sh $src $tgt"
     31  while ($i <= $#tgthost)
     32    echo ssh -f $tgthost[$i] "cd $mydir && ./$program run $i"
     33         ssh -f $tgthost[$i] "cd $mydir && ./$program run $i"
    3234    @ i++
    3335  end
     
    3537endif
    3638
    37 if ($#argv != 2) then
    38   echo "USAGE: launch.insert.sh launch"
    39   echo "USAGE: launch.insert.sh (src) (tgt)"
    40   exit 2
     39if ("$1" == "run") then
     40  if ($#argv != 2) then
     41    echo "USAGE: $program run (Nentry)"
     42    echo "   eg: $program run 1"
     43    exit 2
     44  endif
     45
     46  set N = $2
     47
     48  set hn = $srchost[$N]
     49  set hv = $srcvol[$N]
     50  set tn = $tgthost[$N]
     51  set tv = $tgtvol[$N]
     52
     53  set myhost = `hostname`
     54  if ($tn != $myhost) then
     55    echo "ERROR: need to run $mode on the source host ($tn vs $myhost)"
     56    exit 3
     57  endif
     58
     59  echo "running on $myhost for source $hn.$hv to target $tn.$tv in mode $mode, version $version"
     60  mkdir -p $hn.$hv
     61  echo "./rebalance.mana $mode $hn $hv $tn $tv $version > & $hn.$hv/log.$mode.$version.$run &"
     62        ./rebalance.mana $mode $hn $hv $tn $tv $version > & $hn.$hv/log.$mode.$version.$run &
     63  exit 0
    4164endif
    4265
    43 set src = $1
    44 set tgt = $2
    45 
    46 set v = 0 ; set h = $src; set t = $tgt; ./rebalance.mana $mode $h $v $t $v $version > & $h.$v/log.$mode.$version.$run &
    47 set v = 1 ; set h = $src; set t = $tgt; ./rebalance.mana $mode $h $v $t $v $version > & $h.$v/log.$mode.$version.$run &
    48 
    49 # e.g.: ssh -f ipp127 "cd `pwd` && ./launch.rsync.sh"
    50 
    51 #     echo ssh $f ps ux
    52 #          ssh $f ps ux
    53 #      ssh $f killall mana
    54 #      ssh $f killall find
Note: See TracChangeset for help on using the changeset viewer.