aboutsummaryrefslogtreecommitdiff
path: root/libcrystfel/src/index.c
diff options
context:
space:
mode:
authorThomas White <taw@physics.org>2016-12-05 10:10:24 +0100
committerThomas White <taw@physics.org>2017-02-02 11:45:16 +0100
commitc7abdfb3e404a8a238e8352ea5e195f864efefd2 (patch)
treec0c1dd6e68062b1561cb2d97e3a6dd2475d002ae /libcrystfel/src/index.c
parent526e5ab3d6fd21b8fe3c435f3984866c7e145a84 (diff)
indexamajig: Add ping mechanism to avoid timing out when trying lots of indexers
Diffstat (limited to 'libcrystfel/src/index.c')
-rw-r--r--libcrystfel/src/index.c13
1 files changed, 10 insertions, 3 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 );