#!/bin/sh # # Copyright (C) 2011 The University of Melbourne # # test-autopar, this script tests autoparallelization on the Mercury compiler. # set -e # Run the profiling version. root=`pwd` OPTS=`getopt -o "abcfhj:p" -n "test-autopar" -- "$@"` eval set -- "$OPTS" phase_batch=false phase_build_profile=false phase_feedback=false phase_profile=false usage=false jfactor=1 while true ; do case "$1" in -a) phase_batch=true shift ;; -b) phase_batch=true shift ;; -c) phase_build_profile=true shift ;; -f) phase_feedback=true shift ;; -h) usage=true shift ;; -j) jfactor=$2 shift; shift; ;; -p) phase_profile=true shift ;; --) shift break ;; *) usage=true break ;; esac done if [ "(" "x" != "x$@" ")" -o "(" "x" = "x$jfactor" ")" ]; then usage=true fi if [ "$usage" = "true" ]; then echo "Usage: test-autopar [-abcpfh] [-jN]" echo "" echo "test_autopar will attempt to auto-parallelize the compiler, " echo "it sxpects that 'mmake all' has been run. Different phases " echo "of the test can be selectivly enabled:" echo "" echo " -a\tAll phases" echo " -b\tSetup 'batch' directory" echo " -c\tBuild profiling version of the compiler" echo " -p\tProfile the compiler (generate Deep.data)" echo " -f\tAnalyze the profile (generate .feedback file)" echo "" echo " -jN\tRun N jobs in parallel when calling make" echo "" echo " -h\tPrint this usage message" exit 1 fi if [ "$phase_batch" = "true" ]; then rm -rf batch mkdir batch # Setup profiling options. cat > batch/profile.GRADE < batch/profile.MCFLAGS < batch/auto_par.GRADE < batch/auto_par.MCFLAGS < batch/auto_par_ts.GRADE < batch/auto_par_ts.MCFLAGS <