diff --git a/Dipolar Gas Simulator/+Scripts/test.m b/Dipolar Gas Simulator/+Scripts/run_locally.m similarity index 100% rename from Dipolar Gas Simulator/+Scripts/test.m rename to Dipolar Gas Simulator/+Scripts/run_locally.m diff --git a/Dipolar Gas Simulator/+Scripts/run_on_cluster.m b/Dipolar Gas Simulator/+Scripts/run_on_cluster.m new file mode 100644 index 0000000..5a2eba6 --- /dev/null +++ b/Dipolar Gas Simulator/+Scripts/run_on_cluster.m @@ -0,0 +1,38 @@ +%% This script is testing the functionalities of the Dipolar Gas Simulator +% +% Important: Run only sectionwise!! + +%% - Create Simulator, Potential and Calculator object with specified options + +OptionsStruct = struct; + +OptionsStruct.NumberOfAtoms = 1E6; +OptionsStruct.DipolarPolarAngle = pi/2; +OptionsStruct.DipolarAzimuthAngle = 0; +OptionsStruct.ScatteringLength = 86; + +OptionsStruct.TrapFrequencies = [125, 125, 250]; +OptionsStruct.TrapDepth = 5; +OptionsStruct.BoxSize = 15; +OptionsStruct.TrapPotentialType = 'Harmonic'; + +OptionsStruct.NumberOfGridPoints = [64, 64, 48]; +OptionsStruct.Dimensions = [40, 40, 20]; +OptionsStruct.CutoffType = 'Cylindrical'; +OptionsStruct.SimulationMode = 'ImaginaryTimeEvolution'; % 'ImaginaryTimeEvolution' | 'RealTimeEvolution' +OptionsStruct.TimeStepSize = 50E-6; % in s +OptionsStruct.NumberOfTimeSteps = 100; % in s +OptionsStruct.EnergyTolerance = 5E-10; + +OptionsStruct.JobNumber = 6; +OptionsStruct.SaveData = true; +OptionsStruct.SaveDirectory = './Data'; +options = Helper.convertstruct2cell(OptionsStruct); +clear OptionsStruct + +sim = Simulator.DipolarGas(options{:}); +pot = Simulator.Potentials(options{:}); +sim.Potential = pot.trap(); % + pot.repulsive_chopstick(); + +%-% Run Simulation %-% +[Params, Transf, psi, V, VDk] = sim.run(); \ No newline at end of file diff --git a/Dipolar Gas Simulator/bwhpc_matlab_gpe_sim.slurm b/Dipolar Gas Simulator/bwhpc_matlab_gpe_sim.slurm new file mode 100644 index 0000000..34a2b9b --- /dev/null +++ b/Dipolar Gas Simulator/bwhpc_matlab_gpe_sim.slurm @@ -0,0 +1,38 @@ +#!/bin/bash +########### Begin SLURM header ########### +#Partition +#SBATCH --partition=single +# Request number of nodes and CPU cores per node for job +#SBATCH --nodes=1 +#SBATCH --ntasks-per-node=1 +#SBATCH --cpus-per-task=10 +#SBATCH --mem=8G +# Estimated wallclock time for job +#SBATCH --time=02:00:00 +#SBATCH --job-name=simulation +#SBATCH --error=simulation.err +#SBATCH --output=simulation.out + +########### End SLURM header ########## + +echo "Working Directory: $PWD" +echo "Running on host $HOSTNAME" +echo "Job id: $SLURM_JOB_ID" +echo "Job name: $SLURM_JOB_NAME" +echo "Number of nodes allocated to job: $SLURM_JOB_NUM_NODES" +echo "Number of cores allocated to job: $SLURM_JOB_CPUS_PER_NODE" + + +# Load module +module load math/matlab/R2023a + +echo Directory is `pwd` +echo "Initiating Job..." + +# Start a Matlab program +matlab -nodisplay -nosplash -r "Scripts.run_on_cluster" + +# notice for tests +echo "Job terminated successfully" + +exit