NJOBIHTM(1) Retro Project Manual NJOBIHTM(1) NNAAMMEE njobihtm - number of jobs considering hyper-threading and memory SSYYNNOOPPSSIISS nnjjoobbiihhttmm [--hh] [--mm _n_n_n_[_M_G_]] [--vv] DDEESSCCRRIIPPTTIIOONN The standard system nnpprroocc(1) command is often used to determine the number of parallel jobs, e.g. in a 'make -j'. It simply returns the total number of available threads. On many processors with hyper- threading the usage of all hyper-threads is contra-productive and can lead to a reduction of the throughput. Experience showed that the op- timum throughput is reached when one quarter of the hyper-threads are used. If jobs require a substantial amount of memory this can also limit the number of parallel jobs. nnjjoobbiihhttmm determines the number of CPU-intensive jobs based on the num- ber of CPU and memory resources. The 'ihtm' stands for 'intelligent hy- per-threading and memory'. The script - determines the number of physical cores and the number of threads per core. - adds a quarter of the hyper-threads unless the --nn option is given. - if --mm is given, determines the memory size, assumes that at least one GB should be available for general usage, and limits the number of jobs accordingly. The number of jobs is written to _s_t_d_o_u_t, and can be used like nnpprroocc(1). OOPPTTIIOONNSS --nn ignore hyper-threads, use only physical cores. --mm _s_i_z_e gives the required physical memory per job. _s_i_z_e must be given as an integer with either an 'M' or 'G', indicating MB or GB. --vv the found system parameters and the reasoning is printed to _s_t_d_e_r_r. EEXXAAMMPPLLEESS mmaakkee --jj ``nnjjoobbiihhttmm`` aallll Start mmaakkee(1) with a reasonable number of jobs. nnjjoobbiihhttmm --vv --mm==22GG Determines the number of jobs with 2 GB memory per job. On a system with 4 cores and hyper-threading and 32 GB installed memory one gets due to the --vv the output #cpus: 8 #thread/cpu: 2 #cores: 4 #mem(MB): 31731 #job (cpus): 5 #job (mem): 14 5 Note that the --vv output goes to _s_t_d_e_r_r, only the answer '5' to _s_t_d_- _o_u_t. nnjjoobbiihhttmm --vv --nn --mm==33GG Determines the number of jobs with 3 GB memory per job. Only physi- cal cores are used. On a system with 4 cores and 32 GB installed memory one gets due to the --vv the output #cpus: 8 #thread/cpu: 2 #cores: 4 #mem(MB): 31731 #job (cpus): 4 #job (mem): 9 4 AAUUTTHHOORR Walter F.J. Mueller Retro Project 2022-06-03 NJOBIHTM(1)