} int tpc = atoi(argv[1]); int cps = atoi(argv[2]); int sps = atoi(argv[3]); int base = atoi(argv[4]); if (tpc < 1 || tpc > MAX_TPC || cps < 1 || cps > MAX_CPS || sps < 1 || sps > MAX_SPS) { fprintf(stderr, "Invalid value(s) specified in the command line
"); Print_Usage(argv); exit(EXIT_FAILURE); } int tot = sps * cps * tpc; if (base < 0 || base+tot-1 >= MAX_THR) { fprintf(stderr, "Invalid value specified for the base thread (%d). " "Expected [0, %d]
", base, MAX_THR-tot); Print_Usage(argv); exit(EXIT_FAILURE); } Print_Map(sps, cps, tpc, base); return EXIT_SUCCESS; } Note:  Example 9-6 on page 283 lists a revised version of the code that originally appeared  in Appendix D, “Applications and performance”, of  Implementing an IBM High-Performance  Computing Solution on IBM POWER8 , SG24-8263. The code was adjusted to better fit the  architecture of Power AC922 servers. To use the tool, first you must compile the code by using the C compiler of your choice. For  example, run the following command with the  gcc  compiler: $ gcc -o t_map t_map.c If you run the tool without any arguments, you are provided a brief hint about the usage, as  shown in the following example: $ ./t_map Invalid number of arguments (0). Expecting 4 arguments. Usage: ./t_map threads_per_core=[1-4] cores_per_socket=[1-22]  sockets_per_system=[1-2] base_thread=[0-176] The utility needs you to specify the following amounts and locations of resources that you  want to use: GLYPH<SM590000> Number of threads per core GLYPH<SM590000> Number of cores per socket GLYPH<SM590000> Number of sockets GLYPH<SM590000> The initial logical processor number (counting from zero) Chapter 9. Measuring and tuning applications  285