Depending upon how heavily optimized a program you are using is, it can run only on machines equipped with one or more processors having certain properties. You have several options to determine whether an execution host is usable by your program:

  • Test for the support of certain calls with little helper programs, from inside your job script, like this one, testing for 64-bit pointers:
main() { static int test_array[sizeof (int *) == 8 ? 1 : -1]; }

This code compiles cleanly if pointers are of length 8, i.e., 64 bit, and fails otherwise.

Another example: Test for the presence of the Intel SSSE3 vectorization engine with this program and compile/use a program accordingly:

#include <stdlib.h>
#include <signal.h>
void catch() { exit(1); }
main() {
    signal(SIGILL, catch);
    __asm__ volatile ("pabsd %%xmm0, %%xmm0":::"memory");
}

This code returns 0 if the PABSD instruction, part of the SSSE3 instruction set, is supported, and returns 1 otherwise.

  • Test for the name of the processor: The shell command
sysctl -n machdep.cpu.brand_string

returns the processor’s name and other information for identification.