#!/usr/bin/env bash

set -e

ulimit -n 4096

echo "--- running two shards with few nodes each and checking convergence ..."

OF1=/tmp/rift.out.1.$$
OF2=/tmp/rift.out.2.$$

../bin/rift-environ  -R 5 topology -s 1 -DD ../topology/two_by_two_sharded.yaml > $OF1 &
../bin/rift-environ  -R 5 topology -s 2 -DD ../topology/two_by_two_sharded.yaml > $OF2 &

sleep 7

echo "LSDB for core 1 in shard 1"
cat $OF1 | python lib/curlies.py "LSDB for core_" "[" "]"
echo ============================
echo "LSDB for core 2 in shard 2"
cat $OF2 | python lib/curlies.py "LSDB for core_" "[" "]"
echo ============================

unlink $OF1
unlink $OF2

