Skip to content

mdtest: print out informational output only once#531

Merged
JulianKunkel merged 1 commit intohpc:mainfrom
bertschinger:rank_zero_printing
Mar 4, 2026
Merged

mdtest: print out informational output only once#531
JulianKunkel merged 1 commit intohpc:mainfrom
bertschinger:rank_zero_printing

Conversation

@bertschinger
Copy link
Contributor

When informational output is printed about the arguments passed to mdtest, previously every rank printed out the same messages. Duplicating the same informational messages N times for N ranks isn't helpful for the user.

This change makes it so that only rank 0 prints out informational messages about the parameters.

Before:

$ mpirun -n 4 ./src/mdtest -d test_dir
WARNING: Read bytes is 0, thus, a read test will actually just open/close
WARNING: Read bytes is 0, thus, a read test will actually just open/close
WARNING: Read bytes is 0, thus, a read test will actually just open/close
-- started at 12/10/2025 10:15:46 --

mdtest-4.1.0+dev was launched with 4 total task(s) on 1 node(s)
Command line used: ./src/mdtest '-d' 'test_dir'
WARNING: Read bytes is 0, thus, a read test will actually just open/close
...

After:

$ mpirun -n 4 ./src/mdtest -d test_dir
-- started at 12/10/2025 10:13:29 --

mdtest-4.1.0+dev was launched with 4 total task(s) on 1 node(s)
Command line used: ./src/mdtest '-d' 'test_dir'
WARNING: Read bytes is 0, thus, a read test will actually just open/close
...

When informational output is printed about the arguments passed to
mdtest, previously every rank printed out the same messages. Duplicating
the same informational messages N times for N ranks isn't helpful for
the user.

This change makes it so that only rank 0 prints out informational
messages about the parameters.

Before:

    $ mpirun -n 4 ./src/mdtest -d test_dir
    WARNING: Read bytes is 0, thus, a read test will actually just open/close
    WARNING: Read bytes is 0, thus, a read test will actually just open/close
    WARNING: Read bytes is 0, thus, a read test will actually just open/close
    -- started at 12/10/2025 10:15:46 --

    mdtest-4.1.0+dev was launched with 4 total task(s) on 1 node(s)
    Command line used: ./src/mdtest '-d' 'test_dir'
    WARNING: Read bytes is 0, thus, a read test will actually just open/close
    ...

After:

    $ mpirun -n 4 ./src/mdtest -d test_dir
    -- started at 12/10/2025 10:13:29 --

    mdtest-4.1.0+dev was launched with 4 total task(s) on 1 node(s)
    Command line used: ./src/mdtest '-d' 'test_dir'
    WARNING: Read bytes is 0, thus, a read test will actually just open/close
    ...
@JulianKunkel
Copy link
Collaborator

Cleaner, good job!

@JulianKunkel JulianKunkel merged commit b218534 into hpc:main Mar 4, 2026
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.

3 participants