Labels

Wednesday, August 30, 2023

Average over a sphere surface

 The surface integral of the function $f$ over the surface $S$ is denoted by

\[ \int\int_S f dS \]

$dS$ is the area of an infinitesimal piece of the surface $S$.

Average over the sphere is

\[ <f> = \frac{1}{4\pi} \int_0^{2\pi} d\phi \int_0^{\pi} f \sin(\theta)d\theta ,\]

where $dS=\sin(\theta)d\theta d\phi$. This can be seen as a weight average, the weight is surface area.

\[ <\cos^2(\theta)>=1/3 \]

\[<\sin(\theta)>=2/3.\]




Wednesday, June 7, 2023

Friday, December 30, 2022

Install Slurm on my personal Fedora laptop

Slurm (Simple Linux Utility for Resource Management) is a group utilities used for managing workloads on computer clusters. It can also be sued in your personal laptop. 


  $sudo dnf install slurm slurm-slurmd slurm-slumrctld
  $sudo -u munge /usr/sbin/mungekey -v
  $sudo systemctl start munge
  $sudo systemctl status munge
  $sudo systemctl enable munge
  $munge -n | unmunge // check munge works
  $hostname -f // find out hostname
  $sudo vi  /etc/slurm/slurm.conf
  


ClusterName=localcluster
SlurmctldHost=localhost  // or hostname
MpiDefault=pmix
ProctrackType=proctrack/cgroup
ReturnToService=1
SlurmctldPidFile=/var/run/slurm/slurmctld.pid
SlurmctldPort=6817
SlurmdPidFile=/var/run/slurm/slurmd.pid
SlurmdPort=6818
SlurmdSpoolDir=/var/spool/slurm/d
SlurmUser=root
StateSaveLocation=/var/spool/slurm/ctld
SwitchType=switch/none
InactiveLimit=0
KillWait=30
MinJobAge=300
SlurmctldTimeout=120
SlurmdTimeout=300
Waittime=0

SchedulerType=sched/backfill
SelectType=select/linear
AccountingStorageType=accounting_storage/none
AccountingStoreFlags=job_comment
JobCompType=jobcomp/none
JobAcctGatherFrequency=30
JobAcctGatherType=jobacct_gather/none
SlurmctldDebug=info
SlurmctldLogFile=/var/log/slurm/slurmctld.log
SlurmdDebug=info
SlurmdLogFile=/var/log/slurm/slurmd.log
NodeName=localhost CPUs=12 Sockets=1 CoresPerSocket=6 ThreadsPerCore=2 RealMemory=10000 State=UNKNOWN
PartitionName=sbatch Nodes=ALL Default=YES MaxTime=INFINITE State=UP


change the Node information (marked as red color) to your laptop configuration. 

$ sudo systemctl start slurmctld
$ sudo systemctl status slurmctld
$ sudo systemctl enable slurmctld
$ sudo systemctl status slurmd
$ sudo systemctl enable slurmd

// test the installation
$ srun ls 


Reference:

https://src.fedoraproject.org/rpms/munge

http://docs.nanomatch.de/technical/SimStackRequirements/SingleNodeSlurm.html

https://blog.llandsmeer.com/tech/2020/03/02/slurm-single-instance.html


Thursday, December 22, 2022

Collision Energy

 The kinetic energy between two colliding particles can be expressed in terms of center of mass and relative velocity by

\[ E_k = \frac{1}{2} m_1 v_1^2 + \frac{1}{2} m_2v_2^2 = \frac{1}{2} M v_c^2 + \frac{1}{2} \mu v_r^2 , \]

a sum of a center-of-mass term and a relative momentum term.

where $M$, $v_c$, $\nu$, and $v_r$ are given by

\[ M = (m_1+m_2) ; \]

\[ \mathbf{v_c} = \frac{m_1 \mathbf{v_1} + m_2 \mathbf{v_2}}{m_1 +m_2} ;\]

\[ \mu = \frac{m_1 m_2}{m_1 + m_2} ;\]

\[ \mathbf{v_r} = \mathbf{v_1} - \mathbf{v_2} .\]


$\frac{1}{2} \mu v_r^2$ is called collision energy.

amu is short for atomic mass unitProtons have a positive electrical charge of one (+1) and a mass of 1 atomic mass unit (amu), which is about 1.67×10−27 kilograms.



Reference:

https://chem.libretexts.org/Bookshelves/Physical_and_Theoretical_Chemistry_Textbook_Maps/Map%3A_Physical_Chemistry_for_the_Biosciences_(Chang)/02%3A_Properties_of_Gases/2.8%3A_Molecular_Collisions_and_the_Mean_Free_Path

https://web.chem.ox.ac.uk/teaching/Physics%20for%20CHemists/Mechanics/Collisions.html

https://www.angelo.edu/faculty/kboudrea/periodic/structure_mass.htm