Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > comp.lang.c > #130460

Re: OpenMP and AVX2 Problem

From "F. Russell" <fr@random.info>
Newsgroups comp.lang.c
Subject Re: OpenMP and AVX2 Problem
Date 2018-05-12 19:10 +0000
Organization NewsGuy.com
Message-ID <pd7e7i078@news1.newsguy.com> (permalink)
References <pd703u02761@news2.newsguy.com> <BhEJC.101707$ta2.49032@fx03.am4>

Show all headers | View raw


On Sat, 12 May 2018 16:05:53 +0000, Melzzzzz wrote:

>
> Replace that with clock_gettime or gettimofday
>

I want actual CPU time.

With clock_gettime() there is an option:

"CLOCK_PROCESS_CPUTIME_ID (since Linux 2.6.12)
Per-process  CPU-time  clock  (measures CPU time consumed by all
threads in the process)."

clock_gettime(CLOCK_PROCESS_CPUTIME_ID, &timespec);

Using this I get:

Run Time Single-Thread: 10 msec
Run Time Multi-Thread: 45 msec


I can also use rusage(RUSAGE_SELF, rusestruct): 

"RUSAGE_SELF
Return resource usage statistics for the calling process,  which
is the sum of resources used by all threads in the process."

Using rusage(RUSAGE_SELF, rusestruct) I get:

Run Time Single-Thread: 10 msec
Run Time Multi-Thread: 43 msec

So measuring the actual CPU time used by all threads with
different methods gives the same results and this result
differs from what is expected.

What is the problem here?

Back to comp.lang.c | Previous | Next — Previous in thread | Next in thread | Find similar | Unroll thread


Thread

OpenMP and AVX2 Problem "F. Russell" <fr@random.info> - 2018-05-12 15:09 +0000
  Re: OpenMP and AVX2 Problem Tim Prince <tprince@intelretiree.com> - 2018-05-12 11:33 -0400
  Re: OpenMP and AVX2 Problem Melzzzzz <Melzzzzz@zzzzz.com> - 2018-05-12 16:05 +0000
    Re: OpenMP and AVX2 Problem "F. Russell" <fr@random.info> - 2018-05-12 17:46 +0000
    Re: OpenMP and AVX2 Problem "F. Russell" <fr@random.info> - 2018-05-12 19:10 +0000
  Re: OpenMP and AVX2 Problem [SOLVED] "F. Russell" <fr@random.info> - 2018-05-12 19:42 +0000
    Re: OpenMP and AVX2 Problem [SOLVED] Keith Thompson <kst-u@mib.org> - 2018-05-12 14:04 -0700
  Re: OpenMP and AVX2 Problem scott@slp53.sl.home (Scott Lurndal) - 2018-05-13 17:47 +0000
  Re: OpenMP and AVX2 Problem Wouter Verhelst <w@uter.be> - 2018-05-13 09:57 +0200

csiph-web