Jim Baddoo
|
Passing flag args to pterm, when pterm is spawned.
|
Jim Baddoo
09/25/2012 11:39 AM
post95790
|
Passing flag args to pterm, when pterm is spawned.
I have a command file that executes the following command:
pterm -z on -C 1 ./MyApp
This has the effect of launching pterm, and then MyApp is launched within pterm by 'on' - in other words, it's as if one
had typed into a pterm shell
on -C 1 ./MyApp.
I can verify subsequently that all of the threads within 'MyApp' have been constrained to run on core 1 (of a multi-
core) CPU.
I have a number of applications I wish to launch using a programme that reads, from a text file: (1) the application
name (2) the core to which is should be constrained to run.
I've constructed the equivalent text string, and pass this string to spawn() in the argv[] array.
The pterm is launched, but it displays an error message:
Cannot start program 'on -C 1 ' (No such file or directory)
If I try to supply additional args that are valid for pterm (e.g. pterm -z -r ), followed by 'on -C 1 ./MyApp' the error
message is:
pterm: illegal option --
Does anyone know how I can use spawn to replicate the command string that I've shown to work from within a batch file?
Thanks in advance.
|
|
|