#!/bin/sh

# t2np <tapepvmtrace>
# outputs a *NEW* picl version of <tapepvmtrace>.
# The output is correctly sorted.
# Picl nodes are numbered in order of creation of the
# corresponding tape tasks.

if [ $# != 1 ]
then echo usage: t2np tapepvmtrace
     exit
fi

if [ ! -f $1 ]
then echo $1: no such trace
     exit
fi

sort +4n -5 +5n -6 +0n -1 $1 | tape2npicl | sort +2n -3 +0n -1 +1rn -2
