File indexing completed on 2026-04-27 07:41:45
0001
0002
0003
0004 echo "Running on $(hostname)"
0005 echo "Start time: $(date)"
0006
0007 if [ $
0008 echo "[ERROR] Usage: $0 '<stf_json>'"
0009 exit 1
0010 fi
0011
0012 STF_JSON="$1"
0013
0014 echo "[INFO] Received STF JSON:"
0015 echo "$STF_JSON"
0016
0017
0018 if ! command -v jq &>/dev/null; then
0019 echo "[ERROR] jq is not installed!"
0020 exit 1
0021 fi
0022
0023
0024 RUN_ID=$(echo "$STF_JSON" | jq -r '.run_id')
0025 FILENAME=$(echo "$STF_JSON" | jq -r '.filename')
0026 STATE=$(echo "$STF_JSON" | jq -r '.state')
0027 SUBSTATE=$(echo "$STF_JSON" | jq -r '.substate')
0028
0029 echo "[INFO] Processing Agent Dataset Metadata:"
0030 echo " Run ID: $RUN_ID"
0031 echo " Filename: $FILENAME"
0032 echo " State: $STATE"
0033 echo " Substate: $SUBSTATE"
0034
0035
0036 echo "[INFO] Starting dataset-based STF processing for run $RUN_ID..."
0037
0038
0039
0040
0041
0042 echo "[INFO] Simulating dataset processing (all STF files in run)..."
0043 sleep 3
0044
0045
0046 cat > myout.txt <<EOF
0047 STF Dataset Processing Results
0048 ==============================
0049 Processing completed at: $(date)
0050 Hostname: $(hostname)
0051
0052 Dataset Processing Details:
0053 Run ID: $RUN_ID
0054 Dataset Filename: $FILENAME
0055 Processing State: $STATE
0056 Processing Stage: $SUBSTATE
0057
0058 Processing Mode: Dataset-based (entire run processed as one job)
0059 Processing Status: SUCCESS
0060 Output Files Generated: myout.txt
0061
0062 Notes:
0063 - This job processes all STF files collected for run $RUN_ID
0064 - Files were gathered by the processing agent during data_ready messages
0065 - Dataset was closed at end_run and submitted as single PanDA job
0066
0067 Full JSON Input:
0068 $STF_JSON
0069 EOF
0070
0071 echo "[INFO] Dataset processing completed successfully"
0072 echo "[INFO] Output written to myout.txt"
0073 echo "Done at: $(date)"
0074
0075
0076 echo "[INFO] Output file contents:"
0077 cat myout.txt