This is the mail archive of the cygwin mailing list for the Cygwin project.

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: Some Problems about gcc 4.8.2 on cygwin

On 3/14/2014 8:42 AM, rexdf Rexdf wrote: 2.It's about OpenMP
<elided stuff which doesn't quote legibly>
Is there a cygwin related question here? Questions on OpenMP and clock() might be tolerated on gcc-help.
Advice on how to make meaningful benchmarks is definitely off topic.

With cygwin g++ 4.9 at -O or -O3 on win8.1 I get
time: 0
as evidently the compiler can shortcut your test loop (is that what you wished?).

For the -O0 -fopenmp build,
time: 2484    (1 thread)
time: 2547    (2 threads)
time: 2828    (3 t)
time: 3187    (4 t)
Much as would be expected, as you are asking for the total time spent among all threads (usual interpretation of clock()). The bash time command shows real time decreasing with number of threads (close to total clock time divided by number of threads). OpenMP provides the function omp_get_wtime() for performance measurement (possibly a wrapper for gettimeofday()). The cygwin library evidently doesn't treat clock() as equivalent to omp_get_wtime(). Speculation on how you could find a non-cygwin library which treats them as equivalent is probably off topic here. Anyway, I think your problem is not with the cygwin gcc, unless you are looking for the more aggressive optimization of version 4.9.

Tim Prince

Problem reports:
Unsubscribe info:

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]