12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849 |
- @echo off
- setlocal EnableDelayedExpansion
- set "startTime=%time: =0%"
- 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
- 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
- set "endTime=%time: =0%"
- 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)"
- 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%
|