HPE GreenLake Administration
- Community Home
- >
- Servers and Operating Systems
- >
- Operating Systems
- >
- Operating System - HP-UX
- >
- Process Binding to 0th processor ,mpctl(0 behaviou...
Operating System - HP-UX
1830233
Members
1814
Online
109999
Solutions
Forums
Categories
Company
Local Language
back
Forums
Discussions
Forums
- Data Protection and Retention
- Entry Storage Systems
- Legacy
- Midrange and Enterprise Storage
- Storage Networking
- HPE Nimble Storage
Discussions
Forums
Discussions
Discussions
Discussions
Forums
Discussions
back
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
- BladeSystem Infrastructure and Application Solutions
- Appliance Servers
- Alpha Servers
- BackOffice Products
- Internet Products
- HPE 9000 and HPE e3000 Servers
- Networking
- Netservers
- Secure OS Software for Linux
- Server Management (Insight Manager 7)
- Windows Server 2003
- Operating System - Tru64 Unix
- ProLiant Deployment and Provisioning
- Linux-Based Community / Regional
- Microsoft System Center Integration
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Blogs
Information
Community
Resources
Community Language
Language
Forums
Blogs
Topic Options
- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Printer Friendly Page
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
05-10-2002 02:35 PM
05-10-2002 02:35 PM
Process Binding to 0th processor ,mpctl(0 behaviour.
It looks like behaviour of mpctl() call is
different on hp11.00 and hp11.11. There is
one patch PHKL_25475 on hp11.00 which is causing a problem in our code.
we have code where we check whether that processor is online or not.
res = mpctl (MPC_GETFIRSTSPU, (spu_t) 0,
(pid_t) 0);
Here mpctl() returns 0 as first available processor. now we assign 'res' to 'pross'.
for (pross=res;
pross<=nprocs ; pross++)
{
result = mpctl (MPC_GETNEXTSPU, (spu_t) (pross-1), (pid_t) 0);
printf("For processor %d, result is %d\n",pross, result);
}
This returns (-1) when pross=0 on hp11.11 and
hp11.00 with patch PHKL_25475.
Eariler without patch PHKL_25475
mpctl(MPC_GETNEXTSPU,pross-1,0) used to return 0 where pross=0;
Is it that 0th processor is not available for process binding on hp11.11 onwards?
Or is it that if 2nd parameter for mpctl(,-1,)
has negative value shud return -1 (as in hp11.11) and not 0(as in hp11.00 with out ptach PHKL_25475). ?
Finally my question remains ..,
Can i bind my process to 0th processor on
hp11.11 or its reserved by OS ?
Thanks in advance,
Aniket.
different on hp11.00 and hp11.11. There is
one patch PHKL_25475 on hp11.00 which is causing a problem in our code.
we have code where we check whether that processor is online or not.
res = mpctl (MPC_GETFIRSTSPU, (spu_t) 0,
(pid_t) 0);
Here mpctl() returns 0 as first available processor. now we assign 'res' to 'pross'.
for (pross=res;
pross<=nprocs ; pross++)
{
result = mpctl (MPC_GETNEXTSPU, (spu_t) (pross-1), (pid_t) 0);
printf("For processor %d, result is %d\n",pross, result);
}
This returns (-1) when pross=0 on hp11.11 and
hp11.00 with patch PHKL_25475.
Eariler without patch PHKL_25475
mpctl(MPC_GETNEXTSPU,pross-1,0) used to return 0 where pross=0;
Is it that 0th processor is not available for process binding on hp11.11 onwards?
Or is it that if 2nd parameter for mpctl(,-1,)
has negative value shud return -1 (as in hp11.11) and not 0(as in hp11.00 with out ptach PHKL_25475). ?
Finally my question remains ..,
Can i bind my process to 0th processor on
hp11.11 or its reserved by OS ?
Thanks in advance,
Aniket.
1 REPLY 1
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
05-11-2002 03:58 AM
05-11-2002 03:58 AM
Re: Process Binding to 0th processor ,mpctl(0 behaviour.
First of all, I don't think this will answer your question really but may help....
Looking at the patch, PHKL_25475, it does alter one object file the mpctl() call is in.....althought doesn't include the mpctl.o object itself.
# grep -il mpctl /usr/conf/lib/*
/usr/conf/lib/libdebug.a
/usr/conf/lib/libpm.a
/usr/conf/lib/libscall.a
# nm /usr/conf/lib/libscall.a |grep mpctl
mpctl | |undef |code |
Putting the full output to a file and you can see the object is init_sent.o, which is included in the patch. Your best bet is to find what patch it superseded and check the symptoms it fixes between the last software level.
In terms of difference between versions, all I can show is this....
HPUX 11.11
# ar -x /usr/conf/lib/libpm.a mpctl.o
# cksum mpctl.o
1283031925 18968 mpctl.o
HPUX 11.00
# ar -x /usr/conf/lib/libpm.a mpctl.o
# cksum mpctl.o
1333892570 51112 mpctl.o
I have had a look and cannot find anything that says you can't schedule processes on the monarch processor.
Lastly, some code to schedule processes....
/* This program takes two inputs...first parameter is the cpu number */
/* to run a system command on and the second is the actual command */
/* enclosed in quotes as follows: */
/* set_processor 2 'date' */
#include
#include
#include
#include
extern errno;
extern char*sys_errlist[];
extern int sys_nerr;
int main(argc, argv)
int argc;
char *argv[];
{
spu_t req_cpu, chosen_cpu;
pid_t pid;
if (argc < 3) {
printf("setprocessor spunum command");
exit(1);
}
req_cpu = atoi(argv[1]);
pid = getpid();
chosen_cpu = mpctl(MPC_SETPROCESS,req_cpu, pid);
if (chosen_cpu == -1) {
printf("error found in mpctl with MPC_setprocess \n");
printf("Error number is 37;d.\n",(errno));
if (errno > 0 && errno < sys_nerr)
printf("Error message is: 37;s.\n",sys_errlist[errno]);
exit(1);
}
printf ("chose_cpu = 37;8d pid = 37;8d\n", chosen_cpu, pid);
sleep(1); /* make sure that we get scheduled on this processor */
printf("CPU# is 37;d\n", mpctl(MPC_GETCURRENTSPU,chosen_cpu,pid));
system(argv[2]);
}
Looking at the patch, PHKL_25475, it does alter one object file the mpctl() call is in.....althought doesn't include the mpctl.o object itself.
# grep -il mpctl /usr/conf/lib/*
/usr/conf/lib/libdebug.a
/usr/conf/lib/libpm.a
/usr/conf/lib/libscall.a
# nm /usr/conf/lib/libscall.a |grep mpctl
mpctl | |undef |code |
Putting the full output to a file and you can see the object is init_sent.o, which is included in the patch. Your best bet is to find what patch it superseded and check the symptoms it fixes between the last software level.
In terms of difference between versions, all I can show is this....
HPUX 11.11
# ar -x /usr/conf/lib/libpm.a mpctl.o
# cksum mpctl.o
1283031925 18968 mpctl.o
HPUX 11.00
# ar -x /usr/conf/lib/libpm.a mpctl.o
# cksum mpctl.o
1333892570 51112 mpctl.o
I have had a look and cannot find anything that says you can't schedule processes on the monarch processor.
Lastly, some code to schedule processes....
/* This program takes two inputs...first parameter is the cpu number */
/* to run a system command on and the second is the actual command */
/* enclosed in quotes as follows: */
/* set_processor 2 'date' */
#include
#include
#include
#include
extern errno;
extern char*sys_errlist[];
extern int sys_nerr;
int main(argc, argv)
int argc;
char *argv[];
{
spu_t req_cpu, chosen_cpu;
pid_t pid;
if (argc < 3) {
printf("setprocessor spunum command");
exit(1);
}
req_cpu = atoi(argv[1]);
pid = getpid();
chosen_cpu = mpctl(MPC_SETPROCESS,req_cpu, pid);
if (chosen_cpu == -1) {
printf("error found in mpctl with MPC_setprocess \n");
printf("Error number is 37;d.\n",(errno));
if (errno > 0 && errno < sys_nerr)
printf("Error message is: 37;s.\n",sys_errlist[errno]);
exit(1);
}
printf ("chose_cpu = 37;8d pid = 37;8d\n", chosen_cpu, pid);
sleep(1); /* make sure that we get scheduled on this processor */
printf("CPU# is 37;d\n", mpctl(MPC_GETCURRENTSPU,chosen_cpu,pid));
system(argv[2]);
}
The opinions expressed above are the personal opinions of the authors, not of Hewlett Packard Enterprise. By using this site, you accept the Terms of Use and Rules of Participation.
Company
Events and news
Customer resources
© Copyright 2025 Hewlett Packard Enterprise Development LP