Skip to content
Snippets Groups Projects
Commit 892d550b authored by Blake Fitch's avatar Blake Fitch
Browse files

materials to work with mathworks on slurm

parent 74133d97
No related branches found
No related tags found
No related merge requests found
# mathworks-shared
Shared repo to work with Mathworks on slurm, etc
\ No newline at end of file
Command line just with singularity:
module load singularity
singularity run /ptmp/containers/<PICK A SINGULARITY CONTAINER> -nodesktop -nojvm -r "run('/ptmp/bfitch/workflow-slurm-matlab/cpu_bench.m'); exit;"
maxNumCompThreads(64)
%for N=[10, 100, 1000, 2500, 5000, 7500, 10000, 100000]
for N=[1, 2, 4, 8, 16, 32, 64, 128, 256, 512, 1024, 2048] %, 4096, 8192, 16384, 32768]
N_mult = 32768 / N;
fprintf('N = %d: ', N);
rng(1);
A = rand(N);
B = rand(N);
A_pd = A*A';
tic;
svd(A);
t_svd = toc;
fprintf('SVD ');
tic;
chol(A_pd);
t_chol = toc;
fprintf('Chol ');
tic;
qr(A);
t_qr = toc;
fprintf('QR ');
tic;
for k=1:N_mult
A*B;
end
t_mult = toc;
fprintf('%d mult ', N_mult);
tic;
inv(A);
t_inv = toc;
fprintf('Inv ');
tic;
pinv(A);
t_pinv = toc;
fprintf('Pinv\n\n');
fprintf('TIME IN SECONDS (SIZE: %d):\n', N);
fprintf('maxNumCompThreads %d\n', maxNumCompThreads );
fprintf('SVD: %f\n', t_svd);
fprintf('Cholesky: %f\n', t_chol);
fprintf('QR: %f\n', t_qr);
fprintf('%d matrix products: %f\n', N_mult, t_mult);
fprintf('Inverse: %f\n', t_inv);
fprintf('Pseudo-inverse: %f\n\n', t_pinv);
end
#!/bin/bash -l
# Standard output and error:
#SBATCH -o ./tjob.out.%j
#SBATCH -e ./tjob.err.%j
# Initial working directory:
#SBATCH -D ./
# Job Name:
#SBATCH -J ml_bench
#
#
# Queue (Partition):
#SBATCH --partition=compute # nyx partitions: compute, highmem, gpu
#
# Number of nodes and MPI tasks per node:
#SBATCH --nodes=1
#SBATCH --tasks=1
#SBATCH --cpus-per-task=64
#SBATCH --exclusive
#
#SBATCH --mail-type=END,FAIL
#SBATCH --mail-user=blake.fitch@tuebingen.mpg.de
#
# Wall clock limit:
#SBATCH --time=01:00:00
module purge
module load singularity
export SINGULARITY_BIND="/ptmp,/scratch"
export SINGULARITYENV_MATLABPATH=$PWD
export MATLAB_CONTAINER_PATH=/ptmp/containers/matlab_r2021a-2021-05-10.sif
echo "Here we go..."
time ${MATLAB_CONTAINER_PATH} -nodesktop -nojvm -r "run('/home/bfitch/workflow-slurm-matlab/cpu_bench.m'); exit;"
echo " ... done."
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment