diff options
author | Thomas White <taw@physics.org> | 2016-12-05 10:10:24 +0100 |
---|---|---|
committer | Thomas White <taw@physics.org> | 2017-02-02 11:45:16 +0100 |
commit | c7abdfb3e404a8a238e8352ea5e195f864efefd2 (patch) | |
tree | c0c1dd6e68062b1561cb2d97e3a6dd2475d002ae /libcrystfel/src | |
parent | 526e5ab3d6fd21b8fe3c435f3984866c7e145a84 (diff) |
indexamajig: Add ping mechanism to avoid timing out when trying lots of indexers
Diffstat (limited to 'libcrystfel/src')
-rw-r--r-- | libcrystfel/src/index.c | 13 | ||||
-rw-r--r-- | libcrystfel/src/index.h | 7 |
2 files changed, 15 insertions, 5 deletions
diff --git a/libcrystfel/src/index.c b/libcrystfel/src/index.c index c8c86414..a2fdb861 100644 --- a/libcrystfel/src/index.c +++ b/libcrystfel/src/index.c @@ -3,12 +3,12 @@ * * Perform indexing (somehow) * - * Copyright © 2012-2015 Deutsches Elektronen-Synchrotron DESY, + * Copyright © 2012-2017 Deutsches Elektronen-Synchrotron DESY, * a research centre of the Helmholtz Association. * Copyright © 2012 Lorenzo Galli * * Authors: - * 2010-2014 Thomas White <taw@physics.org> + * 2010-2017 Thomas White <taw@physics.org> * 2010-2011 Richard Kirian <rkirian@asu.edu> * 2012 Lorenzo Galli * 2013 Cornelius Gati <cornelius.gati@cfel.de> @@ -421,10 +421,16 @@ static int finished_retry(IndexingMethod indm, int r, struct image *image) } } - void index_pattern(struct image *image, IndexingMethod *indms, IndexingPrivate **iprivs) { + index_pattern_2(image, indms, iprivs, NULL); +} + + +void index_pattern_2(struct image *image, IndexingMethod *indms, + IndexingPrivate **iprivs, int *ping) +{ int n = 0; ImageFeatureList *orig; @@ -452,6 +458,7 @@ void index_pattern(struct image *image, ntry++; done = finished_retry(indms[n], r, image); if ( ntry > 5 ) done = 1; + if ( ping != NULL ) (*ping)++; } while ( !done ); diff --git a/libcrystfel/src/index.h b/libcrystfel/src/index.h index 2fb5a13d..e5f7764a 100644 --- a/libcrystfel/src/index.h +++ b/libcrystfel/src/index.h @@ -3,13 +3,13 @@ * * Perform indexing (somehow) * - * Copyright © 2012-2016 Deutsches Elektronen-Synchrotron DESY, + * Copyright © 2012-2017 Deutsches Elektronen-Synchrotron DESY, * a research centre of the Helmholtz Association. * Copyright © 2012 Richard Kirian * Copyright © 2012 Lorenzo Galli * * Authors: - * 2010-2016 Thomas White <taw@physics.org> + * 2010-2017 Thomas White <taw@physics.org> * 2010 Richard Kirian * 2012 Lorenzo Galli * 2015 Kenneth Beyerlein <kenneth.beyerlein@desy.de> @@ -154,6 +154,9 @@ extern IndexingPrivate **prepare_indexing(IndexingMethod *indm, UnitCell *cell, extern void index_pattern(struct image *image, IndexingMethod *indms, IndexingPrivate **iprivs); +extern void index_pattern_2(struct image *image, IndexingMethod *indms, + IndexingPrivate **iprivs, int *ping); + extern void cleanup_indexing(IndexingMethod *indms, IndexingPrivate **privs); #ifdef __cplusplus |