To run parallel tasks spawned by ParaStation MPI on clusters using
AFS
, ParaStation MPI provides the scripts
env2tok
and tok2env
.
On the frontend side, calling
. tok2env
will create an environment variable
AFS_TOKEN
containing an encoded access
token for AFS. This variable must be added to the list of
exported variables
PSI_EXPORTS="AFS_TOKEN,$PSI_EXPORTS"
In addition, the variable
PSI_RARG_PRE_0=/some/path/env2tok
must be set. This will call the script
env2tok
before running the actual program
on each node. Env2tok
itself will decode
the token and will setup the AFS environment.
The commands SetToken
and
GetToken
, which are part of the AFS
package, must be available on each node. Also, the commands
uuencode
and
uudecode
must be installed.
Script tok2env
:
#!/bin/bash tmp=$IFS IFS=" " export AFS_TOKEN=`GetToken | uuencode /dev/stdout` IFS=$tmp
Script env2tok
:
#!/bin/bash IFS=" " echo $AFS_TOKEN | uudecode | SetToken exec $*