Skip to content

Commit

Permalink
minor batch script improvements
Browse files Browse the repository at this point in the history
  • Loading branch information
trautmane committed Jun 4, 2024
1 parent 1ed0315 commit a11c76d
Show file tree
Hide file tree
Showing 3 changed files with 18 additions and 9 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -10,15 +10,17 @@ source "${SCRIPT_DIR}"/../00_config.sh "NA"
SLABS_PER_FILE=35
COUNT=0
BATCH_COUNT=0
CSV_PREFIX="64_masked_clahe_dataset"

RUN_DIR="${SCRIPT_DIR}/run_64_masked_clahe_$(date +"%Y%m%d_%H%M%S")"
mkdir -p "${RUN_DIR}"

for SLAB in ${ALL_SLABS}; do

source "${SCRIPT_DIR}"/../00_config.sh "${SLAB}"

if ! (( COUNT % SLABS_PER_FILE )); then
BC_VAL=$(printf '%03d' ${BATCH_COUNT})
CSV_FILE="${CSV_PREFIX}.batch_${BC_VAL}.csv"
CSV_FILE="${RUN_DIR}/batch_${BC_VAL}.csv"
echo -n "" > "${CSV_FILE}"
BATCH_COUNT=$((BATCH_COUNT+=1))
fi
Expand Down Expand Up @@ -47,4 +49,5 @@ for SLAB in ${ALL_SLABS}; do

done

ls -alh ${CSV_PREFIX}.batch_*.csv
echo "Created ${RUN_DIR} with:"
ls -alh ${RUN_DIR}/*.csv
Original file line number Diff line number Diff line change
Expand Up @@ -10,15 +10,17 @@ source "${SCRIPT_DIR}"/../00_config.sh "NA"
SLABS_PER_FILE=31 # 31 slabs should take about 6 hours to complete, 402 / 31 = 13 files
COUNT=0
BATCH_COUNT=0
CSV_PREFIX="71_flat_dataset"

RUN_DIR="${SCRIPT_DIR}/run_71_flat_$(date +"%Y%m%d_%H%M%S")"
mkdir -p "${RUN_DIR}"

for SLAB in ${ALL_SLABS}; do

source "${SCRIPT_DIR}"/../00_config.sh "${SLAB}"

if ! (( COUNT % SLABS_PER_FILE )); then
BC_VAL=$(printf '%03d' ${BATCH_COUNT})
CSV_FILE="${CSV_PREFIX}.batch_${BC_VAL}.csv"
CSV_FILE="${RUN_DIR}/batch_${BC_VAL}.csv"
echo -n "" > "${CSV_FILE}"
BATCH_COUNT=$((BATCH_COUNT+=1))
fi
Expand Down Expand Up @@ -49,4 +51,5 @@ for SLAB in ${ALL_SLABS}; do

done

ls -alh ${CSV_PREFIX}.batch_*.csv
echo "Created ${RUN_DIR} with:"
ls -alh ${RUN_DIR}/*.csv
Original file line number Diff line number Diff line change
Expand Up @@ -14,15 +14,17 @@ FACE_SUFFIX="${SURFACE_DEPTH}${COLOR}"

COUNT=0
BATCH_COUNT=0
CSV_PREFIX="72_face_dataset"

RUN_DIR="${SCRIPT_DIR}/run_72_face_$(date +"%Y%m%d_%H%M%S")"
mkdir -p "${RUN_DIR}"

for SLAB in ${ALL_SLABS}; do

source "${SCRIPT_DIR}"/../00_config.sh "${SLAB}"

if ! (( COUNT % SLABS_PER_FILE )); then
BC_VAL=$(printf '%03d' ${BATCH_COUNT})
CSV_FILE="${CSV_PREFIX}.batch_${BC_VAL}.csv"
CSV_FILE="${RUN_DIR}/batch_${BC_VAL}.csv"
echo -n "" > "${CSV_FILE}"
BATCH_COUNT=$((BATCH_COUNT+=1))
fi
Expand Down Expand Up @@ -74,4 +76,5 @@ for SLAB in ${ALL_SLABS}; do

done

ls -alh ${CSV_PREFIX}.batch_*.csv
echo "Created ${RUN_DIR} with:"
ls -alh ${RUN_DIR}/*.csv

0 comments on commit a11c76d

Please sign in to comment.