1

I'm writing script at tcl on ICC and trying to get error message while sending ran to sung-grid.

For example, I have the below line.

sh /usr/bin/xterm -e "cd DM ; mqsub -int -parallel 200 cal -cal -t 200 CAL_header | tee S.log ; touch .S_finished" &

since I don't have 200 free cpu, If i execute this command line at linux shell I'll get the below message: "Your "qrsh" request could not be scheduled, try again later."

How can i catch this error message at ICC with & and the end of the command?

Thanks

Donal Fellows
  • 133,037
  • 18
  • 149
  • 215

2 Answers2

0

I assume, you are executing the shell command by means of using exec in tcl.

In that case, you could use catch statement to get identify the error message.

if { [catch {exec <your_shell_program_command_here>} result] } {
    puts "Following problem happened : $result"
    exit 1
} 

Syntax :

catch script ?varName?

Quoting the below from the man page

If script raises an error, catch will return a non-zero integer value corresponding to the exceptional return code returned by evaluation of script. Tcl defines the normal return code from script evaluation to be zero (0), or TCL_OK. Tcl also defines four exceptional return codes: 1 (TCL_ERROR), 2 (TCL_RETURN), 3 (TCL_BREAK), and 4 (TCL_CONTINUE). Errors during evaluation of a script are indicated by a return code of TCL_ERROR.

Dinesh
  • 16,014
  • 23
  • 80
  • 122
  • While trying to exec /usr/bin/xterm i get below message: Error: /usr/bin/xterm: /usr/bin/xterm: cannot execute binary file – user3835935 Dec 04 '14 at 12:05
0

Do you mean Synopsys ICCompiler by term ICC?

If there is any error regarding queue for launching the job for any EDA tool kindly prefer, the following way of launching.

{launch command for job (qsub *switches* ) } > & log &

this will eliminate the troubleshooting difficulties. Sorry for posting this question as answer but i am unable to comment

JigarGandhi
  • 243
  • 6
  • 18
  • Yes you right. I mean Synopsys ICCompiler. What is "launch command"? Can you write the full command established on my main message? – user3835935 Dec 04 '14 at 12:57
  • `qsub -P bnormal -l "project=msem,os_distribution=redhat,qsc=i,os_version=WS5.0,mem_free=8G" -v version_path=/remote/user/emll/tools/system//latest -o vnc_logs -cwd -A long /remote/user/emll/tools/system/latest/bin/ss > & log &` this is typical example of launch command – JigarGandhi Dec 04 '14 at 13:14
  • the `qsh` version must be set before launch of command. Since you tried to launch job with 200 free CPU and I cannot see they queue type. i suggest you to meet your local IT team and check about **"long" queue**. Usually long queue is preferred for such type of jobs – JigarGandhi Dec 04 '14 at 13:17
  • i think term is altered by using `setenv term xterm` or better write down the command in other file and source the file. use **shebang** as header of file if needed for all environment settings i.e. `#!/usr/bin/****` – JigarGandhi Dec 04 '14 at 13:34