Parallelise make_java_csharp_arena_{base,diff}

tools/make_java_csharp_arena_base:
tools/make_java_csharp_arena_diff:
    Use xargs -P to run multiple instances of the compiler in parallel.

    Allow the environment variable PARALLEL to control the number of
    parallel tasks.
This commit is contained in:
Peter Wang
2018-07-26 10:32:55 +10:00
parent 5de4c263d1
commit 1daf4d6081
2 changed files with 21 additions and 20 deletions

View File

@@ -28,6 +28,9 @@
# The companion script make_java_csharp_diff then puts the output # The companion script make_java_csharp_diff then puts the output
# of the compiler under test in those grades in arena.java and arena.csharp # of the compiler under test in those grades in arena.java and arena.csharp
# respectively, and compares them to their respective bases. # respectively, and compares them to their respective bases.
#
# The environment variable PARALLEL controls the maximum number of compiler
# processes to run at a time.
if test "${BASE_MMC}" = "" if test "${BASE_MMC}" = ""
then then
@@ -35,6 +38,9 @@ then
exit 1 exit 1
fi fi
PARALLEL=${PARALLEL:-`nproc 2>/dev/null`}
PARALLEL=${PARALLEL:-1}
dirs="library mdbcomp browser compiler slice profiler deep_profiler" dirs="library mdbcomp browser compiler slice profiler deep_profiler"
root=`/bin/pwd` root=`/bin/pwd`
@@ -65,19 +71,15 @@ ${BASE_MMC} -f *.m
cd ${root} cd ${root}
cp -rp arena.base arena.base.java cp -rp arena.base arena.base.java
cd ${root}/arena.base.java cd ${root}/arena.base.java
for f in *.m echo === JAVA ===
do echo *.m | xargs -P${PARALLEL} -n1 -t \
echo === JAVA ${f} === ${BASE_MMC} --grade java --target-code-only
${BASE_MMC} --grade java --target-code-only ${f}
done
cd ${root} cd ${root}
cp -rp arena.base arena.base.csharp cp -rp arena.base arena.base.csharp
cd ${root}/arena.base.csharp cd ${root}/arena.base.csharp
for f in *.m echo === CSHARP ===
do echo *.m | xargs -P${PARALLEL} -n1 -t \
echo === CSHARP ${f} === ${BASE_MMC} --grade csharp --target-code-only
${BASE_MMC} --grade csharp --target-code-only ${f}
done
exit 0 exit 0

View File

@@ -9,6 +9,9 @@ then
exit 1 exit 1
fi fi
PARALLEL=${PARALLEL:-`nproc 2>/dev/null`}
PARALLEL=${PARALLEL:-1}
root=`/bin/pwd` root=`/bin/pwd`
/bin/rm -fr arena.java arena.csharp > /dev/null 2>&1 /bin/rm -fr arena.java arena.csharp > /dev/null 2>&1
@@ -16,18 +19,14 @@ cp -rp arena.base arena.java
cp -rp arena.base arena.csharp cp -rp arena.base arena.csharp
cd ${root}/arena.java cd ${root}/arena.java
for f in *.m echo === JAVA ===
do echo *.m | xargs -P${PARALLEL} -n1 -t \
echo === JAVA ${f} === ${TEST_MMC} --grade java --target-code-only
${TEST_MMC} --grade java --target-code-only ${f}
done
cd ${root}/arena.csharp cd ${root}/arena.csharp
for f in *.m echo === CSHARP ===
do echo *.m | xargs -P${PARALLEL} -n1 -t \
echo === CSHARP ${f} === ${TEST_MMC} --grade csharp --target-code-only
${TEST_MMC} --grade csharp --target-code-only ${f}
done
cd ${root} cd ${root}
diff -ur arena.base.java arena.java > DIFF.ARENA.JAVA 2>&1 diff -ur arena.base.java arena.java > DIFF.ARENA.JAVA 2>&1