lwang-astro / PeTar

PeTar is a high-performance N-body code for modelling the evolution of star clusters and tidal streams, including the effect of galactic potential, dynamics of binary and hierarchical system, single and binary stellar evolution.
MIT License
71 stars 19 forks source link

Ptcl data reading fails when running sample.sh #48

Closed RESBI closed 8 months ago

RESBI commented 9 months ago

Compile with ./configure --enable-cuda

When executing the line of code OMP_NUM_THREADS=8 OMP_STACKSIZE=128M petar -u 1 -b 500 -t 100.0 -o 5.0 input in ‘test/sample.sh’ after generated input datas, it gives an error

Error: Ptcl data reading fails! requiring data number is 4, only obtain 2. Check your input data, whether the consistent features (interrupt mode and external mode) are used in configuring petar and the data generation Aborted (core dumped)

just after it prints the parallelization information. The error was raised at src/ptcl.hpp, Line 183.

gcc version 11.4.0 (Ubuntu 11.4.0-1ubuntu1~22.04)

lwang-astro commented 8 months ago

The sample.sh requires the bse feature switched on (for stellar evolution). This is mentioned in the comment of sample.sh and also shown in the error message you got: "Check your input data, whether the consistent features (interrupt mode and external mode) are used in configuring petar and the data generation".

To properly use the sample.sh file, your configure should include the bse feature:

./configure --with-interrupt=bse --enable-cuda

RESBI commented 8 months ago

Sorry for my carelessness, it's running fine now. Thank you!

nooshinehz commented 3 months ago

I get the same error when I want to use bse When executing the line of code:

OMP_NUM_THREADS=8 OMP_STACKSIZE=128M petar -u 1 -b 500 --bse-metallicity 0.02 -t 100.0 -o 5.0 input &>output

in ‘sample/star_cluster_bse.sh’ after generating input data with mcluster, it gives the error:

----- Parallelization information ----- MPI processors: 1 OMP threads: 8 Error: Ptcl data reading fails! requiring data number is 4, only obtain 2. Check your input data, whether the consistent features (interrupt mode and external mode) are used in configuring petar and the data generation Aborted (core dumped)

while I have already configured the below line:

./configure --with-interrupt=bse --enable-cuda

gcc version gcc (Ubuntu 11.4.0-1ubuntu1~22.04) 11.4.0

lwang-astro commented 3 months ago

The error information suggests that you have not compiled the petar version being consistent with the sample code (with bse, no galpy). Your configure option looks correct, but you may still use the old petar version if you have forgotten to recompile and install the code after configuration. You can check whether you have used the correct PeTar version by using petar -h, if bse is compiled, you will find the --bse--** options

nooshinehz commented 3 months ago

Thanks, it worked! The problem was in compiling PeTar. I had to compile with "sudo make," and "sudo make install".