Operating System - HP-UX
1850754 Members
3622 Online
104055 Solutions
New Discussion

Porting from HP-UX PA-RISC (LP64) to IA 64

 
SOLVED
Go to solution
ShivS
Frequent Advisor

Porting from HP-UX PA-RISC (LP64) to IA 64

Hi, I have a large C++ source code on HP UX 9000/800 machine. The code is compiled as PA-RISC (LP64). Now my development group is planning to buy new HP UX Itanium machines. I have the following questions:
1. My current source code using many 3rd party libraries like Oracle, Xerces, Tuxedo 8.1 all of which are currently PA-RISC (LP64). Will my current PA-RISC (LP64) binaries (executables) run as is on the Itanium machine?

2) If the binaries run as is on the Itanium machine, will there be any performance issues? If yes, what steps should I take to get the best performance on IA machine?

3) If I have to recompile my source code, do I have to recompile the source code of all the 3rd party libraries? In this case what aCC compiler options should I be taking care off?

4) Please provide other misc information which I will have to keep in mind for this porting.

Thanks in advance for your help.

-Shiv
15 REPLIES 15
Dennis Handly
Acclaimed Contributor

Re: Porting from HP-UX PA-RISC (LP64) to IA 64

>1) Will my current PA-RISC (LP64) binaries run as is on the Integrity machine?

If they are not kernel intrusive, they should run under Aries. Provided you have the right to copy those libs to your IPF machine.

>2) If the binaries run as is on the Integrity machine, will there be any performance issues?

Yes. If CPU intensive, they will slow down. If I/O intensive, you may not notice it.

>If yes, what steps should I take to get the best performance on IA machine?

Compile natively of course with aCC6.

>3) If I have to recompile my source code, do I have to recompile the source code of all the 3rd party libraries?

Yes. Or have them provide native IPF versions.

>In this case what aCC compiler options should I be taking care of?

You would want to port to using -AA, to match the default.

>4) Please provide other misc information which I will have to keep in mind for this porting.

You are doing 3 ports at once:
1) PA to IPF.
2) aCC3 to aCC6
3) -AP to -AA

For 2) and 3):
http://h21007.www2.hp.com/portal/site/dspp/menuitem.863c3e4cbcdc3f3515b49c108973a801/?ciid=2708d7c682f02110d7c682f02110275d6e10RCRD
http://h21007.www2.hp.com/portal/site/dspp/menuitem.863c3e4cbcdc3f3515b49c108973a801/?ciid=eb08b3f1eee02110b3f1eee02110275d6e10RCRD

Also see:
http://www.hp.com/go/cpp
http://www.hp.com/go/aries
James R. Ferguson
Acclaimed Contributor

Re: Porting from HP-UX PA-RISC (LP64) to IA 64

Hi:

As for perfomance, the Aries manpages offer some benchmark data as well as other valuable information:

http://docs.hp.com/en/B2355-60130/Aries.5.html

Regards!

...JRF...
ShivS
Frequent Advisor

Re: Porting from HP-UX PA-RISC (LP64) to IA 64

Hi,

Thank you very much for the answering my questions. I came across one more problem. My PA-RISC build application is using the unix "tr" command in the C++ code as follows:

----------------------
sprintf(xmlFileName, "%s.xml", fname);

sprintf(shCommand, "tr -d \"\012\" < %s > %s", fname, xmlFileName);

int retVal = system (shCommand);
----------------------
Here fname is "SomeFile.out". This .out file contains xml data. The above piece of code is used to remove the new line from this .out file. When I run this PA-RISC (HP-UX B.11.11 U 9000/800) code on the ITANIUM machine (HP-UX B.11.23 U ia64 0409362437) the problem with the "tr" command is it runs sometimes and fails in some other runs. The interesting thing is when I run this command on the command line using the same SomeFile.out file, it just runs fine and it never fails.

So my questions are:
1) Are there any system parameters that I need to set for the "tr" command to work properly.

2) Is is possible that the system() call is causing some problems?

3) Is it possible that not everything will run perfectly fine in the emulation mode, which further means that I will have to compile the code on Itanium box?


Thanks in advance for the help.

Regards,
Shiv


James R. Ferguson
Acclaimed Contributor

Re: Porting from HP-UX PA-RISC (LP64) to IA 64

Hi Shiv:

> 1) Are there any system parameters that I need to set for the "tr" command to work properly.

No.

> 2) Is is possible that the system() call is causing some problems?

I seriously doubt that.

> 3) Is it possible that not everything will run perfectly fine in the emulation mode, which further means that I will have to compile the code on Itanium box?

For the case you cite, I don't think you should have a problem. I suspect that your anamolous results are *data* dependent, and not code-dependent.

Regards!

...JRF...
Steven Schweda
Honored Contributor

Re: Porting from HP-UX PA-RISC (LP64) to IA 64

> [...] it runs sometimes and fails in some
> other runs.

What does "fails" mean here? What is
"retVal" when it fails? Is the output file
created? What's in it? What happens? As
usual, "fails" is not a useful problem
description.
ShivS
Frequent Advisor

Re: Porting from HP-UX PA-RISC (LP64) to IA 64

Hi Steven,

Somefile.out contains xml data as shown in the sample below:

17.227642
13.161298
8.915456

Note that in the above sample, each start element begins on a new line.

After running this file through the "tr" command, the "tr" command should generate the file Somefile.out.xml containing the data as shown below (Note that the new lines are to be removed by the "tr" command here):

17.22764213.1612988.915456


By "fail", I mean that the Somefile.out.xml file is not created, which indicates that the "tr" command failed to process the input file Somefile.out

The retVal value is -1 when the Somefile.out.xml is not created and it is 0 when it is created.

Regards,
Shiv
Steven Schweda
Honored Contributor

Re: Porting from HP-UX PA-RISC (LP64) to IA 64

> The retVal value is -1 [...]

"man system":

[...] If a child process cannot be
created, or if the termination status
for the command language interpreter
cannot be obtained, system() returns
-1 and sets errno to indicate the
error.
[...]

So, what's "errno"?

For that matter, do we know what's really in
"shCommand", or are we asuming that it's all
what we expect it to be?
Laurent Menase
Honored Contributor

Re: Porting from HP-UX PA-RISC (LP64) to IA 64

check the errno, but usually it is a problem of PATH.

It is usually better to set the full path when you call system() for a command else it could be a security issue.

so try /usr/bin/tr
Else only errno can help in finding the root cause.




ShivS
Frequent Advisor

Re: Porting from HP-UX PA-RISC (LP64) to IA 64

Hi,

The tr command in the log file looks like:
--------------------
shCommand=tr -d "
" < /tfsw/ocp/temp/API12879_1000.out > /tfsw/ocp/temp/API12879_1000.out.xml

--------------------

I printed the errno immediately after the system() call to run the above given command and it gives the following:

errno(12) strerror(Not enough space)

When I run the "ls -l" on the above files, the retVal from the system() call for both the input and output files is -1 and the errno is 12!!

I checked that the input file /tfsw/ocp/temp/API12879_1000.out is present and is of 153596 bytes.

Also, the "df -k ." command under the /tfsw/ocp/temp directory gives the following :

/tfsw (/dev/vg03/lvol3 ) : 123242977 total allocated Kb
38282738 free allocated Kb
84960239 used allocated Kb
68 % allocation used

So, this indicates that there is enough space available and the final file /tfsw/ocp/temp/API12879_1000.out.xml will certainly be smaller than 153596 bytes in size.

So, then where is the problem?

Regards,
Shiv


Steven Schweda
Honored Contributor
Solution

Re: Porting from HP-UX PA-RISC (LP64) to IA 64

> errno(12) strerror(Not enough space)

> Also, the "df -k ." command

errno 12 is ENOMEM, and is related to
(something like) virtual memory, not disk
space.

"man system":

[...]
ERRORS
If errors are encountered, system() sets errno values as described by
fork(2).
[...]

"man fork":

[...]
[ENOMEM] There is insufficient swap space and/or physical
memory available in which to create the new
process.
[...]

So, is the system (or just this process)
running out of memory (swap space)?
Dennis Handly
Acclaimed Contributor

Re: Porting from HP-UX PA-RISC (LP64) to IA 64

>sprintf(shCommand, "tr -d \"\012\" < %s > %s", fname, xmlFileName);

You haven't followed the quoting rules for C and for the shell. This is the correct form:
"tr -d '\\012' < %s > %s"

You toss the double quotes, so you don't have to quote them. And so you don't need 4 \. Then you need an extra \ so C compiler doesn't replace it by a newline.
ShivS
Frequent Advisor

Re: Porting from HP-UX PA-RISC (LP64) to IA 64

Here are the "swapinfo -tam" stats on the itanium machine where the "tr" command is failing:

Mb Mb Mb PCT START/ Mb
TYPE AVAIL USED FREE USED LIMIT RESERVE PRI NAME
dev 4096 3485 611 85% 0 - 1 /dev/vg00/lvol2
reserve - 597 -597
memory 18425 14554 3871 79%
total 22521 18636 3885 83% - 0 -


My development machine where "tr" always works has the following "swapinfo -tam" stats:

Mb Mb Mb PCT START/ Mb
TYPE AVAIL USED FREE USED LIMIT RESERVE PRI NAME
dev 8192 0 8192 0% 0 - 1 /dev/vg00/lvol11
dev 8192 0 8192 0% 0 - 1 /dev/vg01/lvol12
dev 16384 0 16384 0% 0 - 2 /dev/vg01/lvol17
reserve - 22044 -22044
memory 28019 6768 21251 24%
total 60787 28812 31975 47% - 0 -


I dont know how to read the swapinfo output.



Regards,
Shiv


James R. Ferguson
Acclaimed Contributor

Re: Porting from HP-UX PA-RISC (LP64) to IA 64

Hi:

You need to add more physical memory and/or more swap space on the machine where your 'tr' is failing. An ENOMEM condition or a "can't fork' points to insufficient swap space and/or insufficient data space as bounded by the kernel 'maxdsiz' parameters (32 and 64-bit fences). Your swap and memory utilization are quite high.

As an immediate aid, I would add a generous secondary device swap of 4-8 GB.

Regards!

...JRF...

ShivS
Frequent Advisor

Re: Porting from HP-UX PA-RISC (LP64) to IA 64

Hi,

I asked my Unix admin guys to add additional swap space of 10 GB. Now the "tr" command is working fine.

Thank's everybody for helping me out on this problem.

Regards,
Shiv
ShivS
Frequent Advisor

Re: Porting from HP-UX PA-RISC (LP64) to IA 64

As suggested by the experts in this forum, I found the solution to the problem.