amuse icon indicating copy to clipboard operation
amuse copied to clipboard

Test particles (drift) linked to PeTar - limited success

Open christianboily opened this issue 8 months ago • 3 comments

Describe the bug A clear and concise description of what the bug is.

To Reproduce Steps to reproduce the behavior:

Expected behavior A clear and concise description of what you expected to happen.

Logs If applicable, add logfiles to help explain your problem.

Environment (please complete the following information):

  • OS and version: [e.g. macOS High Sierra; Ubuntu Linux 17.10]
  • Compiler: [e.g. gcc6]

Additional context Add any other context about the problem here.

christianboily avatar Jun 14 '25 12:06 christianboily

I wanted to setup a response code along the line of the "gravity_drifter" textbook example code. I setup a disc with frozen potential and integrated orbits in it (the initial phase-space d.f. for that potential was generated by Agama). I then added a live star cluster integrated with PeTar + SSE . Coupling the disc stars (drifters) to the frozen potential with Bridge() works fine ; adding the star cluster + coupling to the frozen disc works fine ; but oddly couping the drifters to the star cluster worked only when the number of disc orbits < 30k . Then everything works ok : but shifting to > 30k systematically led to a "dead socket" error message after the code crashed.

Replacing the star cluster integrator Petar with Ph4 resolved this issue completely (using 101k drifters works fine). However the internal dynamics is best done by Petar (or Nb6xx for that matter).

So there seems to be a small bug in the Petar interface when the Bridge() retrieves the accelerations that are passed to the drifters. If you have a suggestion as to what I could do to parameterise Petar or its interface to resolve this that would be top.

The bridge structure is as follows :

Stars = disc stars = drifters ; Cl = cluster integrator ; BH = central BH (not needed but ok)
The_potential = forzen galactic potential (mean field) 
                                                
system = Bridge( use_threading=False, method=SPLIT_4TH_S_M4 )   

system.add_system(Stars_gravity, (The_Potential,Cl_gravity, BH_gravity ), do_sync=False )
system.add_system(Cl_gravity, (The_Potential, BH_gravity,), do_sync=True )

A hierarchical setup changed nothing but was slowler (more arithmetic operations) :

system_disc = Bridge( use_threading=False, method=SPLIT_4TH_S_M4 ) system_disc.add_system(Stars_gravity, (The_Potential,), do_sync=False )

system.add_system(system_disc, (Cl_gravity, BH_gravity), do_sync=True ) system.add_system(Cl_gravity, (The_Potential, BH_gravity,), do_sync=True )

Sample output error when running Petar with 1k cluster stars and 31k drifters (field / disc stars ) :

Evolving up to t =  0 Myr
Cluster mass in units of Mcl(0):  1.0 at time [Myr]  0.0
[mac:00000] *** An error occurred in Socket closed
[mac:00000] *** reported by process [110624769,0]
[mac:00000] *** on a NULL communicator
[mac:00000] *** Unknown error
[mac:00000] *** MPI_ERRORS_ARE_FATAL (processes in this communicator will now abort,
[mac:00000] ***    and MPI will try to terminate your MPI job as well)
--------------------------------------------------------------------------
prterun has exited due to process rank 0 with PID 0 on node mac calling
"abort". This may have caused other processes in the application to be
terminated by signals sent by prterun (as reported here).
--------------------------------------------------------------------------

this ran on MacOS 15.5 (Sequoia) with Amuse 24.04.

christianboily avatar Jun 14 '25 12:06 christianboily

@lwang-astro could you have a look at this?

rieder avatar Jun 16 '25 07:06 rieder

From the current error message, it only show MPI crash. Could you provide detailed output log from petar in AMUSE? @rieder you may help to suggest how to allow petar to output log in AMUSE.

lwang-astro avatar Jun 18 '25 14:06 lwang-astro