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
# of the compiler under test in those grades in arena.java and arena.csharp
# 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}" = ""
then
@@ -35,6 +38,9 @@ then
exit 1
fi
PARALLEL=${PARALLEL:-`nproc 2>/dev/null`}
PARALLEL=${PARALLEL:-1}
dirs="library mdbcomp browser compiler slice profiler deep_profiler"
root=`/bin/pwd`
@@ -65,19 +71,15 @@ ${BASE_MMC} -f *.m
cd ${root}
cp -rp arena.base arena.base.java
cd ${root}/arena.base.java
for f in *.m
do
echo === JAVA ${f} ===
${BASE_MMC} --grade java --target-code-only ${f}
done
echo === JAVA ===
echo *.m | xargs -P${PARALLEL} -n1 -t \
${BASE_MMC} --grade java --target-code-only
cd ${root}
cp -rp arena.base arena.base.csharp
cd ${root}/arena.base.csharp
for f in *.m
do
echo === CSHARP ${f} ===
${BASE_MMC} --grade csharp --target-code-only ${f}
done
echo === CSHARP ===
echo *.m | xargs -P${PARALLEL} -n1 -t \
${BASE_MMC} --grade csharp --target-code-only
exit 0

View File

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