From 09e7acaea4f8787f474d7eaf95b8e25428074701 Mon Sep 17 00:00:00 2001 From: Unknown Date: Tue, 19 Oct 2021 13:26:03 +0200 Subject: [PATCH] Resolve UBSAN error in NBLIB test --- api/nblib/tpr.cpp | 9 ++------- 1 file changed, 2 insertions(+), 7 deletions(-) diff --git a/api/nblib/tpr.cpp b/api/nblib/tpr.cpp index f534dcdedc..8e0d33d1e1 100644 --- a/api/nblib/tpr.cpp +++ b/api/nblib/tpr.cpp @@ -75,14 +75,9 @@ TprReader::TprReader(std::string filename) PartialDeserializedTprFile partialDeserializedTpr = read_tpx_state(filename.c_str(), &inputRecord, &globalState, &molecularTopology); - // init commrec - MPI_Comm simulationCommunicator = MPI_COMM_WORLD; - CommrecHandle crHandle = init_commrec(simulationCommunicator); - t_commrec* commrec = crHandle.get(); - assert((commrec != nullptr) && "Must have valid commrec"); - // init forcerec t_forcerec forceRecord; + t_commrec commrec{}; gmx::ForceProviders forceProviders; forceRecord.forceProviders = &forceProviders; init_forcerec(nullptr, @@ -91,7 +86,7 @@ TprReader::TprReader(std::string filename) &forceRecord, inputRecord, molecularTopology, - commrec, + &commrec, globalState.box, nullptr, nullptr, -- 2.22.0