Update the simulation status, max time remaining, and the progress over python in job manager CAD

    • d08941008

      Hi, I'm working on the user-defined "" for optimization(or sweep) job scheduler in CAD-free (without GUI) linux operating system. I noticed that in the .py file (*Lumericalv211scriptsjob_schedulers*) there's a line calling print like this: print(' RUNNING ') or print(''). I'm guessing that it's for the update of the simulation situation shown in the CAD of job manager on the local PC. Given the information such as max time remaining, autoshutoff, and %progress can be extracted by downloading the "*_p0.log" file back to the local from the cluster and by the usage of str.split() over python, I'd like to update them shown in the CAD of job manager on local PC but I'm not sure how to manage the communication between the CAD and python. Is it something like "print(0.87)", "print(8 mins, 7 secs)", or "print(87%)", along with the syntax "sys.stdout.flush()"?


    • Greg Baethge
      Ansys Employee

      Thanks for posting your question. This is not much documented on our side, so I'm not too sure what is possible and what is not. That said, I had a look at the other scheduler scripts, and I noted a function that is not present in ""
      def update_progress_from_stdout_file(job_name, job_id, prev_log_lines)
      This function reads sdtout and "feeds" the progress in the job manager. Schedulers like Slurm will forward sdtout to a file and this is the file the script reads to get the progress. From what I understand, by default, Torque doesn't update the file until the end of the job.
      What you suggest could work with FDTD only, as the simulation progress are stored in the log file. In your script, you would have to load only the lines like:
      0.00800595% complete. Max time remaining: 6 mins, 24 secs. Auto Shutoff: 1
      So you'd have to transfer the log file back to your local PC, and extract the lines in a functions as above.
    • d08941008
      Thanks for the answer. I'll try the script line.
Viewing 2 reply threads
  • You must be logged in to reply to this topic.