Commit 8c68c7ff authored by Andrii Salnikov's avatar Andrii Salnikov

Adding RTE parameters export to ENV/RTE

parent 292424c6
......@@ -5,22 +5,30 @@ if [ "$1" = "0" ] ; then
runtimeenv_var="joboption_runtime_${runtimeenv_idx}"
eval "runtimeenv_name=\"\${${runtimeenv_var}}\""
while [ -n "${runtimeenv_name}" ]; do
# define safe-defaults
arcce_runtimeenv_path=/dev/null
arcce_runtimeenv_params_path=/dev/null
# find RTE location (enabled vs default)
if [ -e "${CONFIG_controldir}/rte/enabled/${runtimeenv_name}" ]; then
if [ -e "${joboption_controldir}/rte/enabled/${runtimeenv_name}" ]; then
arcce_runtimeenv_path="${joboption_controldir}/rte/enabled/${runtimeenv_name}"
else
arcce_runtimeenv_path="${joboption_controldir}/rte/default/${runtimeenv_name}"
fi
# check RTE have parameters file
if [ -e "${joboption_controldir}/rte/params/${runtimeenv_name}" ]; then
arcce_runtimeenv_params_path="${joboption_controldir}/rte/params/${runtimeenv_name}"
fi
# copy RTE script to session directory
sessiondir_runtimeenv_path="${joboption_directory}/rte/${runtimeenv_name}"
mkdir -p "${sessiondir_runtimeenv_path%/*}"
cp -v "$arcce_runtimeenv_path" "$sessiondir_runtimeenv_path"
cat "$arcce_runtimeenv_params_path" > "$sessiondir_runtimeenv_path"
cat "$arcce_runtimeenv_path" >> "$sessiondir_runtimeenv_path"
# next RTE
runtimeenv_idx=$((runtimeenv_idx+1))
runtimeenv_var="joboption_runtime_${runtimeenv_idx}"
eval "runtimeenv_name=\"\${${runtimeenv_var}}\""
done
unset runtimeenv_idx runtimeenv_var sessiondir_runtimeenv_path arcce_runtimeenv_path
unset runtimeenv_idx runtimeenv_var sessiondir_runtimeenv_path arcce_runtimeenv_path arcce_runtimeenv_params_path
fi
true
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment