|
@@ -0,0 +1,49 @@
|
|
|
+@echo off
|
|
|
+REM run on hpc
|
|
|
+
|
|
|
+setlocal EnableDelayedExpansion
|
|
|
+set "startTime=%time: =0%"
|
|
|
+
|
|
|
+REM path %path%;
|
|
|
+REM"C:\Program Files\Lumerical\FDTD\bin\fdtd-engine" -t 32 template-dipole-on-sphere-on-surf-z.fsp
|
|
|
+
|
|
|
+echo Write hostname to temp folder file
|
|
|
+set host=%COMPUTERNAME%
|
|
|
+echo %host% > %TEMP%\hostname.txt
|
|
|
+
|
|
|
+echo Preinit exec.bat
|
|
|
+echo exit /b 1 > %host%exec.bat
|
|
|
+
|
|
|
+echo Before loop
|
|
|
+:loop
|
|
|
+REM random timeout 10 seconds
|
|
|
+ echo random wait
|
|
|
+ set /a timeout=%RANDOM% * 11 / 32768
|
|
|
+ start /wait timeout %timeout%
|
|
|
+ echo %TEMP% > temppath.txt
|
|
|
+ echo execute Lumerical script
|
|
|
+ "C:\Program Files\Lumerical\FDTD\bin\fdtd-solutions" -nw -run create_hpc_bat.lsf
|
|
|
+ echo Run local exec.bat
|
|
|
+ call %host%exec.bat
|
|
|
+if !errorlevel! gtr 0 goto loop
|
|
|
+
|
|
|
+echo after loop
|
|
|
+
|
|
|
+REM mpiexec -n 16 python Si_cylinder_on_Al2O3_substrate.py
|
|
|
+REM python Si_cylinder_on_Al2O3_substrate.py
|
|
|
+
|
|
|
+
|
|
|
+set "endTime=%time: =0%"
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+rem Get elapsed time:
|
|
|
+set "end=!endTime:%time:~8,1%=%%100)*100+1!" & set "start=!startTime:%time:~8,1%=%%100)*100+1!"
|
|
|
+set /A "elap=((((10!end:%time:~2,1%=%%100)*60+1!%%100)-((((10!start:%time:~2,1%=%%100)*60+1!%%100)"
|
|
|
+
|
|
|
+rem Convert elapsed time to HH:MM:SS:CC format:
|
|
|
+set /A "cc=elap%%100+100,elap/=100,ss=elap%%60+100,elap/=60,mm=elap%%60+100,hh=elap/60+100"
|
|
|
+
|
|
|
+echo Start: %startTime%
|
|
|
+echo End: %endTime%
|
|
|
+echo Elapsed: %hh:~1%%time:~2,1%%mm:~1%%time:~2,1%%ss:~1%%time:~8,1%%cc:~1%
|