This is an automated email from the git hooks/post-receive script. lkajan pushed a commit to branch master in repository libfreecontact-perl.
commit 0dc703f15446ac0f0679c17db818e9ddfe5bd4d9 Author: Laszlo Kajan <[email protected]> Date: Fri Jun 7 21:49:53 2013 +0200 Imported Upstream version 0.05 --- Changes | 3 +++ FreeContact.xsp | 11 ++++++++--- META.yml | 2 +- Makefile.PL | 2 +- lib/FreeContact.pm | 14 +++++++++++--- t/02test.t | 9 +++++++-- 6 files changed, 31 insertions(+), 10 deletions(-) diff --git a/Changes b/Changes index bd59e74..3ab1006 100644 --- a/Changes +++ b/Changes @@ -1,5 +1,8 @@ Revision history for Perl extension FreeContact. +0.05 Fri Jun 7 21:24:38 CEST 2013 + - New libfreecontact - added timout argument. + 0.04 Fri Jun 7 14:12:18 CEST 2013 - Fixed density bug. diff --git a/FreeContact.xsp b/FreeContact.xsp index 791a6a6..76bf990 100644 --- a/FreeContact.xsp +++ b/FreeContact.xsp @@ -41,7 +41,7 @@ get_ps_psicov_sd() %{ cont_res_t -predictor::_run( __ali, __cp, __dens, __gapth, __mincontsep, __pseudocnt, __pscnt_weight, __estimate_ivcov, __shrink_lambda, __cov20, __gap_incovm, __vecw, __rho, __num_threads = 0, __timing = NULL ) +predictor::_run( __ali, __cp, __dens, __gapth, __mincontsep, __pseudocnt, __pscnt_weight, __estimate_ivcov, __shrink_lambda, __cov20, __gap_incovm, __vecw, __rho, __num_threads = 0, __icme_timeout = 1800, __timing = NULL ) ali_t& __ali double __cp double __dens @@ -56,13 +56,18 @@ predictor::_run( __ali, __cp, __dens, __gapth, __mincontsep, __pseudocnt, __pscn bool __vecw double __rho int __num_threads + time_t __icme_timeout time_res_t* __timing PREINIT: time_res_t timing; CODE: try { - if(items>=16 && SvROK(ST(15)) && SvTYPE(SvRV(ST(15))) == SVt_PVHV) __timing = &timing; - RETVAL = THIS->run( __ali, __cp, __dens, __gapth, __mincontsep, __pseudocnt, __pscnt_weight, __estimate_ivcov, __shrink_lambda, __cov20, __gap_incovm, __vecw, __rho, __num_threads, __timing ); + if(items>=17 && SvROK(ST(16)) && SvTYPE(SvRV(ST(16))) == SVt_PVHV) __timing = &timing; + RETVAL = THIS->run( __ali, __cp, __dens, __gapth, __mincontsep, __pseudocnt, __pscnt_weight, __estimate_ivcov, __shrink_lambda, __cov20, __gap_incovm, __vecw, __rho, __num_threads, __icme_timeout, __timing ); + } + catch (freecontact::icme_timeout_error& e) + { + croak("Caught FreeContact timeout exception: %s", e.what()); } catch (std::exception& e) { croak("Caught C++ exception of type or derived from 'std::exception': %s", e.what()); diff --git a/META.yml b/META.yml index b440cbe..48f94f2 100644 --- a/META.yml +++ b/META.yml @@ -1,6 +1,6 @@ --- #YAML:1.0 name: FreeContact -version: 0.04 +version: 0.05 abstract: fast protein contact predictor author: - Laszlo Kajan <[email protected]> diff --git a/Makefile.PL b/Makefile.PL index ecae2ac..d12c4ce 100644 --- a/Makefile.PL +++ b/Makefile.PL @@ -16,7 +16,7 @@ WriteMakefile( ($] >= 5.005 ? ## Add these new keywords supported since 5.005 (ABSTRACT_FROM => 'lib/FreeContact.pm', AUTHOR => 'Laszlo Kajan <[email protected]>') : ()), - LIBS => ['-lfreecontact '], + LIBS => ['-lfreecontact'], DEFINE => '', # e.g., '-DHAVE_SOMETHING' INC => '-I.', OBJECT => '$(O_FILES)', diff --git a/lib/FreeContact.pm b/lib/FreeContact.pm index 730e4c3..c5ec6c2 100644 --- a/lib/FreeContact.pm +++ b/lib/FreeContact.pm @@ -35,7 +35,7 @@ our @EXPORT = qw( ); -our $VERSION = '0.04'; +our $VERSION = '0.05'; require XSLoader; XSLoader::load('FreeContact', $VERSION); @@ -60,7 +60,7 @@ sub FreeContact::Predictor::run $args{clustpc}, $args{density}, $args{gapth}, $args{mincontsep}, $args{pseudocnt}, $args{pscnt_weight}, $args{estimate_ivcov}, $args{shrink_lambda}, $args{cov20}, $args{gap_incovm}, $args{veczw}, $args{rho}, - $args{num_threads} || 0, $args{timing} + $args{num_threads} || 0, $args{icme_timeout} || 1800, $args{timing} ); } @@ -143,7 +143,7 @@ Creates an "FreeContact::Predictor". =item run( ali => I<[]>, clustpc => dbl, density => dbl, gapth => dbl, mincontsep => uint, pseudocnt => dbl, pscnt_weight => dbl, estimate_ivcov => bool, shrink_lambda => dbl, cov20 => bool, gap_incovm => bool, veczw => bool, rho => dbl, - [num_threads => int], [timing => I<{}>] ) + [num_threads => int], [icme_timeout => int], [timing => I<{}>] ) Defaults for the arguments are obtained with get_ps_evfold(). @@ -156,6 +156,14 @@ row must hold the query, with no gaps. =item TODO +=item icme_timeout + +Inverse covariance matrix estimation timeout in seconds. Default: 1800. + +The estimation sometimes gets stuck. If the timeout is reached, the run() +method dies with "Caught FreeContact timeout exception: ...". You can catch +this exception and handle it as needed, e.g. by setting a higher B<rho> value. + =item num_threads Number of OpenMP threads to use. If unset, all CPUs are used. diff --git a/t/02test.t b/t/02test.t index 6c30f3a..13b3f17 100644 --- a/t/02test.t +++ b/t/02test.t @@ -2,7 +2,7 @@ use strict; use warnings; use Scalar::Util 'reftype'; -use Test::More tests => 7; +use Test::More tests => 8; BEGIN { use_ok('FreeContact') }; # /usr/share/doc/libextutils-xspp-perl/examples/Object-WithIntAndString/t/02test.t @@ -25,7 +25,6 @@ sub check_obj { my @aln = <EXAMPLE>; chomp(@aln); close(EXAMPLE); - my %test_parset = FreeContact::get_ps_evfold(); my $num_threads = 1; # test will not work with 0 my $timing = {}; @@ -36,6 +35,12 @@ sub check_obj { ok($timing->{num_threads} == $num_threads, "timing results test"); #use Data::Dumper; warn(Dumper($timing)); + + my %test_parset = FreeContact::get_ps_psicov(); + eval { + $res = FreeContact::Predictor->new(dbg => 1)->run(%test_parset, ali => \@aln, num_threads => $num_threads, icme_timeout => 2, timing => $timing); + }; + like($@, qr/^Caught FreeContact timeout exception:/); } # vim:et:ts=4:ai: -- Alioth's /git/debian-med/git-commit-notice on /srv/git.debian.org/git/debian-med/libfreecontact-perl.git _______________________________________________ debian-med-commit mailing list [email protected] http://lists.alioth.debian.org/cgi-bin/mailman/listinfo/debian-med-commit
