eb-local.mpi

module eb-local.mpi  src/mpi.zig[source][autodoc]

MPI transport checks for eb-local doctor --mpi. The overrides are applied only to the hello this module runs. A build does not call this and does not set them.

Types

pub const Transport = enum[source][autodoc]

A site-approved transport. ofi uses the Open MPI cm/ofi pair. ucx uses the ucx point-to-point layer and turns ofi off.

ofi[source]
ucx[source]
pub const Rank = struct[source][autodoc]

One line of hello rank=R size=S cpu=C cpus=N.

rank: u32[source]
size: u32[source]
cpu: i64[source]
cpus: i64[source]
pub const Hello = struct[source][autodoc]

The compiler and the two-rank run for one transport.

source_error: ?[]const u8 = null[source]
missing_compiler: bool = false[source]
missing_launcher: bool = false[source]
compile_code: u32 = 0[source]
compile_timeout: bool = false[source]
ran: bool = false[source]
run_code: u32 = 0[source]
run_timeout: bool = false[source]
ranks: []const Rank = &.{}[source]
override_text: []const u8 = ""[source]

OMPI_MCA_pml=... OMPI_MCA_mtl=..., set only on the hello.

pub const Summary = struct[source][autodoc]

A short reading of fi_info or ucx_info.

present: bool = false[source]
line: []const u8 = ""[source]
code: u32 = 0[source]
timed_out: bool = false[source]

Functions

pub fn parseTransport(name: []const u8) ?Transport[source][autodoc]

ofi or ucx, the only transports a site file may name.

pub fn overrideText(transport: Transport) []const u8[source][autodoc]

The two variables set on the hello, and nowhere else.

pub fn summarize(a: Allocator, exe: ?[]const u8, argv: []const []const u8, envp: proc.Envp) Summary[source][autodoc]

The first non-empty line of argv, at most 160 bytes.

pub fn runHello( a: Allocator, transport: Transport, mpicc: ?[]const u8, mpirun: ?[]const u8, work: []const u8, base: *const std.process.Environ.Map, base_envp: proc.Envp) Allocator.Error!Hello[source][autodoc]

Compile work/hello.c with mpicc and run it with mpirun -np 2. The two Open MPI variables are added to a copy of base for that run.

pub fn parseRanks(a: Allocator, text: []const u8) Allocator.Error![]const Rank[source][autodoc]

Ranks from lines hello rank=R size=S cpu=C cpus=N.

pub fn sharedCpu(ranks: []const Rank) bool[source][autodoc]

True when every reported rank ran on one CPU.