Using Slurm: Difference between revisions

From HPCwiki
Jump to navigation Jump to search
No edit summary
No edit summary
Line 1: Line 1:
== submitting jobs: sbatch ==
== submitting jobs: sbatch ==
from decimal import *
D=Decimal
getcontext().prec=10000000
p=sum(D(1)/16**k*(D(4)/(8*k+1)-D(2)/(8*k+4)-D(1)/(8*k+5)-D(1)/(8*k+6))for k in range(411))
print(str(p)[:10000002])
<source lang='python'>
from decimal import *
D=Decimal
getcontext().prec=10000000
p=sum(D(1)/16**k*(D(4)/(8*k+1)-D(2)/(8*k+4)-D(1)/(8*k+5)-D(1)/(8*k+6))for k in range(411))
print(str(p)[:10000002])
</source>


<source lang='bash'>
<source lang='bash'>
  #!/bin/bash
#!/bin/bash
  # #SBATCH --time=100
# #SBATCH --time=100
  #SBATCH --ntasks=1
#SBATCH --ntasks=1
  #SBATCH --output=output_%j.txt
#SBATCH --output=output_%j.txt
  #SBATCH --error=error_output_%j.txt
#SBATCH --error=error_output_%j.txt
  #SBATCH --job-name=calc_pi.py
#SBATCH --job-name=calc_pi.py
  #SBATCH --partition=research
#SBATCH --partition=research


  time python3 calc_pi.py
time python3 calc_pi.py
</source>
</source>



Revision as of 10:11, 23 November 2013

submitting jobs: sbatch

from decimal import * D=Decimal getcontext().prec=10000000 p=sum(D(1)/16**k*(D(4)/(8*k+1)-D(2)/(8*k+4)-D(1)/(8*k+5)-D(1)/(8*k+6))for k in range(411)) print(str(p)[:10000002])

<source lang='python'> from decimal import * D=Decimal getcontext().prec=10000000 p=sum(D(1)/16**k*(D(4)/(8*k+1)-D(2)/(8*k+4)-D(1)/(8*k+5)-D(1)/(8*k+6))for k in range(411)) print(str(p)[:10000002]) </source>

<source lang='bash'>

  1. !/bin/bash
  2. #SBATCH --time=100
  3. SBATCH --ntasks=1
  4. SBATCH --output=output_%j.txt
  5. SBATCH --error=error_output_%j.txt
  6. SBATCH --job-name=calc_pi.py
  7. SBATCH --partition=research

time python3 calc_pi.py </source>

 JOBID PARTITION     NAME     USER  ST       TIME  NODES NODELIST(REASON)
  3347  research calc_pi. megen002   R       0:03      1 node049

allocating resources interactively: sallocate

running MPI jobs on B4F cluster

monitoring submitted jobs: squeue

removing jobs from a list: scancel

other

external links