pkgsrc-WIP-changes archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

plink2: Add plink-bench script



Module Name:	pkgsrc-wip
Committed By:	Jason Bacon <bacon%NetBSD.org@localhost>
Pushed By:	outpaddling
Date:		Mon Feb 11 09:31:05 2019 -0600
Changeset:	eb958fbd5868a8c94bc55c20cfacc8aaf026c211

Modified Files:
	plink2/Makefile
	plink2/PLIST
	plink2/files/plink2-test.in
Added Files:
	plink2/files/plink2-bench

Log Message:
plink2: Add plink-bench script

To see a diff of this commit:
https://wip.pkgsrc.org/cgi-bin/gitweb.cgi?p=pkgsrc-wip.git;a=commitdiff;h=eb958fbd5868a8c94bc55c20cfacc8aaf026c211

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

diffstat:
 plink2/Makefile             |  1 +
 plink2/PLIST                |  1 +
 plink2/files/plink2-bench   | 50 +++++++++++++++++++++++++++++++++++++++++++++
 plink2/files/plink2-test.in | 24 ++++++++++++++++++++++
 4 files changed, 76 insertions(+)

diffs:
diff --git a/plink2/Makefile b/plink2/Makefile
index e77f79e033..de0b50ce49 100644
--- a/plink2/Makefile
+++ b/plink2/Makefile
@@ -55,6 +55,7 @@ post-install:
 	${SED} -e "s|%%DATADIR%%|${DATADIR}|g" ${FILESDIR}/plink2-test.in \
 		> ${WRKDIR}/plink2-test
 	${INSTALL_SCRIPT} ${WRKDIR}/plink2-test ${DESTDIR}${PREFIX}/bin
+	${INSTALL_SCRIPT} ${FILESDIR}/plink2-bench ${DESTDIR}${PREFIX}/bin
 
 # .include "../../wip/openblas/buildlink3.mk"
 .include "../../lang/python/application.mk"
diff --git a/plink2/PLIST b/plink2/PLIST
index 03ef5c60ef..8d0ecdc9db 100644
--- a/plink2/PLIST
+++ b/plink2/PLIST
@@ -2,6 +2,7 @@
 bin/pgen_compress
 bin/plink2
 bin/plink2-test
+bin/plink2-bench
 share/plink2/Tests/TEST_DOSAGE_ROUND_TRIP/.gitignore
 share/plink2/Tests/TEST_DOSAGE_ROUND_TRIP/run_tests.sh
 share/plink2/Tests/TEST_EXTRACT_CHR/.gitignore
diff --git a/plink2/files/plink2-bench b/plink2/files/plink2-bench
new file mode 100644
index 0000000000..36c19c49f0
--- /dev/null
+++ b/plink2/files/plink2-bench
@@ -0,0 +1,50 @@
+#!/bin/sh -e
+
+##########################################################################
+#   Script description:
+#       Simple performance test for plink2
+#       
+#   History:
+#   Date        Name        Modification
+#   2019-02-11  J Bacon     Begin
+##########################################################################
+
+usage()
+{
+    printf "Usage: $0 trials threads\n"
+    exit 1
+}
+
+
+##########################################################################
+#   Main
+##########################################################################
+
+if [ $# != 2 ]; then
+    usage
+fi
+
+trials=$1
+threads=$2
+
+rm -f plink2.* testdata*
+
+printf "Generating test data...\n"
+plink2 --dummy 9999 999999 --out testdata
+cat testdata.psam | cut -f 1 | tail -n +2 | sort -R | head -n 6666 > id_subset.txt
+which plink2
+
+trial=1
+while [ $trial -le $trials ]; do
+    printf "\n                          *** Trial $trial ***\n"
+    printf "\n===========================================================\n"
+    printf "Running --keep benchmark..."
+    printf "\n===========================================================\n\n"
+    time plink2 --pfile testdata --keep id_subset.txt --make-pgen
+    
+    printf "\n===========================================================\n"
+    printf "Running KING-robust benchmark..."
+    printf "\n===========================================================\n\n"
+    time plink2 --pfile testdata --make-king
+    trial=$(($trial + 1))
+done
diff --git a/plink2/files/plink2-test.in b/plink2/files/plink2-test.in
index e11b3c80f4..97b0551687 100755
--- a/plink2/files/plink2-test.in
+++ b/plink2/files/plink2-test.in
@@ -1,5 +1,29 @@
 #!/bin/sh -e
 
+##########################################################################
+#   Script description:
+#       Run bundled test suite for plink2
+#
+#   History:
+#   Date        Name        Modification
+#   2019-02-11  J Bacon     Begin
+##########################################################################
+
+usage()
+{
+    printf "Usage: $0\n"
+    exit 1
+}
+
+
+##########################################################################
+#   Main
+##########################################################################
+
+if [ $# != 0 ]; then
+    usage
+fi
+
 if ! which plink; then
     cat << EOM
 


Home | Main Index | Thread Index | Old Index