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

Re: [HTCondor-users] conditionals on condor_submit (complex)



Dear John,

Works perfectly! Many thanks. The command I ended up using (for future reference and google searches) was:

java_vm_args = $$([ IfThenElse(Opsys==\"LINUX\", \"-Dexecutor= [ENGINE]Â-Dday=$(DAY) -javaagent:aspectjweaver.jar -agentpath:/usr/lib/jvmquake.so [USERJAVAARGUMENTS]\", \"-Dexecutor=[ENGINE] -Dfeed=[FEED] -javaagent:aspectjweaver.jar [USERJAVAARGUMENTS]\" ) ])

Once again, thanks!

Frankie

----


On Fri, Feb 18, 2022 at 5:02 PM John M Knoeller <johnkn@xxxxxxxxxxx> wrote:
I don't think you want to use an if statement for this. ÂThe if statement will use the OpSys of the submit machine, but I think you want to use the OpSys of the execute machine instead.Â

To use the OpSys of the execute machine, you can use $$() expansion.Â

java_vm_args = $$([ IfThenElse(Opsys=="LINUX", "-agentpath:/var/lib/libjvmquake-linux-x86_64.so", "") ])

The $$([])Â is evaluated each time the job runs using attributes from the execute node that the job will run on.

-tj




From: HTCondor-users <htcondor-users-bounces@xxxxxxxxxxx> on behalf of frankie.lc@xxxxxxxxx <frankie.lc@xxxxxxxxx>
Sent: Thursday, February 17, 2022 7:05 PM
To: HTCondor-Users Mail List <htcondor-users@xxxxxxxxxxx>
Subject: [HTCondor-users] conditionals on condor_submit (complex)
Â
Hi,

I'm trying to submit a Java job that has different java_vm_args if on Linux.

universe = java
executable = fat-jar.jar
arguments = startFatJar
jar_files = fat-jar.jar

# if machine running is linux add an agentpath
if(OpSys == "LINUX")
  java_vm_args = -agentpath:/var/lib/libjvmquake-linux-x86_64.so
else
  java_vm_args =
endif

But it fails with this message:
$ condor_submit condor_job
Submitting job(s)
ERROR: on Line 9 of submit file: OpSys == "LINUX" is not a valid if condition because complex conditionals are not supported

Is there anyway around this?

Many thanks for the help,
Frankie

_______________________________________________
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/