Loading test/sra-sort/md-created.sh 0 → 100755 +52 −0 Original line number Diff line number Diff line #!/bin/bash TMP=/export/home/TMP if [ ! -d "$TMP" ] ; then echo $TMP is not found: skipping the test exit 0 fi if [ "$PANFS_PAN1" == "" ] ; then echo PANFS_PAN1 is not set: exiting exit 1 fi I=`whoami` DSTDIR=$TMP/$I/sra-sort-md DST=$DSTDIR/sorted rm -fr $DSTDIR SORT=sra-sort which $SORT > /dev/null 2>&1 if [ "$?" != "0" ] ; then echo "sra-sort not found: add it to your PATH" exit 10 fi OPT="--tempdir $DSTDIR --mmapdir $DSTDIR --map-file-bsize 80000000000 --max-ref-idx-ids 4000000000 --max-idx-ids 4000000000 --max-large-idx-ids 800000000" SRC=$PANFS_PAN1/sra-test/TEST-DATA/SRR5318091-sra-sort-md CMD="$SORT -f -v -L6 $OPT $SRC $DST" echo $ $CMD $CMD EXIT=$? if [ $EXIT -ne 0 ] ; then echo "sra-sort failed with $EXIT" rm -r $DSTDIR exit $EXIT fi if [ ! -d "$DST/md" ] ; then echo Failure: md was not created in $DST: echo $ ls $DST ls $DST rm -r $DSTDIR exit 20 else echo Success: md was created in $DST: echo $ ls $DST ls $DST fi rm -r $DSTDIR tools/sra-sort/csra-tbl.c +6 −2 Original line number Diff line number Diff line Loading @@ -446,6 +446,10 @@ void cSRATblPairPostCopyAlign ( cSRATblPair *self, const ctx_t *ctx ) cSRAPair *csra = self -> csra; struct KThread ** pt = NULL; assert ( self ); pt = & self -> dad . thread; RowSetIteratorRelease ( self -> rsi, ctx ); self -> rsi = NULL; Loading @@ -458,10 +462,10 @@ void cSRATblPairPostCopyAlign ( cSRATblPair *self, const ctx_t *ctx ) switch ( self -> align_idx ) { case 1: CrossCheckRefAlignTbl ( ctx, csra -> reference -> dtbl, csra -> prim_align -> dtbl, "PRIMARY_ALIGNMENT" ); CrossCheckRefAlignTbl ( ctx, csra -> reference -> dtbl, csra -> prim_align -> dtbl, "PRIMARY_ALIGNMENT", pt ); break; case 2: CrossCheckRefAlignTbl ( ctx, csra -> reference -> dtbl, csra -> sec_align -> dtbl, "SECONDARY_ALIGNMENT" ); CrossCheckRefAlignTbl ( ctx, csra -> reference -> dtbl, csra -> sec_align -> dtbl, "SECONDARY_ALIGNMENT", pt ); #if SEQUENCE_BEFORE_SECONDARY cSRATblPairWhackMappingIdx ( self, ctx ); Loading tools/sra-sort/tbl-pair.c +38 −0 Original line number Diff line number Diff line Loading @@ -47,6 +47,7 @@ typedef struct TablePair StdTblPair; #include <klib/text.h> #include <klib/namelist.h> #include <klib/rc.h> #include <kproc/thread.h> /* KThreadWait */ #include <string.h> Loading Loading @@ -1051,5 +1052,42 @@ void TablePairDestroy ( TablePair *self, const ctx_t *ctx ) MemFree ( ctx, ( void* ) self -> full_spec, self -> full_spec_size + 1 ); if ( self -> thread != NULL ) { rc_t rc = 0; rc_t status = 0; STATUS ( 2, "waiting for background thread 0x%p to finish...", self -> thread ); rc = KThreadWait ( self -> thread, & status ); if ( rc != 0 ) ERROR ( rc, "failed to wait for background thread 0x%p", self -> thread ); else if ( status == 0 ) STATUS ( 2, "...background thread 0x%p succeed", self -> thread ); else { ERROR ( status, "background thread 0x%p failed", self -> thread ); rc = status; } { rc_t r2 = KThreadRelease ( self -> thread ); if ( r2 != 0 ) { ERROR ( r2, "failed to release background thread 0x%p", self -> thread ); if ( rc == 0 ) rc = r2; } } if ( rc != 0 && ctx != NULL ) { ctx_t * mctx = NULL; for ( mctx = ( ctx_t * ) ctx; mctx != NULL && mctx -> rc == 0; mctx = ( ctx_t* ) mctx -> caller ) { mctx -> rc = rc; } } } memset ( self, 0, sizeof * self ); } tools/sra-sort/tbl-pair.h +4 −0 Original line number Diff line number Diff line Loading @@ -45,6 +45,7 @@ */ struct VTable; struct DbPair; struct KThread; struct ColumnReader; struct ColumnWriter; struct ColumnPair; Loading Loading @@ -109,6 +110,9 @@ struct TablePair /* true if already exploded */ bool exploded; /* Thread launched by TablePairPostCopy [ to do consistency-check ] */ struct KThread * thread; uint8_t align [ 2 ]; }; Loading tools/sra-sort/xcheck-ref-align.c +9 −3 Original line number Diff line number Diff line Loading @@ -341,11 +341,12 @@ rc_t CC CrossCheckRefAlignTblRun ( const KThread *self, void *data ) ctx_t thread_ctx = { & pb -> caps, NULL, & ctx_info }; const ctx_t *ctx = & thread_ctx; STATUS ( 2, "running consistency-check on background thread" ); STATUS ( 2, "running consistency-check on background thread 0x%p", self ); CrossCheckRefAlignTblInt ( ctx, pb -> ref_tbl, pb -> align_tbl, pb -> align_name ); STATUS ( 2, "finished consistency-check on background thread" ); STATUS ( 2, "finished consistency-check on background thread 0x%p: %s", self, ctx -> rc ? "failure" : "success "); VTableRelease ( pb -> align_tbl ); VTableRelease ( pb -> ref_tbl ); Loading @@ -357,7 +358,8 @@ rc_t CC CrossCheckRefAlignTblRun ( const KThread *self, void *data ) #endif void CrossCheckRefAlignTbl ( const ctx_t *ctx, const VTable *ref_tbl, const VTable *align_tbl, const char *align_name ) const VTable *ref_tbl, const VTable *align_tbl, const char *align_name, KThread ** pt ) { FUNC_ENTRY ( ctx ); Loading @@ -368,6 +370,9 @@ void CrossCheckRefAlignTbl ( const ctx_t *ctx, STATUS ( 2, "consistency-check on join indices between REFERENCE and %s tables", align_name ); assert ( pt ); * pt = NULL; #if USE_BGTHREAD name_len = strlen ( align_name ); TRY ( pb = MemAlloc ( ctx, sizeof * pb + name_len, false ) ) Loading @@ -391,6 +396,7 @@ void CrossCheckRefAlignTbl ( const ctx_t *ctx, rc = KThreadMake ( & t, CrossCheckRefAlignTblRun, pb ); if ( rc == 0 ) { * pt = t; return; } Loading Loading
test/sra-sort/md-created.sh 0 → 100755 +52 −0 Original line number Diff line number Diff line #!/bin/bash TMP=/export/home/TMP if [ ! -d "$TMP" ] ; then echo $TMP is not found: skipping the test exit 0 fi if [ "$PANFS_PAN1" == "" ] ; then echo PANFS_PAN1 is not set: exiting exit 1 fi I=`whoami` DSTDIR=$TMP/$I/sra-sort-md DST=$DSTDIR/sorted rm -fr $DSTDIR SORT=sra-sort which $SORT > /dev/null 2>&1 if [ "$?" != "0" ] ; then echo "sra-sort not found: add it to your PATH" exit 10 fi OPT="--tempdir $DSTDIR --mmapdir $DSTDIR --map-file-bsize 80000000000 --max-ref-idx-ids 4000000000 --max-idx-ids 4000000000 --max-large-idx-ids 800000000" SRC=$PANFS_PAN1/sra-test/TEST-DATA/SRR5318091-sra-sort-md CMD="$SORT -f -v -L6 $OPT $SRC $DST" echo $ $CMD $CMD EXIT=$? if [ $EXIT -ne 0 ] ; then echo "sra-sort failed with $EXIT" rm -r $DSTDIR exit $EXIT fi if [ ! -d "$DST/md" ] ; then echo Failure: md was not created in $DST: echo $ ls $DST ls $DST rm -r $DSTDIR exit 20 else echo Success: md was created in $DST: echo $ ls $DST ls $DST fi rm -r $DSTDIR
tools/sra-sort/csra-tbl.c +6 −2 Original line number Diff line number Diff line Loading @@ -446,6 +446,10 @@ void cSRATblPairPostCopyAlign ( cSRATblPair *self, const ctx_t *ctx ) cSRAPair *csra = self -> csra; struct KThread ** pt = NULL; assert ( self ); pt = & self -> dad . thread; RowSetIteratorRelease ( self -> rsi, ctx ); self -> rsi = NULL; Loading @@ -458,10 +462,10 @@ void cSRATblPairPostCopyAlign ( cSRATblPair *self, const ctx_t *ctx ) switch ( self -> align_idx ) { case 1: CrossCheckRefAlignTbl ( ctx, csra -> reference -> dtbl, csra -> prim_align -> dtbl, "PRIMARY_ALIGNMENT" ); CrossCheckRefAlignTbl ( ctx, csra -> reference -> dtbl, csra -> prim_align -> dtbl, "PRIMARY_ALIGNMENT", pt ); break; case 2: CrossCheckRefAlignTbl ( ctx, csra -> reference -> dtbl, csra -> sec_align -> dtbl, "SECONDARY_ALIGNMENT" ); CrossCheckRefAlignTbl ( ctx, csra -> reference -> dtbl, csra -> sec_align -> dtbl, "SECONDARY_ALIGNMENT", pt ); #if SEQUENCE_BEFORE_SECONDARY cSRATblPairWhackMappingIdx ( self, ctx ); Loading
tools/sra-sort/tbl-pair.c +38 −0 Original line number Diff line number Diff line Loading @@ -47,6 +47,7 @@ typedef struct TablePair StdTblPair; #include <klib/text.h> #include <klib/namelist.h> #include <klib/rc.h> #include <kproc/thread.h> /* KThreadWait */ #include <string.h> Loading Loading @@ -1051,5 +1052,42 @@ void TablePairDestroy ( TablePair *self, const ctx_t *ctx ) MemFree ( ctx, ( void* ) self -> full_spec, self -> full_spec_size + 1 ); if ( self -> thread != NULL ) { rc_t rc = 0; rc_t status = 0; STATUS ( 2, "waiting for background thread 0x%p to finish...", self -> thread ); rc = KThreadWait ( self -> thread, & status ); if ( rc != 0 ) ERROR ( rc, "failed to wait for background thread 0x%p", self -> thread ); else if ( status == 0 ) STATUS ( 2, "...background thread 0x%p succeed", self -> thread ); else { ERROR ( status, "background thread 0x%p failed", self -> thread ); rc = status; } { rc_t r2 = KThreadRelease ( self -> thread ); if ( r2 != 0 ) { ERROR ( r2, "failed to release background thread 0x%p", self -> thread ); if ( rc == 0 ) rc = r2; } } if ( rc != 0 && ctx != NULL ) { ctx_t * mctx = NULL; for ( mctx = ( ctx_t * ) ctx; mctx != NULL && mctx -> rc == 0; mctx = ( ctx_t* ) mctx -> caller ) { mctx -> rc = rc; } } } memset ( self, 0, sizeof * self ); }
tools/sra-sort/tbl-pair.h +4 −0 Original line number Diff line number Diff line Loading @@ -45,6 +45,7 @@ */ struct VTable; struct DbPair; struct KThread; struct ColumnReader; struct ColumnWriter; struct ColumnPair; Loading Loading @@ -109,6 +110,9 @@ struct TablePair /* true if already exploded */ bool exploded; /* Thread launched by TablePairPostCopy [ to do consistency-check ] */ struct KThread * thread; uint8_t align [ 2 ]; }; Loading
tools/sra-sort/xcheck-ref-align.c +9 −3 Original line number Diff line number Diff line Loading @@ -341,11 +341,12 @@ rc_t CC CrossCheckRefAlignTblRun ( const KThread *self, void *data ) ctx_t thread_ctx = { & pb -> caps, NULL, & ctx_info }; const ctx_t *ctx = & thread_ctx; STATUS ( 2, "running consistency-check on background thread" ); STATUS ( 2, "running consistency-check on background thread 0x%p", self ); CrossCheckRefAlignTblInt ( ctx, pb -> ref_tbl, pb -> align_tbl, pb -> align_name ); STATUS ( 2, "finished consistency-check on background thread" ); STATUS ( 2, "finished consistency-check on background thread 0x%p: %s", self, ctx -> rc ? "failure" : "success "); VTableRelease ( pb -> align_tbl ); VTableRelease ( pb -> ref_tbl ); Loading @@ -357,7 +358,8 @@ rc_t CC CrossCheckRefAlignTblRun ( const KThread *self, void *data ) #endif void CrossCheckRefAlignTbl ( const ctx_t *ctx, const VTable *ref_tbl, const VTable *align_tbl, const char *align_name ) const VTable *ref_tbl, const VTable *align_tbl, const char *align_name, KThread ** pt ) { FUNC_ENTRY ( ctx ); Loading @@ -368,6 +370,9 @@ void CrossCheckRefAlignTbl ( const ctx_t *ctx, STATUS ( 2, "consistency-check on join indices between REFERENCE and %s tables", align_name ); assert ( pt ); * pt = NULL; #if USE_BGTHREAD name_len = strlen ( align_name ); TRY ( pb = MemAlloc ( ctx, sizeof * pb + name_len, false ) ) Loading @@ -391,6 +396,7 @@ void CrossCheckRefAlignTbl ( const ctx_t *ctx, rc = KThreadMake ( & t, CrossCheckRefAlignTblRun, pb ); if ( rc == 0 ) { * pt = t; return; } Loading