Skip to content
Snippets Groups Projects
Commit ea3fbee7 authored by Peter W. Draper's avatar Peter W. Draper
Browse files

Honour -f flag

parent 50707721
No related branches found
No related tags found
1 merge request!6Version with faked data
...@@ -288,15 +288,15 @@ static void *recv_thread(void *arg) { ...@@ -288,15 +288,15 @@ static void *recv_thread(void *arg) {
/** /**
* @brief Comparison function for logged times. * @brief Comparison function for logged times.
*/ */
// static int cmp_logs(const void *p1, const void *p2) { static int cmp_logs(const void *p1, const void *p2) {
// struct mpiuse_log_entry *l1 = *(struct mpiuse_log_entry **)p1; struct mpiuse_log_entry *l1 = *(struct mpiuse_log_entry **)p1;
// struct mpiuse_log_entry *l2 = *(struct mpiuse_log_entry **)p2; struct mpiuse_log_entry *l2 = *(struct mpiuse_log_entry **)p2;
//
// /* Large unsigned values, so take care. */ /* Large unsigned values, so take care. */
// if (l1->tic > l2->tic) return 1; if (l1->tic > l2->tic) return 1;
// if (l1->tic < l2->tic) return -1; if (l1->tic < l2->tic) return -1;
// return 0; return 0;
//} }
/** /**
* @brief Pick out the relevant logging data for our rank, i.e. all * @brief Pick out the relevant logging data for our rank, i.e. all
...@@ -304,7 +304,7 @@ static void *recv_thread(void *arg) { ...@@ -304,7 +304,7 @@ static void *recv_thread(void *arg) {
* The final list is sorted into increasing time of activation if required, * The final list is sorted into increasing time of activation if required,
* otherwise the order is randomized. * otherwise the order is randomized.
* *
* @param random randomize injection order, otherwise use order of thr * @param random randomize injection order, otherwise use order of the
* original logs. * original logs.
*/ */
static void pick_logs(int random) { static void pick_logs(int random) {
...@@ -330,11 +330,13 @@ static void pick_logs(int random) { ...@@ -330,11 +330,13 @@ static void pick_logs(int random) {
} }
} }
/* Sort into increasing time. */ if (!random) {
// qsort(reqs_queue, nr_reqs, sizeof(struct mpiuse_log_entry *), cmp_logs); /* Sort into increasing time. */
qsort(reqs_queue, nr_reqs, sizeof(struct mpiuse_log_entry *), cmp_logs);
/* Randomize the order, so ranks do not all work in sequence. */ } else {
mpiuse_shuffle_logs(reqs_queue, nr_reqs); /* Randomize the order, so ranks do not all work in sequence. */
mpiuse_shuffle_logs(reqs_queue, nr_reqs);
}
/* Check. */ /* Check. */
if (!random) { if (!random) {
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment