[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [HTCondor-users] Regular Expressions in -constraint



Thanks again Christoph, that seems like a step in the right direction.

C:\Users\ONM>condor_q -const " regexp(""lidarMatching"", JobBatchName, ""i"") "

-- Schedd: Host : <IP:PORT?... @ 11/06/19 09:19:07
OWNER    BATCH_NAME                                 SUBMITTED   DONE   RUN    IDLE   HOLD  TOTAL JOB_IDS
<userid>     191105105207_lidarMatching_DAG.dag+1243  11/5  10:52    263      _      1      _    265 2067.0
<userid>     191105105312_lidarMatching_DAG.dag+1250  11/5  10:53    262      5      8      _    276 2036.0 ... 2048.0
<userid>     191105105631_lidarMatching_DAG.dag+1265  11/5  10:56    263      _     18      _    283 2049.0 ... 2066.0

Total for query: 32 jobs; 0 completed, 0 removed, 27 idle, 5 running, 0 held, 0 suspended
Total for all users: 32 jobs; 0 completed, 0 removed, 27 idle, 5 running, 0 held, 0 suspended

Kind Regards,
Mark

-----Original Message-----
From: Beyer, Christoph <christoph.beyer@xxxxxxx> 
Sent: Wednesday, November 6, 2019 9:07 AM
To: O'NEAL Mark <mark.oneal@xxxxxxxxxxx>
Cc: htcondor-users <htcondor-users@xxxxxxxxxxx>
Subject: Re: [HTCondor-users] Regular Expressions in -constraint

This email is not from Hexagonâs Office 365 instance. Please be careful while clicking links, opening attachments, or replying to this email.


hi,

jep, you are right, sorry this is not my speciality at all :(

Though this works for me:

[root@bird-htc-sched13 spool]# condor_q -const 'regexp("dl_4j3b_blr_transformed_IN_H2_tag_bin1",jobbatchname,"i")'

-- Schedd: bird-htc-sched13.desy.de : <131.169.223.41:26735> @ 11/06/19 15:03:08
OWNER    BATCH_NAME                                SUBMITTED   DONE   RUN    IDLE  TOTAL JOB_IDS
<userid> dl_4j3b_blr_transformed_IN_H2_tag_bin1  11/6  14:53      _      _      2      2 21929468.0 ... 21929556.0

Total for query: 2 jobs; 0 completed, 0 removed, 2 idle, 0 running, 0 held, 0 suspended Total for all users: 47099 jobs; 0 completed, 1600 removed, 41630 idle, 3607 running, 262 held, 0 suspended

Maybe you can try it with the exact string first to see if you got the regex overall syntax right and then work your way through the regexpart itself ?

Best
Christoph

--
Christoph Beyer
DESY Hamburg
IT-Department

Notkestr. 85
Building 02b, Room 009
22607 Hamburg

phone:+49-(0)40-8998-2317
mail: christoph.beyer@xxxxxxx

----- UrsprÃngliche Mail -----
Von: "O'NEAL Mark" <mark.oneal@xxxxxxxxxxx>
An: "Christoph Beyer" <christoph.beyer@xxxxxxx>, "htcondor-users" <htcondor-users@xxxxxxxxxxx>
Gesendet: Mittwoch, 6. November 2019 13:56:48
Betreff: RE: [HTCondor-users] Regular Expressions in -constraint

Hi Christoph,

Thanks for your comments.

I thought something similar at first, but the regexp example in the manual:
https://eur02.safelinks.protection.outlook.com/?url=https%3A%2F%2Fhtcondor.readthedocs.io%2Fen%2Fv8_8_4%2Fmisc-concepts%2Fclassad-mechanism.html%23querying-with-classad-expressions&amp;data=02%7C01%7C%7Cc38f378642c641e356d208d762c29b99%7C1b16ab3eb8f64fe39f3e2db7fe549f6a%7C0%7C1%7C637086460283412963&amp;sdata=CBuxliWThP1VvSKm%2F6fRR02%2FtabU3LAX3F6l7ddfzp8%3D&amp;reserved=0

shows passing the attribute Name rather than '$Name'.

I did test it anyway:
condor_q -nobatch -const " regexp(""([0-9]+)(_)([A-Za-z]+)"", '$JobBatchName', ""\3"") "

and no jobs are returned.

Regards,
Mark

-----Original Message-----
From: Beyer, Christoph <christoph.beyer@xxxxxxx>
Sent: Wednesday, November 6, 2019 1:46 AM
To: HTCondor-Users Mail List <htcondor-users@xxxxxxxxxxx>
Cc: O'NEAL Mark <mark.oneal@xxxxxxxxxxx>
Subject: Re: [HTCondor-users] Regular Expressions in -constraint

This email is not from Hexagonâs Office 365 instance. Please be careful while clicking links, opening attachments, or replying to this email.


Hi,

interesting need to try that myself but out of the too of my head: you surely need to put '$JobBatchName' otherwise you try to match the string and not the variable ?

Best
Christoph


--
Christoph Beyer
DESY Hamburg
IT-Department

Notkestr. 85
Building 02b, Room 009
22607 Hamburg

phone:+49-(0)40-8998-2317
mail: christoph.beyer@xxxxxxx


----- UrsprÃngliche Mail -----
Von: O'NEAL Mark via HTCondor-users <htcondor-users@xxxxxxxxxxx>
An: htcondor-users@xxxxxxxxxxx
CC: O'NEAL Mark <mark.oneal@xxxxxxxxxxx>
Gesendet: Wed, 06 Nov 2019 07:01:03 +0100 (CET)
Betreff: [HTCondor-users] Regular Expressions in -constraint

Hello,

I'm trying out the regular expression functionality of HTCondor's ClassAd mechanism, and have a question for some behavior I don't yet understand.

As background, I would eventually like to utilize a portion of the JobBatchName attribute as a Requirement for matching jobs with machines.

To test how this might work, I'm using condor_q to learn.  HTCondor 8.8.4 running on Windows.

To identify the JobBatchName:
condor_q -nobatch -format %s\n JobBatchName

returns:
191105105207_lidarMatching_DAG.dag+1243

The string 'lidarMatching' in the JobBatchName is the portion of interest.

I have constructed a regular expression which I think is successfully matching on JobBatchName:
condor_q -nobatch -constraint " regexp(""([0-9]+)(_)([A-Za-z]+)"", JobBatchName) "

as it will return all queued jobs with a JobBatchName formatted like above.

I try to confirm that I am capturing 'lidarMatching' in the way I expect the regexp should be working:
condor_q -nobatch -constraint " regexp(""([0-9]+)(_)([A-Za-z]+)"", JobBatchName, ""\3"") == ""lidarMatching"" "

but this command doesn't return any jobs.

Could someone point to a way with condor_q or other command line to simply 'print' what is matched by the different regexp capture groups?

Thanks and Regards,
Mark