Limit number of threads to 30 bits (same as GUPC).