Question

IMAE runs slow

  • 26 April 2024
  • 7 replies
  • 73 views

I’m changing four different parameters to find the highest efficency in an optical system.

For this I have build a four layer loop that runs the comand IMAE and do some calculations using the returned value and the pramaters. Hovever zemax doesn’t seem to use the full processor capacity only about 7%.

If I instead use the comand IMA to run the geometric image analyze  the processor runs at full speed and the command runs more than 10x faster. Hovever I cant find any way to read out the data “Total flux” 
 


7 replies

Userlevel 3
Badge

If you are running the analysis using a script, e.g., ZPL, then it will be limited to single-core performance. Using IMAE in the merit function may be faster as it could be multi-threaded.

If you reduce the IMAE sampling, it will run quicker. Use the SAVE button to store those settings when calling IMAE in the merit function or for the macro.

If you can use the merit function, why not use the optimizer to try and find the best solution given your 4-d parameter space?

Userlevel 3
Badge

Just another thought, I’m aware of IMA and that, as opposed to IMAE, it is saving the graphics output of the Geometric Image Analysis. I’m not sure why IMA would run much faster than IMAE as I would think they could be running the same thing. IMAE will always run the “Sport Diagram” for show which is typically slower. IMA can run any of the show options and that may be why it is fast depending on what you have saved. That doesn’t explain the processor utilization difference though...

Thank you for your respond, if wrote a little  macro to show three different technics to get the efficency and the time they take to execute. These are the results when executing att different number of rays.  When the number of rays are less than ca 300, the filehandling and readout using “update” or “ima” take longer time. If start the windows taskmanager and set the number of rays to 100000x1000 you can clearly see that processor usage clearly decrease when IMAE starts

result 100000x1000rays:
ima: 0,4882 time:5,1090s
update: 0,4882 time:5,1720s
imae: 0,4883 time:95,9220s

result 10000x1000rays:
ima: 0,4881 time:0,6560s
update: 0,4880 time:0,6870s
imae: 0,4880 time:6,2340s

result 1000x1000rays:
ima: 0,4878 time:0,2030s
update: 0,4887 time:0,2660s
imae: 0,4876 time:0,6250s

result 100x1000rays:
ima: 0,4907 time:0,1400s
update: 0,4863 time:0,1880s
imae: 0,4871 time:0,0780s

 

!time for IMA
timer
A$ = $TEMPFILENAME()
GETTEXTFILE A$, Ima
OPEN A$
for n,0,13,1
 readskip -1
next
readskip 34
read_locale t
print "ima: ",t," time:",etim(),"s"

!time for update
timer
update 1
savewindow 1, c:\data\lob.txt
open c:\data\lob.txt
for n,0,13,1
 readskip -1
next
readskip 34
read_locale t
print "update: ",t," time:",etim(),"s"

!time for imae
timer
t=imae(0)
print "imae: ",t," time:",etim(),"s"

Running the spotdiagram seems to take a loooong time. Do you think there is any way to inherit the spot diagram run.

seems unnecessary to get the efficency value. 

Spot diagram does seem to take the longest of the Show options in the settings. Other show options also report the efficiency so it seems that there should be a way to get the efficiency value without spot diagram. I’ll do a little research to see if I can find an answer too as this is a good question. The first place I would look would be to see if it could be calculated easily from the IMA results.

Thank you Dennis

I have found ways to make my calculations with IMA even though it’s not realy straight forward.

If I could wish i would like to have an Siulation Command  and  an  IMAE comand  simular to the NSC NSTR-NSDD.

If  I could wish more I would like the IMAE and NSDD to have a ROI-option so I can examine different ROI within the same simulation/raytracing

Reply