BNL-C3D / ExaLearn

BNL ExaLearn
1 stars 0 forks source link

Run N-body simulation (PyCola) #7

Closed YHRen closed 5 years ago

YHRen commented 5 years ago

Read the document and run pycola to generate 3D cosmo images. related #4 . pycola

YHRen commented 5 years ago

pycola document is here

YHRen commented 5 years ago

pycola requires MUSIC initialization. MUSIC document here So, based on my naive understanding, it takes a long time (MUSIC) to initialize a universe, and then, takes some other time (either PyCola or Gadget-2) to "evolve" the universe.

YHRen commented 5 years ago

pycola requires MUSIC initialization. MUSIC document here So, based on my naive understanding, it takes a long time (MUSIC) to initialize a universe, and then, takes some other time (either PyCola or Gadget-2) to "evolve" the universe.

YHRen commented 5 years ago

compiling MUSIC requires

  1. fftw3,
  2. GSL
    • apt install libgsl-dev
  3. HDF5
    • apt install libhdf5-openmpi-dev
    • doesn't work :(. ended up using anaconda3.
  4. LIBBOX
    • apt install libbox-dev
  5. compile, change makefile accordingly:
    FFTW3       = yes 
    MULTITHREADFFTW = yes 
    SINGLEPRECISION = yes 
    HAVEHDF5        = yes 
    CC = g++

haha cool logo:

vulcan$ ./MUSIC 

    __    __     __  __     ______     __     ______      
   /\ "-./  \   /\ \/\ \   /\  ___\   /\ \   /\  ___\  
   \ \ \-./\ \  \ \ \_\ \  \ \___  \  \ \ \  \ \ \____ 
    \ \_\ \ \_\  \ \_____\  \/\_____\  \ \_\  \ \_____\ 
     \/_/  \/_/   \/_____/   \/_____/   \/_/   \/_____/ 

                            this is music! version 1.53
YHRen commented 5 years ago

Peter's comment on MUSIC config file: Here's a config file:

[setup]
boxlength = 512
zstart = 0.0
levelmin = 9
levelmax = 9
overlap = 4
align_top = no
baryons = no
use_2LPT = no
use_LLA = no
periodic_TF = yes

[cosmology]
Omega_m                 = 0.385325
Omega_L = 0.614675
w0 = -1.0
wa = 0.0
Omega_b = 0.045
H0 = 70.0
sigma_8                 = 1.00
nspec                   = 0.930515
transfer = eisenstein

[random]
seed[9]                 = 5238374

[output]
##generic MUSIC data format (used for testing)
##requires HDF5 installation and HDF5 enabled in Makefile
format = generic
filename                = ics_2019-01_b5238374.hdf5

[poisson]
fft_fine = yes
accuracy = 1e-5
pre_smooth = 3
post_smooth = 3
smoother = gs
laplace_order = 6
grad_order = 6

For speed I would probably set the boxlength to 128 to start.

Omega_m + Omega_L = 1.0

Range:

0.15 <= Omega_M < 0.45

-0.8 <= w0 <= -1.2

0.5 <= sigma_8 <= 1.0
YHRen commented 5 years ago

install

run

in example.py change music_file to the one generated by MUSIC. change boxsize, level, level_zoom, level0 and level1 to the corresponding values.

YHRen commented 5 years ago

box len 128 takes about 15 mins on my laptop (8700k). Got an error:

Time elapsed on small box (including IC): 779.015093088 seconds.
Making a figure ...
Traceback (most recent call last):
  File "example.py", line 251, in <module>
    0)
TypeError: Argument 'sx' has incorrect type (expected numpy.ndarray, got numpy.float64)
YHRen commented 5 years ago

this seems to be a known issue. there are multiple versions of example*.py in the git repo. in example_orig.py, the same error was rasied as a comment

YHRen commented 5 years ago

1) The error was not critical. 2) Here some thing might be useful. https://github.com/LLNL/lbann