Results 1 to 9 of 9

Thread: How can i know which core is running

  1. #1
    Join Date
    Sep 2010
    Posts
    59

    How can i know which core is running

    I am running a 4x4 machine. I want to know what core are running in each thread. I even want to know if the 4 core are running on same thread run on same die. Do you have any idea how to do this? I an doing research. Your suggestion would be appreciated.Thank you in advance.

  2. #2
    Join Date
    May 2008
    Posts
    835

    Re: How can i know which core is running

    I should tell you if you do not set affinity, the threads will not be put long enough for a meaningful diagnosis. Even if you have a way it wont stay long. The interesting thing is that the performance depends how you allocate the threads. You can do this by windows task manager or by linux tools taskset or by threading library function call.OPenMP implementation can be provided through typically environment.

  3. #3
    Join Date
    Oct 2005
    Posts
    924

    Re: How can i know which core is running

    Even i know i have to set affinity. But what i want to know is that whether the software is able to allocate the core on same die to the thread.Thats why i want to know the brief idea of core and also tell me whether they are on the same die. And task manager for evaluation the performance is not fine sometime it give wrong message. Evaluating the performance is not enough for me at least in this situation.

  4. #4
    Join Date
    Oct 2005
    Posts
    1,217

    Re: How can i know which core is running

    Just thinking this might help to you. If you attach a callback routine you can solve half of your problem. In the process you can use OS API to get affinity info. OR you can execute CPUID instruction to ask for current thread context. See that your call back should not alter the affinity setting.Based on APIC ID and its evaluation across OS scheduler quanta you can compare that to a system map of cpu topology. After you have done with you injection study, produce the system topology map after or before it.

  5. #5
    Join Date
    Nov 2005
    Posts
    1,187

    Re: How can i know which core is running

    It depends on which OS you are using:
    The following will run for Vista:
    decSpecial(naked) unsigned get_current_procedure()
    {

    {
    mov ecx, 03Bh
    lsl eax, ecx
    shr eax, 0Eh
    return
    }
    }

    For windows xp you can try this:
    unsigned idTable;
    unsigned idTable_size;

    declspecial(thread) unsigned threadCache_idt;
    declspecial(thread) unsigned threadCache_proc;

    unsigned get_current_processor()
    {
    #pragma pack(push, 1)
    struct IDT_table
    {
    unsigned short size;
    unsigned base;
    };
    #pragma pack(pop)

    IDT_table idt;
    sidt(&idt);
    if (idt.base != threadCache_idt)
    {
    for (unsigned i = 0; i != idtTable_size; ++i)
    {
    if (idtTable[i] == idt.base)
    {
    threadCache_idt = idt.base;
    threadCache_proc = i;
    break;
    }
    }
    }
    return threadCache_proc;
    }

    Or:

    struct current_proc_table
    {
    unsigned no;
    unsigned time_stamp;
    unsigned period;
    };

    declspecial(thread) current_proc_t current_proc = {0, 0, 1};

    declspecial(noinline) void update_current_proc()
    {
    current_proc_t& cp = current_proc;
    cp.time_stamp = *(unsigned*)0x7FFE0000;
    cp.period = 10;
    unsigned proc;
    __asm
    {
    mov eax, 1;
    cpuid;
    shr ebx, 24;
    mov proc, ebx;
    }
    cp.no = proc;
    }

    unsigned get_current_proc(
    )
    {
    current_procr_t& cp = current_proc;
    if (0 == --cp.period || cp.time_stamp != *(unsigned*)0x7FFE0000)
    update_current_proc();
    return cp.no;
    }

  6. #6
    Join Date
    Oct 2005
    Posts
    924

    Re: How can i know which core is running

    Five great thing you need to know about core. This are the five frequently asked question.
    1)Hyper-threading makes two cores seem like four.
    2)Core i5 overclocks itself with Turbo Boost.
    3)Graphics and memory controllers are built into chip
    4)Core i5 blows away core 2 Duo.
    5)Core i5 offers a good compromise between low-budget core i3 and high-end core i7.

  7. #7
    Join Date
    Sep 2010
    Posts
    1

    Re: How can i know which core is running

    Undoubtedly, technology problems hold you and your company back. That's not good for business and as such it's a great idea to get the problems fixed quickly. For several small companies, small business computer support isn't confined to one person within the company; rather, it is tech support that is called in.

    ============
    Last edited by Maqbool; 25-09-2010 at 12:02 AM. Reason: External Links Not Allowed, Removed The Same.

  8. #8
    Join Date
    Nov 2005
    Posts
    1,187

    Re: How can i know which core is running

    On windows Vista you can use GetCurrentProcessorNumber(). And on Linux you can use vgetcpu(). On AMD processor you can use RDTSCP (Read Time-Stamp Counter and Processor ID) instruction. RDTSCP is available on Nehalem architecture, too. Description is available in section 16.11.2 of the Intel 64 bit.

  9. #9
    Join Date
    May 2008
    Posts
    816

    Re: How can i know which core is running

    I am having E1505 which is usually very quietly. And it seem that it is running only on one core. I am havinh AMD atalon X2 dual processor. How I can know that my dual processor is working fine as it was suppose to work. Is there any method or software or program I can use to check that my dual core processor is running properly.

Similar Threads

  1. intel core i7 running at 96 Mhz, extremely slow
    By Martineau in forum Overclocking & Computer Modification
    Replies: 7
    Last Post: 03-05-2012, 12:27 AM
  2. Intel Core 2 Quad is running very slow
    By HatRix in forum Motherboard Processor & RAM
    Replies: 4
    Last Post: 15-12-2010, 05:25 PM
  3. AMD Athlon Dual-Core QL-62 Slow running game
    By KADRI in forum Motherboard Processor & RAM
    Replies: 6
    Last Post: 07-06-2010, 01:29 PM
  4. Running Fedora Core 10 using Windows 7 Virtual PC
    By MABON in forum Operating Systems
    Replies: 3
    Last Post: 01-04-2010, 10:57 PM
  5. Intel core i7 running too hot
    By screwball in forum Overclocking & Computer Modification
    Replies: 3
    Last Post: 28-08-2009, 08:22 PM

Tags for this Thread

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Page generated in 1,714,177,602.14577 seconds with 17 queries