Mailing List Archives
Authenticated access
|
|
|
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [HTCondor-users] $(PROCESS) - enumerate it?
- Date: Wed, 20 Sep 2017 14:14:28 +0000
- From: John M Knoeller <johnkn@xxxxxxxxxxx>
- Subject: Re: [HTCondor-users] $(PROCESS) - enumerate it?
To a computer person, starting from 0 makes the more sense. Having the procid be the same as the number of procs that come before it has some useful mathematical properties. The decision to start at 0 was made about 30 years ago, and at this point it would be very disruptive to change it.
-----Original Message-----
From: HTCondor-users [mailto:htcondor-users-bounces@xxxxxxxxxxx] On Behalf Of lejeczek
Sent: Wednesday, September 20, 2017 3:16 AM
To: HTCondor-Users Mail List <htcondor-users@xxxxxxxxxxx>
Subject: Re: [HTCondor-users] $(PROCESS) - enumerate it?
On 19/09/17 18:48, John M Knoeller wrote:
> you can do this, but due to some limitations in the parser for the $() expansion stuff, you have to use a temporary variable.
>
> Add this to your submit file
>
> OutputId = $(Process)+1
> output = $INT(OutputId)
>
> Note that Process is an alias for ProcId. They both evaluate to the same thing, but ProcId is the actual attribute name that you see when you use condor_q -long. so the preferred form is this
>
> OutputId = $(ProcId)+1
> output = $INT(OutputId)
>
> the $INT() macro expansion has an optional second argument that you can use to control the formatting, the main use for this is to get leading zeros. for instance this:
>
> tmp = $(ProcId)+1
> output = $INT(tmp,%04d)
>
> will produce the sequence 0001, 0002, 0003, etc
>
> But leading an trailing characters in the formatting are honored, so this
>
> tmp = $(ProcId)+1
> output = $INT(tmp,file_%04d)
>
> will produce the sequence file_0001, file_0002, file_0003, etc
>
> -tj
thanks a lot! btw, should not something like processes ids
start from 1 anyway?
I mean, to an amateur like myself even the sound of "first
process having number zero" does not vibrate right.
> -----Original Message-----
> From: HTCondor-users [mailto:htcondor-users-bounces@xxxxxxxxxxx] On Behalf Of lejeczek
> Sent: Tuesday, September 19, 2017 6:34 AM
> To: HTCondor Users Mailinglist <htcondor-users@xxxxxxxxxxx>
> Subject: [HTCondor-users] $(PROCESS) - enumerate it?
>
> hi all
>
> I'm reading docs on macros and I wonder(for I've not across
> yes) how to make something like: output = $(PROCESS)+1.
>
> Simple thought here I had was how to start enumerate from 1
> since very rarely in my setups anything would start with 0.
>
> many thanks,
> p.s. beginner here, so go easy on me.
>
>
> .
> _______________________________________________
> HTCondor-users mailing list
> To unsubscribe, send a message to htcondor-users-request@xxxxxxxxxxx with a
> subject: Unsubscribe
> You can also unsubscribe by visiting
> https://lists.cs.wisc.edu/mailman/listinfo/htcondor-users
>
> The archives can be found at:
> https://lists.cs.wisc.edu/archive/htcondor-users/
> _______________________________________________
> HTCondor-users mailing list
> To unsubscribe, send a message to htcondor-users-request@xxxxxxxxxxx with a
> subject: Unsubscribe
> You can also unsubscribe by visiting
> https://lists.cs.wisc.edu/mailman/listinfo/htcondor-users
>
> The archives can be found at:
> https://lists.cs.wisc.edu/archive/htcondor-users/
.
_______________________________________________
HTCondor-users mailing list
To unsubscribe, send a message to htcondor-users-request@xxxxxxxxxxx with a
subject: Unsubscribe
You can also unsubscribe by visiting
https://lists.cs.wisc.edu/mailman/listinfo/htcondor-users
The archives can be found at:
https://lists.cs.wisc.edu/archive/htcondor-users/