Skip to content

Refactor to drop TransportMan where we can (not bp3/4)#5048

Merged
eisenhauer merged 14 commits into
ornladios:masterfrom
eisenhauer:drop-transportman-bp5
May 28, 2026
Merged

Refactor to drop TransportMan where we can (not bp3/4)#5048
eisenhauer merged 14 commits into
ornladios:masterfrom
eisenhauer:drop-transportman-bp5

Conversation

@eisenhauer

Copy link
Copy Markdown
Member

No description provided.

@eisenhauer eisenhauer requested a review from pnorbert May 26, 2026 20:55
Comment thread source/adios2/engine/bp5/BP5Writer.cpp Outdated
eisenhauer and others added 13 commits May 27, 2026 12:50
Lifts the body of TransportMan::OpenFileTransport into a new
transport::OpenFile (and OpenFileChained) free function. The
TransportMan method becomes a one-line forwarder so existing callers
are unaffected. First step toward dropping TransportMan from
non-frozen engines.
ReadRemoteFile constructed a TransportMan only to call OpenFileTransport
on it once and discard. Use the free function instead. Also drops an
unused local.
FilePool and SharedTarFDCache now decouple from TransportMan via a
TransportOpener typedef (std::function<shared_ptr<Transport>(name,
params)>). Callers pass a lambda that constructs transports however
they like.

BP5Reader's FilePool construction sites switch to lambdas wrapping
transport::OpenFile. m_TransportFactory becomes unused; deletion in a
follow-up commit.
With FilePool taking a TransportOpener lambda, the TransportMan member
is no longer referenced. Remove the field, its constructor init, and
the TransportMan.h include.
Adds transport::MkDirsBarrier alongside OpenFile/OpenFileChained.
TransportMan::MkDirsBarrier forwards to it so frozen engines
(BP3/BP4/DAOS) are unaffected.

BP5Writer's factory-hat m_TransportFactory is now unused: replace its
three OpenFileTransport calls with transport::OpenFile, the MkDirsBarrier
call with the free function, and delete the member.
io.AddTransport() can be called multiple times to attach parallel
transports, but no caller (test, example, or committed config) actually
does this for a BP5 engine. Throw at Init() so the historical
multiplexer paths don't have to remain plausibly multi-transport-safe.
AggTransportData now holds std::vector<std::shared_ptr<Transport>>
m_DataSubstreams instead of a TransportMan. All data writes, opens,
flushes, truncates, seeks, closes, and async-thread handoffs become
explicit loops over the vector.

The 'transportIndex' parameter to DoClose is now ignored: multi-transport
configs are rejected at Init (see prior commit), so close always covers
every substream.

AsyncWriteInfo carries a pointer to the substream vector instead of a
TransportMan* so async writer threads iterate without going through the
manager.
Only frozen engines (BP3, BP4) and the not-yet-migrated DAOS engine
still use TransportMan. Steer new code toward transport::OpenFile and
bare shared_ptr<Transport> members.
Mirrors the BP5 migration (016286c + 69f0cce): DaosWriter and
DaosReader hold std::shared_ptr<Transport> for the metadata files and
open them via transport::OpenFile / transport::MkDirsBarrier.  Init
hard-errors when m_IO.m_TransportsParameters.size() > 1, matching the
BP5 reject pattern.

Reader side also drops dead code that survived the BP5 fork: ReadData
never actually used its FileManager / maxOpenFiles parameters (DAOS
data reads go straight to daos_array_read against m_DataArrayHandles),
so the per-thread fileManagers vector, m_DataFileManager,
m_ActiveFlagFileManager, and singleComm are all removed.  The
PerformGets thread lambda loses its now-unused FileManagerID and
maxOpenFiles arguments.

DestructorClose's UpdateActiveFlag(false) is now correctly guarded to
rank 0 (the prior TransportMan version no-op'd on empty maps, so the
missing guard was latent).

The transportman::TransportMan::GetFilesBaseNames static helper call
in InitTransports is left as-is; same pattern as BP5Writer post-migration.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
Test file was missed in 7da002c (FilePool API change). Replaces the
TransportMan factory with a lambda wrapping transport::OpenFile in each
test, matching the BP5Reader caller pattern.
AggTransportData's m_DataSubstreams (vector), m_SubStreamNames (vector),
and m_DrainSubStreamNames (vector) become singular shared_ptr<Transport>
and string members. The vectors were size-1 by construction
(GetBPSubStreamNames is called with a single base name, and the user
multi-transport feature is rejected at Init).

Drops the for-each loops over m_DataSubstreams in the write path and
across the async writer, where the size-1 invariant made the loop
vestigial. AsyncWriteInfo carries a shared_ptr<Transport>* instead of a
vector*.

CloseFiles and FlushProfiler iterations now null-check m_DataSubstream:
an AggTransportData entry may exist with no open transport when the
rank hasn't written through that aggregator.
@eisenhauer eisenhauer force-pushed the drop-transportman-bp5 branch from 140e51d to f99b52e Compare May 27, 2026 16:51
pnorbert
pnorbert previously approved these changes May 27, 2026
WriteData calls Flush/FinalizeSegment on aggData.m_DataSubstream
unconditionally after the per-mode write dispatch. In TwoLevelShm-style
modes only the aggregator rank holds an open transport; the original
vector-based code silently no-op'd on non-aggregator ranks (empty
vector). The post-singularization code crashed with a null deref —
caught by the lammps contract test. Restores the no-op.
@eisenhauer

Copy link
Copy Markdown
Member Author

@pnorbert One more fix after eliminating the loop...

@eisenhauer eisenhauer enabled auto-merge May 27, 2026 18:16
@eisenhauer eisenhauer merged commit a3f28e1 into ornladios:master May 28, 2026
48 checks passed
@eisenhauer eisenhauer deleted the drop-transportman-bp5 branch May 28, 2026 16:46
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