regressions: Do not use ck_error for debug output.

ck_pring
Samy Al Bahra 13 years ago
parent f1be36b6d2
commit 5c93ee3add

@ -37,7 +37,7 @@ main(void)
const ck_backoff_t ceiling = CK_BACKOFF_CEILING + 1;
unsigned int i = 0;
ck_error("Ceiling is: %u (%#x)\n", CK_BACKOFF_CEILING, CK_BACKOFF_CEILING);
fprintf(stderr, "Ceiling is: %u (%#x)\n", CK_BACKOFF_CEILING, CK_BACKOFF_CEILING);
for (;;) {
ck_backoff_t previous = backoff;

@ -144,7 +144,7 @@ reader(void *arg)
break;
}
ck_error("Read %llu entries in %llu iterations.\n", n_entries, iterations);
fprintf(stderr, "Read %llu entries in %llu iterations.\n", n_entries, iterations);
ck_pr_inc_uint(&barrier);
while (ck_pr_load_uint(&barrier) != NUM_READER_THREADS + 1)
@ -199,7 +199,7 @@ writer_thread(void *unused)
ck_epoch_poll(&epoch_bag, &epoch_wr);
}
ck_error("Writer %u iterations, %u writes per iteration.\n", iteration, writer_max);
fprintf(stderr, "Writer %u iterations, %u writes per iteration.\n", iteration, writer_max);
while (ck_pr_load_uint(&barrier) != NUM_READER_THREADS)
ck_pr_stall();
@ -241,7 +241,7 @@ main(int argc, char **argv)
if (ck_bag_init(&bag, b, CK_BAG_ALLOCATE_GEOMETRIC) == false) {
ck_error("Error: failed ck_bag_init().");
}
ck_error("Configuration: %u entries, %zu bytes/block, %zu entries/block\n", writer_max, bag.info.bytes, bag.info.max);
fprintf(stderr, "Configuration: %u entries, %zu bytes/block, %zu entries/block\n", writer_max, bag.info.bytes, bag.info.max);
i = 1;
/* Basic Test */
@ -278,16 +278,16 @@ main(int argc, char **argv)
pthread_create(&readers[i], NULL, reader, NULL);
}
ck_error("Waiting...");
fprintf(stderr, "Waiting...");
sleep(30);
ck_error("done\n");
fprintf(stderr, "done\n");
ck_pr_store_int(&leave, 1);
for (i = 0; i < NUM_READER_THREADS; i++)
pthread_join(readers[i], NULL);
pthread_join(writer, NULL);
ck_error("Current entries: %u\n", ck_bag_count(&bag));
fprintf(stderr, "Current entries: %u\n", ck_bag_count(&bag));
ck_bag_destroy(&bag);
return 0;
}

@ -106,13 +106,13 @@ main(int argc, char *argv[])
a.delta = atoi(argv[2]);
ck_error("Creating threads (barrier)...");
fprintf(stderr, "Creating threads (barrier)...");
for (i = 0; i < nthr; ++i) {
if (pthread_create(&threads[i], NULL, thread, NULL)) {
ck_error("ERROR: Could not create thread %d\n", i);
}
}
ck_error("done\n");
fprintf(stderr, "done\n");
sleep(10);

@ -102,18 +102,18 @@ main(int argc, char *argv[])
a.delta = atoi(argv[2]);
ck_error("Creating threads (barrier)...");
fprintf(stderr, "Creating threads (barrier)...");
for (i = 0; i < nthr; i++) {
if (pthread_create(&threads[i], NULL, thread, NULL)) {
ck_error("ERROR: Could not create thread %d\n", i);
}
}
ck_error("done\n");
fprintf(stderr, "done\n");
ck_error("Waiting for threads to finish correctness regression...");
fprintf(stderr, "Waiting for threads to finish correctness regression...");
for (i = 0; i < nthr; i++)
pthread_join(threads[i], NULL);
ck_error("done (passed)\n");
fprintf(stderr, "done (passed)\n");
return (0);

@ -125,18 +125,18 @@ main(int argc, char *argv[])
for (i = 0; i < ngroups; i++)
ck_barrier_combining_group_init(&barrier, groupings + i, nthr);
ck_error("Creating threads (barrier)...");
fprintf(stderr, "Creating threads (barrier)...");
for (i = 0; i < (nthr * ngroups); i++) {
if (pthread_create(&threads[i], NULL, thread, groupings + (i % ngroups))) {
ck_error("ERROR: Could not create thread %d\n", i);
}
}
ck_error("done\n");
fprintf(stderr, "done\n");
ck_error("Waiting for threads to finish correctness regression...");
fprintf(stderr, "Waiting for threads to finish correctness regression...");
for (i = 0; i < (nthr * ngroups); i++)
pthread_join(threads[i], NULL);
ck_error("done (passed)\n");
fprintf(stderr, "done (passed)\n");
return (0);
}

@ -125,18 +125,18 @@ main(int argc, char *argv[])
}
ck_barrier_dissemination_init(barrier, barrier_internal, nthr);
ck_error("Creating threads (barrier)...");
fprintf(stderr, "Creating threads (barrier)...");
for (i = 0; i < nthr; i++) {
if (pthread_create(&threads[i], NULL, thread, barrier)) {
ck_error("ERROR: Could not create thread %d\n", i);
}
}
ck_error("done\n");
fprintf(stderr, "done\n");
ck_error("Waiting for threads to finish correctness regression...");
fprintf(stderr, "Waiting for threads to finish correctness regression...");
for (i = 0; i < nthr; i++)
pthread_join(threads[i], NULL);
ck_error("done (passed)\n");
fprintf(stderr, "done (passed)\n");
return (0);

@ -112,18 +112,18 @@ main(int argc, char *argv[])
a.delta = atoi(argv[2]);
ck_error("Creating threads (barrier)...");
fprintf(stderr, "Creating threads (barrier)...");
for (i = 0; i < nthr; i++) {
if (pthread_create(&threads[i], NULL, thread, barrier)) {
ck_error("ERROR: Could not create thread %d\n", i);
}
}
ck_error("done\n");
fprintf(stderr, "done\n");
ck_error("Waiting for threads to finish correctness regression...");
fprintf(stderr, "Waiting for threads to finish correctness regression...");
for (i = 0; i < nthr; i++)
pthread_join(threads[i], NULL);
ck_error("done (passed)\n");
fprintf(stderr, "done (passed)\n");
return (0);

@ -124,18 +124,18 @@ main(int argc, char *argv[])
ck_barrier_tournament_init(&barrier, rounds, nthr);
ck_error("Creating threads (barrier)...");
fprintf(stderr, "Creating threads (barrier)...");
for (i = 0; i < nthr; i++) {
if (pthread_create(&threads[i], NULL, thread, NULL)) {
ck_error("ERROR: Could not create thread %d\n", i);
}
}
ck_error("done\n");
fprintf(stderr, "done\n");
ck_error("Waiting for threads to finish correctness regression...");
fprintf(stderr, "Waiting for threads to finish correctness regression...");
for (i = 0; i < nthr; i++)
pthread_join(threads[i], NULL);
ck_error("done (passed)\n");
fprintf(stderr, "done (passed)\n");
return (0);
}

@ -127,7 +127,7 @@ main(int argc, char *argv[])
base = ck_bitmap_base(length);
bytes = ck_bitmap_size(length);
ck_error("Configuration: %u bytes\n",
fprintf(stderr, "Configuration: %u bytes\n",
bytes);
g_bits = malloc(bytes);
@ -142,7 +142,7 @@ main(int argc, char *argv[])
ck_bitmap_test(g_bits, length - 1);
CK_BITMAP_INSTANCE(STATIC_LENGTH) sb;
ck_error("Static configuration: %zu bytes\n",
fprintf(stderr, "Static configuration: %zu bytes\n",
sizeof(sb));
memset(CK_BITMAP_BUFFER(&sb), 0xFF, ck_bitmap_base(STATIC_LENGTH));
CK_BITMAP_INIT(&sb, STATIC_LENGTH, false);

@ -140,21 +140,21 @@ main(int argc, char *argv[])
affinity.delta = atoi(argv[1]);
affinity.request = 0;
ck_error("Creating threads (brlock)...");
fprintf(stderr, "Creating threads (brlock)...");
for (t = 0; t < threads; t++) {
if (pthread_create(&p[t], NULL, thread_brlock, latency + t) != 0) {
ck_error("ERROR: Could not create thread %d\n", t);
}
}
ck_error("done\n");
fprintf(stderr, "done\n");
sleep(10);
ck_pr_store_uint(&flag, 1);
ck_error("Waiting for threads to finish acquisition regression...");
fprintf(stderr, "Waiting for threads to finish acquisition regression...");
for (t = 0; t < threads; t++)
pthread_join(p[t], NULL);
ck_error("done\n\n");
fprintf(stderr, "done\n\n");
for (t = 1; t <= threads; t++)
printf("%10u %20" PRIu64 "\n", t, latency[t - 1]);

@ -137,18 +137,18 @@ main(int argc, char *argv[])
a.delta = atoi(argv[2]);
ck_error("Creating threads (mutual exclusion)...");
fprintf(stderr, "Creating threads (mutual exclusion)...");
for (i = 0; i < nthr; i++) {
if (pthread_create(&threads[i], NULL, thread, NULL)) {
ck_error("ERROR: Could not create thread %d\n", i);
}
}
ck_error("done\n");
fprintf(stderr, "done\n");
ck_error("Waiting for threads to finish correctness regression...");
fprintf(stderr, "Waiting for threads to finish correctness regression...");
for (i = 0; i < nthr; i++)
pthread_join(threads[i], NULL);
ck_error("done (passed)\n");
fprintf(stderr, "done (passed)\n");
return (0);
}

@ -144,19 +144,19 @@ main(int argc, char *argv[])
a.delta = atoi(argv[2]);
ck_error("Creating threads (mutual exclusion)...");
fprintf(stderr, "Creating threads (mutual exclusion)...");
for (i = 0; i < nthr; i++) {
context[i].tid = i + 1;
if (pthread_create(&threads[i], NULL, thread, context + i)) {
ck_error("ERROR: Could not create thread %d\n", i);
}
}
ck_error("done\n");
fprintf(stderr, "done\n");
ck_error("Waiting for threads to finish correctness regression...");
fprintf(stderr, "Waiting for threads to finish correctness regression...");
for (i = 0; i < nthr; i++)
pthread_join(threads[i], NULL);
ck_error("done (passed)\n");
fprintf(stderr, "done (passed)\n");
return (0);
}

@ -138,7 +138,7 @@ read_thread(void *unused CK_CC_UNUSED)
ck_pr_inc_uint(&e_barrier);
while (ck_pr_load_uint(&e_barrier) < n_threads);
ck_error("[R] Observed entries: %u\n", j);
fprintf(stderr, "[R] Observed entries: %u\n", j);
return (NULL);
}
@ -182,7 +182,7 @@ write_thread(void *unused CK_CC_UNUSED)
ck_pr_stall();
if (tid == 0) {
ck_error("\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b[W] %2.2f: %c",
fprintf(stderr, "\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b[W] %2.2f: %c",
(double)j / ITERATE_S, animate[i % strlen(animate)]);
}
@ -200,7 +200,7 @@ write_thread(void *unused CK_CC_UNUSED)
ck_epoch_synchronize(&stack_epoch, &record);
if (tid == 0) {
ck_error("\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b[W] Peak: %u (%2.2f%%)\n Reclamations: %lu\n\n",
fprintf(stderr, "\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b[W] Peak: %u (%2.2f%%)\n Reclamations: %lu\n\n",
record.n_peak,
(double)record.n_peak / ((double)PAIRS_S * ITERATE_S) * 100,
record.n_dispatch);

@ -138,7 +138,7 @@ read_thread(void *unused CK_CC_UNUSED)
ck_pr_inc_uint(&e_barrier);
while (ck_pr_load_uint(&e_barrier) < n_threads);
ck_error("[R] Observed entries: %u\n", j);
fprintf(stderr, "[R] Observed entries: %u\n", j);
return (NULL);
}
@ -182,7 +182,7 @@ write_thread(void *unused CK_CC_UNUSED)
ck_pr_stall();
if (tid == 0) {
ck_error("\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b[W] %2.2f: %c",
fprintf(stderr, "\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b[W] %2.2f: %c",
(double)j / ITERATE_S, animate[i % strlen(animate)]);
}
@ -198,7 +198,7 @@ write_thread(void *unused CK_CC_UNUSED)
ck_epoch_call(&stack_epoch, &record, &e->epoch_entry, destructor);
} else {
if (tid == 0 && i % 8192)
ck_error("\b%c", animate[i % strlen(animate)]);
fprintf(stderr, "\b%c", animate[i % strlen(animate)]);
destructor(&e->epoch_entry);
}
@ -208,7 +208,7 @@ write_thread(void *unused CK_CC_UNUSED)
ck_epoch_synchronize(&stack_epoch, &record);
if (tid == 0) {
ck_error("\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b[W] Peak: %u (%2.2f%%)\n Reclamations: %lu\n\n",
fprintf(stderr, "\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b[W] Peak: %u (%2.2f%%)\n Reclamations: %lu\n\n",
record.n_peak,
(double)record.n_peak / ((double)PAIRS_S * ITERATE_S) * 100,
record.n_dispatch);

@ -117,8 +117,8 @@ thread(void *unused CK_CC_UNUSED)
ck_pr_inc_uint(&e_barrier);
while (ck_pr_load_uint(&e_barrier) < n_threads);
ck_error("Deferrals: %lu (%2.2f)\n", smr, (double)smr / PAIRS);
ck_error("Peak: %u (%2.2f%%), %u pending\nReclamations: %lu\n\n",
fprintf(stderr, "Deferrals: %lu (%2.2f)\n", smr, (double)smr / PAIRS);
fprintf(stderr, "Peak: %u (%2.2f%%), %u pending\nReclamations: %lu\n\n",
record.n_peak,
(double)record.n_peak / PAIRS * 100,
record.n_pending,

@ -154,7 +154,7 @@ main(int argc, char *argv[])
int
main(void)
{
ck_error("Unsupported.\n");
fprintf(stderr, "Unsupported.\n");
return 0;
}
#endif

@ -68,7 +68,7 @@ test(void *c)
}
#ifdef DEBUG
ck_error("%p %u: %u -> %u\n", fifo+context->tid, context->tid, context->previous, context->tid);
fprintf(stderr, "%p %u: %u -> %u\n", fifo+context->tid, context->tid, context->previous, context->tid);
#endif
if (context->tid == 0) {

@ -107,7 +107,7 @@ thread(void *unused CK_CC_UNUSED)
ck_pr_inc_uint(&e_barrier);
while (ck_pr_load_uint(&e_barrier) < n_threads);
ck_error("Peak: %u (%2.2f%%)\nReclamations: %" PRIu64 "\n\n",
fprintf(stderr, "Peak: %u (%2.2f%%)\nReclamations: %" PRIu64 "\n\n",
record.n_peak,
(double)record.n_peak / PAIRS * 100,
record.n_reclamations);

@ -219,6 +219,6 @@ main(int argc, char *argv[])
for (i = 0; i < n_threads; i++)
pthread_join(threads[i], NULL);
ck_error("Push: %u\nPop: %u\n", pushs, pops);
fprintf(stderr, "Push: %u\nPop: %u\n", pushs, pops);
return (0);
}

@ -49,7 +49,7 @@ static void
destructor(void *pointer)
{
ck_error("Free %p\n", pointer);
fprintf(stderr, "Free %p\n", pointer);
free(pointer);
return;
}

@ -343,12 +343,12 @@ main(int argc, char *argv[])
for (i = 0; i < keys_length; i++)
d += set_insert(keys[i]) == false;
ck_error(" [S] %d readers, 1 writer.\n", n_threads);
ck_error(" [S] %zu entries stored and %u duplicates.\n\n",
fprintf(stderr, " [S] %d readers, 1 writer.\n", n_threads);
fprintf(stderr, " [S] %zu entries stored and %u duplicates.\n\n",
set_count(), d);
ck_error(" ,- BASIC TEST\n");
ck_error(" | Executing SMR test...");
fprintf(stderr, " ,- BASIC TEST\n");
fprintf(stderr, " | Executing SMR test...");
a = 0;
for (j = 0; j < r; j++) {
if (set_reset() == false) {
@ -361,9 +361,9 @@ main(int argc, char *argv[])
e = rdtsc();
a += e - s;
}
ck_error("done (%" PRIu64 " ticks)\n", a / (r * keys_length));
fprintf(stderr, "done (%" PRIu64 " ticks)\n", a / (r * keys_length));
ck_error(" | Executing replacement test...");
fprintf(stderr, " | Executing replacement test...");
a = 0;
for (j = 0; j < r; j++) {
s = rdtsc();
@ -372,9 +372,9 @@ main(int argc, char *argv[])
e = rdtsc();
a += e - s;
}
ck_error("done (%" PRIu64 " ticks)\n", a / (r * keys_length));
fprintf(stderr, "done (%" PRIu64 " ticks)\n", a / (r * keys_length));
ck_error(" | Executing get test...");
fprintf(stderr, " | Executing get test...");
a = 0;
for (j = 0; j < r; j++) {
s = rdtsc();
@ -386,10 +386,10 @@ main(int argc, char *argv[])
e = rdtsc();
a += e - s;
}
ck_error("done (%" PRIu64 " ticks)\n", a / (r * keys_length));
fprintf(stderr, "done (%" PRIu64 " ticks)\n", a / (r * keys_length));
a = 0;
ck_error(" | Executing removal test...");
fprintf(stderr, " | Executing removal test...");
for (j = 0; j < r; j++) {
s = rdtsc();
for (i = 0; i < keys_length; i++)
@ -400,9 +400,9 @@ main(int argc, char *argv[])
for (i = 0; i < keys_length; i++)
set_insert(keys[i]);
}
ck_error("done (%" PRIu64 " ticks)\n", a / (r * keys_length));
fprintf(stderr, "done (%" PRIu64 " ticks)\n", a / (r * keys_length));
ck_error(" | Executing negative look-up test...");
fprintf(stderr, " | Executing negative look-up test...");
a = 0;
for (j = 0; j < r; j++) {
s = rdtsc();
@ -412,18 +412,18 @@ main(int argc, char *argv[])
e = rdtsc();
a += e - s;
}
ck_error("done (%" PRIu64 " ticks)\n", a / (r * keys_length));
fprintf(stderr, "done (%" PRIu64 " ticks)\n", a / (r * keys_length));
ck_epoch_record_t epoch_temporary = epoch_wr;
ck_epoch_synchronize(&epoch_hs, &epoch_wr);
ck_error(" '- Summary: %u pending, %u peak, %lu reclamations -> "
fprintf(stderr, " '- Summary: %u pending, %u peak, %lu reclamations -> "
"%u pending, %u peak, %lu reclamations\n\n",
epoch_temporary.n_pending, epoch_temporary.n_peak, epoch_temporary.n_dispatch,
epoch_wr.n_pending, epoch_wr.n_peak, epoch_wr.n_dispatch);
ck_error(" ,- READER CONCURRENCY\n");
ck_error(" | Executing reader test...");
fprintf(stderr, " ,- READER CONCURRENCY\n");
fprintf(stderr, " | Executing reader test...");
ck_pr_store_int(&state, HS_STATE_GET);
while (ck_pr_load_int(&barrier[HS_STATE_STOP]) != n_threads)
@ -433,10 +433,10 @@ main(int argc, char *argv[])
ck_pr_store_int(&state, HS_STATE_STRICT_REPLACEMENT);
while (ck_pr_load_int(&barrier[HS_STATE_GET]) != n_threads)
ck_pr_stall();
ck_error("done (reader = %" PRIu64 " ticks)\n",
fprintf(stderr, "done (reader = %" PRIu64 " ticks)\n",
accumulator[HS_STATE_GET] / n_threads);
ck_error(" | Executing strict replacement test...");
fprintf(stderr, " | Executing strict replacement test...");
a = repeated = 0;
signal(SIGALRM, alarm_handler);
@ -462,13 +462,13 @@ main(int argc, char *argv[])
ck_pr_stall();
set_reset();
ck_epoch_synchronize(&epoch_hs, &epoch_wr);
ck_error("done (writer = %" PRIu64 " ticks, reader = %" PRIu64 " ticks)\n",
fprintf(stderr, "done (writer = %" PRIu64 " ticks, reader = %" PRIu64 " ticks)\n",
a / (repeated * keys_length), accumulator[HS_STATE_STRICT_REPLACEMENT] / n_threads);
signal(SIGALRM, alarm_handler);
alarm(r);
ck_error(" | Executing deletion test (%.2f)...", p_d * 100);
fprintf(stderr, " | Executing deletion test (%.2f)...", p_d * 100);
a = repeated = 0;
ck_pr_inc_int(&barrier[HS_STATE_STRICT_REPLACEMENT]);
for (;;) {
@ -498,13 +498,13 @@ main(int argc, char *argv[])
set_reset();
ck_epoch_synchronize(&epoch_hs, &epoch_wr);
ck_error("done (writer = %" PRIu64 " ticks, reader = %" PRIu64 " ticks)\n",
fprintf(stderr, "done (writer = %" PRIu64 " ticks, reader = %" PRIu64 " ticks)\n",
a / (repeated * keys_length), accumulator[HS_STATE_DELETION] / n_threads);
signal(SIGALRM, alarm_handler);
alarm(r);
ck_error(" | Executing replacement test (%.2f)...", p_r * 100);
fprintf(stderr, " | Executing replacement test (%.2f)...", p_r * 100);
a = repeated = 0;
ck_pr_inc_int(&barrier[HS_STATE_DELETION]);
for (;;) {
@ -538,14 +538,14 @@ main(int argc, char *argv[])
ck_pr_stall();
set_reset();
ck_epoch_synchronize(&epoch_hs, &epoch_wr);
ck_error("done (writer = %" PRIu64 " ticks, reader = %" PRIu64 " ticks)\n",
fprintf(stderr, "done (writer = %" PRIu64 " ticks, reader = %" PRIu64 " ticks)\n",
a / (repeated * keys_length), accumulator[HS_STATE_REPLACEMENT] / n_threads);
ck_pr_inc_int(&barrier[HS_STATE_REPLACEMENT]);
epoch_temporary = epoch_wr;
ck_epoch_synchronize(&epoch_hs, &epoch_wr);
ck_error(" '- Summary: %u pending, %u peak, %lu reclamations -> "
fprintf(stderr, " '- Summary: %u pending, %u peak, %lu reclamations -> "
"%u pending, %u peak, %lu reclamations\n\n",
epoch_temporary.n_pending, epoch_temporary.n_peak, epoch_temporary.n_dispatch,
epoch_wr.n_pending, epoch_wr.n_peak, epoch_wr.n_dispatch);

@ -223,10 +223,10 @@ main(int argc, char *argv[])
d += set_insert(keys[i]) == false;
ck_hs_stat(&hs, &st);
ck_error("# %zu entries stored, %u duplicates, %u probe.\n",
fprintf(stderr, "# %zu entries stored, %u duplicates, %u probe.\n",
set_count(), d, st.probe_maximum);
ck_error("# reverse_insertion serial_insertion random_insertion serial_replace reverse_get serial_get random_get serial_remove negative_get\n\n");
fprintf(stderr, "# reverse_insertion serial_insertion random_insertion serial_replace reverse_get serial_get random_get serial_remove negative_get\n\n");
a = 0;
for (j = 0; j < r; j++) {

@ -338,12 +338,12 @@ main(int argc, char *argv[])
for (i = 0; i < keys_length; i++)
d += table_insert(keys[i]) == false;
ck_error(" [S] %d readers, 1 writer.\n", n_threads);
ck_error(" [S] %zu entries stored and %u duplicates.\n\n",
fprintf(stderr, " [S] %d readers, 1 writer.\n", n_threads);
fprintf(stderr, " [S] %zu entries stored and %u duplicates.\n\n",
table_count(), d);
ck_error(" ,- BASIC TEST\n");
ck_error(" | Executing SMR test...");
fprintf(stderr, " ,- BASIC TEST\n");
fprintf(stderr, " | Executing SMR test...");
a = 0;
for (j = 0; j < r; j++) {
if (table_reset() == false) {
@ -356,9 +356,9 @@ main(int argc, char *argv[])
e = rdtsc();
a += e - s;
}
ck_error("done (%" PRIu64 " ticks)\n", a / (r * keys_length));
fprintf(stderr, "done (%" PRIu64 " ticks)\n", a / (r * keys_length));
ck_error(" | Executing replacement test...");
fprintf(stderr, " | Executing replacement test...");
a = 0;
for (j = 0; j < r; j++) {
s = rdtsc();
@ -367,9 +367,9 @@ main(int argc, char *argv[])
e = rdtsc();
a += e - s;
}
ck_error("done (%" PRIu64 " ticks)\n", a / (r * keys_length));
fprintf(stderr, "done (%" PRIu64 " ticks)\n", a / (r * keys_length));
ck_error(" | Executing get test...");
fprintf(stderr, " | Executing get test...");
a = 0;
for (j = 0; j < r; j++) {
s = rdtsc();
@ -381,10 +381,10 @@ main(int argc, char *argv[])
e = rdtsc();
a += e - s;
}
ck_error("done (%" PRIu64 " ticks)\n", a / (r * keys_length));
fprintf(stderr, "done (%" PRIu64 " ticks)\n", a / (r * keys_length));
a = 0;
ck_error(" | Executing removal test...");
fprintf(stderr, " | Executing removal test...");
for (j = 0; j < r; j++) {
s = rdtsc();
for (i = 0; i < keys_length; i++)
@ -395,9 +395,9 @@ main(int argc, char *argv[])
for (i = 0; i < keys_length; i++)
table_insert(keys[i]);
}
ck_error("done (%" PRIu64 " ticks)\n", a / (r * keys_length));
fprintf(stderr, "done (%" PRIu64 " ticks)\n", a / (r * keys_length));
ck_error(" | Executing negative look-up test...");
fprintf(stderr, " | Executing negative look-up test...");
a = 0;
for (j = 0; j < r; j++) {
s = rdtsc();
@ -407,18 +407,18 @@ main(int argc, char *argv[])
e = rdtsc();
a += e - s;
}
ck_error("done (%" PRIu64 " ticks)\n", a / (r * keys_length));
fprintf(stderr, "done (%" PRIu64 " ticks)\n", a / (r * keys_length));
ck_epoch_record_t epoch_temporary = epoch_wr;
ck_epoch_synchronize(&epoch_ht, &epoch_wr);
ck_error(" '- Summary: %u pending, %u peak, %lu reclamations -> "
fprintf(stderr, " '- Summary: %u pending, %u peak, %lu reclamations -> "
"%u pending, %u peak, %lu reclamations\n\n",
epoch_temporary.n_pending, epoch_temporary.n_peak, epoch_temporary.n_dispatch,
epoch_wr.n_pending, epoch_wr.n_peak, epoch_wr.n_dispatch);
ck_error(" ,- READER CONCURRENCY\n");
ck_error(" | Executing reader test...");
fprintf(stderr, " ,- READER CONCURRENCY\n");
fprintf(stderr, " | Executing reader test...");
ck_pr_store_int(&state, HT_STATE_GET);
while (ck_pr_load_int(&barrier[HT_STATE_STOP]) != n_threads)
@ -428,10 +428,10 @@ main(int argc, char *argv[])
ck_pr_store_int(&state, HT_STATE_STRICT_REPLACEMENT);
while (ck_pr_load_int(&barrier[HT_STATE_GET]) != n_threads)
ck_pr_stall();
ck_error("done (reader = %" PRIu64 " ticks)\n",
fprintf(stderr, "done (reader = %" PRIu64 " ticks)\n",
accumulator[HT_STATE_GET] / n_threads);
ck_error(" | Executing strict replacement test...");
fprintf(stderr, " | Executing strict replacement test...");
a = repeated = 0;
signal(SIGALRM, alarm_handler);
@ -457,13 +457,13 @@ main(int argc, char *argv[])
ck_pr_stall();
table_reset();
ck_epoch_synchronize(&epoch_ht, &epoch_wr);
ck_error("done (writer = %" PRIu64 " ticks, reader = %" PRIu64 " ticks)\n",
fprintf(stderr, "done (writer = %" PRIu64 " ticks, reader = %" PRIu64 " ticks)\n",
a / (repeated * keys_length), accumulator[HT_STATE_STRICT_REPLACEMENT] / n_threads);
signal(SIGALRM, alarm_handler);
alarm(r);
ck_error(" | Executing deletion test (%.2f)...", p_d * 100);
fprintf(stderr, " | Executing deletion test (%.2f)...", p_d * 100);
a = repeated = 0;
ck_pr_inc_int(&barrier[HT_STATE_STRICT_REPLACEMENT]);
for (;;) {
@ -493,13 +493,13 @@ main(int argc, char *argv[])
table_reset();
ck_epoch_synchronize(&epoch_ht, &epoch_wr);
ck_error("done (writer = %" PRIu64 " ticks, reader = %" PRIu64 " ticks)\n",
fprintf(stderr, "done (writer = %" PRIu64 " ticks, reader = %" PRIu64 " ticks)\n",
a / (repeated * keys_length), accumulator[HT_STATE_DELETION] / n_threads);
signal(SIGALRM, alarm_handler);
alarm(r);
ck_error(" | Executing replacement test (%.2f)...", p_r * 100);
fprintf(stderr, " | Executing replacement test (%.2f)...", p_r * 100);
a = repeated = 0;
ck_pr_inc_int(&barrier[HT_STATE_DELETION]);
for (;;) {
@ -533,14 +533,14 @@ main(int argc, char *argv[])
ck_pr_stall();
table_reset();
ck_epoch_synchronize(&epoch_ht, &epoch_wr);
ck_error("done (writer = %" PRIu64 " ticks, reader = %" PRIu64 " ticks)\n",
fprintf(stderr, "done (writer = %" PRIu64 " ticks, reader = %" PRIu64 " ticks)\n",
a / (repeated * keys_length), accumulator[HT_STATE_REPLACEMENT] / n_threads);
ck_pr_inc_int(&barrier[HT_STATE_REPLACEMENT]);
epoch_temporary = epoch_wr;
ck_epoch_synchronize(&epoch_ht, &epoch_wr);
ck_error(" '- Summary: %u pending, %u peak, %lu reclamations -> "
fprintf(stderr, " '- Summary: %u pending, %u peak, %lu reclamations -> "
"%u pending, %u peak, %lu reclamations\n\n",
epoch_temporary.n_pending, epoch_temporary.n_peak, epoch_temporary.n_dispatch,
epoch_wr.n_pending, epoch_wr.n_peak, epoch_wr.n_dispatch);

@ -274,7 +274,7 @@ main(int argc, char *argv[])
n_threads = CORES - 1;
if (argc < 2) {
ck_error("Usage: parallel <#entries> [<interval length> <initial size> <readers>\n"
fprintf(stderr, "Usage: parallel <#entries> [<interval length> <initial size> <readers>\n"
" <probability of replacement> <probability of deletion> <epoch threshold>]\n");
}
@ -330,11 +330,11 @@ main(int argc, char *argv[])
for (i = 0; i < keys_length; i++)
d += table_insert(keys[i]) == false;
ck_error(" [S] %zu entries stored and %u duplicates.\n\n",
fprintf(stderr, " [S] %zu entries stored and %u duplicates.\n\n",
table_count(), d);
ck_error(" ,- BASIC TEST\n");
ck_error(" | Executing SMR test...");
fprintf(stderr, " ,- BASIC TEST\n");
fprintf(stderr, " | Executing SMR test...");
a = 0;
for (j = 0; j < r; j++) {
if (table_reset() == false) {
@ -347,9 +347,9 @@ main(int argc, char *argv[])
e = rdtsc();
a += e - s;
}
ck_error("done (%" PRIu64 " ticks)\n", a / (r * keys_length));
fprintf(stderr, "done (%" PRIu64 " ticks)\n", a / (r * keys_length));
ck_error(" | Executing replacement test...");
fprintf(stderr, " | Executing replacement test...");
a = 0;
for (j = 0; j < r; j++) {
s = rdtsc();
@ -358,9 +358,9 @@ main(int argc, char *argv[])
e = rdtsc();
a += e - s;
}
ck_error("done (%" PRIu64 " ticks)\n", a / (r * keys_length));
fprintf(stderr, "done (%" PRIu64 " ticks)\n", a / (r * keys_length));
ck_error(" | Executing get test...");
fprintf(stderr, " | Executing get test...");
a = 0;
for (j = 0; j < r; j++) {
s = rdtsc();
@ -372,10 +372,10 @@ main(int argc, char *argv[])
e = rdtsc();
a += e - s;
}
ck_error("done (%" PRIu64 " ticks)\n", a / (r * keys_length));
fprintf(stderr, "done (%" PRIu64 " ticks)\n", a / (r * keys_length));
a = 0;
ck_error(" | Executing removal test...");
fprintf(stderr, " | Executing removal test...");
for (j = 0; j < r; j++) {
s = rdtsc();
for (i = 0; i < keys_length; i++)
@ -386,9 +386,9 @@ main(int argc, char *argv[])
for (i = 0; i < keys_length; i++)
table_insert(keys[i]);
}
ck_error("done (%" PRIu64 " ticks)\n", a / (r * keys_length));
fprintf(stderr, "done (%" PRIu64 " ticks)\n", a / (r * keys_length));
ck_error(" | Executing negative look-up test...");
fprintf(stderr, " | Executing negative look-up test...");
a = 0;
for (j = 0; j < r; j++) {
s = rdtsc();
@ -398,18 +398,18 @@ main(int argc, char *argv[])
e = rdtsc();
a += e - s;
}
ck_error("done (%" PRIu64 " ticks)\n", a / (r * keys_length));
fprintf(stderr, "done (%" PRIu64 " ticks)\n", a / (r * keys_length));
ck_epoch_record_t epoch_temporary = epoch_wr;
ck_epoch_synchronize(&epoch_ht, &epoch_wr);
ck_error(" '- Summary: %u pending, %u peak, %lu reclamations -> "
fprintf(stderr, " '- Summary: %u pending, %u peak, %lu reclamations -> "
"%u pending, %u peak, %lu reclamations\n\n",
epoch_temporary.n_pending, epoch_temporary.n_peak, epoch_temporary.n_dispatch,
epoch_wr.n_pending, epoch_wr.n_peak, epoch_wr.n_dispatch);
ck_error(" ,- READER CONCURRENCY\n");
ck_error(" | Executing reader test...");
fprintf(stderr, " ,- READER CONCURRENCY\n");
fprintf(stderr, " | Executing reader test...");
ck_pr_store_int(&state, HT_STATE_GET);
while (ck_pr_load_int(&barrier[HT_STATE_STOP]) != n_threads)
@ -419,10 +419,10 @@ main(int argc, char *argv[])
ck_pr_store_int(&state, HT_STATE_STRICT_REPLACEMENT);
while (ck_pr_load_int(&barrier[HT_STATE_GET]) != n_threads)
ck_pr_stall();
ck_error("done (reader = %" PRIu64 " ticks)\n",
fprintf(stderr, "done (reader = %" PRIu64 " ticks)\n",
accumulator[HT_STATE_GET] / n_threads);
ck_error(" | Executing strict replacement test...");
fprintf(stderr, " | Executing strict replacement test...");
a = repeated = 0;
signal(SIGALRM, alarm_handler);
@ -448,13 +448,13 @@ main(int argc, char *argv[])
ck_pr_stall();
table_reset();
ck_epoch_synchronize(&epoch_ht, &epoch_wr);
ck_error("done (writer = %" PRIu64 " ticks, reader = %" PRIu64 " ticks)\n",
fprintf(stderr, "done (writer = %" PRIu64 " ticks, reader = %" PRIu64 " ticks)\n",
a / (repeated * keys_length), accumulator[HT_STATE_STRICT_REPLACEMENT] / n_threads);
signal(SIGALRM, alarm_handler);
alarm(r);
ck_error(" | Executing deletion test (%.2f)...", p_d * 100);
fprintf(stderr, " | Executing deletion test (%.2f)...", p_d * 100);
a = repeated = 0;
ck_pr_inc_int(&barrier[HT_STATE_STRICT_REPLACEMENT]);
for (;;) {
@ -484,13 +484,13 @@ main(int argc, char *argv[])
table_reset();
ck_epoch_synchronize(&epoch_ht, &epoch_wr);
ck_error("done (writer = %" PRIu64 " ticks, reader = %" PRIu64 " ticks)\n",
fprintf(stderr, "done (writer = %" PRIu64 " ticks, reader = %" PRIu64 " ticks)\n",
a / (repeated * keys_length), accumulator[HT_STATE_DELETION] / n_threads);
signal(SIGALRM, alarm_handler);
alarm(r);
ck_error(" | Executing replacement test (%.2f)...", p_r * 100);
fprintf(stderr, " | Executing replacement test (%.2f)...", p_r * 100);
a = repeated = 0;
ck_pr_inc_int(&barrier[HT_STATE_DELETION]);
for (;;) {
@ -524,14 +524,14 @@ main(int argc, char *argv[])
ck_pr_stall();
table_reset();
ck_epoch_synchronize(&epoch_ht, &epoch_wr);
ck_error("done (writer = %" PRIu64 " ticks, reader = %" PRIu64 " ticks)\n",
fprintf(stderr, "done (writer = %" PRIu64 " ticks, reader = %" PRIu64 " ticks)\n",
a / (repeated * keys_length), accumulator[HT_STATE_REPLACEMENT] / n_threads);
ck_pr_inc_int(&barrier[HT_STATE_REPLACEMENT]);
epoch_temporary = epoch_wr;
ck_epoch_synchronize(&epoch_ht, &epoch_wr);
ck_error(" '- Summary: %u pending, %u peak, %lu reclamations -> "
fprintf(stderr, " '- Summary: %u pending, %u peak, %lu reclamations -> "
"%u pending, %u peak, %lu reclamations\n\n",
epoch_temporary.n_pending, epoch_temporary.n_peak, epoch_temporary.n_dispatch,
epoch_wr.n_pending, epoch_wr.n_peak, epoch_wr.n_dispatch);

@ -220,10 +220,10 @@ main(int argc, char *argv[])
d += table_insert(keys[i]) == false;
ck_ht_stat(&ht, &st);
ck_error("# %zu entries stored, %u duplicates, %" PRIu64 " probe.\n",
fprintf(stderr, "# %zu entries stored, %u duplicates, %" PRIu64 " probe.\n",
table_count(), d, st.probe_maximum);
ck_error("# reverse_insertion serial_insertion random_insertion serial_replace reverse_get serial_get random_get serial_remove negative_get\n\n");
fprintf(stderr, "# reverse_insertion serial_insertion random_insertion serial_replace reverse_get serial_get random_get serial_remove negative_get\n\n");
a = 0;
for (j = 0; j < r; j++) {

@ -92,7 +92,7 @@ main(int argc, char *argv[])
}
memset(count, 0, sizeof(uint64_t) * nthr);
ck_error("Creating threads (fairness)...");
fprintf(stderr, "Creating threads (fairness)...");
for (i = 0; i < nthr; i++) {
context[i].tid = i;
if (pthread_create(&threads[i], NULL, fairness, context + i)) {
@ -100,16 +100,16 @@ main(int argc, char *argv[])
exit(EXIT_FAILURE);
}
}
ck_error("done\n");
fprintf(stderr, "done\n");
ck_pr_store_uint(&ready, 1);
sleep(10);
ck_pr_store_uint(&ready, 0);
ck_error("Waiting for threads to finish acquisition regression...");
fprintf(stderr, "Waiting for threads to finish acquisition regression...");
for (i = 0; i < nthr; i++)
pthread_join(threads[i], NULL);
ck_error("done\n\n");
fprintf(stderr, "done\n\n");
for (i = 0, v = 0; i < nthr; i++) {
printf("%d %15" PRIu64 "\n", i, count[i]);

@ -100,7 +100,7 @@ test_foreach(void)
break;
}
ck_error("(%d, %d) ", j, k);
fprintf(stderr, "(%d, %d) ", j, k);
return;
}
@ -138,7 +138,7 @@ main(int argc, char *argv[])
ck_error("ERROR: Number of entries must be >= 4.\n");
}
ck_error("Beginning serial test...");
fprintf(stderr, "Beginning serial test...");
CK_LIST_INIT(&head);
for (i = 1; i <= goal; i++) {
@ -160,9 +160,9 @@ main(int argc, char *argv[])
ck_error("List is not empty after bulk removal.\n");
}
ck_error("done (success)\n");
fprintf(stderr, "done (success)\n");
ck_error("Beginning parallel traversal...");
fprintf(stderr, "Beginning parallel traversal...");
n = malloc(sizeof *n);
assert(n != NULL);
@ -208,7 +208,7 @@ main(int argc, char *argv[])
for (i = 0; i < n_threads; i++)
pthread_join(thread[i], NULL);
ck_error("done (success)\n");
fprintf(stderr, "done (success)\n");
return (0);
}

@ -100,7 +100,7 @@ test_foreach(void)
break;
}
ck_error("(%d, %d) ", j, k);
fprintf(stderr, "(%d, %d) ", j, k);
return;
}
@ -138,7 +138,7 @@ main(int argc, char *argv[])
ck_error("ERROR: Number of entries must be >= 4.\n");
}
ck_error("Beginning serial test...");
fprintf(stderr, "Beginning serial test...");
CK_SLIST_INIT(&head);
for (i = 1; i <= goal; i++) {
@ -160,9 +160,9 @@ main(int argc, char *argv[])
ck_error("List is not empty after bulk removal.\n");
}
ck_error("done (success)\n");
fprintf(stderr, "done (success)\n");
ck_error("Beginning parallel traversal...");
fprintf(stderr, "Beginning parallel traversal...");
n = malloc(sizeof *n);
assert(n != NULL);
@ -211,7 +211,7 @@ main(int argc, char *argv[])
for (i = 0; i < n_threads; i++)
pthread_join(thread[i], NULL);
ck_error("done (success)\n");
fprintf(stderr, "done (success)\n");
return (0);
}

@ -105,7 +105,7 @@ test_spmc(void *c)
}
}
ck_error("[%d] Observed %u\n", tid, observed);
fprintf(stderr, "[%d] Observed %u\n", tid, observed);
return NULL;
}
@ -206,7 +206,7 @@ main(int argc, char *argv[])
thread = malloc(sizeof(pthread_t) * nthr);
assert(thread);
ck_error("SPSC test:");
fprintf(stderr, "SPSC test:");
for (i = 0; i < nthr; i++) {
context[i].tid = i;
if (i == 0) {
@ -230,9 +230,9 @@ main(int argc, char *argv[])
for (i = 0; i < nthr; i++)
pthread_join(thread[i], NULL);
ck_error(" done\n");
fprintf(stderr, " done\n");
ck_error("SPMC test:\n");
fprintf(stderr, "SPMC test:\n");
buffer = malloc(sizeof(struct entry) * (size + 1));
assert(buffer);
memset(buffer, 0, sizeof(struct entry) * (size + 1));

@ -138,21 +138,21 @@ main(int argc, char *argv[])
affinity.delta = atoi(argv[1]);
affinity.request = 0;
ck_error("Creating threads (rwlock)...");
fprintf(stderr, "Creating threads (rwlock)...");
for (t = 0; t < threads; t++) {
if (pthread_create(&p[t], NULL, thread_rwlock, latency + t) != 0) {
ck_error("ERROR: Could not create thread %d\n", t);
}
}
ck_error("done\n");
fprintf(stderr, "done\n");
sleep(10);
ck_pr_store_uint(&flag, 1);
ck_error("Waiting for threads to finish acquisition regression...");
fprintf(stderr, "Waiting for threads to finish acquisition regression...");
for (t = 0; t < threads; t++)
pthread_join(p[t], NULL);
ck_error("done\n\n");
fprintf(stderr, "done\n\n");
for (t = 1; t <= threads; t++)
printf("%10u %20" PRIu64 "\n", t, latency[t - 1]);

@ -207,31 +207,31 @@ main(int argc, char *argv[])
a.delta = atoi(argv[2]);
ck_error("Creating threads (mutual exclusion)...");
fprintf(stderr, "Creating threads (mutual exclusion)...");
for (i = 0; i < nthr; i++) {
if (pthread_create(&threads[i], NULL, thread, NULL)) {
ck_error("ERROR: Could not create thread %d\n", i);
}
}
ck_error("done\n");
fprintf(stderr, "done\n");
ck_error("Waiting for threads to finish correctness regression...");
fprintf(stderr, "Waiting for threads to finish correctness regression...");
for (i = 0; i < nthr; i++)
pthread_join(threads[i], NULL);
ck_error("done (passed)\n");
fprintf(stderr, "done (passed)\n");
ck_error("Creating threads (mutual exclusion, recursive)...");
fprintf(stderr, "Creating threads (mutual exclusion, recursive)...");
for (i = 0; i < nthr; i++) {
if (pthread_create(&threads[i], NULL, thread_recursive, NULL)) {
ck_error("ERROR: Could not create thread %d\n", i);
}
}
ck_error("done\n");
fprintf(stderr, "done\n");
ck_error("Waiting for threads to finish correctness regression...");
fprintf(stderr, "Waiting for threads to finish correctness regression...");
for (i = 0; i < nthr; i++)
pthread_join(threads[i], NULL);
ck_error("done (passed)\n");
fprintf(stderr, "done (passed)\n");
return (0);
}

@ -87,7 +87,7 @@ consumer(void *unused CK_CC_UNUSED)
}
}
ck_error("%u retries.\n", retries - STEPS);
fprintf(stderr, "%u retries.\n", retries - STEPS);
ck_pr_dec_uint(&barrier);
return (NULL);
}

@ -178,7 +178,7 @@ main(int argc, char *argv[])
}
memset(count, 0, sizeof(*count) * nthr);
ck_error("Creating threads (fairness)...");
fprintf(stderr, "Creating threads (fairness)...");
for (i = 0; i < nthr; i++) {
context[i].tid = i;
if (pthread_create(&threads[i], NULL, fairness, context + i)) {
@ -186,16 +186,16 @@ main(int argc, char *argv[])
exit(EXIT_FAILURE);
}
}
ck_error("done\n");
fprintf(stderr, "done\n");
ck_pr_store_uint(&ready, 1);
sleep(10);
ck_pr_store_uint(&ready, 0);
ck_error("Waiting for threads to finish acquisition regression...");
fprintf(stderr, "Waiting for threads to finish acquisition regression...");
for (i = 0; i < nthr; i++)
pthread_join(threads[i], NULL);
ck_error("done\n\n");
fprintf(stderr, "done\n\n");
for (i = 0, v = 0; i < nthr; i++) {
printf("%d %15" PRIu64 "\n", i, count[i].value);

@ -135,19 +135,19 @@ main(int argc, char *argv[])
a.delta = atoi(argv[2]);
a.request = 0;
ck_error("Creating threads (mutual exclusion)...");
fprintf(stderr, "Creating threads (mutual exclusion)...");
for (i = 0; i < nthr; i++) {
if (pthread_create(&threads[i], NULL, thread, NULL)) {
ck_error("ERROR: Could not create thread %" PRIu64 "\n", i);
exit(EXIT_FAILURE);
}
}
ck_error("done\n");
fprintf(stderr, "done\n");
ck_error("Waiting for threads to finish correctness regression...");
fprintf(stderr, "Waiting for threads to finish correctness regression...");
for (i = 0; i < nthr; i++)
pthread_join(threads[i], NULL);
ck_error("done (passed)\n");
fprintf(stderr, "done (passed)\n");
return (0);
}

Loading…
Cancel
Save