How do you assign the number of cores via an ssh script?
Mostrar comentarios más antiguos
Hello,
i have a batch script file that is run on an ssh with the following format:
nohup matlab -nodesktop -nosplash -nodisplay <script_file.m>& output_script_file.txt &
I want to set the number of cores for the job to 6, seeing as the script_file.m uses a parfor loop. I know feature('numcores') will display the number of cores available, but I want to specifically assign the number of cores. Is this done through the batch script file, and if so how? If not, how can I assign the number of cores to a job on an ssh?
Thanks.
Respuesta aceptada
Más respuestas (1)
Walter Roberson
el 26 de Dic. de 2020
0 votos
However you could also consider modifying the cluster profile to limit the cores in it.
7 comentarios
Alessandro Maria Laspina
el 26 de Dic. de 2020
Walter Roberson
el 26 de Dic. de 2020
maxnumcompthreads also controls the number of cores permitted when MATLAB automatically parallelizes mathematical functions by calling MKL or LAPACK .
Alessandro Maria Laspina
el 26 de Dic. de 2020
Walter Roberson
el 26 de Dic. de 2020
https://en.m.wikipedia.org/wiki/LAPACK
Walter Roberson
el 26 de Dic. de 2020
Editada: Walter Roberson
el 26 de Dic. de 2020
nohup matlab -batch 'maxNumCompThreads(6);script_file' &> output_script_file.txt &
Alessandro Maria Laspina
el 27 de Dic. de 2020
Raymond Norris
el 2 de En. de 2021
Also consider using the -logfile switch
nohup matlab -batch 'maxNumCompThreads(6);script_file' -logfile output_script_file.txt &
Categorías
Más información sobre Startup and Shutdown en Centro de ayuda y File Exchange.
Productos
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!