crooks

combinatorial rooks
git clone https://a3nm.net/git/crooks/
Log | Files | Refs

commit 6aabf972e5ce0af3fefab10f7e60ce54a4b6b3b3
parent b1e4c2d44bab2bb10b93db8b0c6388f452f0eb04
Author: Antoine Amarilli <a3nm@a3nm.net>
Date:   Sat,  7 Jun 2014 20:04:11 +0200

+runner scripts

Diffstat:
parallel.sh | 12++++++++++++
run.sh | 10++++++++++
2 files changed, 22 insertions(+), 0 deletions(-)

diff --git a/parallel.sh b/parallel.sh @@ -0,0 +1,12 @@ +#!/bin/bash + +for a in `seq 2 $1` +do + ./run.sh $a $2 & +done +wait +for a in `seq 2 $1` +do + echo -n "$a " + grep DONE tmp/out$a | cut -d ' ' -f3 | tail -1 +done diff --git a/run.sh b/run.sh @@ -0,0 +1,10 @@ +#!/bin/bash +FILE="tmp/main_${1}.c" +PROG="tmp/rooks$1" +OUT="tmp/out$1" +cat main.c | sed 's/define MAXN.*/define MAXN '$1'/' > $FILE +gcc -std=c99 -O2 -o $PROG $FILE +$PROG $1 1 > $OUT & +PID="$!" +sleep $2 +kill $PID