Skip to content

Conversation

@pkourdis
Copy link

@pkourdis pkourdis commented Dec 8, 2025

Add support for automatically detecting rank and size when running in PALS (Parallel Application Launching System) environments, commonly used with PBS workload managers.

Key changes:

  • Implement query_pals_ranksize to resolve rank/size from PALS/PBS env vars.
  • Add logic to calculate world size using PBS_NODEFILE and PALS_LOCAL_SIZE when PALS_SIZE is unavailable.
  • Add count_file_lines utility for counting the number of lines in a file with empty line handling.
  • Integrate PALS detection into query_ranksize bootstrap logic.
  • Update test helper to support PALS environments.
  • Refactor rank/size validation to ensure non-negative rank and positive size.

@meta-cla meta-cla bot added the CLA Signed This label is managed by the Meta Open Source bot. label Dec 8, 2025
Add support for automatically detecting rank and world size when running
in PALS (Parallel Application Launching System) environments, commonly
used with PBS workload managers.

Key changes:
* Implement `query_pals_ranksize` to resolve rank/size from PALS/PBS env vars.
* Add logic to calculate world size using `PBS_NODEFILE` and `PALS_LOCAL_SIZE`
  when `PALS_SIZE` is unavailable.
* Add `count_file_lines` utility for parsing nodefiles with empty line handling.
* Integrate PALS detection into `query_ranksize` bootstrap logic.
* Update test helpers to support PALS environments.
* Refactor rank/size validation to ensure non-negative rank and positive size.
std::istreambuf_iterator will not set the eofbit.
When counting newline characters with the std::istreambuf_iterator,
files that don't ended with a newline were undercounted by one.

This change should fix this issue.
@pkourdis pkourdis force-pushed the feature/pals-support branch from aea1bff to 5026d61 Compare December 10, 2025 05:28
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

CLA Signed This label is managed by the Meta Open Source bot.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant