hadoop-mapreduce-issues mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Allen Wittenauer (JIRA)" <j...@apache.org>
Subject [jira] [Updated] (MAPREDUCE-6391) util/Timer.cc completely misunderstands _POSIX_CPUTIME
Date Tue, 27 Oct 2015 19:08:27 GMT

     [ https://issues.apache.org/jira/browse/MAPREDUCE-6391?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
]

Allen Wittenauer updated MAPREDUCE-6391:
----------------------------------------
    Affects Version/s:     (was: 2.7.0)
                       3.0.0

> util/Timer.cc completely misunderstands _POSIX_CPUTIME
> ------------------------------------------------------
>
>                 Key: MAPREDUCE-6391
>                 URL: https://issues.apache.org/jira/browse/MAPREDUCE-6391
>             Project: Hadoop Map/Reduce
>          Issue Type: Sub-task
>          Components: build
>    Affects Versions: 3.0.0
>            Reporter: Alan Burlison
>            Assignee: Alan Burlison
>             Fix For: 3.0.0
>
>         Attachments: MAPREDUCE-6391.001.patch
>
>
> util/Timer.cc contains the following code:
> clock_gettime(_POSIX_CPUTIME, &ts);
> I'm not exactly sure what sort of time value this code is attempting to obtain (the process's
on-CPU time perhaps?) but it is completely wrong, even on Linux. _POSIX_CPUTIME is a feature
test macro and is *not* a valid parameter to clock_gettime. From the clock_gettime manpage:
> bq. The symbols _POSIX_MONOTONIC_CLOCK, _POSIX_CPUTIME, _POSIX_THREAD_CPUTIME indicate
that CLOCK_MONOTONIC, CLOCK_PROCESS_CPUTIME_ID, CLOCK_THREAD_CPUTIME_ID are available
> On  my Linux distro the value of _POSIX_CPUTIME is defined as 0. That corresponds to
> bq.  #define __CLOCK_REALTIME0       0       /* obsolete; same as CLOCK_REALTIME */
> And CLOCK_REALTIME is
> bq. #define CLOCK_REALTIME          3       /* wall clock */
> Which I suspect is not what is required here.
> Getting cross-platform CPU time is fiddly, the following blog post has a good summary:
http://nadeausoftware.com/articles/2012/03/c_c_tip_how_measure_cpu_time_benchmarking (code
examples are CC licensed so should be no taint issues)



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)

Mime
View raw message