Skip to content
Snippets Groups Projects
Commit 542465a9 authored by masak1112's avatar masak1112
Browse files

Merge branch 'bing_issue#159_change_dir_for_runscript_in_create_env' into develop

parents b6f74d2e 8edf150f
No related branches found
No related tags found
No related merge requests found
Pipeline #93157 failed
...@@ -9,7 +9,7 @@ Loading: ...@@ -9,7 +9,7 @@ Loading:
- era5 - era5
stage: build stage: build
script: script:
- echo "dataset testing" - echo "Dataset testing"
- cd /data_era5/2017 - cd /data_era5/2017
- ls -ls - ls -ls
...@@ -26,7 +26,7 @@ Preprocessing: ...@@ -26,7 +26,7 @@ Preprocessing:
- era5 - era5
stage: build stage: build
script: script:
- echo "Building-preprocessing" - echo "Building preprocessing"
Training: Training:
...@@ -34,14 +34,34 @@ Training: ...@@ -34,14 +34,34 @@ Training:
- era5 - era5
stage: build stage: build
script: script:
- echo "Building-Training" - echo "Building training"
Postprocessing:
tags:
- era5
stage: build
script:
- echo "Building postprocessing"
- zypper --non-interactive install gcc gcc-c++ gcc-fortran
- zypper --non-interactive install openmpi openmpi-devel
- zypper --non-interactive install python3
- ls /usr/lib64/mpi/gcc/openmpi/bin
- export LD_LIBRARY_PATH=/usr/local/lib:$LD_LIBRARY_PATH
- export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:/usr/lib64/mpi/gcc/openmpi/bin
- export PATH=$PATH:/usr/lib64/mpi/gcc/openmpi/bin
- mpicxx -showme:link -pthread -L/usr/lib64/mpi/gcc/openmpi/bin -lmpi_cxx -lmpi -lopen-rte -lopen-pal -ldl -Wl,--export-dynamic -lnsl -lutil -lm -ldl
- pip install -r video_prediction_tools/env_setup/requirements_non_HPC.txt
- chmod +x ./video_prediction_tools/other_scripts/visualize_postprocess_era5_template.sh
- ./video_prediction_tools/other_scripts/visualize_postprocess_era5_template.sh
test: test:
tags: tags:
- era5 - era5
stage: build stage: build
script: script:
- echo "model testing" - echo "Model testing"
# - zypper --non-interactive install python3-pip # - zypper --non-interactive install python3-pip
# - zypper --non-interactive install python-devel # - zypper --non-interactive install python-devel
# - pip install --upgrade pip # - pip install --upgrade pip
......
...@@ -4,7 +4,9 @@ pandas==0.25.3 ...@@ -4,7 +4,9 @@ pandas==0.25.3
xarray==0.16.0 xarray==0.16.0
basemap==1.3.0 basemap==1.3.0
imageio==2.15.0 # although this numpy-version is in the container, we set it here to avoid any further installation imageio==2.15.0 # although this numpy-version is in the container, we set it here to avoid any further installation
numpy==1.17.3
scikit-image==0.17.2 scikit-image==0.17.2
#scikit-image==0.18.1
opencv-python-headless==4.2.0.34 opencv-python-headless==4.2.0.34
netcdf4==1.5.8 netcdf4==1.5.8
#metadata==0.2 #metadata==0.2
......
...@@ -13,8 +13,8 @@ lquick=1 ...@@ -13,8 +13,8 @@ lquick=1
climate_file=/home/b.gong/data_era5/T2monthly/climatology_t2m_1991-2020.nc climate_file=/home/b.gong/data_era5/T2monthly/climatology_t2m_1991-2020.nc
#select models #select models
model=convLSTM model=convLSTM
mkdir ${results_dir} #mkdir ${results_dir}
python3 ../main_scripts/main_visualize_postprocess.py --checkpoint ${checkpoint_dir} --mode test \ python3 ./video_prediction_tools/main_scripts/main_visualize_postprocess.py --checkpoint ${checkpoint_dir} --mode test \
--results_dir ${results_dir} --batch_size 4 \ --results_dir ${results_dir} --batch_size 4 \
--num_stochastic_samples 1 \ --num_stochastic_samples 1 \
--lquick_evaluation ${lquick} --climatology_file ${climate_file} --lquick_evaluation ${lquick} --climatology_file ${climate_file}
......
...@@ -76,20 +76,28 @@ class Config_Postprocess(Config_runscript_base): ...@@ -76,20 +76,28 @@ class Config_Postprocess(Config_runscript_base):
self.model = os.path.basename(dir_base) self.model = os.path.basename(dir_base)
# List the subdirectories... # List the subdirectories...
_ = Config_Postprocess.get_subdir_list(dir_base) _ = Config_Postprocess.get_subdir_list(dir_base)
# ... and obtain the checkpoint directory
# Chose the checkpoint directory
ckp_req_str = "Chose a checkpoint directory from the list above:"
ckp_req_err = NotADirectoryError("Could not find the passed directory.")
dir_base = Config_Postprocess.keyboard_interaction(ckp_req_str, Config_Postprocess.check_dir, ckp_req_err,
prefix2arg=dir_base+"/", ntries=2)
# List the subdirectories...
_ = Config_Postprocess.get_subdir_list(dir_base)
# ... and obtain the model directory with checkpoints
trained_dir_req_str = "Choose a trained model from the experiment list above:" trained_dir_req_str = "Choose a trained model from the experiment list above:"
trained_err = FileNotFoundError("No trained model parameters found.") trained_err = FileNotFoundError("No trained model parameters found.")
self.checkpoint_dir = Config_Postprocess.keyboard_interaction(trained_dir_req_str, self.checkpoint_dir = Config_Postprocess.keyboard_interaction(trained_dir_req_str,
Config_Postprocess.check_traindir, Config_Postprocess.check_traindir,
trained_err, ntries=3, prefix2arg=dir_base+"/") trained_err, ntries=3, prefix2arg=dir_base+"/")
# get the relevant information from checkpoint_dir in order to construct source_dir and results_dir # get the relevant information from checkpoint_dir in order to construct source_dir and results_dir
# (following naming convention) # (following naming convention)
cp_dir_split = Config_Postprocess.path_rec_split(self.checkpoint_dir) cp_dir_split = Config_Postprocess.path_rec_split(self.checkpoint_dir)
cp_dir_split = list(filter(None, cp_dir_split)) # get rid of empty list elements cp_dir_split = list(filter(None, cp_dir_split)) # get rid of empty list elements
base_dir, exp_dir_base, exp_dir = "/"+os.path.join(*cp_dir_split[:-4]), cp_dir_split[-3], cp_dir_split[-1] base_dir, exp_dir_base, exp_dir = "/"+os.path.join(*cp_dir_split[:-4]), cp_dir_split[-3], cp_dir_split[-2]
self.runscript_target = self.rscrpt_tmpl_prefix + self.dataset + "_" + exp_dir + ".sh" self.runscript_target = self.rscrpt_tmpl_prefix + self.dataset + "_" + exp_dir + ".sh"
# Set results_dir # Set results_dir
......
...@@ -31,9 +31,9 @@ class Config_runscript_base: ...@@ -31,9 +31,9 @@ class Config_runscript_base:
self.VIRT_ENV_NAME = venv_name self.VIRT_ENV_NAME = venv_name
# runscript related attributes # runscript related attributes
if lhpc: if lhpc:
self.runscript_dir = "../HPC_scripts" self.runscript_dir = "../JSC_scripts"
else: else:
self.runscript_dir = "../nonHPC_scripts" self.runscript_dir = "../HPC_scripts"
self.long_name_wrk_step = None self.long_name_wrk_step = None
self.rscrpt_tmpl_prefix = None self.rscrpt_tmpl_prefix = None
......
...@@ -47,7 +47,7 @@ else ...@@ -47,7 +47,7 @@ else
fi fi
echo "Start setting up templates under nonHPC_scripts/..." echo "Start setting up templates under nonHPC_scripts/..."
for f in "${BASE_DIR}"/nonHPC_scripts/*template.sh; do for f in "${BASE_DIR}"/HPC_scripts/*template.sh; do
echo "Setting up ${f}..." echo "Setting up ${f}..."
fnew=${f%%.*}_${USER}.sh fnew=${f%%.*}_${USER}.sh
cp "${f}" "${fnew}" cp "${f}" "${fnew}"
...@@ -56,7 +56,7 @@ done ...@@ -56,7 +56,7 @@ done
echo "Done!" echo "Done!"
echo "Start setting up templates under HPC_scripts/" echo "Start setting up templates under HPC_scripts/"
for f in "${BASE_DIR}"/HPC_scripts/*template.sh; do for f in "${BASE_DIR}"/JSC_scripts/*template.sh; do
echo "Setting up ${f}..." echo "Setting up ${f}..."
fnew=${f%%.*}_${USER}.sh fnew=${f%%.*}_${USER}.sh
cp "${f}" "${fnew}" cp "${f}" "${fnew}"
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment