<commit_before>#!/bin/bash
export PLTSTDERR="info"
PLTROOT="/opt/plt/plt"
LOGS="/opt/plt/logs"
R="$PLTROOT/bin/racket"
DRDR="/opt/svn/drdr"

cd "$DRDR"

kill_all() {
  cat "$LOGS/"*.pid > /tmp/leave-pids-$$
  KILL=`pgrep '^(Xorg|Xvfb|Xvnc|fluxbox|racket|gracket(-text)?)$' | grep -w -v -f /tmp/leave-pids-$$`
  rm /tmp/leave-pids-$$
  kill -15 $KILL
  sleep 2
  kill -9 $KILL
}

run_loop () { # <basename> <kill?>
  while true; do
    echo "$1: compiling"
    "$PLTROOT/bin/raco" make "$1.rkt"
    echo "$1: running"
    "$R" -t "$1.rkt" 2>&1 >> "$LOGS/$1.log" &
    echo "$!" > "$LOGS/$1.pid"
    wait "$!"
    echo "$1: died"
    rm "$LOGS/$1.pid"
    if [[ "x$2" = "xyes" ]]; then
      echo "killing processes"
      kill_all
    fi
  done
}

exec 2>&1 >> "$LOGS/meta.log"

run_loop render &
run_loop main yes &<commit_msg>Fixing shmget<commit_after>#!/bin/bash
export PLTSTDERR="info"
PLTROOT="/opt/plt/plt"
LOGS="/opt/plt/logs"
R="$PLTROOT/bin/racket"
DRDR="/opt/svn/drdr"

cd "$DRDR"

kill_all() {
  cat "$LOGS/"*.pid > /tmp/leave-pids-$$
  KILL=`pgrep '^(Xorg|Xvfb|Xvnc|fluxbox|racket|gracket(-text)?)$' | grep -w -v -f /tmp/leave-pids-$$`
  rm /tmp/leave-pids-$$
  kill -15 $KILL
  sleep 2
  kill -9 $KILL
  sleep 1
  # Clear unattached shared memory segments
  ipcs -ma | awk '0 == $6 {print $2}' | xargs -n 1 ipcrm -m
}

run_loop () { # <basename> <kill?>
  while true; do
    echo "$1: compiling"
    "$PLTROOT/bin/raco" make "$1.rkt"
    echo "$1: running"
    "$R" -t "$1.rkt" 2>&1 >> "$LOGS/$1.log" &
    echo "$!" > "$LOGS/$1.pid"
    wait "$!"
    echo "$1: died"
    rm "$LOGS/$1.pid"
    if [[ "x$2" = "xyes" ]]; then
      echo "killing processes"
      kill_all
    fi
  done
}

exec 2>&1 >> "$LOGS/meta.log"

run_loop render &
run_loop main yes &
{'fraction_non_alphanumeric': 0.22058823529411764, 'fraction_numerical': 0.022058823529411766, 'mean_word_length': 2.8456521739130434, 'pattern_counts': {'":': 0, '<': 7, '<?xml version=': 0, '>': 23, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '339426', 'n_tokens_mistral': 824, 'n_tokens_neox': 800, 'n_words': 172}