Return-Path: X-Original-To: apmail-hadoop-mapreduce-issues-archive@minotaur.apache.org Delivered-To: apmail-hadoop-mapreduce-issues-archive@minotaur.apache.org Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by minotaur.apache.org (Postfix) with SMTP id 36111176F6 for ; Tue, 27 Oct 2015 19:08:51 +0000 (UTC) Received: (qmail 66092 invoked by uid 500); 27 Oct 2015 19:08:28 -0000 Delivered-To: apmail-hadoop-mapreduce-issues-archive@hadoop.apache.org Received: (qmail 66018 invoked by uid 500); 27 Oct 2015 19:08:28 -0000 Mailing-List: contact mapreduce-issues-help@hadoop.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: mapreduce-issues@hadoop.apache.org Delivered-To: mailing list mapreduce-issues@hadoop.apache.org Received: (qmail 65819 invoked by uid 99); 27 Oct 2015 19:08:27 -0000 Received: from arcas.apache.org (HELO arcas) (140.211.11.28) by apache.org (qpsmtpd/0.29) with ESMTP; Tue, 27 Oct 2015 19:08:27 +0000 Received: from arcas.apache.org (localhost [127.0.0.1]) by arcas (Postfix) with ESMTP id D5B282C1F5D for ; Tue, 27 Oct 2015 19:08:27 +0000 (UTC) Date: Tue, 27 Oct 2015 19:08:27 +0000 (UTC) From: "Allen Wittenauer (JIRA)" To: mapreduce-issues@hadoop.apache.org Message-ID: In-Reply-To: References: Subject: [jira] [Updated] (MAPREDUCE-6391) util/Timer.cc completely misunderstands _POSIX_CPUTIME MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit X-JIRA-FingerPrint: 30527f35849b9dde25b450d4833f0394 [ 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)