Simon,
I think there is already a way to do this, but on checking the wiki it doesn't look like it's been documented.
In a <submit> element, and after any <arg> and <input> elements, you specify the attributes/properties you want mapped to environment variables. e.g.:
<submit-batch ... replaceEnvironment="true"> <arg>bg_submit</arg> <arg>-env_all</arg> ... <environment name="BG_ENV_VAR" value="${ptp_rm:bg_attribute}"/> ... </submit-batch>
You probably want to set replaceEnvironment=true so that all the client environment variables aren't sent over as well, as these are probably not very useful.
Let me know if this helps, Greg On Sep 12, 2011, at 2:45 AM, Simon Wail wrote: PTP Gurus,
I'm trying to write a new JAXB defined
resource manager for PTP and I would like to access the environment variables
the user can define in the launch configuration from the resource manager
XML file. From what I've seen in the wiki documentation and the JAXB
demo presentation, only a hand full of values from the launch configuration
are available in the XML, such as "executablePath", "progArgs",
"directory", etc. These are accessible using the ${ptp_rm:...}
notation. I can't seem to find anywhere that mentions about the environment
variables being available in the XML with a similar notation.
The reason I need access to the environment
variables is because on the system I'm developing the resource manager
for (IBM Blue Gene), the environment is NOT passed to the running application
from the resource manager batch script when "mpirun" is executed.
In order to pass environment variables to the application, you need
to use specific mpirun command line arguments - "-env", "-exp_env"
or "-env_all". It is possible to pass the entire environment
using the "-env_all" command line argument but this fails if
the sum total length (name, value pairs) of your environment exceeds 2K
- quite easily done. Therefore it is necessary to explicitly specify
which environment variables are needed using the "-env" or "-exp_env"
command line arguments to mpirun. My plan was to put into the generated
batch script some sort of loop that built the necessary mpirun command
line arguments to pass the user defined environment variables.
It is obvious the JAXB resource manager
code has access to the launch configured environment variables as it is
able to add them in the generated batch script. On looking at the
code, it seems the resource manager environment (properties and attributes
accessible using ${ptp_rm:...}) is kept quite separate from the launch
environment variables. That is why I don't seem to be able to access
the environment variables from the XML file. So would it be possible
to add to the resource manager environment a series of properties or attributes
that represented the user defined environment variables. The exact
format of these properties would need to be discussed as well as how these
properties could be utilised in the generated batch script - they'd need
to be able to be handled in a shell loop.
Regards,
Simon Wail, Ph.D
|
HPC Specialist
|
<Mail Attachment.gif>
| IBM Research Collaboratory
for Life Sciences - Melbourne
|
<Mail Attachment.gif>
|
phone:
| +61 3 9035-4341
fax: +61 3 8344-9130
|
address:
| VLSCI, Gnd Floor, 187 Grattan St
|
| Carlton VIC 3010 Australia
|
email:
| simon.wail@xxxxxxxxxxx |
|
_______________________________________________ ptp-dev mailing list ptp-dev@xxxxxxxxxxx https://dev.eclipse.org/mailman/listinfo/ptp-dev
|