#!/usr/bin/perl

$hostname = `hostname`;
($suffix, $rest) = $hostname =~ m/d-(\d+)\.cs\.wisc\.edu/;

my $realsuffix = $suffix - 100;
printf "real suffix is $realsuffix\n";

`mkdir -p /scratch/tpc-h/3TB-50`;
`cp /p/condor/workspaces/epaulson.1/tpc-h/dists.dss /scratch/tpc-h/3TB-50`;
chdir("/scratch/tpc-h/3TB-50");
`/p/condor/workspaces/epaulson.1/tpc-h/dbgen -s 3000 -S $realsuffix -C 50`;

`mkdir -p /scratch/tpc-h/10G-10`;
`cp /p/condor/workspaces/epaulson.1/tpc-h/dists.dss /scratch/tpc-h/10G-10`;
chdir("/scratch/tpc-h/10G-10");
`/p/condor/workspaces/epaulson.1/tpc-h/dbgen -s 10 -S $realsuffix -C 10`;

`chmod -R 755 /scratch/tpc-h`;
