hbatch parser

General discussions and questions.
Post Reply
keyframe
Posts: 62
Joined: Sat Jan 21, 2017 9:43 pm
Location: Toronto

hbatch parser

Post by keyframe »

Heya,

We use ALFRED style progress in hbatch when logging output... below is a sample:

Code: Select all

ALF_PROGRESS 1%
17:49:29 geometry1 frame 1001 (1 of 120)
ALF_PROGRESS 2%
17:49:30 geometry1 frame 1002 (2 of 120)
ALF_PROGRESS 3%
17:49:33 geometry1 frame 1003 (3 of 120)
ALF_PROGRESS 3%
17:49:36 geometry1 frame 1004 (4 of 120)
ALF_PROGRESS 4%
17:49:39 geometry1 frame 1005 (5 of 120)
ALF_PROGRESS 5%
I adjusted the hbatch.py parser's regex to:

p = re.compile(".*(?:ALF_PROGRESS (\d+))", re.S)

but it does not appear to be reporting correctly. Is there anything else I should be modifying?

G
--
Rocky Linux 8.5, cgru 3.2.1
User avatar
timurhai
Site Admin
Posts: 911
Joined: Sun Jan 15, 2017 8:40 pm
Location: Russia, Korolev
Contact:

Re: hbatch parser

Post by timurhai »

Hi!

Strange, it should work. Try to test expression and the output line just in a Python console - this check is much faster.
Then, if it works, try to print() all intermediate results and watch afrender process output to trace parser work.
You can also take a look at mantra parser, it works with ALF_PROGRESS too:
https://github.com/CGRU/cgru/blob/maste ... /mantra.py

btw,
Afanasy parser has not only percent property, it has frame and percentframe properties:
https://github.com/CGRU/cgru/blob/maste ... ser.py#L18

As i see in your output, you are catching frame, not a frame percentage. If frames per task are set correctly and a parser caught frame number, it can calculates a total percent itself:
https://github.com/CGRU/cgru/blob/maste ... tch.py#L43
And this keyframe is used for it:
https://github.com/CGRU/cgru/blob/maste ... atch.py#L7

So better you to fix your hbatch output, this way there is no need to fix native parser.

If afserver knows frames per task and frame, you can use sub-task dependence:
https://cgru.readthedocs.io/en/latest/a ... endsubtask
https://cgru.readthedocs.io/en/latest/s ... dependence
And start to render not finished simulation.
Timur Hairulin
CGRU 3.3.1, Ubuntu 20.04, 22.04, MS Windows 10 (clients only).
Post Reply