#!/usr/bin/perl # # file names # $exfile = "pedge_detect"; $machinefile = "machines"; $infile = "image2048.pgm"; $outfile = "/var/tmp/out.pgm"; $resultprefix = "workqueue2048"; # number of hosts to use at iteration 1, 2, 3... @nprocs = (2, 3, 5, 9); # chunk x- and y-dimentions to try at each iteration @xchunk = (4, 8, 16, 32, 64, 128, 256, 512, 1024); @ychunk = (4, 8, 16, 32, 64, 128, 256, 512, 1024); if($#xchunk!=$#ychunk) { die "xchunk and ychunk must be the same size!"; } # number of times to repeat each iteration (to get a better average) $repeat = 1; foreach $np (@nprocs) { foreach $re (1..$repeat) { $resultfile = sprintf "$resultprefix.%i", $np-1; if ($repeat>1) { $resultfile .= "-$re"; } $errfile = "$resultfile.err"; system "cat /dev/null >$resultfile" || die "could not truncate $resultfile"; system "cat /dev/null >$errfile" || die "could not truncate $errfile"; foreach $i (0..$#xchunk) { $runline = "mpirun -np $np " . "-machinefile $machinefile " . "$exfile -i $infile -o $outfile " . "-x $xchunk[$i] -y $ychunk[$i] " . ">>$resultfile 2>>$errfile"; print "$runline\n"; system $runline; } } }