Operating System - OpenVMS
cancel
Showing results for 
Search instead for 
Did you mean: 

Internal PID to Extended PID conversion "problem"

 
Mark Corcoran
Frequent Advisor

Internal PID to Extended PID conversion "problem"

I'm trying to assist a colleague who is for whatever reason obtaining details of an offending process, by finding a logical defined in its job table.

Obviously, knowing the job table name doesn't of itself tell you what the offending process is.

I advised him to use SDA to FORMAT /TYP=JIB the xxxxxxxx part of the LNM$JOB_xxxxxxxx table name.

From this, you can get the JIB$L_MPID value (Master Internal PID).

For the subsequent processing he needs to do, he needs to have the Extended PID (EPID), not the MPID.

I'm having difficulty in converting the MPID to the EPID...

The Internals & Data Structures manual says this about the EPID:

Bit 31 is always 0, to avoid negative PIDs (reading between the lines, in some places where PIDs can be passed, a negative value has a special meaning).

Bits 21-30 contain the Node Sequence Number and Node Index, which are derived from SCH$GW_LOCALNODE.

Bits 0-20 are split between the Process Index and the Process Sequence Number, with the number of bits allocated to each, being dependent on the value of the MAXPROCESSCNT SYSGEN parameter (which determines SCH$GL_PIXWIDTH, which is then used in deciding the field width).

On one cluster, if I look at my own process in SDA, I see that MPID=005407F2, and EPID=228547F2.

SCH$GL_PIXWIDTH is %X0C
SCH$GW_LOCALNODE is %X114

So, we have:

3 2 1 0
10987654321098765432109876543210
XBBBBBBBBBBAAAAAAAAAAAAAAAAAAAAA
100010100001010100011111110010 EPID(228547F2)
000000010101000000011111110010 MPID(5407F2)

Bit shifting the SCH$GW_LOCALNODE value so that it can be overlayed into BBBBBBBBBB:

100010100 SCH$GW(114)

If I perform a logical AND on the MPID and the bit-shifted SCH$GW_LOCALNODE value, I get:

100010100101000000011111110010 Calculated EPID(114407F2)

However, the actual EPID has bits 14 and 16 set, and bit 20 clear:

3 2 1 0
10987654321098765432109876543210
XBBBBBBBBBBAAAAAAAAAAAAAAAAAAAAA
100010100001010100011111110010 EPID(228547F2)
100010100101000000011111110010 Calculated EPID(114407F2)

Am I missing something out here?

I don't have my copy of the book to hand, though I was surprised to find it online as a scanned copy at Google Books.

Is there something I have skipped, or is it not as simple as bit shifting the SCH$GW_LOCALNODE value and doing a logical AND with the MPID value?

Even if there is a simpler way of getting the EPID from a job logical name table, I'm still perplexed by the MPID->EPID conversion.

If anyone can clear the wood so I can see the trees, I'd be much obliged!

Mark
9 REPLIES 9
Kris Clippeleyr
Honored Contributor

Re: Internal PID to Extended PID conversion "problem"

Hi,
There is a routine

int exe_std$cvt_ipid_to_epid ( in ipid );

that returns the EPID given an IPID.

Regards,
Kris (aka Qkcl)
I'm gonna hit the highway like a battering ram on a silver-black phantom bike...
Shriniketan Bhagwat
Trusted Contributor

Re: Internal PID to Extended PID conversion "problem"

Hi,

Internal process ID of the target process. The internal PID, or internal process ID, is distinct from the extended PID, or PID. The internal PID does not include any node information, and is used only in internal routines that operate on a single node within a cluster. The two types of pids are described in the PCBDEF.SDL file. Note that the bit layout of the pids is dependent upon the version of OpenVMS in use, and may change from one version of OpenVMS to the next. However, the internal PID can be derived from the extended PID using the routine EXE_STD$CVT_EPID_TO_IPID. This routine takes a single argument (the extended pid, unsigned longword by value) and returns the internal pid (unsigned longword by value) as the return value of the routine. If an error occurs, the return value is set to zero.

Regards,
Ketan
Shriniketan Bhagwat
Trusted Contributor

Re: Internal PID to Extended PID conversion "problem"

Hi,

Here is a link which explains about the CVT_EPID_TO_IPID. You may like to refer.

http://www.openvms.compaq.com/wizard/wiz_9234.html


Regards,
Ketan
Shriniketan Bhagwat
Trusted Contributor

Re: Internal PID to Extended PID conversion "problem"

Hi,

Here are the usual suspects for PID-related conversions:

EXE$CVT_EPID_TO_IPID,
EXE$CVT_IPID_TO_EPID,
EXE$CVT_IPID_TO_KTB,
EXE$CVT_IPID_TO_PCB,
EXE_STD$CVT_EPID_TO_IPID,
EXE_STD$CVT_IPID_TO_EPID,
EXE_STD$CVT_IPID_TO_PCB


Regards,
Ketan
Mark Corcoran
Frequent Advisor

Re: Internal PID to Extended PID conversion "problem"

Kris and Shriniketan, thanks for the suggestion - I'd already seen this, however...

It seems a bit of a chore to create an executable just to perform the conversion of MPID to EPID only, since he'd still have to manually do the ANA /SYS, READ SYSDEF.STB, FORMAT /TYP=JIB and then extract the MPID.

I'd be inclined to put the the whole lot into an executable, so it takes whatever input he currently has (to determine the job table name of the offending process), and simply spits out the EPID.

However, I'm busy with other things at the moment, and was keen to get him going with an automated solution in DCL however clunky it might be.