HP OpenVMS Systems

ask the wizard
Content starts here

Porting code using (shared memory) $crmpsc?

» close window

The Question is:

Hi Wizard,
I am new to open vms, and I am now involved in
migrating applications from vax/vms to open
vms on alpha 7.1. I have all the source code
and I have been successfull in recomiling and
linking all the applications which r written
in fortran, pascal and c. These applications
uses the same addresses (i.e the start address
and the end address) in the inadr arguments of
the $crmpsc and the SEC$M_EXPREG is not set.
while running the application gives a runtime
error  invalid arguments. after setting the
sec$M_EXPREG flag the error goes off , but
mapping is not taking place. the other process
is not able to fetch the record placed by this
process in the global section. The manual says
the end address of the inadr argument should
be 1 less than the end os the cpu specific
page boundary.this application is written in
pascal. I am not able to figure out or
understand how to set the inadr[0] aligned on
a cpu specific page boundary and the inadr[1]
with the end of the cpu-specific page.the
$getsyi for my system returned 8192. I seem to
be badly struct with this and I would
apprecite a lot if this can be illustrated
with a pascal example.
Thank u
HN Prasanna

The Answer is :

  The OpenVMS Wizard would first recommend reviewing for the errors
  discussed in topic (1661), and -- if this is memory shared among
  multiple processes -- topic (2681).
  The easiest approach is to use position independence and particularly
  the SEC$M_EXPREG/SEC$V_EXPREG option setting, and entirely avoid
  specifying the range of virtual memory to map the section into.
  A C example of shared memory is available at the main page of the
  Ask The Wizard area.
  Also please see existing discussions of $crmpsc including topics
  (4487), (4051), (3791), (3635), (3365), (2486), (2637), (2181),
  (860), and others.
  Also seriously consider using RMS and global buffers, as this can
  resolve a variety of synchronization problems, and can also operate
  (correctly) across nodes operating in an OpenVMS Cluster configuration.
  Also please review the application migration documentation materials
  in (the archived section of) the OpenVMS documentation website,
  as that documentation also covers correctly handling the differences
  in the memory page sizes.

answer written or last revised on ( 27-AUG-2001 )

» close window