Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Experiment directory with @ character does not run properly #395

Closed
danielabdi-noaa opened this issue Oct 4, 2022 · 5 comments
Closed
Assignees
Labels
bug Something isn't working Priority: low

Comments

@danielabdi-noaa
Copy link
Collaborator

Expected behavior

SRW app should run when experiment directory contains @ character.

Current behavior

SRW app fails to run properly when the experiment directory contains the @ character. This was revealed during Jenkins testing on Cheyene, where both gnu and intel are tested and the latter is assigned a different experiment directory differentiated by expt_dir@2. It looks like rocoto <cyclestring>&LOGDIR;</cyclesctring> changes the @ character to % causing all sorts of problems. Now a an underscore is used for Jenkins but the @ issue still exists.

Machines affected

All

Steps To Reproduce

Add to your experiment directory path the @ character.

Detailed Description of Fix (optional)

Could be a rocoto issue.

Additional Information (optional)

Possible Implementation (optional)

Output (optional)

You will get the log files in a different directory where the @ is replaced with %. The LOGDIR generated by rocoto changes
test@2 to test%2

#! /bin/sh
#SBATCH --account=zrtrr
#SBATCH --qos=batch
#SBATCH --partition=service
#SBATCH --nodes=1-1
#SBATCH --tasks-per-node=1
#SBATCH -t 00:45:00
#SBATCH --job-name=get_extrn_ics
#SBATCH -o /scratch2/BMC/gsd-hpcs/Daniel.Abdi/expt_dirs/test%2/custom_GFDLgrid/log/get_extrn_ics_2019070100.log
#SBATCH --comment=22bb59625914e244ba065a866351335e
export GLOBAL_VAR_DEFNS_FP='/scratch2/BMC/gsd-hpcs/Daniel.Abdi/expt_dirs/test@2/custom_GFDLgrid/var_defns.sh'
export PDY='20190701'
export cyc='00'
export subcyc='00'
export LOGDIR='/scratch2/BMC/gsd-hpcs/Daniel.Abdi/expt_dirs/test%2/custom_GFDLgrid/log'
export ICS_OR_LBCS='ICS'
/scratch2/BMC/gsd-hpcs/Daniel.Abdi/ufs-srweather-app/ush/load_modules_run_task.sh "get_extrn_ics" "/scratch2/BMC/gsd-hpcs/Daniel.Abdi/ufs-srweather-app/jobs/JREGIONAL_GET_EXTRN_MDL_FILES"
@danielabdi-noaa danielabdi-noaa added bug Something isn't working Priority: low labels Oct 4, 2022
@danielabdi-noaa danielabdi-noaa changed the title Experiment directory with @ does not run properly Experiment directory with @ character does not run properly Oct 4, 2022
@christopherwharrop-noaa
Copy link
Collaborator

The @ character is used in Rocoto <cyclestr> tags to designate various date/time components. If you want to use text in a <cyclestr> that contains an actual @ character, you will need to escape it by using two consecutive @@. The @ characters in <cyclestr> tags are replaced internally with % so that the strftime method can be called to expand the string into the values represented by the date/time fields.

@christopherwharrop-noaa
Copy link
Collaborator

Rocoto doesn't use % characters directly because the % character has special meaning in XML that interferes with that function, causing the XML parsers to fail.

@christopherwharrop-noaa
Copy link
Collaborator

Another solution would be to put the portion of the string containing the @ character outside of the <cyclstr> tag so that <cyclestr> only contains characters to be interpreted as date/time.

For example, replace:

<cyclestr>my silly @ string for time @Y@m@d@H@M</cyclestr>

with

my silly @ string for time <cyclestr>@Y@m@d@H@M</cyclestr>

@christopherwharrop-noaa
Copy link
Collaborator

Another solution, specific to this scenario, is to not use cyclestr> tags when there is nothing in the string that is dependent on the cycle. In the example cited here, no part of the LOGDIR path contains any date or time information. So you can just completely eliminate the use of <cyclstr> for this particular instance.

@dshawul
Copy link
Contributor

dshawul commented Oct 4, 2022

@christopherwharrop-noaa Thanks for the explanation! I will try to move the cyclestring out of the LOGDIR path.

@danielabdi-noaa danielabdi-noaa self-assigned this Oct 4, 2022
danielabdi-noaa added a commit that referenced this issue Oct 5, 2022
)

* Fix @ issue on LOGDIR.

* Get rid of RUN_CMD_* specification in deactivate_tasks.

* Add TEST_ALT_* directories to all machines.

* Enforce config sourcing order in setup.

* Also fix DYN/PHY dir @ situation.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working Priority: low
Projects
None yet
Development

No branches or pull requests

3 participants