TransWikia.com

If statement in dynamic cluster query

Mathematica Asked by mrtydn on March 2, 2021

I use a High-Performance Cluster for some of my work. I can dynamically see the state of the work but I couldn’t use the If statement in the cluster query. I want to hear a sound when my work finishes.

My code follows. First I can see the state of the work then I convert it to a String and it is counted. If t2 is not equal to 68, that means the work is finished. But it didn’t work. Do you have any other ideas?

Dynamic[RemoteRunProcess[remote, "squeue -u21", 
   "StandardOutput"], UpdateInterval -> 10] // Framed
t2 = Dynamic[
  StringCount[
   ToString[
    RemoteRunProcess[remote, "squeue -u21", 
     "StandardOutput"]], _?LetterQ], UpdateInterval -> 10]
If[t2 != 68, EmitSound[Sound@SoundNote[0]]]

Add your own answers!

Ask a Question

Get help from others!

© 2024 TransWikia.com. All rights reserved. Sites we Love: PCI Database, UKBizDB, Menu Kuliner, Sharing RPP