
私は 15 コアの Intel Xeon で稼働している Fedora サーバーで作業しています。一部のユーザーは 4 つのコアを使用するシミュレーションを実行していますが、他のコアは使用されていないようです。使用中のコアが解放されるのを待たずに、空いているコアでプログラムを実行できる方法はありますか?
答え1
それはmatlabのせいだと分かりました。私のプロセスを尊重してくれなかったのです。他のシミュレーションを実行した後で再度実行したところ、別のコアで動作するようになりました。シネテックとにかくLinuxコマンドがタスクセット手動で行う必要がある場合に、必要な操作を実行できます。
$ taskset
Usage: taskset [options] [mask | cpu-list] [pid|cmd [args...]]
Options:
-p, --pid operate on existing given pid
-c, --cpu-list display and specify cpus in list format
-h, --help display this help
-V, --version output version information
The default behavior is to run a new command:
taskset 03 sshd -b 1024
You can retrieve the mask of an existing task:
taskset -p 700
Or set it:
taskset -p 03 700
List format uses a comma-separated list instead of a mask:
taskset -pc 0,3,7-11 700
Ranges in list format can take a stride argument:
e.g. 0-31:2 is equivalent to mask 0x55555555
For more information see taskset(1).