Simon,
That sounds right. I'm not sure what environment variables the user is going to need either. Things like PATH are probably not going to make sense since the local path is likely to be very different than the remote path.
Regards, Greg On Sep 13, 2011, at 1:41 AM, Simon Wail wrote: Greg,
I think this will work if I understand
you correctly. Let me summarize:
1) In my batch script I use the "-env_all"
command line argument to mpirun. This will pass the entire environment
of the script to mpirun.
2) The script definition has the "insertEnvironmentAfter"
attribute set which will cause the script generator to include the environment
variables defined in the launch configuration to be added to the script
and therefore passed to the mpirun command via the "-env_all"
argument.
3) Using the "replaceEnvironment=true"
attribute in the "submit-batch" element will remove all the shell
environment variables from the batch script environment as it won't be
passed to the "submit-batch" command. This will remove
the 2K limit problem with mpirun.
4) I can use the "environment"
element to add specific environment variables to the "submit-batch"
command, but I'm not sure what I'll need here, other than "PATH"
for the commands in the batch script.
The only problem I can see with this,
is when a user submits their own script with PTP. In this case they
will not have access to any previously setup shell environment and will
have to modify their script accordingly. I don't think this is really
an issue as anyone using their own script should know enough to modify
it as necessary.
Thanks for the help.
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 |
|
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
_______________________________________________
ptp-dev mailing list
ptp-dev@xxxxxxxxxxx
https://dev.eclipse.org/mailman/listinfo/ptp-dev
_______________________________________________ ptp-dev mailing list ptp-dev@xxxxxxxxxxx https://dev.eclipse.org/mailman/listinfo/ptp-dev
|