exit code from pgaccelinfo (9.0-4)

I wanted to put pgaccelinfo in a script and so checked its exit code as part of the sanity checking. The exit code was 192. Does this mean anything and/or how do you interpret it?

(2 C1060 cards in this machine, if that helps)

Hi tonycurtis,

Does this mean anything

Nope, right now it’s meaningless. I’ll get our engineers to update it so that it returns “0” if it finds an accelerator or “1” if it encountered an error or no accelerators were found.

We’ve missed the 10.1 release, so look for it in 10.2 next month.

Thanks,
Mat

Nope, right now it’s meaningless.

I suspected that, but was being polite :-)

Also, a 1-line-per-card summary format would be nice for scripting purposes.

Also, a 1-line-per-card summary format would be nice for scripting purposes.

Sure I can put a request in. Just to clear, can you post a simple example of what format you’d like?

Thanks,
Mat

I was thinking just something like

0 Tesla C1060
1 Tesla C1060

although if you wanted to get all fancy and stuff, a % formatting string could be nice too, e.g.

pgaccelinfo --short "%n %d"

could mean the same as above (device number, description).

Thanks, I added feature request as TPR#16438 and sent it to our engineers.

  • Mat

Hi Tonycurtis,

As of 10.2, pgaccelinfo will return “0” if it was able successfully detect that the system has a functioning accelerator. It returns non-zero for errors and if no accelerator was found.

We’ve also add the “-short” (“-s”) and “-quiet” (“-q”) flags:

System with accelerator with 4 Tesla cards:

% pgaccelinfo -help
pgaccelinfo [options]
Options include:
  -all    - show accelerators of all types (default)
  -amd    - show AMD/ATI accelerators
  -ati    - same as -amd
  -help   - show this help information
  -nv     - same as -nvidia
  -nvidia - show NVIDIA accelerators
  -quiet  - no output, just return code
  -short  - brief output, one line
  -v      - show additional information for accelerators not found
% pgaccelinfo -short
0 Tesla T10 Processor
1 Tesla T10 Processor
2 Tesla T10 Processor
3 Tesla T10 Processor
% pgaccelinfo -quiet
% echo $?
0

System without an accelerator:

% pgaccelinfo
No accelerators found.
Try pgaccelinfo -v for more information
% echo $?
1

Also, in the “etc/samples” directory, the “cufinfo.cuf” sample code contains the simplified CUDA Fortran version of pgaccelinfo.

Thanks for the suggestion,
Mat