Batch file scripting is brand new to me, so please be patient with me...
In order to run calculations in a program called GULP on a windows (10, 64-bit) environment, I use the .bat file that has the following form:
Code: Select all
gulp.exe < input-1.dat > output-1.out
gulp.exe < input-2.dat > output-2.out
gulp.exe < input-3.dat > output-3.out
.
.
.
gulp.exe < input-5076.dat > output-5076.out
This .bat file is found in the same folder as both the GULP executable (gulp.exe) the .dat input files [simple text files] being passed into the executable.
These calculations should be relatively quick in running (minutes at the most). Many will terminate "because of an error". Unfortunately however, some of the calculations will hang (for unknown reasons)...currently, when this occurs, I manually kill the whole batch command...which, means I have to keep an eye on how the calculations are progressing and cannot simply leave them running (e.g. overnight)
Thus, I am looking for a way of automatically killing the gulp.exe executable if it has been running for 20mins, in a way that enables the next calculation in the list still runs.
i.e. if calculation 2 hangs, kill it and run calculation 3
Ideally, the number of the killed calculation - obtained from the input/output filenames - would be written to a new text file.
Any pointers as to how this may be achieved would be very gratefully received
Regards,
GilesTRAbbit