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

Re: [HTCondor-users] Function macro - matching files



You canât have a queue statement inside an If statement.

 

You have âmatching files matching filesâ which is not valid syntax

 

You should be aware that */*  will only work on platforms where the underlying OS supports it,

In the general case only a single * is allowed, but I think most Linux platforms do support */*,

so this might work for you.

 

One way to do what you want is to put the path pattern into a temporary variable like this

 

SINGLE_VIDEO = True

if $(SINGLE_VIDEO)

    PATH_SPEC = $(PATH)/*/*.$(EXTENSION)

else

    PATH_SPEC = $(PATH)/*.$(EXTENSION)

endif

Queue VIDEO matching files $(PATH_SPEC)

 

Or you can use the output of a script as the list of files, like this

 

queue VIDEO from /bin/sh -c /bin/ls $(PATH)/*.$(EXTENSION) |

 

-tj

 

 

From: HTCondor-users <htcondor-users-bounces@xxxxxxxxxxx> On Behalf Of JoÃo BaÃto
Sent: Tuesday, April 16, 2019 12:24 PM
To: HTCondor-Users Mail List <htcondor-users@xxxxxxxxxxx>
Subject: [HTCondor-users] Function macro - matching files

 

Hi,

 

I'm trying to use the matching files function macro but it doesn't seem to accept what I'm doing.

 

What I want to do is, based on the value of a variable, the _expression_ passed to the matching files is modified. I tried using an if else block that queues jobs but when testing with dry-run it fails with "submit file: endif without matching if" which makes sense but I don't know to avoid this issue.

 

EXTENSION = avi

SINGLE_VIDEO = True

if $INT(SINGLE_VIDEO)

    queue VIDEO matching files matching files ($(PATH)/*/*.$(EXTENSION))

else

    queue VIDEO matching files matching files ($(PATH)/*.$(EXTENSION))

endif

 

Any idea on how to make this work?

 

Cheers,

 

JoÃo BaÃto

---------------

Scientific Computing and Software Platform

Champalimaud Research
Champalimaud Center for the Unknown
Av. BrasÃlia, Doca de PedrouÃos
1400-038 Lisbon, Portugal

fchampalimaud.org