447
Scheduling specific flags\&.
458
Set scheduler bind type\&. Currently valid \fIBindType\fRs:
465
Same as erlang:system_flag(scheduler_bind_type, unbound)\&.
469
Same as erlang:system_flag(scheduler_bind_type, no_spread)\&.
473
Same as erlang:system_flag(scheduler_bind_type, thread_spread)\&.
477
Same as erlang:system_flag(scheduler_bind_type, processor_spread)\&.
481
Same as erlang:system_flag(scheduler_bind_type, no_node_thread_spread)\&.
485
Same as erlang:system_flag(scheduler_bind_type, no_node_processor_spread)\&.
489
Same as erlang:system_flag(scheduler_bind_type, thread_no_node_processor_spread)\&.
493
Same as erlang:system_flag(scheduler_bind_type, default_bind)\&.
498
Binding of schedulers are currently only supported on newer Linux and Solaris systems\&.
502
If no CPU topology is available when the \fI+sbt\fR flag is processed and \fIBindType\fR is any other type than \fIu\fR, the runtime system will fail to start\&. CPU topology can be defined using the +sct flag\&. Note that the \fI+sct\fR flag may have to be passed before the \fI+sbt\fR flag on the command line (in case no CPU topology has been automatically detected)\&.
506
For more information, see erlang:system_flag(scheduler_bind_type, SchedulerBindType)\&.
510
\fI+sct CpuTopology\fR:
516
\fI<Id> = integer(); when 0 =< <Id> =< 65535\fR
519
\fI<IdRange> = <Id>-<Id>\fR
522
\fI<IdOrIdRange> = <Id> | <IdRange>\fR
525
\fI<IdList> = <IdOrIdRange>, <IdOrIdRange> | <IdOrIdRange>\fR
528
\fI<LogicalIds> = L<IdList>\fR
531
\fI<ThreadIds> = T<IdList> | t<IdList>\fR
534
\fI<CoreIds> = C<IdList> | c<IdList>\fR
537
\fI<ProcessorIds> = P<IdList> | p<IdList>\fR
540
\fI<NodeIds> = N<IdList> | n<IdList>\fR
543
\fI<IdDefs> = <LogicalIds><ThreadIds><CoreIds><ProcessorIds><NodeIds>\fR
546
\fICpuTopology = <IdDefs>:<IdDefs> | <IdDefs>\fR
551
Upper-case letters signify real identifiers and lower-case letters signify fake identifiers only used for description of the topology\&. Identifiers passed as real identifiers may be used by the runtime system when trying to access specific hardware and if they are not correct the behavior is undefined\&. Faked logical CPU identifiers are not accepted since there is no point in defining the CPU topology without real logical CPU identifiers\&. Thread, core, processor, and node identifiers may be left out\&. If left out, thread id defaults to \fIt0\fR, core id defaults to \fIc0\fR, processor id defaults to \fIp0\fR, and node id will be left undefined\&. Either all processors or no processors should have node identifiers defined\&.
555
Both increasing and decreasing \fI<IdRange>\fRs are allowed\&.
559
NUMA node identifiers are system wide\&. That is, each NUMA node on the system have to have a unique identifier\&. Processor identifiers are also system wide\&. Core identifiers are processor wide\&. Thread identifiers are core wide\&.
563
The order of the identifier types imply the hierarchy of the CPU topology\&. Currently, the only valid order is: logical, thread, core, processor, node\&. That is, thread is part of a core which is part of a processor which is part of a NUMA node\&. This will, however, change in the future, since multiple NUMA nodes can be part of a processor, but this is not supported yet\&.
567
If a list of identifiers is used in an \fI<IdDefs>\fR:
573
\fI<LogicalIds>\fR have to be a list of identifiers\&.
576
At least one other identifier type apart from \fI<LogicalIds>\fR also have to have a list of identifiers\&.
579
All lists of identifiers have to produce the same amount of identifiers\&.
584
A simple example\&. A single quad core processor may be described this way:
591
1> erlang:system_info(cpu_topology)\&.
593
[{processor,[{core,{logical,0}},
596
{core,{logical,3}}]}]
602
A little more complicated example\&. Two quad core processors\&. Each processor in its own NUMA node\&. The ordering of logical processors is a little weird\&. This in order to give a better example of identifier lists:
607
% erl +sct L0-1,3-2c0-3p0N0:L7,4,6-5c0-3p1N1
609
1> erlang:system_info(cpu_topology)\&.
611
[{node,[{processor,[{core,{logical,0}},
614
{core,{logical,2}}]}]},
615
{node,[{processor,[{core,{logical,7}},
618
{core,{logical,5}}]}]}]
624
As long as real identifiers are correct it is okay to pass a CPU topology that is not a correct description of the CPU topology\&. When used with care this can actually be very useful\&. This in order to trick the emulator to bind its schedulers as you want\&. For example, if you want to run multiple Erlang runtime systems on the same machine, you want to reduce the amount of schedulers used and manipulate the CPU topology so that they bind to different logical CPUs\&. An example, with two Erlang runtime systems on a quad core machine:
629
% erl +sct L0-3c0-3 +sbt db +S3:2 -detached -noinput -noshell -sname one
631
% erl +sct L3-0c0-3 +sbt db +S3:2 -detached -noinput -noshell -sname two
638
In this example each runtime system have two schedulers each online, and all schedulers online will run on different cores\&. If we change to one scheduler online on one runtime system, and three schedulers online on the other, all schedulers online will still run on different cores\&.
642
Note that a faked CPU topology that does not reflect how the real CPU topology looks like is likely to decrease the performance of the runtime system\&.
646
For more information, see erlang:system_flag(cpu_topology, CpuTopology)\&.