From e443c75092e44d82e3048a5cfddd327be5c854d6 Mon Sep 17 00:00:00 2001
From: ccooper <ccooper>
Date: Wed, 31 Dec 2003 03:34:44 +0000
Subject: [PATCH] - new test: run create and rename in same directory on
 multiple nodes in parallel

---
 lustre/tests/acceptance-metadata-parallel.sh | 105 +++++++++++++++++++
 1 file changed, 105 insertions(+)
 create mode 100644 lustre/tests/acceptance-metadata-parallel.sh

diff --git a/lustre/tests/acceptance-metadata-parallel.sh b/lustre/tests/acceptance-metadata-parallel.sh
new file mode 100644
index 0000000000..c4f0dd49fd
--- /dev/null
+++ b/lustre/tests/acceptance-metadata-parallel.sh
@@ -0,0 +1,105 @@
+#!/bin/sh
+set -e
+
+#########################################################################
+# Runs create.pl on a single mountpoint and directory with increasing
+# load across multiple clients.
+#########################################################################
+
+LUSTRE=${LUSTRE:-`dirname $0`/..}
+LTESTDIR=${LTESTDIR:-$LUSTRE/../ltest}
+PATH=$LUSTRE/utils:$LUSTRE/tests:$PATH
+ 
+RLUSTRE=${RLUSTRE:-$LUSTRE}
+RPWD=${RPWD:-$PWD}
+ 
+. $LUSTRE/tests/test-framework.sh
+
+TIME=${TIME:-/usr/bin/time}
+PDSH=${PDSH:-"pdsh -S -w"}
+MOUNTPT=${MOUNTPT:-"/mnt/lustre"}
+
+CREATE=$LUSTRE/tests/create.pl
+RENAME=$LUSTRE/tests/rename.pl
+
+[ -z "$CLIENTS" ] && exit 1
+#CLIENTS=`comma_list $CLIENTS`
+
+display_elapsed_time() {
+    PREVIOUS_TS=$CURRENT_TS
+    CURRENT_TS=`date +%s`
+    BLOCK_ELAPSED=`expr $CURRENT_TS - $PREVIOUS_TS`
+    TOTAL_ELAPSED=`expr $CURRENT_TS - $START_TS`
+
+    echo " "
+    echo "Elapsed time (block): ${BLOCK_ELAPSED} seconds"
+    echo "Elapsed time (TOTAL): ${TOTAL_ELAPSED} seconds"
+    echo " "
+}    
+
+set_debug_level() 
+{
+    $PDSH $CLIENTS "echo $1 > /proc/sys/portals/debug"
+}
+
+debug_client_on()
+{
+    set_debug_level -1
+}
+
+debug_client_partial()
+{
+    set_debug_level 0x3f0400
+}
+
+debug_client_off()
+{
+    set_debug_level 0
+}
+
+# Get our initial timestamps.
+START_TS=`date +%s`
+CURRENT_TS=$START_TS
+PREVIOUS_TS=$START_TS
+
+debug_client_off
+
+echo "create.pl, 1 mount, 1 thread, 1000 ops"
+$TIME $PDSH $CLIENTS "umask 0022 && cd $RLUSTRE/tests && perl $CREATE --mountpt=${MOUNTPT} --num_mounts=-1 --iterations=1000 --silent"
+#echo "create.pl --mcreate=0, 1 mount, 1 thread, 1000 ops, debug off"
+#$TIME $PDSH $CLIENTS "umask 0022 && cd $RLUSTRE/tests && perl $CREATE --mountpt=${MOUNTPT} --num_mounts=-1 --iterations=1000 --use_mcreate=0 --silent"
+wait
+#echo "rename.pl, 1 mount, 1 thread, 1000 ops, debug off"
+#$TIME $PDSH $CLIENTS "umask 0022 && cd $RLUSTRE/tests && perl $RENAME --mountpt=${MOUNTPT} --num_mounts=-1 --iterations=1000 --silent"
+
+display_elapsed_time
+
+echo "create.pl, 1 mount, 2 threads, 2000 ops, debug off"
+$TIME $PDSH $CLIENTS "umask 0022 && cd $RLUSTRE/tests && perl $CREATE --mountpt=${MOUNTPT} --num_mounts=-1 --iterations=2000 --num_threads=2 --silent"
+#echo "create.pl --mcreate=0, 1 mount, 2 threads, 2000 ops, debug off"
+#$TIME $PDSH $CLIENTS "umask 0022 && cd $RLUSTRE/tests && perl $CREATE --mountpt=${MOUNTPT} --num_mounts=-1 --iterations=2000 --num_threads=2 --use_mcreate=0  --silent"
+wait
+#echo "rename.pl, 1 mount, 2 threads, 2000 ops, debug off"
+#$TIME $PDSH $CLIENTS "umask 0022 && cd $RLUSTRE/tests && perl $RENAME --mountpt=${MOUNTPT} --num_mounts=-1 --iterations=2000 --num_threads=2 --silent#
+
+display_elapsed_time
+
+echo "create.pl, 1 mount, 4 threads, 2000 ops, debug off"
+$TIME $PDSH $CLIENTS "umask 0022 && cd $RLUSTRE/tests && perl $CREATE --mountpt=${MOUNTPT} --num_mounts=-1 --iterations=2000 --num_threads=4  --silent"
+#echo "create.pl --mcreate=0, 1 mount, 4 threads, 2000 ops, debug off"
+#$TIME $PDSH $CLIENTS "umask 0022 && cd $RLUSTRE/tests && perl $CREATE --mountpt=${MOUNTPT} --num_mounts=-1 --iterations=2000 --num_threads=4  --use_mcreate=0 --silent"
+wait
+#echo "rename.pl, 1 mount, 4 threads, 2000 ops, debug off"
+#$TIME $PDSH $CLIENTS "umask 0022 && cd $RLUSTRE/tests && perl $RENAME --mountpt=${MOUNTPT} --num_mounts=-1 --iterations=2000 --num_threads=4 --silent"
+
+display_elapsed_time
+
+echo "create.pl, 1 mount, 8 threads, 2000 ops, debug off"
+$TIME $PDSH $CLIENTS "umask 0022 && cd $RLUSTRE/tests && perl $CREATE --mountpt=${MOUNTPT} --num_mounts=-1 --iterations=2000 --num_threads=8  --silent"
+#echo "create.pl --mcreate=0, 1 mount, 8 threads, 2000 ops, debug off"
+#$TIME $PDSH $CLIENTS "umask 0022 && cd $RLUSTRE/tests && perl $CREATE --mountpt=${MOUNTPT} --num_mounts=-1 --iterations=2000 --num_threads=8  --use_mcreate=0 --silent"
+wait
+#echo "rename.pl, 1 mount, 8 threads, 2000 ops, debug off"
+#$TIME $PDSH $CLIENTS "umask 0022 && cd $RLUSTRE/tests && perl $RENAME --mountpt=${MOUNTPT} --num_mounts=-1 --iterations=2000 --num_threads=8 --silent"
+
+display_elapsed_time
-- 
GitLab