(method)


This method suspends the host's thread until all the OpenDSS running jobs finish.


Example


% Create DSS object

DSSObject = actxserver('OpenDSSEngine.DSS')

if ~DSSObject.Start(0),

                    disp('Unable to start openDSS');

                    return

end;

DSSText = DSSObject.Text;

DSSCircuit = DSSObject.ActiveCircuit;

% Handler for Parallel processing functions

DSSParallel = DSSCircuit.Parallel;    

% Gets the number of CPUs this PC has

CPUs = DSSParallel.NumCPUs;    

% By default one actor is created, if you want more than one

% parallel instance you will have to create them. Try to leave at least

% One CPU available to handle the rest of windows, otherwise will block everything

disp('Creating Actors');

DSSText.Command = 'compile "C:\Program Files\OpenDSS\EPRITestCircuits\ckt5\Master_ckt5.DSS"';

DSSText.Command = 'set maxiterations=1000 maxcontroliter=1000';   % Just in case

DSSCircuit.Solution.Solve(); % Solves Actor 1


DSSText.Command = ['Clone ',int2str(CPUs-2)]; %Creates the other actors

DSSText.Command = 'set ActiveActor=*';        %activates all actors to send commands concurrently

DSSText.Command = 'set mode=Time stepsize=1h number=16000';


DSSParallel.ActiveActor = 1; % Go back to actor 1

DSSParallel.ActiveParallel = 1;   % Activates the parallel features


disp('Starting simulation');

% Now the actors are solved

DSSCircuit.Solution.SolveAll;

% Freeze my app until DSS is done (all actors)

DSSParallel.Wait();

disp('Simulation done');