Skip to content

Commit

Permalink
update
Browse files Browse the repository at this point in the history
  • Loading branch information
franciscovillaescusa committed Dec 24, 2020
1 parent 829dce2 commit 5ae8dab
Show file tree
Hide file tree
Showing 3 changed files with 38 additions and 24 deletions.
17 changes: 9 additions & 8 deletions Voids/submitter_driver.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,22 +15,23 @@
nodes = int(realizations/step)

# do a loop over each node
for i in xrange(nodes):
for i in range(nodes):

for folder in ['Om_p', 'Ob2_p', 'h_p', 'ns_p', 's8_p',
'Om_m', 'Ob2_m', 'h_m', 'ns_m', 's8_m',
'Mnu_p', 'Mnu_pp', 'Mnu_ppp', 'fiducial']:
#for folder in ['Om_p', 'Ob2_p', 'h_p', 'ns_p', 's8_p',
# 'Om_m', 'Ob2_m', 'h_m', 'ns_m', 's8_m',
# 'Mnu_p', 'Mnu_pp', 'Mnu_ppp', 'fiducial']:
for folder in ['fiducial_ZA']:


a = """#!/bin/bash
#SBATCH -J void_finder
#SBATCH --exclusive
#SBATCH -t 7-00:00
#SBATCH -t 2-00:00
#SBATCH --nodes=1
#SBATCH --ntasks-per-node=16
#SBATCH --partition=general
#SBATCH --ntasks-per-node=20
#######SBATCH --partition=general
######SBATCH --partition=preempt
#SBATCH --export=ALL
########SBATCH --export=ALL
python void_finder.py %d %d %s\n
Expand Down
19 changes: 13 additions & 6 deletions Voids/void_finder.py
Original file line number Diff line number Diff line change
Expand Up @@ -37,11 +37,16 @@ def find_voids(snapshot, ptypes, grid, MAS, do_RSD, axis, threshold, Radii,
VSF_R = V.Rbins # bins in radius
VSF = V.void_vsf # void size function

parameters = [grid, MAS, '%s'%ptypes, threshold, '%s'%Radii]
parameters = np.array([grid, MAS, '%s'%ptypes, threshold, '%s'%Radii])

# save the results to file
f = h5py.File(fout, 'w')
f.create_dataset('parameters', data=parameters)
f.create_dataset('grid', data=grid)
f.create_dataset('MAS', data=MAS)
f.create_dataset('ptype', data=ptypes)
f.create_dataset('threshold', data=threshold)
f.create_dataset('Radii_input', data=Radii)
#f.create_dataset('parameters', data=parameters)
f.create_dataset('pos', data=void_pos)
f.create_dataset('radius', data=void_radius)
f.create_dataset('VSF_Rbins', data=VSF_R)
Expand All @@ -50,7 +55,8 @@ def find_voids(snapshot, ptypes, grid, MAS, do_RSD, axis, threshold, Radii,



root = '/simons/scratch/fvillaescusa/pdf_information/%s'%args.cosmo
#root = '/simons/scratch/fvillaescusa/pdf_information/%s'%args.cosmo
root = '/projects/QUIJOTE/Snapshots/%s'%args.cosmo
################################# INPUT ######################################
# density field parameters
grid = 768
Expand All @@ -63,10 +69,11 @@ def find_voids(snapshot, ptypes, grid, MAS, do_RSD, axis, threshold, Radii,
threshold = -0.5
Radii = np.array([41, 39, 37, 35, 33, 31, 29, 27, 25, 23, 21, 19, 17, 15, 13,
11, 9, 7, 5], dtype=np.float32)*1000.0/768
threads1 = 16
threads1 = 20
threads2 = 4

root_out = '/simons/scratch/fvillaescusa/pdf_information/Voids/%s'%args.cosmo
#root_out = '/simons/scratch/fvillaescusa/pdf_information/Voids/%s'%args.cosmo
root_out = '/projects/QUIJOTE/Voids/%s'%args.cosmo
##############################################################################

z_dict = {4:0, 3:0.5, 2:1, 1:2, 0:3}
Expand All @@ -75,7 +82,7 @@ def find_voids(snapshot, ptypes, grid, MAS, do_RSD, axis, threshold, Radii,
if not(os.path.exists(root_out)): os.system('mkdir %s'%root_out)

# do a loop over the different realizations
for i in xrange(args.first, args.last):
for i in range(args.first, args.last):

# loop over standard and paired fixed simulations
for prefix in ['%d'%i, 'NCV_0_%d'%i, 'NCV_1_%d'%i]:
Expand Down
26 changes: 16 additions & 10 deletions checksums/check_files.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,26 +12,31 @@
################################## INPUT #######################################
root = '/projects/QUIJOTE/Snapshots'

cosmologies = ['Om_p', 'Om_p']
cosmologies = ['fiducial']
start, end = 6200, 8000
################################################################################

# do a loop over the different cosmologies
for cosmo in cosmologies:

# find the number of standard and paired fixed sims
if cosmo=='fiducial': std, pf = 15000, 250
elif cosmo=='Ob_p': std, pd = 0, 250
elif cosmo=='Ob_m': std, pf = 0, 250
elif cosmo=='w_p': std, pf = 500, 0
elif cosmo=='w_m': std, pf = 500, 0
elif cosmo=='DC_p': std, pf = 500, 0
elif cosmo=='DC_m': std, pf = 500, 0
else: std, pf = 500, 250
if cosmo=='fiducial': std, pf = 15000, 0#250
elif cosmo=='fiducial_LR': std, pf = 1000, 0
elif cosmo=='fiducial_HR': std, pf = 100, 0
elif cosmo=='Ob_p': std, pf = 0, 250
elif cosmo=='Ob_m': std, pf = 0, 250
elif cosmo=='w_p': std, pf = 500, 0
elif cosmo=='w_m': std, pf = 500, 0
elif cosmo=='DC_p': std, pf = 500, 0
elif cosmo=='DC_m': std, pf = 500, 0
else: std, pf = 500, 250
realizations = max(std,pf)

# find the numbers that each cpu will work with
realizations = max(std, pf)
numbers = np.where(np.arange(realizations)%nprocs==myrank)[0]
#numbers = np.where(np.arange(realizations)%nprocs==myrank)[0]
numbers = np.where(np.arange(start,end)%nprocs==myrank)[0]
numbers = np.arange(start,end)[numbers]

# do a loop over all realizations
count = 0
Expand All @@ -51,6 +56,7 @@
folder = '%s/%s/%s'%(root,cosmo,suffix)
os.chdir('%s'%folder)
os.system('sha224sum -c SHA224SUMS --quiet')
print(myrank,count,i,suffix,flush=True)
count += 1
count_partial = np.array(count, dtype=np.int64)
count_total = np.array(0, dtype=np.int64)
Expand Down

0 comments on commit 5ae8dab

Please sign in to comment.