Am 01.02.2012 um 19:56 schrieb Rayson Ho:

> On Wed, Feb 1, 2012 at 1:45 PM, Lane Schwartz <[email protected]> wrote:
>> To solve the problem, I have wrapped the above code in my
>> .bash_profile to first check to see if I am in a grid job:
>> 
>> if [ -n "$JOB_ID" ]; then
>>    # do stuff
>> else
>>    if [ -f $HOME/.path_history/host.$HOSTNAME ]; then
>>        cd `cat $HOME/.path_history/host.$HOSTNAME`
>>    fi
>> fi
> 
> Good to know that it is working for you!
> 
> Just a small suggestion - check "$ENVIRONMENT" and see if it is equal

I second this. Not because of portability, but for documentation purpose.


> to "BATCH". I forgot whether it is defined by the IEEE standard for
> batch systems or somehere else, but at least it is supported by SGE
> and Torque. On the other hand, JOB_ID is not defined by the standard,
> and it is only set when the job is run under SGE.

There is another man page in my system `man 1p qsub` which refers to POSIX and 
lists PBS_... environment variables by mentioning IEEE Std 1003.1-2001,  
Section  12.2. Like PBS_ENVIRONMENT (as in Torque) [besides PBS_JOBID] which 
should be set to PBS_BATCH.

In the essence you would need to check various variables (think of LoadLeveler 
and Slurm). AFAIK this is done by Open MPI and MPICH2 to determine also the 
type of batch system automatically this way for their automatic tight 
integration.

-- Reuti


> It is usually better to use a portable approach - just IMO!
> 
> Rayson
> 
> 
> 
>> 
>> Thanks for the help debugging this! The problem now appears to be solved.
>> 
>> Cheers,
>> Lane
> 
> _______________________________________________
> users mailing list
> [email protected]
> https://gridengine.org/mailman/listinfo/users
> 


_______________________________________________
users mailing list
[email protected]
https://gridengine.org/mailman/listinfo/users

Reply via email to