diff options
author | Thomas White <taw@physics.org> | 2011-03-22 15:43:00 +0100 |
---|---|---|
committer | Thomas White <taw@physics.org> | 2012-02-22 15:27:20 +0100 |
commit | 254d6459a53e12b39af6015e681925a70ff46393 (patch) | |
tree | 3c1bb1427d366a96a66ba15839c3e3b22a92c714 | |
parent | e397d27fbbfdc93449ed729fe48eda4f40f020e4 (diff) |
indexamajig: Reduce verbosity a lot
-rw-r--r-- | src/cell.c | 5 | ||||
-rw-r--r-- | src/hdf5-file.c | 2 | ||||
-rw-r--r-- | src/index.c | 4 | ||||
-rw-r--r-- | src/indexamajig.c | 41 | ||||
-rw-r--r-- | src/peaks.c | 3 |
5 files changed, 36 insertions, 19 deletions
@@ -795,11 +795,6 @@ UnitCell *match_cell(UnitCell *cell, UnitCell *template, int verbose, } } - if ( new_cell != NULL ) { - STATUS("Success! --------------- \n"); - cell_print(new_cell); - } - free(cand[0]); free(cand[1]); free(cand[2]); diff --git a/src/hdf5-file.c b/src/hdf5-file.c index f025acee..98e18cb0 100644 --- a/src/hdf5-file.c +++ b/src/hdf5-file.c @@ -161,7 +161,6 @@ int get_peaks(struct image *image, struct hdfile *f) image_add_feature(image->features, fs, ss, image, val, NULL); } - STATUS("Got %i peaks from peak list.\n", (int)size[0]); free(buf); H5Sclose(sh); @@ -323,7 +322,6 @@ static void debodge_saturation(struct hdfile *f, struct image *image) if ( dh < 0 ) { /* This isn't an error */ - STATUS("No saturation table found.\n"); return; } diff --git a/src/index.c b/src/index.c index 317c9200..0459540d 100644 --- a/src/index.c +++ b/src/index.c @@ -140,16 +140,13 @@ void index_pattern(struct image *image, UnitCell *cell, IndexingMethod *indm, case INDEXING_NONE : return; case INDEXING_DIRAX : - STATUS("Running DirAx...\n"); run_dirax(image); break; case INDEXING_MOSFLM : - STATUS("Running MOSFLM...\n"); run_mosflm(image, cell); break; } if ( image->ncells == 0 ) { - STATUS("No candidate cells found.\n"); n++; continue; } @@ -200,7 +197,6 @@ void index_pattern(struct image *image, UnitCell *cell, IndexingMethod *indm, /* Sanity check */ if ( !config_insane && !peak_sanity_check(image, new_cell, 0, 0.1) ) { - STATUS("Failed peak sanity check.\n"); cell_free(new_cell); continue; } diff --git a/src/indexamajig.c b/src/indexamajig.c index c0757edd..6094c552 100644 --- a/src/indexamajig.c +++ b/src/indexamajig.c @@ -23,7 +23,7 @@ #include <hdf5.h> #include <gsl/gsl_errno.h> #include <pthread.h> -#include <sys/time.h> +#include <time.h> #include "utils.h" #include "hdf5-file.h" @@ -38,6 +38,10 @@ #include "reflist-utils.h" + +#define STATS_EVERY_N_SECONDS (5) + + enum { PEAK_ZAEF, PEAK_HDF5, @@ -92,9 +96,13 @@ struct queue_args int config_basename; struct static_index_args static_args; - int n_indexable; - char *use_this_one_instead; + + int n_indexable; + int n_processed; + int n_indexable_last_stats; + int n_processed_last_stats; + int t_last_stats; }; @@ -210,8 +218,6 @@ static void process_image(void *pp, int cookie) image.filename = filename; image.det = copy_geom(pargs->static_args.det); - STATUS("Processing '%s'\n", image.filename); - pargs->indexable = 0; hdfile = hdfile_open(filename); @@ -384,8 +390,26 @@ static void finalise_image(void *qp, void *pp) { struct queue_args *qargs = qp; struct index_args *pargs = pp; + struct timespec tp; qargs->n_indexable += pargs->indexable; + qargs->n_processed++; + + clock_gettime(CLOCK_REALTIME, &tp); + if ( tp.tv_sec > qargs->t_last_stats+STATS_EVERY_N_SECONDS ) { + + STATUS("%i out of %i indexed so far," + " %i out of %i in the last %i seconds.\n", + qargs->n_indexable, qargs->n_processed, + qargs->n_indexable - qargs->n_indexable_last_stats, + qargs->n_processed - qargs->n_processed_last_stats, + STATS_EVERY_N_SECONDS); + + qargs->n_processed_last_stats = qargs->n_processed; + qargs->n_indexable_last_stats = qargs->n_indexable; + qargs->t_last_stats = tp.tv_sec; + + } free(pargs->filename); free(pargs); @@ -439,6 +463,7 @@ int main(int argc, char *argv[]) char *element = NULL; double nominal_photon_energy; int stream_flags = STREAM_INTEGRATED; + struct timespec tp; /* Long options */ const struct option longopts[] = { @@ -759,6 +784,12 @@ int main(int argc, char *argv[]) qargs.prefix = prefix; qargs.config_basename = config_basename; qargs.n_indexable = 0; + qargs.n_processed = 0; + qargs.n_indexable_last_stats = 0; + qargs.n_processed_last_stats = 0; + clock_gettime(CLOCK_REALTIME, &tp); + qargs.t_last_stats = tp.tv_sec; + n_images = run_threads(nthreads, process_image, get_image, finalise_image, &qargs, 0); diff --git a/src/peaks.c b/src/peaks.c index 591b9e46..21e60cce 100644 --- a/src/peaks.c +++ b/src/peaks.c @@ -492,7 +492,6 @@ RefList *find_projected_peaks(struct image *image, UnitCell *cell, optimise_reflist(reflections); - STATUS("Found %i reflections\n", n_reflections); return reflections; } @@ -559,8 +558,6 @@ int peak_sanity_check(struct image *image, UnitCell *cell, } - STATUS("Sanity factor: %f / %f = %f\n", (float)n_sane, (float)n_feat, - (float)n_sane / (float)n_feat); if ( (float)n_sane / (float)n_feat < 0.1 ) return 0; return 1; |