MATLAB Hilfe-Center
Get current parallel pool
p = gcp
p = gcp("nocreate")
p = gcp returns a parallel.Pool object representing the current parallel pool. The current pool is where parallel language features execute, such as parfor, spmd, distributed, Composite, parfeval and parfevalOnAll.
parallel.Pool
parfor
spmd
distributed
Composite
parfeval
parfevalOnAll
If no parallel pool exists, gcp starts a new parallel pool and returns a pool object for that, unless automatic pool starts are disabled in your parallel settings. If no parallel pool exists and automatic pool starts are disabled, gcp returns an empty pool object.
gcp
example
p = gcp("nocreate") returns the current pool if one exists. If no pool exists, the "nocreate" option causes gcp not to create a pool, regardless of your parallel settings.
"nocreate"
collapse all
Find the number of workers in the current parallel pool.
p = gcp("nocreate"); % If no pool, do not create new one. if isempty(p) poolsize = 0; else poolsize = p.NumWorkers end
Use the parallel pool object to delete the current pool.
delete(gcp("nocreate"))
expand all
backgroundPool
ThreadPool
This function fully supports thread-based environments. For more information, see Run MATLAB Functions in Thread-Based Environment.
Introduced in R2013b
Composite | delete | distributed | parfeval | parfevalOnAll | parfor | parpool | spmd
delete
parpool
You clicked a link that corresponds to this MATLAB command:
Run the command by entering it in the MATLAB Command Window. Web browsers do not support MATLAB commands.
Website auswählen
Wählen Sie eine Website aus, um übersetzte Inhalte (sofern verfügbar) sowie lokale Veranstaltungen und Angebote anzuzeigen. Auf der Grundlage Ihres Standorts empfehlen wir Ihnen die folgende Auswahl: .
Sie können auch eine Website aus der folgenden Liste auswählen:
So erhalten Sie die bestmögliche Leistung auf der Website
Wählen Sie für die bestmögliche Website-Leistung die Website für China (auf Chinesisch oder Englisch). Andere landesspezifische Websites von MathWorks sind für Besuche von Ihrem Standort aus nicht optimiert.
Amerika
Europa
Asien-Pazifik
Kontakt zu Ihrer lokalen Niederlassung