aboutsummaryrefslogtreecommitdiff
path: root/src/merge.c
diff options
context:
space:
mode:
authorThomas White <taw@physics.org>2015-11-19 13:08:02 +0100
committerThomas White <taw@physics.org>2015-11-19 14:33:08 +0100
commit08b93f124d2fc60cfa1dfff82b1700a2f2fbf91f (patch)
tree04519b9805cc1893f09809c5dacf1638e40c2cea /src/merge.c
parent40dd7ff04a44688544e22cc3a0384bef808abc64 (diff)
Count reflections in merge and scaling
Diffstat (limited to 'src/merge.c')
-rw-r--r--src/merge.c13
1 files changed, 13 insertions, 0 deletions
diff --git a/src/merge.c b/src/merge.c
index 488b25df..8d1fae0f 100644
--- a/src/merge.c
+++ b/src/merge.c
@@ -62,6 +62,7 @@ struct merge_queue_args
PartialityModel pmodel;
double push_res;
int use_weak;
+ long long int n_reflections;
};
@@ -70,6 +71,7 @@ struct merge_worker_args
struct merge_queue_args *qargs;
Crystal *crystal;
int crystal_number;
+ int n_reflections;
};
@@ -140,6 +142,8 @@ static void run_merge_job(void *vwargs, int cookie)
RefListIterator *iter;
double G, B;
+ wargs->n_reflections = 0;
+
/* If this crystal's scaling was dodgy, it doesn't contribute to the
* merged intensities */
if ( crystal_get_user_flag(cr) != 0 ) return;
@@ -207,12 +211,18 @@ static void run_merge_job(void *vwargs, int cookie)
set_temp1(f, temp);
set_redundancy(f, get_redundancy(f)+1);
unlock_reflection(f);
+
+ wargs->n_reflections++;
+
}
}
static void finalise_merge_job(void *vqargs, void *vwargs)
{
+ struct merge_queue_args *qargs = vqargs;
+ struct merge_worker_args *wargs = vwargs;
+ qargs->n_reflections += wargs->n_reflections;
free(vwargs);
}
@@ -240,6 +250,7 @@ RefList *merge_intensities(Crystal **crystals, int n, int n_threads,
qargs.pmodel = pmodel;
qargs.push_res = push_res;
qargs.use_weak = use_weak;
+ qargs.n_reflections = 0;
pthread_rwlock_init(&qargs.full_lock, NULL);
run_threads(n_threads, run_merge_job, create_merge_job,
@@ -273,6 +284,8 @@ RefList *merge_intensities(Crystal **crystals, int n, int n_threads,
}
}
+ STATUS("%lli reflections went into the merge.\n", qargs.n_reflections);
+
reflist_free(full);
return full2;
}