Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #!/usr/bin/python3.6
- import numpy
- E0 = 10
- Emax = 50
- nstep = 40
- npart = 500000
- # print("for i in {10..15}")
- # print("\tdo")
- # print("\techo \"Run ${i} started\"")
- for i in range(nstep-1, 0, -1):
- step = numpy.power(10, ((i + 1) / nstep) * (numpy.log10(Emax) - numpy.log10(E0)) + numpy.log10(E0)) + \
- numpy.power(10, ((i - 1) / nstep) * (numpy.log10(Emax) - numpy.log10(E0)) + numpy.log10(E0))
- filename = "G4Opt{0:5.2f}_{1:d}K.sh".format(step / 2, npart//1000)
- afile = open(filename, mode='w')
- print("#!/bin/csh", file=afile)
- print("#SBATCH -J G4Opt{0:.0f}_{1:d}K".format(step / 0.02, npart//1000), file=afile)
- print("#SBATCH -e G4Opt{0:.0f}_%j.txt".format(step / 0.02), file=afile)
- print("#SBATCH -o G4Opt_%j.out", file=afile)
- print("#SBATCH --mem-per-cpu=1000", file=afile)
- print("#SBATCH -t 0-06:05:00", file=afile)
- print("#SBATCH -n 768", file=afile)
- print("#SBATCH -p all\n", file=afile)
- print("mpirun ./G4OpticEdep ./RADMON.v2.gdml -n {1:8d} -p proton -e {0:6.3f}".format(step / 2, npart), file=afile)
- afile.close()
- print("sbatch ", filename, sep='', end='\n')
- print("done")
- # (10, ) - pow(10, ((double)(i - 1) / nstep) * (log10(Emax) - log10(E0)) + log10(E0));
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement