"Fossies" - the Fresh Open Source Software Archive  

Source code changes of the file "stress-stream.c" between
stress-ng-0.12.09.tar.xz and stress-ng-0.12.10.tar.xz

About: stress-ng will stress test a computer system in various selectable ways. It was designed to exercise various physical subsystems of a computer as well as the various operating system kernel interfaces.

stress-stream.c  (stress-ng-0.12.09.tar.xz):stress-stream.c  (stress-ng-0.12.10.tar.xz)
skipping to change at line 328 skipping to change at line 328
for (i = 0; i < n; i++) for (i = 0; i < n; i++)
a[idx1[i]] = b[idx2[i]] + (c[idx3[i]] * q); a[idx1[i]] = b[idx2[i]] + (c[idx3[i]] * q);
} }
static void stress_stream_init_data( static void stress_stream_init_data(
double *RESTRICT data, double *RESTRICT data,
const uint64_t n) const uint64_t n)
{ {
uint64_t i; uint64_t i;
const double divisor = 1.0 / (double)(4294967296ULL);
for (i = 0; i < n; i++) { for (i = 0; i < n; i++) {
const uint32_t r32 = stress_mwc32(); const uint32_t r1 = stress_mwc32();
const uint64_t r64 = stress_mwc64();
data[i] = (double)r32 / (1.0 + (double)r64); data[i] = (double)r1 * divisor;
} }
} }
static inline void *stress_stream_mmap(const stress_args_t *args, uint64_t sz) static inline void *stress_stream_mmap(const stress_args_t *args, uint64_t sz)
{ {
void *ptr; void *ptr;
ptr = mmap(NULL, (size_t)sz, PROT_READ | PROT_WRITE, ptr = mmap(NULL, (size_t)sz, PROT_READ | PROT_WRITE,
#if defined(MAP_POPULATE) #if defined(MAP_POPULATE)
MAP_POPULATE | MAP_POPULATE |
skipping to change at line 573 skipping to change at line 573
mb = ((double)(get_counter(args) * 10) * (double)sz) / (double)MB; mb = ((double)(get_counter(args) * 10) * (double)sz) / (double)MB;
fp = ((double)(get_counter(args) * 4) * (double)sz) / (double)MB; fp = ((double)(get_counter(args) * 4) * (double)sz) / (double)MB;
dt = t2 - t1; dt = t2 - t1;
if (dt >= 4.5) { if (dt >= 4.5) {
mb_rate = mb / (dt); mb_rate = mb / (dt);
fp_rate = fp / (dt); fp_rate = fp / (dt);
pr_inf("%s: memory rate: %.2f MB/sec, %.2f Mflop/sec" pr_inf("%s: memory rate: %.2f MB/sec, %.2f Mflop/sec"
" (instance %" PRIu32 ")\n", " (instance %" PRIu32 ")\n",
args->name, mb_rate, fp_rate, args->instance); args->name, mb_rate, fp_rate, args->instance);
stress_misc_stats_set(args->misc_stats, 0, "memory rate (MB per s
ec)", mb_rate);
stress_misc_stats_set(args->misc_stats, 1, "memory rate (Mflop pe
r sec)", fp_rate);
} else { } else {
if (args->instance == 0) if (args->instance == 0)
pr_inf("%s: run duration too short to determine memory ra te\n", args->name); pr_inf("%s: run duration too short to determine memory ra te\n", args->name);
} }
rc = EXIT_SUCCESS; rc = EXIT_SUCCESS;
stress_set_proc_state(args->name, STRESS_STATE_DEINIT); stress_set_proc_state(args->name, STRESS_STATE_DEINIT);
if (idx3) if (idx3)
 End of changes. 4 change blocks. 
3 lines changed or deleted 7 lines changed or added

Home  |  About  |  Features  |  All  |  Newest  |  Dox  |  Diffs  |  RSS Feeds  |  Screenshots  |  Comments  |  Imprint  |  Privacy  |  HTTP(S)