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

Re: [HTCondor-users] Running Pyhton 3 jobs on different os



Werner,   you can do what you want using $$([]) substitution in the submit file.  
The $$() indicates that this to be expanded at match time with the match ad (basically the machine ad) in scope.
The [] inside indicates an for an arbitrary classad expression. The expression should evaluate to a string. 

So something like this

executable = $$([ifThenElse(OpSys=="WINDOWS", "c:/path/to/python.exe", "/usr/bin/python3")])
transfer_executable = false

-tj


-----Original Message-----
From: HTCondor-users <htcondor-users-bounces@xxxxxxxxxxx> On Behalf Of Thomas Hartmann
Sent: Monday, February 15, 2021 6:13 AM
To: HTCondor-Users Mail List <htcondor-users@xxxxxxxxxxx>; Werner Koppelstätter <Werner.Koppelstaetter@xxxxxx>
Subject: Re: [HTCondor-users] Running Pyhton 3 jobs on different os

Hi Werner,

no idea, if it works under Windows but I prefer for script shebangs 
under *ix

#!/usr/bin/env python3
(#! env python  ## should work "in principle")

maybe one could build something *ix and powershell compatible ~ `env 
python` ?

Cheers,
   Thomas

On 15/02/2021 09.55, Werner Koppelstätter wrote:
> Hi all,
> 
> We use HTCondor with python binding and has Windows and Linux 
> (Ubuntu) workstation in our cluster.
> Now we want run Python 3 jobs. The problem is that the command for 
> Python 3 on windows systems is "python" and for Linux system "python3".
> 
> Is there a possibility to define commands depending of the OS? For 
> example through an expression which is evaluated or a script before the 
> job starts?
> 
> 
> Thank you.
> 
> Regards,
> Werner
> 
> _______________________________________________
> 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/
>