Become a MacRumors Supporter for $50/year with no ads, ability to filter front page stories, and private forums.

dlnels

macrumors newbie
Original poster
May 28, 2024
1
0
CA
I’m writing an N-body gravitational program to model the Milky Way. I want to use at least 100,000 “heavy” stars, which translates to 100,000**2 or 10 billion operations = 320 GBytes (4 double precision variables). I’ve implemented this on a Mac Studio with 32 GBytes RAM,1 TByte SSD (~370 GBytes free). With multi-threading disabled in my IDL code, and using small data chunks, the program successfully generates a rotating galaxy that takes too long to execute. Using the IDL engine, which facilitates multi-threading, and re-engineering the code to use very large data chunks for the 12 CPU cores to handle, the program crashes after processing about 80 GBytes of data (it runs OK using 50,000 stars). Activity Monitor shows about 60% CPU usage before the crash, reasonable memory pressure and up to 94 GBytes of memory in use by the IDL engine. I presume swapping to virtual is somehow the cause. I understand that RAM cannot be upgraded in the Mac Studios, right?. Any suggestions on the source of the problem and a fix? Thanks!
 

galad

macrumors 6502a
Apr 22, 2022
598
484
Read the crash log, see where it crashes, and fix the issue, we don't have a magic wand to fix your code.
That's a lot of swap, probably performance will suffer a lot.
 
  • Like
Reactions: flybass

apostolosdt

macrumors 6502
Dec 29, 2021
315
280
Like already said, that’s an awful amount of swap memory used. The Studio Max is not a research-grade machine for scientific projects. Any links to an academic environment? Better use their resources.
 
  • Like
Reactions: Eduardot

ultratiem

macrumors newbie
Jun 21, 2023
25
22
What do you mean “crashes.” Please operationally define “crash.” Does the M1 simply shutdown? If so, that’s a thermal issue. There is nothing else that will shutdown a machine. Does it kernel panic? That could be anything and the KP logs will indicate what it is. Does your program simply crash? If so, then as others have said, consult the respective programs crash logs for info.

There’s no such thing as a Mac built for science. Every computer provided they meet the requirements of the program can run it. The only difference is how fast they run it. That’s it. It’s like riding a tricycle on the Tour de France or one built specifically for it. Both will cover the terrain. Only one will do it in an acceptable amount of time.
 
  • Like
Reactions: b17777

Melbourne Park

macrumors 65816
You could order a 192 GB Ram Ultra, and see how it runs. You'll have 14 days to return it for a full credit. Worth the effort IMO. Or find one close by with the top spec to do the same. Bandwidth on RAM is much wider too on those, plus some other stuff. A 1TB drive sounds a bit small too if it starts virtualising.
 
  • Like
Reactions: mac1984
Register on MacRumors! This sidebar will go away, and you'll see fewer ads.