Intel® Fortran Compiler
Build applications that can scale for the future with optimized code designed for Intel® Xeon® and compatible processors.
28435 Discussions

How to batch run long run time executables and provide keyboard input???

Deleted_U_Intel
Employee
531 Views
I have developed an agent based model for the penetration of new technology into the automarket. Some of my analyses will require multiple runs to generate appropriate statistics. Depending on the number of agents employed in the model, the run time can be quite long for each. It would be quite nice to run the model from a batch file multiple times. However, my executable requires some input from the keyboard each run, e.g. Are you introducing Car A or Car B.

Question: Can I run my *.exe file from a batch file which would also provide the normal keyboard input?

Thank you!

John
0 Kudos
4 Replies
ZlamalJakub
New Contributor III
531 Views
I supopose You are using console application.

Long time ago I put keyboard input into my FORTRAN executables through text files:

let say I have text file keyboard.txt containing:
car a
testit
carb

then I run program.exe < keyboard.txt

and each time program.exe uses "read(*,*) variable"
it obtains from keyboard.txt text (or value) "car a", "testit" and "carb".

I hope it helps

Jakub Zlamal
0 Kudos
onkelhotte
New Contributor II
531 Views
I have developed an agent based model for the penetration of new technology into the automarket. Some of my analyses will require multiple runs to generate appropriate statistics. Depending on the number of agents employed in the model, the run time can be quite long for each. It would be quite nice to run the model from a batch file multiple times. However, my executable requires some input from the keyboard each run, e.g. Are you introducing Car A or Car B.

Question: Can I run my *.exe file from a batch file which would also provide the normal keyboard input?

Thank you!

John

Would a normal argument list do the job?

Look up GETARG in the help file for more informations.

Markus
0 Kudos
Steven_L_Intel1
Employee
531 Views
Or better, the standard GET_COMMAND_ARGUMENT.
0 Kudos
Jugoslav_Dujic
Valued Contributor II
531 Views
Or have I missed something?

John

Yes, that you can convert a string to a number using internal READ (and the other way round using internal WRITE).

Jugoslav
0 Kudos
Reply