Skip to content

Fix Particle file output spacing for consistency and ease of parsing#32

Merged
qianglbl merged 3 commits intoimpact-lbl:masterfrom
ken-lauer:fix_output_spacing
Feb 26, 2025
Merged

Fix Particle file output spacing for consistency and ease of parsing#32
qianglbl merged 3 commits intoimpact-lbl:masterfrom
ken-lauer:fix_output_spacing

Conversation

@ken-lauer
Copy link
Contributor

@ken-lauer ken-lauer commented Feb 24, 2025

Changes

  1. Fix leading/trailing spaces in particle file output
  2. Add compilation documentation when using conda-forge's compilers
  3. Fix CI building/running

Particle file output

This fixes the leading spaces in output particle files. This saves a bit of space and makes it slightly easier for not-so-smart parsers to read the output particles (specifically polars.read_csv on our end, which can be ~10x faster than numpy.loadtxt for large particle output files).

Currently particles look like this:

   0.192544220656E-03  -0.451056940538E-04   0.472496073462E-08   0.564525641813E-03  -0.107436741277E-05   0.115771507881E-02  -0.195692801440E-05  -0.000000000000E+00   0.100000000000E+01

After this PR, the leading space and double spaces between should be removed. g0 formatting looks like the following:

0.19254422065579266E-3 -0.45105694053811659E-4 0.47249607346183573E-8 0.56452564181341889E-3 -0.10743674127672016E-5 0.11577150788125525E-2 -0.19569280144029904E-5 -0.0000000000000000 1.0000000000000000

Fortunately, there does not appear to be a trailing space inserted with 9(g0,1x).

CI fix

  • A necessary flag for the standard GNU make workflow to work with modern compilers wasn't being passed (-fallow-argument-mismatch)
  • MPICH on GitHub Actions appears to have issues assigning the number of requested processors for the communicator
    • This made running the first example with 2+ cores impossible. (See notes below)
    • It would result in the error: MPIR_Cart_create_impl(41): Size of the communicator (1) is smaller than the size of the Cartesian topology (2)
    • I adjusted MPICH to only run 1x1 processes, to at least verify that the build worked.

(Similar to impact-lbl/IMPACT-Z#12)

@ken-lauer ken-lauer marked this pull request as ready for review February 26, 2025 21:14
@qianglbl qianglbl merged commit 0fe66e8 into impact-lbl:master Feb 26, 2025
@ken-lauer ken-lauer deleted the fix_output_spacing branch February 27, 2025 00:14
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants