Skip to content

feat: use arrow for datetimes and standardize output block#56

Open
qibinlei wants to merge 18 commits into
usatlas:mainfrom
qibinlei:feat/useArrowForDatetimes
Open

feat: use arrow for datetimes and standardize output block#56
qibinlei wants to merge 18 commits into
usatlas:mainfrom
qibinlei:feat/useArrowForDatetimes

Conversation

@qibinlei
Copy link
Copy Markdown
Contributor

@qibinlei qibinlei commented May 3, 2026

  • Created a new file benchmark_utils.sh which has a function that appends a benchmark block into all output logs
  • Updated parser to use arrow package in python
  • Updated parser to scrape benchmark block (reducing amount of handlers needed)

@qibinlei qibinlei changed the title Feat/use arrow for datetimes feat: use arrow for datetimes and standardize output block May 3, 2026
Comment thread EVNT/BNL/CentOS7/centos_cron.sh
Comment thread parsing/handlers/base_parser.py Outdated
"runTime": run_time,
"status": status,
"submitTime": start_dt.int_timestamp * 1000, # milliseconds
"queueTime": 0,
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
"queueTime": 0,
"queueTime": queueTime,

Comment thread parsing/handlers/base_parser.py Outdated
"status": status,
"submitTime": start_dt.int_timestamp * 1000, # milliseconds
"queueTime": 0,
"runTime": wall_time,
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

why is this wall_time and not end_time_utc - start_time_utc? The logic should be inside the parsing.

Comment thread Rucio/rucio_script.sh
# shellcheck disable=SC1091
# shellcheck disable=SC2115
source "${ATLAS_LOCAL_ROOT_BASE}"/user/atlasLocalSetup.sh -c el9 -m "${2}" -r "export RUCIO_ACCOUNT=jroblesg && \
source "${ATLAS_LOCAL_ROOT_BASE}"/user/atlasLocalSetup.sh -c el9 -m "${2}" -r "export RUCIO_ACCOUNT=qlei && \
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

need @qibinlei 's voms credentials added as secrets to af-benchmarking

@kratsg kratsg force-pushed the feat/useArrowForDatetimes branch from b543db4 to 35b246d Compare May 4, 2026 23:01
@kratsg kratsg changed the base branch from feat/useArrowForDatetimes to main May 4, 2026 23:03
kratsg and others added 13 commits May 4, 2026 16:04
- Replace wall_time_sec with end_time_utc - start_time_utc for runTime
- Use queue_time variable instead of hardcoded 0 for queueTime
- Add benchmark_utils.sh shared shell utilities for benchmark scripts

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
append_benchmark now takes (log_file, start_time, end_time, mode) —
wall_time_sec is no longer written to the BENCHMARK block since
parsers derive run time from end_time_utc - start_time_utc directly.

Removes start_epoch, end_epoch, and wall_time variables from all
21 run scripts and drops the wall_time_sec field from benchmark_utils.sh.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
All job types now use the BENCHMARK block approach via base_parser.py.
Remove handlers/ subdirectory and all per-type parsers (evnt, truth3,
rucio, coffea, eventloop, fastframes), ParsingClass from base/, and
text_utils.py which had no remaining callers.

Move base_parser.py to parsing/ root and update ci_parse.py import.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Loads coffea, eventloop, and fastframes photon pT histograms and prints
an integral/ratio summary and saves an overlay plot with a ratio panel.

Highlights the key difference: coffea/eventloop apply an event-level
tightID cut while fastframes fills underflow for events with no tightID
photon via sorted ph1_pt1_NOSYS.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Replace uproot + numpy + matplotlib with PyROOT — available on all
ATLAS analysis facilities without extra installs. Output default
changed to PDF (vector, better for publication).

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
- benchmark_utils.sh: reorder append_benchmark params so mode is last
  (new signature: log_file start end [setup_start] [setup_end] [mode])
  and read SUBMIT_TIME from env for queue-time tracking via HTCondor
- base_parser.py: parse submit_time_utc (→ submitTime ms, queueTime s)
  and setup_start/end_time_utc (→ setupTime s) using arrow
- payload.schema.json: add optional setupTime field
- All 21 run scripts (EVNT, TRUTH3, NTuple_Hist, Rucio):
  - Container scripts: capture setup_start before export
    ATLAS_LOCAL_ROOT_BASE, write SETUP_COMPLETE marker inside -r string
    after asetup/lsetup, grep it after container exits for setup_end
  - Native scripts: capture setup_start/setup_end around
    atlasLocalSetup + asetup/lsetup before payload command
  - Rucio: records setupTime=0 (start_time used for both bounds)

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Slight clock differences between submit host and worker node can
produce negative values from timestamp arithmetic, violating the
schema's minimum: 0 constraint. Added max(0, ...) guards for both.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
The sourced benchmark_utils.sh uses an absolute cluster path that
doesn't exist locally, causing false SC1091 failures in shellcheck.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
@qibinlei qibinlei requested a review from kratsg May 21, 2026 01:34
Qi Bin Lei and others added 3 commits May 21, 2026 15:28
The 11 HTCondor .sub files pointed Executable at
/usatlas/u/qlei/dev/af-benchmarking/... while every BNL shell script
sourced and referenced /usatlas/u/qlei/AF-Benchmarking/. This mismatch
meant HTCondor launched executables from a different checkout than the
one the scripts internally relied on.

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants