In my understanding the export command
   makes that variable available only to child processes of your
   shell. Consequently I doubt this way you can access to variables
   exported in a prolog script from any shell that slurm provides.
   However, in the documentation I've seen there's a way to do this:
   
   - Create a prolog script and print the command that exports your
   variables:
   prolog.sh:
   /
     #!/bin/bash
     echo "export VAR1=\"VALUE1\""/
   /echo "export VAR2=\"VALUE2\""
     ...
     
   /- In your slurm.conf file, use the TaskProlog directive
   instead of Prolog/:
   /Slurm.conf/:
     ...
     TaskProlog=<dir>/prolog.sh
     .../
   
   - And execute:
   /$srun env/
   
   And you should see VAR1 and VAR2 variables.
   
   Note that this prolog only gets executed in jobsteps (when
   executing srun), that means that when you run an sbatch or an
   salloc it won't work.
   
   However, the best way to check if your prolog/epilog scripts are
   working is to cast something to a file somewhere and then go to
   check it manually.
   
   Greetings,
   Joan
   /
   /On 18/06/14 16:13, Brian Baughman wrote:
   Hello Joan,

The scripts basically just echo stuff and set some environmental variables. If 
I set TESTVAL in my user prolog file:

export TESTVAL="this is a test variable"

Then run a test job that does something like:

echo ">>>${TESTVAL}<<<"

I get the output:
         <<<
So the variable isn’t set. 

Regards,
Brian
 -- 
   
     Joan Francesc Arbona
     Ext. 2582
     Centre de Tecnologies de la Informació
     Universitat de les Illes Balears
     
     http://jfdeu.wordpress.com
     http://guifisoller.wordpress.com

Reply via email to