Month: July 2024
Select first and last dates subject appears
Hello,
I want to select the first recorded start date and the final recorded end date of clients with multiple entries (they can move across various locations in our housing service) to calculate the total number of months they were housed. Most clients have a single entry but many have multiple entries.
I have looked at using the XLOOKUP and AND functions… Any ideas? See screenshot.
Hello,I want to select the first recorded start date and the final recorded end date of clients with multiple entries (they can move across various locations in our housing service) to calculate the total number of months they were housed. Most clients have a single entry but many have multiple entries.I have looked at using the XLOOKUP and AND functions… Any ideas? See screenshot. Read More
Can you please help me? My CPU usage remains consistently low when using parallel processing.
I investigated multiple reasons and discovered that the command matlab –prefersoftwareopengl is causing high I/O usage. How can I resolve this I/O hogging issue?
T1=20001;
T2=29000;
% Start the parallel pool
parpool(‘Threads’, 64);
N=T2-T1+1; % 数据点数
dmix = zeros(nx-start1-end1,ny-start2-end2,N);
parfor k = 1:N
i = T1 + k – 1;
fileName = sprintf(‘./left.out/m%06d.ovf’, i-1);
fid = fopen(fileName, ‘r’);
datam = textscan(fid, ‘%f%f%f’, ‘headerlines’, 28, ‘collectoutput’, 1);
fclose(fid);
datam = datam{1};
mix111 = reshape(datam(:,2), [nx, ny, nz]); % select x component
mix111 = permute(mix111, [2 1 3]); % x-y transform
mix11 = mix111(start1+1:nx-end1, start2+1:ny-end2, 2) – mix111(start1+1:nx-end1, start2+1:ny-end2, 1);
mix1 = squeeze(mix11);
% Compute the difference and store in dmix
dmix(:,:,k) = mix1;
end
delete(gcp(‘nocreate’));I investigated multiple reasons and discovered that the command matlab –prefersoftwareopengl is causing high I/O usage. How can I resolve this I/O hogging issue?
T1=20001;
T2=29000;
% Start the parallel pool
parpool(‘Threads’, 64);
N=T2-T1+1; % 数据点数
dmix = zeros(nx-start1-end1,ny-start2-end2,N);
parfor k = 1:N
i = T1 + k – 1;
fileName = sprintf(‘./left.out/m%06d.ovf’, i-1);
fid = fopen(fileName, ‘r’);
datam = textscan(fid, ‘%f%f%f’, ‘headerlines’, 28, ‘collectoutput’, 1);
fclose(fid);
datam = datam{1};
mix111 = reshape(datam(:,2), [nx, ny, nz]); % select x component
mix111 = permute(mix111, [2 1 3]); % x-y transform
mix11 = mix111(start1+1:nx-end1, start2+1:ny-end2, 2) – mix111(start1+1:nx-end1, start2+1:ny-end2, 1);
mix1 = squeeze(mix11);
% Compute the difference and store in dmix
dmix(:,:,k) = mix1;
end
delete(gcp(‘nocreate’)); I investigated multiple reasons and discovered that the command matlab –prefersoftwareopengl is causing high I/O usage. How can I resolve this I/O hogging issue?
T1=20001;
T2=29000;
% Start the parallel pool
parpool(‘Threads’, 64);
N=T2-T1+1; % 数据点数
dmix = zeros(nx-start1-end1,ny-start2-end2,N);
parfor k = 1:N
i = T1 + k – 1;
fileName = sprintf(‘./left.out/m%06d.ovf’, i-1);
fid = fopen(fileName, ‘r’);
datam = textscan(fid, ‘%f%f%f’, ‘headerlines’, 28, ‘collectoutput’, 1);
fclose(fid);
datam = datam{1};
mix111 = reshape(datam(:,2), [nx, ny, nz]); % select x component
mix111 = permute(mix111, [2 1 3]); % x-y transform
mix11 = mix111(start1+1:nx-end1, start2+1:ny-end2, 2) – mix111(start1+1:nx-end1, start2+1:ny-end2, 1);
mix1 = squeeze(mix11);
% Compute the difference and store in dmix
dmix(:,:,k) = mix1;
end
delete(gcp(‘nocreate’)); parallel computing toolbox, parallel computing MATLAB Answers — New Questions
How to export all the Test sequences from Simulink Test Manager as an excel file.
I am reviewing some older models, and I wish to be able to extract all Test Sequences for all Simulink Test Manager Files into an office document.I am reviewing some older models, and I wish to be able to extract all Test Sequences for all Simulink Test Manager Files into an office document. I am reviewing some older models, and I wish to be able to extract all Test Sequences for all Simulink Test Manager Files into an office document. simulink, test manager, test sequence MATLAB Answers — New Questions
solving system of 4 coupled odes using shooting method and boundary conditions given
Hello! i am trying to solve a boundary value problem with four coupled first order odes, with four initial conditions at r=0 and four boundary conditions at r=10. my code is running but im not getting my desired output and it is not satisfying the conditions. Can someone help me finding where am i going wrong?
function proca_star_shooting_method
% Clear the workspace and command window
clear;
clc;
format long;
% Define constants and parameters
infinity = 10;
w = 0.817;
x_init = linspace(1e-5, infinity, 1000); % More efficient space vector
% Define initial conditions and boundary conditions
initial_conditions = [0.394, 0.394, 0, 0];
boundary_conditions = [1, 0, 0.745, 0];
% Shooting method with RK4 integration
options = optimset(‘TolX’, 1e-6, ‘Display’, ‘iter’);
phi_c_shoot = fminbnd(@(phi_c) shooting_error(phi_c, x_init, initial_conditions, boundary_conditions, w), 0, 1, options);
% Solve the BVP using the optimal phi_c obtained from the shooting method
[r_data, y_data] = solve_bvp(x_init, initial_conditions, phi_c_shoot, w);
% Plot the results
plot_results(r_data, y_data, infinity);
end
function error = shooting_error(phi_c, x_init, initial_conditions, boundary_conditions, w)
% Solve BVP with given phi_c and calculate the error at the boundary
[~, y_data] = solve_bvp(x_init, initial_conditions, phi_c, w);
yb = y_data(:, end);
error = norm(yb – boundary_conditions’);
end
function [r_data, y_data] = solve_bvp(x_init, initial_conditions, phi_c, w)
% Define the initial conditions for the solver
y0 = [initial_conditions(1), initial_conditions(2), initial_conditions(3), phi_c];
% Initialize the solution arrays
r_data = x_init;
y_data = zeros(4, length(x_init));
y_data(:, 1) = y0;
h = x_init(2) – x_init(1); % Step size
% RK4 integration loop
for i = 2:length(x_init)
y_data(:, i) = rk4_step(@(r, y) bsode(r, y, w), r_data(i-1), y_data(:, i-1), h);
end
end
function y_next = rk4_step(odefun, r, y, h)
% Perform one step of RK4 integration
k1 = h * odefun(r, y);
k2 = h * odefun(r + h/2, y + k1/2);
k3 = h * odefun(r + h/2, y + k2/2);
k4 = h * odefun(r + h, y + k3);
y_next = y + (k1 + 2*k2 + 2*k3 + k4) / 6;
end
function dfdr = bsode(r, y, w)
% Define the system of ODEs to be solved
N = 1 – 2 * y(3) / r;
dfdr = [
4 * pi * r * 0.745 * (y(4)^2 + y(2)^2 / (N^2 * y(1)^2));
w * y(4) – 0.745 * y(1)^2 * N * y(4) / w;
4 * pi * r^2 * (((0.745 * y(1)^2 * N^2 * y(4)^2)^2) / (2 * y(1)^2 * w^2) + 0.5 * 0.745 * (y(4)^2 * N + y(2)^2 / (N * y(1)^2)));
r^2 * y(2) * w / (y(1)^2 * N^2) – 2 * y(4)
];
end
function plot_results(r_data, y_data, infinity)
% Plot the results of the BVP solution
figure;
plot(r_data, y_data(1,:), r_data, y_data(2,:), r_data, y_data(3,:), r_data, y_data(4,:));
axis([0 infinity -0.5 1.2]);
title(‘Functions vs r’);
xlabel(‘r’);
ylabel(‘sigma’);
legend(‘y1’, ‘y2’, ‘y3’, ‘y4’);
grid on;
end
This is my desired plot. Please help me out!Hello! i am trying to solve a boundary value problem with four coupled first order odes, with four initial conditions at r=0 and four boundary conditions at r=10. my code is running but im not getting my desired output and it is not satisfying the conditions. Can someone help me finding where am i going wrong?
function proca_star_shooting_method
% Clear the workspace and command window
clear;
clc;
format long;
% Define constants and parameters
infinity = 10;
w = 0.817;
x_init = linspace(1e-5, infinity, 1000); % More efficient space vector
% Define initial conditions and boundary conditions
initial_conditions = [0.394, 0.394, 0, 0];
boundary_conditions = [1, 0, 0.745, 0];
% Shooting method with RK4 integration
options = optimset(‘TolX’, 1e-6, ‘Display’, ‘iter’);
phi_c_shoot = fminbnd(@(phi_c) shooting_error(phi_c, x_init, initial_conditions, boundary_conditions, w), 0, 1, options);
% Solve the BVP using the optimal phi_c obtained from the shooting method
[r_data, y_data] = solve_bvp(x_init, initial_conditions, phi_c_shoot, w);
% Plot the results
plot_results(r_data, y_data, infinity);
end
function error = shooting_error(phi_c, x_init, initial_conditions, boundary_conditions, w)
% Solve BVP with given phi_c and calculate the error at the boundary
[~, y_data] = solve_bvp(x_init, initial_conditions, phi_c, w);
yb = y_data(:, end);
error = norm(yb – boundary_conditions’);
end
function [r_data, y_data] = solve_bvp(x_init, initial_conditions, phi_c, w)
% Define the initial conditions for the solver
y0 = [initial_conditions(1), initial_conditions(2), initial_conditions(3), phi_c];
% Initialize the solution arrays
r_data = x_init;
y_data = zeros(4, length(x_init));
y_data(:, 1) = y0;
h = x_init(2) – x_init(1); % Step size
% RK4 integration loop
for i = 2:length(x_init)
y_data(:, i) = rk4_step(@(r, y) bsode(r, y, w), r_data(i-1), y_data(:, i-1), h);
end
end
function y_next = rk4_step(odefun, r, y, h)
% Perform one step of RK4 integration
k1 = h * odefun(r, y);
k2 = h * odefun(r + h/2, y + k1/2);
k3 = h * odefun(r + h/2, y + k2/2);
k4 = h * odefun(r + h, y + k3);
y_next = y + (k1 + 2*k2 + 2*k3 + k4) / 6;
end
function dfdr = bsode(r, y, w)
% Define the system of ODEs to be solved
N = 1 – 2 * y(3) / r;
dfdr = [
4 * pi * r * 0.745 * (y(4)^2 + y(2)^2 / (N^2 * y(1)^2));
w * y(4) – 0.745 * y(1)^2 * N * y(4) / w;
4 * pi * r^2 * (((0.745 * y(1)^2 * N^2 * y(4)^2)^2) / (2 * y(1)^2 * w^2) + 0.5 * 0.745 * (y(4)^2 * N + y(2)^2 / (N * y(1)^2)));
r^2 * y(2) * w / (y(1)^2 * N^2) – 2 * y(4)
];
end
function plot_results(r_data, y_data, infinity)
% Plot the results of the BVP solution
figure;
plot(r_data, y_data(1,:), r_data, y_data(2,:), r_data, y_data(3,:), r_data, y_data(4,:));
axis([0 infinity -0.5 1.2]);
title(‘Functions vs r’);
xlabel(‘r’);
ylabel(‘sigma’);
legend(‘y1’, ‘y2’, ‘y3’, ‘y4’);
grid on;
end
This is my desired plot. Please help me out! Hello! i am trying to solve a boundary value problem with four coupled first order odes, with four initial conditions at r=0 and four boundary conditions at r=10. my code is running but im not getting my desired output and it is not satisfying the conditions. Can someone help me finding where am i going wrong?
function proca_star_shooting_method
% Clear the workspace and command window
clear;
clc;
format long;
% Define constants and parameters
infinity = 10;
w = 0.817;
x_init = linspace(1e-5, infinity, 1000); % More efficient space vector
% Define initial conditions and boundary conditions
initial_conditions = [0.394, 0.394, 0, 0];
boundary_conditions = [1, 0, 0.745, 0];
% Shooting method with RK4 integration
options = optimset(‘TolX’, 1e-6, ‘Display’, ‘iter’);
phi_c_shoot = fminbnd(@(phi_c) shooting_error(phi_c, x_init, initial_conditions, boundary_conditions, w), 0, 1, options);
% Solve the BVP using the optimal phi_c obtained from the shooting method
[r_data, y_data] = solve_bvp(x_init, initial_conditions, phi_c_shoot, w);
% Plot the results
plot_results(r_data, y_data, infinity);
end
function error = shooting_error(phi_c, x_init, initial_conditions, boundary_conditions, w)
% Solve BVP with given phi_c and calculate the error at the boundary
[~, y_data] = solve_bvp(x_init, initial_conditions, phi_c, w);
yb = y_data(:, end);
error = norm(yb – boundary_conditions’);
end
function [r_data, y_data] = solve_bvp(x_init, initial_conditions, phi_c, w)
% Define the initial conditions for the solver
y0 = [initial_conditions(1), initial_conditions(2), initial_conditions(3), phi_c];
% Initialize the solution arrays
r_data = x_init;
y_data = zeros(4, length(x_init));
y_data(:, 1) = y0;
h = x_init(2) – x_init(1); % Step size
% RK4 integration loop
for i = 2:length(x_init)
y_data(:, i) = rk4_step(@(r, y) bsode(r, y, w), r_data(i-1), y_data(:, i-1), h);
end
end
function y_next = rk4_step(odefun, r, y, h)
% Perform one step of RK4 integration
k1 = h * odefun(r, y);
k2 = h * odefun(r + h/2, y + k1/2);
k3 = h * odefun(r + h/2, y + k2/2);
k4 = h * odefun(r + h, y + k3);
y_next = y + (k1 + 2*k2 + 2*k3 + k4) / 6;
end
function dfdr = bsode(r, y, w)
% Define the system of ODEs to be solved
N = 1 – 2 * y(3) / r;
dfdr = [
4 * pi * r * 0.745 * (y(4)^2 + y(2)^2 / (N^2 * y(1)^2));
w * y(4) – 0.745 * y(1)^2 * N * y(4) / w;
4 * pi * r^2 * (((0.745 * y(1)^2 * N^2 * y(4)^2)^2) / (2 * y(1)^2 * w^2) + 0.5 * 0.745 * (y(4)^2 * N + y(2)^2 / (N * y(1)^2)));
r^2 * y(2) * w / (y(1)^2 * N^2) – 2 * y(4)
];
end
function plot_results(r_data, y_data, infinity)
% Plot the results of the BVP solution
figure;
plot(r_data, y_data(1,:), r_data, y_data(2,:), r_data, y_data(3,:), r_data, y_data(4,:));
axis([0 infinity -0.5 1.2]);
title(‘Functions vs r’);
xlabel(‘r’);
ylabel(‘sigma’);
legend(‘y1’, ‘y2’, ‘y3’, ‘y4’);
grid on;
end
This is my desired plot. Please help me out! shooting method, bvp4c, rk4, plot, boundary value problem MATLAB Answers — New Questions
Brace indexing error using fitcensemble
I am getting strange errors trying to use fitcensemble, so I refered to the manual, and ran the simple following example, which I found on the fitcensemble help page:
load census1994
Mdl1 = fitcensemble(adultdata,’salary’)
these two simple lines of code should result in a classification ensemble but instead I get the following error:
Error using classreg.learning.internal.callBuiltinFitEnsemble
Error: File: callBuiltinFitEnsemble.m Line: 191 Column: 41
Brace indexing into the result of a function call is not supported. Assign the result of ‘curvature’ to a variable first, then brace index into it.
Error in classreg.learning.ensemble.Ensemble/fitBuiltinEnsemble (line 457)
classreg.learning.internal.callBuiltinFitEnsemble(this.Method,…
Error in classreg.learning.classif.ClassificationEnsemble (line 85)
this = fitBuiltinEnsemble(this,nlearn,dataSummary,classSummary);
Error in classreg.learning.FitTemplate/fit (line 292)
[varargout{1:nargout}] = this.MakeFitObject(X,Y,W,this.ModelParams,fitArgs{:});
Error in fitensemble (line 364)
obj = fit(temp,X,Y);
Error in fitcensemble (line 212)
obj = fitensemble(X, Y, Method, NumLearningCycles, Learners, …
So I feel like the problem is not my code, but instead I wonder if the problem is with some of the recent updates?
I am using version: ‘24.1.0.2628055 (R2024a) Update 4’
on a 64-bit Windows® platformI am getting strange errors trying to use fitcensemble, so I refered to the manual, and ran the simple following example, which I found on the fitcensemble help page:
load census1994
Mdl1 = fitcensemble(adultdata,’salary’)
these two simple lines of code should result in a classification ensemble but instead I get the following error:
Error using classreg.learning.internal.callBuiltinFitEnsemble
Error: File: callBuiltinFitEnsemble.m Line: 191 Column: 41
Brace indexing into the result of a function call is not supported. Assign the result of ‘curvature’ to a variable first, then brace index into it.
Error in classreg.learning.ensemble.Ensemble/fitBuiltinEnsemble (line 457)
classreg.learning.internal.callBuiltinFitEnsemble(this.Method,…
Error in classreg.learning.classif.ClassificationEnsemble (line 85)
this = fitBuiltinEnsemble(this,nlearn,dataSummary,classSummary);
Error in classreg.learning.FitTemplate/fit (line 292)
[varargout{1:nargout}] = this.MakeFitObject(X,Y,W,this.ModelParams,fitArgs{:});
Error in fitensemble (line 364)
obj = fit(temp,X,Y);
Error in fitcensemble (line 212)
obj = fitensemble(X, Y, Method, NumLearningCycles, Learners, …
So I feel like the problem is not my code, but instead I wonder if the problem is with some of the recent updates?
I am using version: ‘24.1.0.2628055 (R2024a) Update 4’
on a 64-bit Windows® platform I am getting strange errors trying to use fitcensemble, so I refered to the manual, and ran the simple following example, which I found on the fitcensemble help page:
load census1994
Mdl1 = fitcensemble(adultdata,’salary’)
these two simple lines of code should result in a classification ensemble but instead I get the following error:
Error using classreg.learning.internal.callBuiltinFitEnsemble
Error: File: callBuiltinFitEnsemble.m Line: 191 Column: 41
Brace indexing into the result of a function call is not supported. Assign the result of ‘curvature’ to a variable first, then brace index into it.
Error in classreg.learning.ensemble.Ensemble/fitBuiltinEnsemble (line 457)
classreg.learning.internal.callBuiltinFitEnsemble(this.Method,…
Error in classreg.learning.classif.ClassificationEnsemble (line 85)
this = fitBuiltinEnsemble(this,nlearn,dataSummary,classSummary);
Error in classreg.learning.FitTemplate/fit (line 292)
[varargout{1:nargout}] = this.MakeFitObject(X,Y,W,this.ModelParams,fitArgs{:});
Error in fitensemble (line 364)
obj = fit(temp,X,Y);
Error in fitcensemble (line 212)
obj = fitensemble(X, Y, Method, NumLearningCycles, Learners, …
So I feel like the problem is not my code, but instead I wonder if the problem is with some of the recent updates?
I am using version: ‘24.1.0.2628055 (R2024a) Update 4’
on a 64-bit Windows® platform fitcensemble, error, brace indexing MATLAB Answers — New Questions
Fail to start parpool on cluster
Hello, I’m submitting a batch job using SLURM:
sbatch shllscrpt96_16jul2024.sh false iter 1
shllscrpt96_16jul2024.sh itself looks like:
#!/bin/bash
#SBATCH -n 96
#SBATCH –mail-type="ALL"
#SBATCH –mem-per-cpu=8000M
module purge
module load matlab/2023b
matlab -nosplash -nodesktop -nodisplay -r "scriptfun_11jul2024($1,’$2′,$3); exit"
scriptfun_11jul2024(run_Spec, ms_Display, Category_MS) itself looks like:
function scriptfun_11jul2024(run_Spec,ms_Display,Category_MS)
n_cores = str2double(getenv(‘SLURM_NTASKS’));
pool = parpool(‘local’, n_cores);
"lots of statements (I’m happy to provide more details, but I’m 100% sure this is not the part causing the problem..)"
delete(pool)
end
The batch job "successfully" completes, but the output file shows that it failed:
Starting parallel pool (parpool) using the ‘local’ profile …
Preserving jobs with IDs: 13 14 15 16 because they contain crash dump files.
You can use ‘delete(myCluster.Jobs)’ to remove all jobs created with profile Processes. To create ‘myCluster’ use ‘myCluster = parcluster(‘Processes’)’.
Parallel pool using the ‘Processes’ profile is shutting down.
{�Error using parpool
Parallel pool failed to start with the following error. For more detailed
information, validate the profile ‘Processes’ in the Cluster Profile Manager.
Error in kimscriptfun_11jul2024 (line 13)
pool = parpool(‘local’, n_cores);
Caused by:
Error using
parallel.internal.pool.AbstractInteractiveClient>iThrowWithCause
Failed to initialize the interactive session.
Error using
parallel.internal.pool.AbstractInteractiveClient>iThrowIfBadParallelJobStatus
The interactive communicating job failed with no message.
}�
I’d appreciate any and all thoughts on what I might have done wrong. Thank you!Hello, I’m submitting a batch job using SLURM:
sbatch shllscrpt96_16jul2024.sh false iter 1
shllscrpt96_16jul2024.sh itself looks like:
#!/bin/bash
#SBATCH -n 96
#SBATCH –mail-type="ALL"
#SBATCH –mem-per-cpu=8000M
module purge
module load matlab/2023b
matlab -nosplash -nodesktop -nodisplay -r "scriptfun_11jul2024($1,’$2′,$3); exit"
scriptfun_11jul2024(run_Spec, ms_Display, Category_MS) itself looks like:
function scriptfun_11jul2024(run_Spec,ms_Display,Category_MS)
n_cores = str2double(getenv(‘SLURM_NTASKS’));
pool = parpool(‘local’, n_cores);
"lots of statements (I’m happy to provide more details, but I’m 100% sure this is not the part causing the problem..)"
delete(pool)
end
The batch job "successfully" completes, but the output file shows that it failed:
Starting parallel pool (parpool) using the ‘local’ profile …
Preserving jobs with IDs: 13 14 15 16 because they contain crash dump files.
You can use ‘delete(myCluster.Jobs)’ to remove all jobs created with profile Processes. To create ‘myCluster’ use ‘myCluster = parcluster(‘Processes’)’.
Parallel pool using the ‘Processes’ profile is shutting down.
{�Error using parpool
Parallel pool failed to start with the following error. For more detailed
information, validate the profile ‘Processes’ in the Cluster Profile Manager.
Error in kimscriptfun_11jul2024 (line 13)
pool = parpool(‘local’, n_cores);
Caused by:
Error using
parallel.internal.pool.AbstractInteractiveClient>iThrowWithCause
Failed to initialize the interactive session.
Error using
parallel.internal.pool.AbstractInteractiveClient>iThrowIfBadParallelJobStatus
The interactive communicating job failed with no message.
}�
I’d appreciate any and all thoughts on what I might have done wrong. Thank you! Hello, I’m submitting a batch job using SLURM:
sbatch shllscrpt96_16jul2024.sh false iter 1
shllscrpt96_16jul2024.sh itself looks like:
#!/bin/bash
#SBATCH -n 96
#SBATCH –mail-type="ALL"
#SBATCH –mem-per-cpu=8000M
module purge
module load matlab/2023b
matlab -nosplash -nodesktop -nodisplay -r "scriptfun_11jul2024($1,’$2′,$3); exit"
scriptfun_11jul2024(run_Spec, ms_Display, Category_MS) itself looks like:
function scriptfun_11jul2024(run_Spec,ms_Display,Category_MS)
n_cores = str2double(getenv(‘SLURM_NTASKS’));
pool = parpool(‘local’, n_cores);
"lots of statements (I’m happy to provide more details, but I’m 100% sure this is not the part causing the problem..)"
delete(pool)
end
The batch job "successfully" completes, but the output file shows that it failed:
Starting parallel pool (parpool) using the ‘local’ profile …
Preserving jobs with IDs: 13 14 15 16 because they contain crash dump files.
You can use ‘delete(myCluster.Jobs)’ to remove all jobs created with profile Processes. To create ‘myCluster’ use ‘myCluster = parcluster(‘Processes’)’.
Parallel pool using the ‘Processes’ profile is shutting down.
{�Error using parpool
Parallel pool failed to start with the following error. For more detailed
information, validate the profile ‘Processes’ in the Cluster Profile Manager.
Error in kimscriptfun_11jul2024 (line 13)
pool = parpool(‘local’, n_cores);
Caused by:
Error using
parallel.internal.pool.AbstractInteractiveClient>iThrowWithCause
Failed to initialize the interactive session.
Error using
parallel.internal.pool.AbstractInteractiveClient>iThrowIfBadParallelJobStatus
The interactive communicating job failed with no message.
}�
I’d appreciate any and all thoughts on what I might have done wrong. Thank you! parpool, cluster, batch-job MATLAB Answers — New Questions
Stream classic videos has been deleted and unable to access them from Team SharePoint site.
One of our DevOps SharePoint sites has multiple videos which were in stream classic and now we are unable to access those videos without receiving any notification (no email to the site owner as well).
Please help us to retrieve these videos as those are essential part of our site and not available anywhere else.
Thanks in advance.
One of our DevOps SharePoint sites has multiple videos which were in stream classic and now we are unable to access those videos without receiving any notification (no email to the site owner as well).
Please help us to retrieve these videos as those are essential part of our site and not available anywhere else.
Thanks in advance.
Read More
3 Ways to Effortlessly Embed YouTube channel on Website & Supercharge your Website
The secret of having a good web presence is having exciting content, and what can be more interesting than having a YouTube channel integrated into your website?
Think about a dynamic stream of interesting videos representing your field, services, products, or the story behind the brand embedded in the website. A brand needs to know how to embed YouTube channel on website effectively for maximum results.
Let us examine the intricacies of this strategy and how it benefits a brand in terms of marketing and ultimately, sales.
How do you embed a YouTube channel on the website?
You now know how awesome it is to have a YouTube channel embedded on your website, but how do you begin doing it? Let’s look at different ways to do it.
1. Tagembed for Embedding YouTube Channel in Website:
Tagembed offers a seamless process for embedding YouTube channels.
Just follow these simple steps:
Create a free account: Click on the link provided and create an account with Tagembed for free.
Choose “Social Widget”: Choose the “Social Widget” option to create the YouTube channel feed.
Pick Your Channel: From the options provided, select “YouTube” and click “Channel” to display your whole channel.
Search or Enter URL: You can search for the name of your YouTube channel by typing it in the search bar or typing the URL of your YouTube channel into the URL field.
Customize and Generate Code: Tagembed provides layout, size, and color scheme preferences that may be adjusted to the user’s preference. Once you are satisfied with the appearance, click on the ‘generate’ button to get the code for the embed.
Copy & Paste: The created embed code must be copied and inserted into the website’s back end.
Save the changes, and bang! You have now integrated your YouTube channel on your website.
Tagembed helps you embed your YouTube channel as simply and conveniently as possible.
2. Manually Embedding YouTube Channel on Website:
For those comfortable with a bit of code, YouTube offers a manual embedding option:
Step 1: Choose Your Video: Choose the video you want to embed in your website.
Step 2: Click “Share.”: Look for the “Share” button under the chosen video.
Step 3: Copy the Embed Code: Then click “Embed” and copy the generated code.
Step 4: Paste & Display: Copy the code and place it on the website’s back end where you wish to display the video. Click save, and the chosen YouTube video will be shown on your website!
While this method is simple, it has limitations:
One video at a time: Manual embedding involves using “embed” code for each video at a time, which is tedious for entire channels.
Limited customization: You have less control over the video’s look and feel here than when using a social media aggregator tool.
3. Through Plugins:
While using a Content Management System (CMS) like WordPress or Shopify, you can leverage dedicated plugins for YouTube embedding. Several third-party plugins like Tagembed can also help you embed YouTube channels on your CMS website. Research and choose one that best suits your needs and platform.
No matter your technical expertise, there’s a solution to embed your YouTube channel on your website and unlock its potential to boost website engagement!
Benefits of Embedding a YouTube Channel on a Website
Embedding a YouTube Channel on your website makes your online platform lively. Here’s how this strategy can supercharge your website:
Attention Grabber: Videos tend to grab the audience’s attention more than simple text. When you integrate your YouTube channel, you give your visitors something to do and watch, and they stay on your website and click for more.Credibility Booster: Use videos to present your brand’s message, advertise your products, or feature your specialists. This will make people more aware of your brand and position you as an expert. Laser-Targeted Traffic: Include playlists or videos related to your website’s content, products, and services. This will spark visitors’ interest and direct them to other parts of your website, thus bringing traffic to the right areas.Conversion machine: When you embed YouTube channel on website, product demonstrations, explainer videos, and customer testimonials become practical conversion tools. Education and sales videos are highly effective in increasing conversion.SEO: Videos are preferred over text in search results. Enhancing a site’s SEO performance and getting organic traffic from people interested in the video content uploaded to the channel is possible.Community Catalyst: Encourage the audience to click on the “like” and “subscribe” buttons on your YouTube channel from your website. This creates a social feel and engagement, which is good for your relations with the audience.
Conclusion
By now, it is pretty evident that embedding a YouTube channel on your website is a stroke of genius with many benefits. From capturing people’s attention with exciting videos to amassing an involved community, YouTube is a titan, and thus, Tagembed emerges as your best bet in this YouTube embedding process.
It has a user-friendly interface, can be customized, and delivers current information. However, with Tagembed, you get more than just the simple embedding option. You can get helpful information about the audience and enhance your content.
Suppose you are interested in transforming your simple website into an eye-catching one. Visit Tagembed right now and learn how YouTube and Tagemebed can improve your business.
The secret of having a good web presence is having exciting content, and what can be more interesting than having a YouTube channel integrated into your website?Think about a dynamic stream of interesting videos representing your field, services, products, or the story behind the brand embedded in the website. A brand needs to know how to embed YouTube channel on website effectively for maximum results. Let us examine the intricacies of this strategy and how it benefits a brand in terms of marketing and ultimately, sales. How do you embed a YouTube channel on the website?You now know how awesome it is to have a YouTube channel embedded on your website, but how do you begin doing it? Let’s look at different ways to do it. 1. Tagembed for Embedding YouTube Channel in Website:Tagembed offers a seamless process for embedding YouTube channels. Just follow these simple steps: Create a free account: Click on the link provided and create an account with Tagembed for free.Choose “Social Widget”: Choose the “Social Widget” option to create the YouTube channel feed. Pick Your Channel: From the options provided, select “YouTube” and click “Channel” to display your whole channel.Search or Enter URL: You can search for the name of your YouTube channel by typing it in the search bar or typing the URL of your YouTube channel into the URL field.Customize and Generate Code: Tagembed provides layout, size, and color scheme preferences that may be adjusted to the user’s preference. Once you are satisfied with the appearance, click on the ‘generate’ button to get the code for the embed.Copy & Paste: The created embed code must be copied and inserted into the website’s back end. Save the changes, and bang! You have now integrated your YouTube channel on your website.Tagembed helps you embed your YouTube channel as simply and conveniently as possible.2. Manually Embedding YouTube Channel on Website:For those comfortable with a bit of code, YouTube offers a manual embedding option: Step 1: Choose Your Video: Choose the video you want to embed in your website.Step 2: Click “Share.”: Look for the “Share” button under the chosen video.Step 3: Copy the Embed Code: Then click “Embed” and copy the generated code.Step 4: Paste & Display: Copy the code and place it on the website’s back end where you wish to display the video. Click save, and the chosen YouTube video will be shown on your website!While this method is simple, it has limitations:One video at a time: Manual embedding involves using “embed” code for each video at a time, which is tedious for entire channels.Limited customization: You have less control over the video’s look and feel here than when using a social media aggregator tool.3. Through Plugins:While using a Content Management System (CMS) like WordPress or Shopify, you can leverage dedicated plugins for YouTube embedding. Several third-party plugins like Tagembed can also help you embed YouTube channels on your CMS website. Research and choose one that best suits your needs and platform. No matter your technical expertise, there’s a solution to embed your YouTube channel on your website and unlock its potential to boost website engagement! Benefits of Embedding a YouTube Channel on a WebsiteEmbedding a YouTube Channel on your website makes your online platform lively. Here’s how this strategy can supercharge your website:Attention Grabber: Videos tend to grab the audience’s attention more than simple text. When you integrate your YouTube channel, you give your visitors something to do and watch, and they stay on your website and click for more.Credibility Booster: Use videos to present your brand’s message, advertise your products, or feature your specialists. This will make people more aware of your brand and position you as an expert. Laser-Targeted Traffic: Include playlists or videos related to your website’s content, products, and services. This will spark visitors’ interest and direct them to other parts of your website, thus bringing traffic to the right areas.Conversion machine: When you embed YouTube channel on website, product demonstrations, explainer videos, and customer testimonials become practical conversion tools. Education and sales videos are highly effective in increasing conversion.SEO: Videos are preferred over text in search results. Enhancing a site’s SEO performance and getting organic traffic from people interested in the video content uploaded to the channel is possible.Community Catalyst: Encourage the audience to click on the “like” and “subscribe” buttons on your YouTube channel from your website. This creates a social feel and engagement, which is good for your relations with the audience.ConclusionBy now, it is pretty evident that embedding a YouTube channel on your website is a stroke of genius with many benefits. From capturing people’s attention with exciting videos to amassing an involved community, YouTube is a titan, and thus, Tagembed emerges as your best bet in this YouTube embedding process. It has a user-friendly interface, can be customized, and delivers current information. However, with Tagembed, you get more than just the simple embedding option. You can get helpful information about the audience and enhance your content.Suppose you are interested in transforming your simple website into an eye-catching one. Visit Tagembed right now and learn how YouTube and Tagemebed can improve your business. Read More
Windows 11 single app kiosk disabling Wifi and Scanner
Hello,
I have installed a tablet with embedded scanner in Windows 11 and single app kiosk mode.
The kiosk mode is correctly applied but when I shutdown the tablet and power it up again, the Scanner and the Wifi are disabled.
I can plug the tablet to the wired network and the network card is perfectly fine.
Before the shutdown, I can restart the tablet and still be connected to the Wifi or use the scanner.
If I deactivate the kiosk mode and reboot the tablet, I get Wifi and Scanner back.
Where and how can I specify that the Wifi and Scanner need to still run when in kiosk mode ?
Thank you for your help.
Matthieu De Bonnaires
Hello, I have installed a tablet with embedded scanner in Windows 11 and single app kiosk mode.The kiosk mode is correctly applied but when I shutdown the tablet and power it up again, the Scanner and the Wifi are disabled.I can plug the tablet to the wired network and the network card is perfectly fine.Before the shutdown, I can restart the tablet and still be connected to the Wifi or use the scanner.If I deactivate the kiosk mode and reboot the tablet, I get Wifi and Scanner back. Where and how can I specify that the Wifi and Scanner need to still run when in kiosk mode ? Thank you for your help. Matthieu De Bonnaires Read More
July 2024 – OneDrive Opening in Browser
Hello Everybody
OneDrive (Office365 Family) on user computers are opening in browser. Are anybody else experiencing this problem?
Hello Everybody OneDrive (Office365 Family) on user computers are opening in browser. Are anybody else experiencing this problem? Read More
Need help to burn dmg to USB for making Mac bootable USB drive?
I bought an used MacBook Pro from eBay and there is no OS on it. I need to make a bootable USB for macOS in order to reinstall macOS on it. Unfortunately, I don’t have a Mac for doing this, which could be an easy task.
I heard this could be done on a Windows PC as well by burning dmg to USB but don’t know how to make a bootable USB from macOS dmg file. Currently, I am using a Windows 11 laptop. Pls help!
I bought an used MacBook Pro from eBay and there is no OS on it. I need to make a bootable USB for macOS in order to reinstall macOS on it. Unfortunately, I don’t have a Mac for doing this, which could be an easy task. I heard this could be done on a Windows PC as well by burning dmg to USB but don’t know how to make a bootable USB from macOS dmg file. Currently, I am using a Windows 11 laptop. Pls help! Read More
COUNTIF not working with arguments defined by LET function
I have a data table with key index as XXX_ID (Data!$A:$A), including a list of XXX IDs for each data rows, and there are repetitive IDs in the column as data in other columns are different.
I need the median for the list of how many times each unique XXX ID shows up in XXX_ID column, so I wrote =LET(filter,FILTER(Data!$A:$A,filter criteria),unique,UNIQUE(filter),count_times,COUNTIF(filter,unique),MEDIAN(count_times))
However, the COUNTIF(filter,unique) part returns error!
I tested filter and unique parts in separate columns, and use COUNTIF in the third column as COUNTIF(filter result data list, unique result data list), I get a correct result data list showing how many times each unique XXX ID shows up in the filter result data list.
I changed COUNTIF(filter,unique) to DROP(FREQUENCY(filter,unique),-1)
This time it works! Not sure if it is a bug with COUNTIF.
I have a data table with key index as XXX_ID (Data!$A:$A), including a list of XXX IDs for each data rows, and there are repetitive IDs in the column as data in other columns are different.I need the median for the list of how many times each unique XXX ID shows up in XXX_ID column, so I wrote =LET(filter,FILTER(Data!$A:$A,filter criteria),unique,UNIQUE(filter),count_times,COUNTIF(filter,unique),MEDIAN(count_times))However, the COUNTIF(filter,unique) part returns error! I tested filter and unique parts in separate columns, and use COUNTIF in the third column as COUNTIF(filter result data list, unique result data list), I get a correct result data list showing how many times each unique XXX ID shows up in the filter result data list. I changed COUNTIF(filter,unique) to DROP(FREQUENCY(filter,unique),-1)This time it works! Not sure if it is a bug with COUNTIF. Read More
Why do I receive an error when installing MATLAB 6.5 (R13)?
I get the error
ERROR: Unable to Start the Application – the class files could not be loaded
when installing MATLAB 6.x (R12.x / R13).
This error message appears just after the MATLAB 6.x (R12.x / R13) cd has been inserted in the CD-ROM drive.I get the error
ERROR: Unable to Start the Application – the class files could not be loaded
when installing MATLAB 6.x (R12.x / R13).
This error message appears just after the MATLAB 6.x (R12.x / R13) cd has been inserted in the CD-ROM drive. I get the error
ERROR: Unable to Start the Application – the class files could not be loaded
when installing MATLAB 6.x (R12.x / R13).
This error message appears just after the MATLAB 6.x (R12.x / R13) cd has been inserted in the CD-ROM drive. MATLAB Answers — New Questions
How can I integrate Virtual Arduino/Arduino simulator and simulink?
actually i am unable to get an arduino board for now.
I was doing A college project where i have A virtual Arduino circuit on Wokwi. I need to use matlab Simulink interface (GUI) to control Servo motors connected to arduino. ( Those servo motors are controlling a robotic arm. their kinetic equation and everythin else is ready).
please suggest me a good arduino Emulator where it can be interfaced with Simuink GUI.
or if any other method
maybe how to create virtual arduino circuit in simulink and control it with Simulink GUI??
plz suggest me a solution!actually i am unable to get an arduino board for now.
I was doing A college project where i have A virtual Arduino circuit on Wokwi. I need to use matlab Simulink interface (GUI) to control Servo motors connected to arduino. ( Those servo motors are controlling a robotic arm. their kinetic equation and everythin else is ready).
please suggest me a good arduino Emulator where it can be interfaced with Simuink GUI.
or if any other method
maybe how to create virtual arduino circuit in simulink and control it with Simulink GUI??
plz suggest me a solution! actually i am unable to get an arduino board for now.
I was doing A college project where i have A virtual Arduino circuit on Wokwi. I need to use matlab Simulink interface (GUI) to control Servo motors connected to arduino. ( Those servo motors are controlling a robotic arm. their kinetic equation and everythin else is ready).
please suggest me a good arduino Emulator where it can be interfaced with Simuink GUI.
or if any other method
maybe how to create virtual arduino circuit in simulink and control it with Simulink GUI??
plz suggest me a solution! arduino, simulink, matlab gui MATLAB Answers — New Questions
Leader follower approach formation control problem
Hello everyone, I’m Enrica. For a university project I have a task consisting on modeling on simulink three robots of which one leader and two followers. In the first scenario the robot has to follow a linear trajectory while in the second one the trajectory to follow is circular. In both scenarios the robots must start from different positions. For what concern the initial position of the robots, through the delay present in the loops, I tried to set the initial conditions inside the delay block but there is something that doesn’t work. The robots are described through a space-state block on both x and y axes and they are controlled by two different discrete PID, the internal one controls the velocity (that must be mantained constant) while the external one regulates the position. I tried to model the trajectories using the matlab function block and I tuned the PID with the "tune" button. Plotting the robots on the XY graph they don’t follow each other and I’m not able to identify where is the problem, if it’s related to the structure and connections of the simulink scheme or if it’s related to the space-state block or PID settinggs.
For a better understanding, attached you can find simulink and matlab codes (matlab versione R2023A).
Thank you to those who can help meHello everyone, I’m Enrica. For a university project I have a task consisting on modeling on simulink three robots of which one leader and two followers. In the first scenario the robot has to follow a linear trajectory while in the second one the trajectory to follow is circular. In both scenarios the robots must start from different positions. For what concern the initial position of the robots, through the delay present in the loops, I tried to set the initial conditions inside the delay block but there is something that doesn’t work. The robots are described through a space-state block on both x and y axes and they are controlled by two different discrete PID, the internal one controls the velocity (that must be mantained constant) while the external one regulates the position. I tried to model the trajectories using the matlab function block and I tuned the PID with the "tune" button. Plotting the robots on the XY graph they don’t follow each other and I’m not able to identify where is the problem, if it’s related to the structure and connections of the simulink scheme or if it’s related to the space-state block or PID settinggs.
For a better understanding, attached you can find simulink and matlab codes (matlab versione R2023A).
Thank you to those who can help me Hello everyone, I’m Enrica. For a university project I have a task consisting on modeling on simulink three robots of which one leader and two followers. In the first scenario the robot has to follow a linear trajectory while in the second one the trajectory to follow is circular. In both scenarios the robots must start from different positions. For what concern the initial position of the robots, through the delay present in the loops, I tried to set the initial conditions inside the delay block but there is something that doesn’t work. The robots are described through a space-state block on both x and y axes and they are controlled by two different discrete PID, the internal one controls the velocity (that must be mantained constant) while the external one regulates the position. I tried to model the trajectories using the matlab function block and I tuned the PID with the "tune" button. Plotting the robots on the XY graph they don’t follow each other and I’m not able to identify where is the problem, if it’s related to the structure and connections of the simulink scheme or if it’s related to the space-state block or PID settinggs.
For a better understanding, attached you can find simulink and matlab codes (matlab versione R2023A).
Thank you to those who can help me simulink MATLAB Answers — New Questions
where can i find help for simulink models
Hello,
i have a question about simulink in matlab. I am working on my thesis for my uni for which i created a boat navigation system and i want to simulate that system in simulink to tune my pid. In this system there is a gps receiver, an arduino and the rudder component (which is the actuator, the speed is constant). I also have the code required to operate the system. Are there any premade gps objects/models that i can find without purchasing extra toolboxes for matlab? And if there arent, where should i start as a begginer of simulink? All i find is models that i dont understand what they do or how they work.Hello,
i have a question about simulink in matlab. I am working on my thesis for my uni for which i created a boat navigation system and i want to simulate that system in simulink to tune my pid. In this system there is a gps receiver, an arduino and the rudder component (which is the actuator, the speed is constant). I also have the code required to operate the system. Are there any premade gps objects/models that i can find without purchasing extra toolboxes for matlab? And if there arent, where should i start as a begginer of simulink? All i find is models that i dont understand what they do or how they work. Hello,
i have a question about simulink in matlab. I am working on my thesis for my uni for which i created a boat navigation system and i want to simulate that system in simulink to tune my pid. In this system there is a gps receiver, an arduino and the rudder component (which is the actuator, the speed is constant). I also have the code required to operate the system. Are there any premade gps objects/models that i can find without purchasing extra toolboxes for matlab? And if there arent, where should i start as a begginer of simulink? All i find is models that i dont understand what they do or how they work. gps, simulation MATLAB Answers — New Questions
“Failed to mount the Azure file share” looks like a false alarm?
Hi,
I have been using Azure and the Azure shell (Bash) on the Azure portal for nearly half a year.
Yesterday when I started the Azure shell, I got this warning message:
Warning: Failed to mount the Azure file share. Your cloud drive won’t be available.
Your Cloud Shell session will be ephemeral so no files or system changes will persist beyond your current session.
As far as I know, I never unmounted or changed any permission of the storage account to the clouddrive folder.
However, I found that my cloud drive (mounted to the clouddrive/ folder) was still accessible, and the files I created there could still be found when I started another Cloud Shell session.
I tried to reset my user settings and remount the same storage account to the clouddrive/ folder, and restarted the Bash Cloud Shell again. The warning message still appeared while the clouddrive/ could still be accessible.
So I wonder if the warning message was a false alarm, or if it referred to something else. May I ask if there is any command I can run to display the mounting log that resulted in the warning message, so I can check if it is really a false alarm?
Best Regards,
Benny (@evergrn_tree).
Hi, I have been using Azure and the Azure shell (Bash) on the Azure portal for nearly half a year. Yesterday when I started the Azure shell, I got this warning message: Warning: Failed to mount the Azure file share. Your cloud drive won’t be available.
Your Cloud Shell session will be ephemeral so no files or system changes will persist beyond your current session. As far as I know, I never unmounted or changed any permission of the storage account to the clouddrive folder. However, I found that my cloud drive (mounted to the clouddrive/ folder) was still accessible, and the files I created there could still be found when I started another Cloud Shell session. I tried to reset my user settings and remount the same storage account to the clouddrive/ folder, and restarted the Bash Cloud Shell again. The warning message still appeared while the clouddrive/ could still be accessible. So I wonder if the warning message was a false alarm, or if it referred to something else. May I ask if there is any command I can run to display the mounting log that resulted in the warning message, so I can check if it is really a false alarm? Best Regards,Benny (@evergrn_tree). Read More
windows 11 non-admin user IIS Pool access issue in local machine
By creating a non-admin user in Windows 11 home edition, I allowed him full control over inetsrv
%SystemRoot%System32inetsrv
folder, after logging in with this user and running this command from CMD
%SystemRoot%System32inetsrvappcmd list apppool /name:poolname/text:state
Results show : Unknown. But “poolname” is a pool running.
%SystemRoot%System32inetsrvappcmd start apppool /apppool.name:poolname
The result shows : “ERROR ( message:The WAS service is not available – try starting the service first. )”. But a “WAS” is running.
By creating a non-admin user in Windows 11 home edition, I allowed him full control over inetsrv %SystemRoot%System32inetsrvfolder, after logging in with this user and running this command from CMD%SystemRoot%System32inetsrvappcmd list apppool /name:poolname/text:stateResults show : Unknown. But “poolname” is a pool running.%SystemRoot%System32inetsrvappcmd start apppool /apppool.name:poolnameThe result shows : “ERROR ( message:The WAS service is not available – try starting the service first. )”. But a “WAS” is running. Read More
Microsoft Team Calendar wont let me book meetings
I have had a mare of a day, trying to sort out teams calendar. I have had no issued making appointments until yesterday, now it is saying ‘something went wrong’ unable to create meeting? Any help appreciated, I cannot work if it is not working
Thanks
I have had a mare of a day, trying to sort out teams calendar. I have had no issued making appointments until yesterday, now it is saying ‘something went wrong’ unable to create meeting? Any help appreciated, I cannot work if it is not working Thanks Read More
Effectively troubleshoot latency in SQL Server Transactional replication: Part 2
Let us continue our troubleshooting by checking threads in this part.
Step 4.1. Troubleshoot latency in Log Reader agent’s reader thread
Firstly, define the level of reader thread latency by running below query in Publisher server.
sp_replcounters
GO
The above shows reader thread replicating on average 115 transactions per second and more than 7.5mln transactions are waiting to be replicated to the distribution database. On average, transactions are waiting 134880secs to be replicated, which is high latency.
Run below in publisher server and find session id of Log Reader’ reader thread:SELECT
SessionId = s.session_id,
App = ISNULL(s.program_name, N”)
FROM sys.dm_exec_sessions s
WHERE s.program_name LIKE ‘%LogReader%’
Place the session id to the below Event session and create event session. Run the session for about 5mins:CREATE EVENT SESSION [LogReaderMonitor] ON SERVER
ADD EVENT sqlos.wait_completed(
ACTION(package0.callstack)
WHERE ([sqlserver].[session_id]=(123))), —Change session id here
ADD EVENT sqlos.wait_info_external(
ACTION(package0.callstack)
WHERE (([opcode]=(‘End’)) AND ([sqlserver].[session_id]=(123)))), —Change session id here
ADD EVENT sqlserver.rpc_completed(
ACTION(package0.callstack)
WHERE ([sqlserver].[session_id]=(123))) —Change session id here
ADD TARGET package0.event_file(SET filename=N’C:Templogreader_reader_track’,max_file_size=(256),max_rollover_files=(5))
WITH (MAX_MEMORY=8192 KB,EVENT_RETENTION_MODE=ALLOW_MULTIPLE_EVENT_LOSS,MAX_DISPATCH_LATENCY=30 SECONDS,MAX_EVENT_SIZE=0 KB,MEMORY_PARTITION_MODE=NONE,TRACK_CAUSALITY=ON,STARTUP_STATE=OFF)
GO
Investigate the event file. For example, below you can confirm the activities with the same GUID with sequence ids. As you can see, initially, we are spending time for memory allocation and then sp_replcmds is finishing after 789 microseconds.
Note: duration of wait_info_external is in milliseconds while rpc_completed is in microseconds.
If wait time is high compared to CPU time, check wait type and troubleshoot accordingly. For example, on the above example we faced MEMORY_ALLOCATION_EXT wait_type but duration is 0. So, we are not waiting.
If CPU time is higher, this means log thread is running but latency is being observed because you have high load. High load can be caused by several causes:
Large batch of replicated transactions: large batch of transactions are the main cause of latency in reader thread performance. Check number of commands and transactions in agent statistics from verbose logs we obtained in Step 3.1.b. If the number of commands is significantly high compared to the number of transactions, it is possible that large transactions are being replicated. For example, as below:
If Reader Latency is caused by large number of pending commands, waiting for the Log Reader to catch up may be the best short-term solution. Long-term options include replicating batches during non-peak time.
Large number of non-replication transactions: A transaction log with a high percentage of non-replicated transaction will cause latency as the Log Reader scans over transaction to be ignored. You can check whether this problem exists by looking at Log Reader agent history we checked in Step 3.1.a. For example, in the below log reader history, we can see more than 5mln rows are being scanned but only 142 rows have been marked for replication.
In this case, ensure constant transaction log truncation and try to perform maintenance activities offline.
High number of VLFs: A large number of Virtual Log Files (VLFs) can contribute to long running read times. For the number of VLFs, execute the following command. Counts in 100K+ may be contributing to Log Reader Reader-Thread performance problems.
SELECT COUNT (DISTINCT vlf_sequence_number) FROM sys.dm_db_log_info ( PublisherDBID )
Step 4.2. Troubleshoot latency in Log Reader agent’s writer thread
By using log reader’s history log (refer to Step 3.1.a), you can get last transaction sequence number and delivery rate, latency information. If you do not observe latency in reader thread (Step 4.1), this means the latency rate is mainly by writer thread:
You can use below command to check transaction (xact_seqno) at where we are currently:
— Get publisher db id
USE distribution
GO
SELECT * FROM dbo.MSpublisher_databases
— Get commands we are at
SET TRANSACTION ISOLATION LEVEL READ UNCOMMITTED
GO
BEGIN TRAN
USE distribution
GO
EXEC Sp_browsereplcmds
@xact_seqno_start = ‘xact_seqno’,
@xact_seqno_end = ‘xact_seqno’,
@publisher_database_id = PUBLISHERDB_ID
COMMIT TRAN
GO
Run below in publisher server and find session id of Log Reader’ writer thread:
SELECT
SessionId = s.session_id,
App = ISNULL(s.program_name, N”)
FROM sys.dm_exec_sessions s
WHERE s.program_name LIKE ‘%LogReader%’
Check whether any blocking happening with this session:
sp_who2
Then run the below query in distributor server by changing the session id to log reader session id:
CREATE EVENT SESSION [logreader_writer_track] ON SERVER
ADD EVENT sqlos.wait_completed(
ACTION(package0.callstack)
WHERE ([sqlserver].[session_id]=(64))), — Change session id to log reader writer session id
ADD EVENT sqlos.wait_info_external(
ACTION(package0.callstack)
WHERE (([opcode]=(‘End’)) AND ([sqlserver].[session_id]=(64)))), — Change session id to log reader writer session id
ADD EVENT sqlserver.sp_statement_completed(
ACTION(package0.event_sequence,sqlserver.plan_handle,sqlserver.session_id,sqlserver.transaction_id)
WHERE ([sqlserver].[session_id]=(64))) — Change session id to log reader writer session id
ADD TARGET package0.event_file(SET filename=N’C:Templogreader_writer_track’,max_file_size=(256),max_rollover_files=(5))
WITH (MAX_MEMORY=8192 KB,EVENT_RETENTION_MODE=ALLOW_MULTIPLE_EVENT_LOSS,MAX_DISPATCH_LATENCY=30 SECONDS,MAX_EVENT_SIZE=0 KB,MEMORY_PARTITION_MODE=NONE,TRACK_CAUSALITY=ON,STARTUP_STATE=OFF)
Investigate the collected event logs. For example, below you can confirm the activities with the same GUID with sequence ids. Each of this activity is writer threads attempt to write replication logs to distribution database. As you can see, we spent very little time (nearly 0) initially for MEMORY_ALLOCATION_EXT, then select statement is finishing after 39 microseconds.
Compare wait time (duration – cpu_time) and cpu_time. If wait time is high compared to CPU time, check wait_type and troubleshoot accordingly. For example, above we face MEMORY_ALLOCATION_EXT wait_type. If CPU time is high, you can investigate the execution plan by using corresponding plan_handle for time consuming query which you can get from above event logs:
SELECT * FROM sys.dm_exec_query_plan(PLAN_HANDLE)
Step 4.3. Troubleshoot latency in Distribution agent’s reader thread
To find the session id for Distribution agent, you need to find if it is a Push or Pull Subscription. In the case of push subscription, run below command in distributor server. In the case of Pull subscription, run below command in subscriber server.
SELECT
SessionId = s.session_id,
App = ISNULL(s.program_name, N”)
FROM sys.dm_exec_sessions s LEFT OUTER JOIN sys.dm_exec_connections c ON (s.session_id = c.session_id)
WHERE (select text from sys.dm_exec_sql_text(c.most_recent_sql_handle)) LIKE ‘%sp_MSget_repl_command%’
Check whether any blocking happening with this session:
sp_who2
Then run the below query in distributor server by changing the session id to distribution agent session id:
CREATE EVENT SESSION [distributor_writer_track] ON SERVER
ADD EVENT sqlos.wait_completed(
ACTION(package0.callstack)
WHERE ([sqlserver].[session_id]=(64))), — Change session id to dist agent session id
ADD EVENT sqlos.wait_info_external(
ACTION(package0.callstack)
WHERE (([opcode]=(‘End’)) AND ([sqlserver].[session_id]=(64)))), — Change session id to dist agent session id
ADD EVENT sqlserver.sp_statement_completed(
ACTION(package0.event_sequence,sqlserver.plan_handle,sqlserver.session_id,sqlserver.transaction_id)
WHERE ([sqlserver].[session_id]=(64))) — Change session id to dist agent session id
ADD TARGET package0.event_file(SET filename=N’C:Tempdistributor_reader_track’,max_file_size=(256),max_rollover_files=(5))
WITH (MAX_MEMORY=8192 KB,EVENT_RETENTION_MODE=ALLOW_MULTIPLE_EVENT_LOSS,MAX_DISPATCH_LATENCY=30 SECONDS,MAX_EVENT_SIZE=0 KB,MEMORY_PARTITION_MODE=NONE,TRACK_CAUSALITY=ON,STARTUP_STATE=OFF)
Investigate the collected event logs. For example, below you can confirm the activities with the same GUID with sequence ids. Each of this activity is reader threads attempt to read replication logs. As you can see, we spent very little time (nearly 0) initially for MEMORY_ALLOCATION_EXT, then select statement is finishing after 29 microseconds.
Compare wait time (duration – cpu_time) and cpu_time. If wait time is high compared to CPU time, check wait_type and troubleshoot accordingly. For example, above we face MEMORY_ALLOCATION_EXT wait_type. If CPU time is high, you can investigate the execution plan by using corresponding plan_handle for time consuming query which you can get from above event logs:
SELECT * FROM sys.dm_exec_query_plan(PLAN_HANDLE)
High CPU time can often mean there is a high load which can be caused by large batch of replicated transactions. You can compare the number of commands and transactions by using the below query.
SELECT count(c.xact_seqno) as CommandCount, count(DISTINCT t.xact_seqno) as TransactionCount
FROM MSrepl_commands c with (nolock)
LEFT JOIN msrepl_transactions t with (nolock)
on t.publisher_database_id = c.publisher_database_id and t.xact_seqno = c.xact_seqno
WHERE c.publisher_database_id = 1 –Change to target database id here
For the past days’ statistics, you can leverage below command:
USE distribution
select t.publisher_database_id, t.xact_seqno,
max(t.entry_time) as EntryTime, count(c.xact_seqno) as
CommandCount, count(DISTINCT t.xact_seqno) as TransactionCount
into #results
FROM MSrepl_commands c with (nolock)
LEFT JOIN msrepl_transactions t with (nolock)
on t.publisher_database_id = c.publisher_database_id
and t.xact_seqno = c.xact_seqno
GROUP BY t.publisher_database_id, t.xact_seqno
SELECT publisher_database_id
,datepart(year, EntryTime) as Year
,datepart(month, EntryTime) as Month
,datepart(day, EntryTime) as Day
,datepart(hh, EntryTime) as Hour
,sum(CommandCount) as CommandCountPerTimeUnit
,sum(TransactionCount) as TransactionCountPerTimeUnit
FROM #results
GROUP BY publisher_database_id
,datepart(year, EntryTime)
,datepart(month, EntryTime)
,datepart(day, EntryTime)
,datepart(hh, EntryTime)
ORDER BY publisher_database_id, Month, Day, Hour
As you see, I am executing one command per transaction making TransactionCount nearly equal to CommandCount.
Step 4.4. Troubleshoot latency in Distribution agent’s writer thread
Find the session id and App name for Distribution agent by inserting your publication name to WHERE clause below:
SELECT
SessionId = s.session_id,
App = ISNULL(s.program_name, N”)
FROM sys.dm_exec_sessions s
WHERE s.program_name LIKE ‘%publish%’
GO
Check whether there is blocking for the above session id(s):
sp_who2
Create event session by inserting app name:
CREATE EVENT SESSION [distributor_writer_track] ON SERVER
ADD EVENT sqlos.wait_completed(
ACTION(package0.callstack,sqlserver.session_id,sqlserver.sql_text)
WHERE ([sqlserver].[client_app_name]=N’SQLVM4-TRANSACR_AdventureWorksLT_test_table_pub’ AND [package0].[greater_than_uint64]([duration],(0)))),
ADD EVENT sqlos.wait_info_external(
ACTION(package0.callstack,sqlserver.session_id,sqlserver.sql_text)
WHERE ([sqlserver].[client_app_name]=N’SQLVM4-TRANSACR_AdventureWorksLT_test_table_pub’ AND [package0].[greater_than_uint64]([duration],(0)))),
ADD EVENT sqlserver.sp_statement_completed(
ACTION(package0.event_sequence,sqlserver.plan_handle,sqlserver.session_id,sqlserver.transaction_id)
WHERE ([sqlserver].[client_app_name]=N’SQLVM4-TRANSACR_AdventureWorksLT_test_table_pub’))
ADD TARGET package0.event_file(SET filename=N’C:Tempdistributor_writer_track’,max_file_size=(5),max_rollover_files=(5))
WITH (MAX_MEMORY=8192 KB,EVENT_RETENTION_MODE=ALLOW_MULTIPLE_EVENT_LOSS,MAX_DISPATCH_LATENCY=30 SECONDS,MAX_EVENT_SIZE=0 KB,MEMORY_PARTITION_MODE=NONE,TRACK_CAUSALITY=ON,STARTUP_STATE=OFF)
GO
Investigate the collected event logs. For example, below you can confirm the activities with the same GUID with sequence ids as statement levels. Can you find any high duration at any of the statements?
Compare wait time (duration – cpu_time) and cpu_time. If wait time is high compared to CPU time, check wait_type and troubleshoot accordingly. For example, above we face NETWORK_IO wait_type. If CPU time is high, you can investigate the execution plan by using corresponding plan_handle for time consuming query which you can get from above event logs:
SELECT * FROM sys.dm_exec_query_plan(PLAN_HANDLE)
Supervisor: Collin Benkler, Sr EE for SQL Server in Microsoft
Microsoft Tech Community – Latest Blogs –Read More