From 2d0ce45bb056ea32321c01587b6ae8ddce372d52 Mon Sep 17 00:00:00 2001 From: Karthik Gururaj Date: Thu, 27 Feb 2014 10:12:23 -0800 Subject: [PATCH] Moved JNI_README --- .../{src/main/c++/JNI_README => README.md} | 25 +++++++++----- public/VectorPairHMM/pom.xml | 34 +++---------------- public/VectorPairHMM/src/main/c++/run.sh | 4 +-- 3 files changed, 22 insertions(+), 41 deletions(-) rename public/VectorPairHMM/{src/main/c++/JNI_README => README.md} (62%) diff --git a/public/VectorPairHMM/src/main/c++/JNI_README b/public/VectorPairHMM/README.md similarity index 62% rename from public/VectorPairHMM/src/main/c++/JNI_README rename to public/VectorPairHMM/README.md index 3eb797ab6..69ef76c50 100644 --- a/public/VectorPairHMM/src/main/c++/JNI_README +++ b/public/VectorPairHMM/README.md @@ -9,9 +9,9 @@ function implementation that is supported on the machine on which the program is run. The two pointers are for float and double respectively. This initialization is done only once for the whole program. 3. initialize(): To initialized the region for PairHMM. Pass haplotype bases to native -code through the JNIHaplotypeDataHolders class. Since the haplotype list is common across -multiple samples in computeReadLikelihoods(), we can store the haplotype bases to the -native code once and re-use across multiple samples. +code through the JNIHaplotypeDataHolders class. Since the haplotype list is common across multiple +samples in computeReadLikelihoods(), we can store the haplotype bases to the native code once and +re-use across multiple samples. 4. computeLikelihoods(): Copies array references for readBases/quals etc to array of JNIReadDataHolder objects. Invokes the JNI function to perform the computation and updates the likelihoodMap. @@ -33,9 +33,16 @@ support all AVX intrinsics. Type 'make'. This should create a library called libVectorLoglessPairHMM.so Running: -If libVectorLoglessPairHMM.so is compiled using icc, make sure that the Intel Composer XE -libraries are in your LD_LIBRARY_PATH : -source /bin/compilervars.sh intel64 -See run.sh in this directory on how to invoke HaplotypeCaller with the native library. The -argument -Djava.library.path is needed if the native implementation is selected, else -unnecessary. +The default implementation of PairHMM is still LOGLESS_CACHING in HaplotypeCaller.java. To use the +native version, use the command line argument "--pair_hmm_implementation VECTOR_LOGLESS_CACHING" +(see run.sh in src/main/c++). +The native library is bundled with the StingUtils jar file. When HaplotypeCaller is invoked with the +VectorLoglessPairHMM implementation (see run.sh in the directory src/main/c++), then the library is +unpacked from the jar file, copied to the /tmp directory (with a unique id) and loaded by the Java class +VectorLoglessPairHMM in the constructor (if it has not been loaded already). +The default library can be overridden by using the -Djava.library.path argument for the JVM to pass +the path to the library. If the library libVectorLoglessPairHMM.so can be found in +java.library.path, then it is loaded and the 'packed' library is not used. +See run.sh in this directory on how to invoke HaplotypeCaller with the vector implementation of +PairHMM. The argument -Djava.library.path is needed if you wish to override the default packed +library, else unnecessary. diff --git a/public/VectorPairHMM/pom.xml b/public/VectorPairHMM/pom.xml index b310148d6..41bb73211 100644 --- a/public/VectorPairHMM/pom.xml +++ b/public/VectorPairHMM/pom.xml @@ -13,7 +13,7 @@ pom Vectorized PairHMM native libraries - Builds a GNU/Linux x86_64 version of VectorPairHMM. During install, copies it into sting-utils. + Builds a GNU/Linux x86_64 library of VectorPairHMM using icc (Intel C++ compiler). During install, copies it into sting-utils. Neither tested nor expected to work on any other platform. UTF-8 @@ -23,20 +23,12 @@ ${sting.basedir}/public/sting-utils ${sting-utils.basedir}/src/main/resources/org/broadinstitute/sting/utils/pairhmm - - - - x86_64 - so - + + + org.apache.maven.plugins maven-enforcer-plugin @@ -64,7 +56,6 @@ make src/main/c++ - ${pairhmm.build.architecture} ${java.home} ${project.build.directory} @@ -125,21 +116,4 @@ - - - - - linux_x86_64 - - - linux - amd64 - - - - linux_x86_64 - - - - diff --git a/public/VectorPairHMM/src/main/c++/run.sh b/public/VectorPairHMM/src/main/c++/run.sh index b52dddc46..7cc240c9d 100755 --- a/public/VectorPairHMM/src/main/c++/run.sh +++ b/public/VectorPairHMM/src/main/c++/run.sh @@ -7,8 +7,8 @@ then pair_hmm_implementation=$1; fi -#-Djava.library.path is needed if you are using JNI_LOGLESS_CACHING, else not needed -#java -Djava.library.path=${GSA_ROOT_DIR}/public/c++/VectorPairHMM -jar $GSA_ROOT_DIR/target/GenomeAnalysisTK.jar -T HaplotypeCaller \ +#-Djava.library.path is needed if you wish to override the default 'packed' library +#java -Djava.library.path=${GSA_ROOT_DIR}/public/VectorPairHMM/src/main/c++ -jar $GSA_ROOT_DIR/target/GenomeAnalysisTK.jar -T HaplotypeCaller \ java -jar $GSA_ROOT_DIR/target/GenomeAnalysisTK.jar -T HaplotypeCaller \ --dbsnp /data/broad/samples/joint_variant_calling/dbSNP/00-All.vcf \ -R /opt/Genomics/ohsu/dnapipeline/humanrefgenome/human_g1k_v37.fasta \