Followed Khalid's suggestion for packing libVectorLoglessCaching into

the jar file with Maven
This commit is contained in:
Karthik Gururaj 2014-02-26 10:53:51 -08:00
parent ac1cefce29
commit 0d5627c2f1
15 changed files with 240 additions and 16 deletions

36
.gitignore vendored
View File

@ -3,6 +3,7 @@
/*.bed
*~
/*.vcf
/*.vcf.idx
/*.txt
/*.csh
/.*
@ -40,3 +41,38 @@ perf
verify
maven-metadata-local.xml
dependency-reduced-pom.xml
private/gatk-private/private/
private/gatk-private/public/
private/gatk-private/target/
private/na12878kb-utils/public/
private/na12878kb-utils/target/
private/queue-private/private/
private/queue-private/public/
private/queue-private/target/
private/scala/
private/testdata
protected/gatk-protected/private/
protected/gatk-protected/public/
protected/gatk-protected/target/
public/external-example/target/
public/gatk-framework/private/
public/gatk-framework/public/
public/gatk-framework/target/
public/gatk-package/private/
public/gatk-package/public/
public/gatk-package/target/
public/gatk-queue-extgen/public/
public/gatk-queue-extgen/target/
public/gsalib/public/
public/gsalib/target/
public/queue-framework/private/
public/queue-framework/public/
public/queue-framework/target/
public/queue-package/private/
public/queue-package/public/
public/queue-package/target/
public/scala/
public/sting-utils/public/
public/sting-utils/target/
public/testdata
target/

View File

@ -155,4 +155,8 @@ public class GraphBasedLikelihoodCalculationEngine implements LikelihoodCalculat
}
}
}
@Override
public void close() {
}
}

View File

@ -1043,7 +1043,7 @@ public class HaplotypeCaller extends ActiveRegionWalker<List<VariantContext>, In
referenceConfidenceModel.close();
//TODO remove the need to call close here for debugging, the likelihood output stream should be managed
//TODO (open & close) at the walker, not the engine.
likelihoodCalculationEngine.close();
likelihoodCalculationEngine.close();
logger.info("Ran local assembly on " + result + " active regions");
}

View File

@ -170,9 +170,10 @@ public class PairHMMLikelihoodCalculationEngine implements LikelihoodCalculation
@Override
public void close() {
if ( likelihoodsStream != null ) likelihoodsStream.close();
pairHMMThreadLocal.get().close();
pairHMMThreadLocal.get().close();
}
private void writeDebugLikelihoods(final GATKSAMRecord processedRead, final Haplotype haplotype, final double log10l){
if ( WRITE_LIKELIHOODS_TO_FILE ) {
likelihoodsStream.printf("%s %s %s %s %s %s %f%n",

View File

@ -79,4 +79,9 @@ public class RandomLikelihoodCalculationEngine implements LikelihoodCalculationE
return result;
}
@Override
public void close() {
}
}

View File

@ -55,7 +55,7 @@ import org.broadinstitute.sting.utils.haplotype.Haplotype;
import org.broadinstitute.sting.utils.sam.GATKSAMRecord;
import org.broadinstitute.variant.variantcontext.Allele;
import org.broadinstitute.sting.utils.exceptions.UserException;
import static org.broadinstitute.sting.utils.pairhmm.PairHMMModel.*;
import java.util.List;
import java.util.Map;
@ -258,7 +258,7 @@ public class DebugJNILoglessPairHMM extends LoglessPairHMM {
relative_error = 0;
else
relative_error = Math.abs(abs_error/mLikelihoodArray[i]);
if(abs_error > 1e-6 && relative_error > 1e-6)
if(abs_error > 1e-5 && relative_error > 1e-5)
{
toDump = true;
break;

View File

@ -67,8 +67,6 @@ import java.io.IOException;
import java.io.InputStream;
import java.io.OutputStream;
/**
* Created with IntelliJ IDEA.
* User: rpoplin, carneiro

View File

@ -58,7 +58,7 @@ $(AVX_OBJECTS): CXXFLAGS=$(COMMON_COMPILATION_FLAGS) -xAVX
$(SSE_OBJECTS): CXXFLAGS=$(COMMON_COMPILATION_FLAGS) -xSSE4.2
OBJECTS=$(NO_VECTOR_OBJECTS) $(AVX_OBJECTS) $(SSE_OBJECTS)
all: $(BIN) Sandbox.class
all: $(BIN) Sandbox.class copied_lib
-include $(addprefix $(DEPDIR)/,$(SOURCES:.cc=.d))
@ -79,5 +79,11 @@ $(OBJECTS): %.o: %.cc
Sandbox.class: Sandbox.java
javac Sandbox.java
copied_lib: libVectorLoglessPairHMM.so
ifdef OUTPUT_DIR
mkdir -p $(OUTPUT_DIR)
rsync -a libVectorLoglessPairHMM.so $(OUTPUT_DIR)/
endif
clean:
rm -rf $(BIN) *.o $(DEPDIR) *.class

View File

@ -191,8 +191,6 @@ inline JNIEXPORT void JNICALL Java_org_broadinstitute_sting_utils_pairhmm_Vector
}
}
//#define DO_WARMUP
//#define DO_REPEAT_PROFILING
//Do compute over vector of testcase structs
inline void compute_testcases(vector<testcase>& tc_array, unsigned numTestCases, double* likelihoodDoubleArray,
unsigned maxNumThreadsToUse)

View File

@ -8,7 +8,8 @@ then
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/dist/GenomeAnalysisTK.jar -T HaplotypeCaller \
#java -Djava.library.path=${GSA_ROOT_DIR}/public/c++/VectorPairHMM -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 \
-I /data/simulated/sim1M_pairs_final.bam \

View File

@ -306,15 +306,12 @@ uint64_t diff_time(struct timespec& prev_time)
return (uint64_t)((curr_time.tv_sec-prev_time.tv_sec)*1000000000+(curr_time.tv_nsec-prev_time.tv_nsec));
}
#define DUMP_COMPUTE_VALUES 1
//#define DO_REPEATS
#ifdef USE_PAPI
#include "papi.h"
#define NUM_PAPI_COUNTERS 4
#endif
#define BATCH_SIZE 10000
#define RUN_HYBRID
void do_compute(char* filename, bool use_old_read_testcase, unsigned chunk_size, bool do_check)
{
FILE* fptr = 0;
@ -370,7 +367,7 @@ void do_compute(char* filename, bool use_old_read_testcase, unsigned chunk_size,
#endif
get_time(&start_time);
#pragma omp parallel for schedule(dynamic,chunk_size) num_threads(12)
#ifdef DO_REPEATS
#ifdef DO_REPEAT_PROFILING
for(unsigned z=0;z<10;++z)
#endif
{

View File

@ -40,4 +40,11 @@ enum ProcessorCapabilitiesEnum
uint64_t get_machine_capabilities();
void initialize_function_pointers(uint64_t mask=ENABLE_ALL_HARDWARE_FEATURES);
void do_compute(char* filename, bool use_old_read_testcase=true, unsigned chunk_size=10000, bool do_check=true);
//#define DO_WARMUP
//#define DO_REPEAT_PROFILING
//#define DUMP_COMPUTE_VALUES 1
#define BATCH_SIZE 10000
#define RUN_HYBRID
#endif

167
public/c++/pom.xml 100644
View File

@ -0,0 +1,167 @@
<?xml version="1.0" encoding="UTF-8"?>
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
<modelVersion>4.0.0</modelVersion>
<parent>
<groupId>org.broadinstitute.sting</groupId>
<artifactId>sting-root</artifactId>
<version>2.8-SNAPSHOT</version>
<relativePath>../../public/sting-root</relativePath>
</parent>
<artifactId>pairhmm-native</artifactId>
<packaging>pom</packaging>
<name>PairHMM Native Libraries</name>
<description>Builds a platform dependent version of pairhmm. During install, copies it into sting-utils.</description>
<properties>
<sourceEncoding>UTF-8</sourceEncoding>
<project.build.sourceEncoding>${sourceEncoding}</project.build.sourceEncoding>
<project.reporting.outputEncoding>${sourceEncoding}</project.reporting.outputEncoding>
<sting.basedir>${project.basedir}/../..</sting.basedir>
<sting-utils.basedir>${sting.basedir}/public/sting-utils</sting-utils.basedir>
<!-- Where to place the library in sting-utils -->
<pairhmm.resources.directory>${sting-utils.basedir}/src/main/resources/org/broadinstitute/sting/utils/pairhmm</pairhmm.resources.directory>
<!-- Per architecture properties, overriden in profiles below -->
<!--
NOTE: cxxflags is for currently only for -fPIC on linux.
For other architectures still have to pass something, until possibly
switching to command line arguments with exec-maven-plugin 1.3
http://jira.codehaus.org/browse/MEXEC-104
-->
<pairhmm.build.architecture>x86_64</pairhmm.build.architecture>
<pairhmm.build.extension>so</pairhmm.build.extension>
<pairhmm.build.cxxflags>-Wall</pairhmm.build.cxxflags>
<pairhmm.build.ldflags>-dynamiclib</pairhmm.build.ldflags>
</properties>
<build>
<plugins>
<!-- Print out the current architecture, to know which profile is being activated. -->
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-enforcer-plugin</artifactId>
<executions>
<execution>
<goals>
<goal>display-info</goal>
</goals>
<phase>validate</phase>
</execution>
</executions>
</plugin>
<!-- Run make -->
<plugin>
<groupId>org.codehaus.mojo</groupId>
<artifactId>exec-maven-plugin</artifactId>
<executions>
<execution>
<goals>
<goal>exec</goal>
</goals>
<phase>compile</phase>
<configuration>
<executable>make</executable>
<workingDirectory>VectorPairHMM</workingDirectory>
<environmentVariables>
<ARCHITECTURE>${pairhmm.build.architecture}</ARCHITECTURE>
<LIB_EXT>${pairhmm.build.extension}</LIB_EXT>
<CXXFLAGS>${pairhmm.build.cxxflags}</CXXFLAGS>
<LDFLAGS>${pairhmm.build.ldflags}</LDFLAGS>
<OUTPUT_DIR>${project.build.directory}</OUTPUT_DIR>
</environmentVariables>
</configuration>
</execution>
</executions>
</plugin>
<!-- Don't actually install this artifact into the user's repo -->
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-install-plugin</artifactId>
<configuration>
<skip>true</skip>
</configuration>
</plugin>
<!-- Copy the built library into sting-utils -->
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-resources-plugin</artifactId>
<executions>
<execution>
<id>default-install</id>
<goals>
<goal>copy-resources</goal>
</goals>
<phase>install</phase>
<configuration>
<outputDirectory>${pairhmm.resources.directory}</outputDirectory>
<resources>
<resource>
<directory>${project.build.directory}</directory>
<includes>
<include>**/*</include>
</includes>
</resource>
</resources>
</configuration>
</execution>
</executions>
</plugin>
<!-- pom.xml cleanup, always sort according to the definitions in sting-root -->
<plugin>
<groupId>com.google.code.sortpom</groupId>
<artifactId>maven-sortpom-plugin</artifactId>
<configuration>
<createBackupFile>false</createBackupFile>
<predefinedSortOrder>custom_1</predefinedSortOrder>
<lineSeparator>\n</lineSeparator>
<encoding>${sourceEncoding}</encoding>
<keepBlankLines>true</keepBlankLines>
<sortDependencies>scope</sortDependencies>
<nrOfIndentSpace>4</nrOfIndentSpace>
<expandEmptyElements>false</expandEmptyElements>
</configuration>
</plugin>
</plugins>
</build>
<profiles>
<profile>
<id>mac_x86_64</id>
<activation>
<os>
<family>mac</family>
<arch>x86_64</arch>
</os>
</activation>
<properties>
<pairhmm.build.architecture>mac_x86_64</pairhmm.build.architecture>
<pairhmm.build.extension>jnilib</pairhmm.build.extension>
<pairhmm.build.ldflags>-dynamiclib</pairhmm.build.ldflags>
</properties>
</profile>
<profile>
<id>linux_x86_64</id>
<activation>
<os>
<name>linux</name>
<arch>amd64</arch>
</os>
</activation>
<properties>
<pairhmm.build.architecture>linux_x86_64</pairhmm.build.architecture>
<pairhmm.build.extension>jnilib</pairhmm.build.extension>
<pairhmm.build.cxxflags>-fPIC</pairhmm.build.cxxflags>
<pairhmm.build.ldflags>-shared</pairhmm.build.ldflags>
</properties>
</profile>
</profiles>
</project>

View File

@ -332,7 +332,11 @@
<artifactId>maven-assembly-plugin</artifactId>
<version>2.4</version>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-enforcer-plugin</artifactId>
<version>1.3.1</version>
</plugin>
<!--
surefire/failsafe configurations are global, even across poms
not directly aggregated, for example package-tests/pom.xml