Processor bind info

Processor bind info

Post by Ashish Ashtek » Thu, 21 Feb 2002 07:16:42



Hi,

I am writing an application which will be bound to a specific number
of processors - this I know how to do [using bindprocessor() on AIX &
mpctl() on HP11]. I also want to find out within this app how many
CPUs it is bound to. Does anyone know how this could be done on AIX
and HP11.

I wrote sample code for HP11:

#include <sys/types.h>
#include <sys/mpctl.h>
#include <stdio.h>
#include <errno.h>

int main ()
{
    mpc_request_t request = MPC_SPUNOCHANGE;
    int retValue = mpctl (request, MPC_SPUNOCHANGE, MPC_SELFPID);

    printf ("RetValue = %d\n", retValue);

    if (errno)
    {
        perror ("");
        return -1;
    }
    return 0;

Quote:}

The retvalue that gets printed is -6. Does anyone know how to
interpret this?

Also on AIX I have no clue how read the processor bind info within the
process.

Thanks for any help.

- Ashish

 
 
 

Processor bind info

Post by Jack Perd » Thu, 21 Feb 2002 07:46:35



>Hi,

>I am writing an application which will be bound to a specific number
>of processors - this I know how to do [using bindprocessor() on AIX &
>mpctl() on HP11]. I also want to find out within this app how many
>CPUs it is bound to. Does anyone know how this could be done on AIX
>and HP11.

>I wrote sample code for HP11:

>#include <sys/types.h>
>#include <sys/mpctl.h>
>#include <stdio.h>
>#include <errno.h>

>int main ()
>{
>    mpc_request_t request = MPC_SPUNOCHANGE;
>    int retValue = mpctl (request, MPC_SPUNOCHANGE, MPC_SELFPID);

Shouldn't request = MPC_SETPROCESS_FORCE or MPC_SETLWP_FORCE
or MPC_GETCURRENTSPU (depending upon what you are attempting)?

I suggest the man page for mpctl.

jack (just noticing the duplication of MPC_SPUNOCHANGE)

- Show quoted text -

Quote:

>    printf ("RetValue = %d\n", retValue);

>    if (errno)
>    {
>        perror ("");
>        return -1;
>    }
>    return 0;
>}

>The retvalue that gets printed is -6. Does anyone know how to
>interpret this?

>Also on AIX I have no clue how read the processor bind info within the
>process.

>Thanks for any help.

>- Ashish


 
 
 

Processor bind info

Post by Simon Marches » Thu, 21 Feb 2002 09:45:50



> Hi,

> I am writing an application which will be bound to a specific number
> of processors - this I know how to do [using bindprocessor() on AIX &

If you know this, then you'll know that bindprocessor() binds a thread (or
all the threads within a process) to a single processor. So your question
may need rephrasing.
Quote:

> mpctl() on HP11]. I also want to find out within this app how many
> CPUs it is bound to. Does anyone know how this could be done on AIX
> and HP11.

> I wrote sample code for HP11:

> #include <sys/types.h>
> #include <sys/mpctl.h>
> #include <stdio.h>
> #include <errno.h>

> int main ()
> {
>     mpc_request_t request = MPC_SPUNOCHANGE;
>     int retValue = mpctl (request, MPC_SPUNOCHANGE, MPC_SELFPID);

>     printf ("RetValue = %d\n", retValue);

>     if (errno)
>     {
>         perror ("");
>         return -1;
>     }
>     return 0;
> }

> The retvalue that gets printed is -6. Does anyone know how to
> interpret this?

> Also on AIX I have no clue how read the processor bind info within the
> process.

> Thanks for any help.

> - Ashish

 
 
 

1. How to get utilization info PER PROCESSOR on a multi-processors

Hi,

How can I get utilization info PER PEROCESSOR on  a multi-processor
machine?  vmstat gives the average for all the processors.

I know that proctool can help me, but I am looking for a command-line
utility.

Thanks,

Yossi

Sent via Deja.com http://www.deja.com/
Share what you know. Learn what you don't.

2. Oracle, v7.1, v6.36 and oraperl

3. list processors vs. info processors

4. Partition size.

5. Binding "Threads" to processors under Solaris 2.3

6. let Net Devices feed Entropy, updated (1/2)

7. what process bind to what processor ?

8. OpenLinux installation problem

9. Binding a process to a processor

10. Can I bind a thread on specified processor ?

11. binding a process to a processor

12. Binding thread to a processor

13. Binding a process to a specific processor.