[llvm-dev] Get timestamp and processor ID in the IR

zhi chen via llvm-dev llvm-dev at lists.llvm.org
Fri Nov 20 13:26:30 PST 2015


Hi Hal,

I just want to see which core the program is assigned to. I know we could
set the CPUaffinity, but I don't want to specify it. I want it to be
scheduled by the operating systems itself, then I will check which core it
is scheduled. Is it possible to get this information? Thanks.

On Fri, Nov 20, 2015 at 11:45 AM, Hal Finkel <hfinkel at anl.gov> wrote:

> ----- Original Message -----
> > From: "zhi chen" <zchenhn at gmail.com>
> > To: "Hal Finkel" <hfinkel at anl.gov>
> > Cc: llvm-dev at lists.llvm.org
> > Sent: Thursday, November 19, 2015 5:47:45 PM
> > Subject: Re: [llvm-dev] Get timestamp and processor ID in the IR
> >
> >
> > Say if we have 8 cores, I want to get which core is running the
> > current program. Thanks.
> >
>
> What do you intend to do with that information?
>
> One obvious complication is that the identity of the core running your
> application might change at any time (whenever the operating system
> performs a context switch). If you need to need to restrict to running only
> on one core, you'll likely need to adjust the process's core bindings
> (affinity mask) using some operating-system specific method.
>
>  -Hal
>
> >
> > On Thu, Nov 19, 2015 at 3:37 PM, Hal Finkel < hfinkel at anl.gov >
> > wrote:
> >
> >
> > ----- Original Message -----
> > > From: "zhi chen" < zchenhn at gmail.com >
> > > To: "Hal Finkel" < hfinkel at anl.gov >
> > > Cc: llvm-dev at lists.llvm.org
> > > Sent: Thursday, November 19, 2015 3:48:02 PM
> > > Subject: Re: [llvm-dev] Get timestamp and processor ID in the IR
> > >
> > >
> > > Hi Hal,
> > >
> > >
> > > Thanks for the pointer. Is it possible to get the processor ID on
> > > X86
> > > architecture? There is a library call in linux, sched_getcpu(), to
> > > the ID.
> > >
> >
> > What exactly do you mean by "processor ID"?
> >
> > -Hal
> >
> >
> >
> > >
> > > Also, is it possible to get the program counter in the IR?
> > >
> > >
> > > Best,
> > > Zhi
> > >
> > >
> > > On Thu, Nov 19, 2015 at 1:33 PM, Hal Finkel < hfinkel at anl.gov >
> > > wrote:
> > >
> > >
> > > Hi Zhi,
> > >
> > > There is no standard (architecture-independent) way to get the
> > > processor id. We do have an intrinsic to get the cycle counter:
> > >
> > > http://llvm.org/docs/LangRef.html#llvm-readcyclecounter-intrinsic
> > >
> > > -Hal
> > >
> > >
> > >
> > > ----- Original Message -----
> > > > From: "zhi chen via llvm-dev" < llvm-dev at lists.llvm.org >
> > > > To: llvm-dev at lists.llvm.org
> > > > Sent: Thursday, November 19, 2015 3:29:40 PM
> > > > Subject: [llvm-dev] Get timestamp and processor ID in the IR
> > > >
> > > >
> > > >
> > > > Hi,
> > > >
> > > >
> > > > I am wondering if it is possible to get the time-stamp and the
> > > > processor ID where an instruction is exectued in the IR? Thanks
> > > > for
> > > > your help in advance:)
> > > >
> > > >
> > > > Best,
> > > > Zhi
> > > > _______________________________________________
> > > > LLVM Developers mailing list
> > > > llvm-dev at lists.llvm.org
> > > > http://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-dev
> > > >
> > >
> > > --
> > > Hal Finkel
> > > Assistant Computational Scientist
> > > Leadership Computing Facility
> > > Argonne National Laboratory
> > >
> > >
> >
> > --
> > Hal Finkel
> > Assistant Computational Scientist
> > Leadership Computing Facility
> > Argonne National Laboratory
> >
> >
>
> --
> Hal Finkel
> Assistant Computational Scientist
> Leadership Computing Facility
> Argonne National Laboratory
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/llvm-dev/attachments/20151120/86d21b5d/attachment.html>


More information about the llvm-dev mailing list