geodesymiami / rsmas_insar

RSMAS InSAR code
https://rsmas-insar.readthedocs.io/
GNU General Public License v3.0
59 stars 23 forks source link

Need read_platform_defaults.bash to read environment variables from table #449

Closed falkamelung closed 3 years ago

falkamelung commented 3 years ago

To simplify our defaults we need a script read_platform_defaults.bash that reads suggestion_platforms_defaults.cfg (committed in /accounts; will be renamed to platforms_defaults.cfg) and exports as environment variables. $PLATFORM_NAME is given and then it should run export JOBSCHEDULER=SLURM, export QUEUENAME=skx-normal, etc.

If one of the environment variables is set already, it should NOT overwrite them (to allow for personal customization)

more accounts/suggestion_platforms_defaults.cfg 
###################################################################################################
echo "exporting environment variables using ~/accounts/platforms_defaults.cfg ..."
###################################################################################################
# set environment variables. For example for PLATFORM_NAME stampede2 do `export JOBSCHEDULER=SLURM`
###################################################################################################
PLATFORM_NAME JOBSCHEDULER QUEUENAME     JOB_SUBMISSION_SCHEME      JOBSHEDULER_PROJECTNAME  SCRATCHDIR                              WORKDIR
stampede2        SLURM     skx-normal launcher_multiTask_singleNode     TG-EAR200012         ${SCRATCH}                             ~/insarlab
frontera         SLURM       normal   launcher_multiTask_singleNode       EAR20013           ${SCRATCH}                             ~/insarlab
comet            SLURM       compute           singleTask                 EAR20013        /oasis/scratch/comet/$USER/temp_project   ~/insarlab
deqing_server    PBS         batch             singleTask               TG-EAR180012         ${SCRATCH}                             ~/insarlab
eos              PBS         batch             singleTask                    NONE         /scratch/insarlab/${USER_PREFERRED}       ~/insarlab
jetstream        NONE        NONE                 NONE                       NONE           /data/HDF5EOS                           ~/insarlab
mac              NONE        NONE                 NONE                       NONE          ~/insarlac/scratch                       ~/insarlab
Ovec8hkin commented 3 years ago

Is this script intended to take PLATFORM_NAME as an input parameter (ie read_platform_defaults.bash --platform stampede2)

falkamelung commented 3 years ago

Yes, almost. $PLATFORM_NAME will exist as environment variable so we would just run as read_platform_defaults.bash and it will use $PLATFORM_NAME internally.

And it should assume that /accounts/platforms_defaults.cfg exist

This will be in the .bashrcso we better ommit --platform $PLATFORM_NAME. But items 1,2,3 are higher priority.

Ovec8hkin commented 3 years ago

Just committed this.