UCL-RITS / pi_examples

A lot of ways to run the same way of calculating pi. Some of them are dumb.
Creative Commons Zero v1.0 Universal
28 stars 8 forks source link

Fix type of iterator in `c_hybrid_mpi+openmp` #22

Closed giordano closed 20 hours ago

giordano commented 5 days ago

int can be too small to deal with large number of steps, and long int matches the type of num_steps https://github.com/UCL-RITS/pi_examples/blob/09f685ae96e8abe69d009cb5e461c36c979c4267/c_hybrid_mpi%2Bopenmp_dir/hybrid_pi.c#L6 Also, this matches what's done in c_pi: https://github.com/UCL-RITS/pi_examples/blob/09f685ae96e8abe69d009cb5e461c36c979c4267/c_pi_dir/pi.c#L6

Ref: https://github.com/UCL-RITS/pi_examples/issues/21#issuecomment-2123621687