Skip to content
Snippets Groups Projects
Commit 23c5350d authored by Lukáš Krupčík's avatar Lukáš Krupčík
Browse files

Merge branch 'MUST-1.10.0-fiber-preview' into 'main'

Add MUST-1.10.0-fiber-preview-gompi-2022a.eb

See merge request !5
parents f88e1539 cf1e543f
No related branches found
No related tags found
1 merge request!5Add MUST-1.10.0-fiber-preview-gompi-2022a.eb
easyblock = 'CMakeMake'
name = "MUST"
version = "1.10.0-fiber-preview"
homepage = 'https://hpc.rwth-aachen.de/must/'
description = """MUST detects usage errors of the Message Passing Interface (MPI) and reports them
to the user. As MPI calls are complex and usage errors common, this functionality is extremely helpful
for application developers that want to develop correct MPI applications. This includes errors that
already manifest --segmentation faults or incorrect results -- as well as many errors that are not
visible to the application developer or do not manifest on a certain system or MPI implementation.
"""
toolchain = {'name': 'gompi', 'version': '2022a'}
source_urls = ['https://hpc.rwth-aachen.de/must/files/']
sources = ['%(name)s-v%(version)s.tar.gz']
patches = [
'MUST-1.10.0-fiber-preview-tsan-module.patch',
'MUST-1.10.0-fiber-preview-handle-shim.patch',
]
checksums = ['ddbcae9a7d09117470eb9a7cdddbf8772359b9892e24dc70ca9e49011342ffe3',
'16d8a8abfe8ee947a15ee31d93bec917f14184e8680fc1ff3d727a2d4533d122',
'95146c044f27d19ec9b822a163e84d12eaf7edf7b2cee24dc1664026c6c0d161']
builddependencies = [
('CMake', '3.24.3'),
('Python', '3.10.4'),
]
dependencies = [
#('Graphviz', '2.49.3'),
('libxml2', '2.9.13'),
('bzip2', '1.0.8'),
('Clang', '13.0.1', '-CUDA-11.7.0'),
]
preconfigopts = 'export CC=clang CXX=clang++ OMPI_CC=clang OMPI_CXX=clang++ && '
configopts = ' -DCMAKE_BUILD_TYPE=RelWithDebInfo -DENABLE_TYPEART=OFF'
installopts = 'all install-prebuilds'
sanity_check_paths = {
'files': ["bin/mustrun", "include/mustConfig.h"],
'dirs': [],
}
moduleclass = 'perf'
diff '--color=auto' -uNr MUST-orig/externals/mpi-handle-shim/gen-wrappers.w MUST-v1.10.0-beta/externals/mpi-handle-shim/gen-wrappers.w
--- MUST-orig/externals/mpi-handle-shim/gen-wrappers.w 2024-06-28 20:23:58.000000000 +0200
+++ MUST-v1.10.0-beta/externals/mpi-handle-shim/gen-wrappers.w 2024-08-29 09:32:05.994233067 +0200
@@ -62,7 +62,7 @@
return PMPI_Finalize();
}
-{{fnallntype fn_name MPI_Request MPI_Comm_free MPI_Comm_disconnect MPI_Group_free MPI_Type_free MPI_Type_commit MPI_Op_free MPI_Win_free MPI_Session_finalize MPI_Alltoallw MPI_Neighbor_alltoallw MPI_Type_create_struct MPI_Type_get_contents MPI_Type_struct MPI_Alltoallw_c MPI_Neighbor_alltoallw_c MPI_Type_create_struct_c MPI_Type_get_contents_c MPI_Comm_create_keyval MPI_Comm_free_keyval MPI_Keyval_create MPI_Keyval_free MPI_Type_create_keyval MPI_Type_free_keyval MPI_Win_create_keyval MPI_Win_free_keyval MPI_Get_address MPI_Address MPI_Add_error_class MPI_Add_error_code MPI_Add_error_string MPI_Comm_create_errhandler MPI_Errhandler_free MPI_Error_class MPI_Error_string MPI_File_create_errhandler MPI_Session_create_errhandler MPI_Win_create_errhandler MPI_Errhandler_create MPI_Info_create MPI_Info_create_env MPI_Info_delete MPI_Info_dup MPI_Info_free MPI_Info_get MPI_Info_get_nkeys MPI_Info_get_nthkey MPI_Info_get_string MPI_Info_get_valuelen MPI_Info_set MPI_Finalize MPI_Finalized MPI_Init MPI_Init_thread MPI_Initialized MPI_Is_thread_main MPI_Query_thread MPI_Get_library_version MPI_Get_processor_name MPI_Get_version MPI_Pcontrol MPI_Buffer_attach MPI_Buffer_detach MPI_Status_set_cancelled MPI_Test_cancelled MPI_Alloc_mem MPI_Free_mem MPI_Close_port MPI_Lookup_name MPI_Open_port MPI_Publish_name MPI_Unpublish_name MPI_Dims_create MPI_Buffer_attach_c MPI_Buffer_detach_c MPI_File_delete MPI_Register_datarep MPI_Register_datarep_c MPI_Aint_add MPI_Aint_diff }}
+{{fnallntype fn_name MPI_Request MPI_Comm_free MPI_Comm_disconnect MPI_Group_free MPI_Type_free MPI_Type_commit MPI_Op_free MPI_Win_free MPI_Session_finalize MPI_Alltoallw MPI_Neighbor_alltoallw MPI_Type_create_struct MPI_Type_get_contents MPI_Alltoallw_c MPI_Neighbor_alltoallw_c MPI_Type_create_struct_c MPI_Type_get_contents_c MPI_Comm_create_keyval MPI_Comm_free_keyval MPI_Keyval_create MPI_Keyval_free MPI_Type_create_keyval MPI_Type_free_keyval MPI_Win_create_keyval MPI_Win_free_keyval MPI_Get_address MPI_Address MPI_Add_error_class MPI_Add_error_code MPI_Add_error_string MPI_Comm_create_errhandler MPI_Errhandler_free MPI_Error_class MPI_Error_string MPI_File_create_errhandler MPI_Session_create_errhandler MPI_Win_create_errhandler MPI_Errhandler_create MPI_Info_create MPI_Info_create_env MPI_Info_delete MPI_Info_dup MPI_Info_free MPI_Info_get MPI_Info_get_nkeys MPI_Info_get_nthkey MPI_Info_get_string MPI_Info_get_valuelen MPI_Info_set MPI_Finalize MPI_Finalized MPI_Init MPI_Init_thread MPI_Initialized MPI_Is_thread_main MPI_Query_thread MPI_Get_library_version MPI_Get_processor_name MPI_Get_version MPI_Pcontrol MPI_Buffer_attach MPI_Buffer_detach MPI_Status_set_cancelled MPI_Test_cancelled MPI_Alloc_mem MPI_Free_mem MPI_Close_port MPI_Lookup_name MPI_Open_port MPI_Publish_name MPI_Unpublish_name MPI_Dims_create MPI_Buffer_attach_c MPI_Buffer_detach_c MPI_File_delete MPI_Register_datarep MPI_Register_datarep_c MPI_Aint_add MPI_Aint_diff }}
{{apply_to_type MPI_Comm preComm}} {{apply_to_type MPI_Datatype preType}} {{apply_to_type MPI_Group preGroup}} {{apply_to_type MPI_File preFile}} {{apply_to_type MPI_Win preWin}} {{apply_to_type MPI_Op preOp}} {{apply_to_type MPI_Session preSession}}
{{ret_val}} = P{{fn_name}}({{args}});
{{apply_to_type MPI_Comm* postComm}} {{apply_to_type MPI_Datatype* postType}} {{apply_to_type MPI_Group* postGroup}} {{apply_to_type MPI_Win* postWin}} {{apply_to_type MPI_File* postFile}} {{apply_to_type MPI_Op* postOp}} {{apply_to_type MPI_Session* postSession}}
diff '--color=auto' -uNr MUST-orig/externals/mpi-handle-shim/man-wrappers.cpp MUST-v1.10.0-beta/externals/mpi-handle-shim/man-wrappers.cpp
--- MUST-orig/externals/mpi-handle-shim/man-wrappers.cpp 2024-06-28 20:23:58.000000000 +0200
+++ MUST-v1.10.0-beta/externals/mpi-handle-shim/man-wrappers.cpp 2024-08-29 09:31:54.604231971 +0200
@@ -131,30 +131,6 @@
}
#ifdef HAVE_COUNT
-/* ================== C Wrappers for MPI_Type_struct ================== */
-int PMPI_Type_struct(int count, int array_of_blocklengths[],
- MPI_Aint array_of_displacements[],
- MPI_Datatype array_of_types[], MPI_Datatype *newtype);
-int MPI_Type_struct(int count, int array_of_blocklengths[],
- MPI_Aint array_of_displacements[],
- MPI_Datatype array_of_types[], MPI_Datatype *newtype) {
- int _wrap_py_return_val = 0;
-#ifdef HANDLE_TYPE
- MPI_Datatype myTypes[count];
- for (int i = 0; i < count; i++) {
- myTypes[i] = tf.getHandle(array_of_types[i]);
- }
-#else
- MPI_Datatype *myTypes = array_of_types;
-#endif
-
- _wrap_py_return_val = PMPI_Type_struct(
- count, array_of_blocklengths, array_of_displacements, myTypes, newtype);
- postType(newtype);
-
- return _wrap_py_return_val;
-}
-
/* ================== C Wrappers for MPI_Alltoallw_c ================== */
int PMPI_Alltoallw_c(const void *sendbuf, const MPI_Count sendcounts[],
const MPI_Aint sdispls[], const MPI_Datatype sendtypes[],
--- b/modules/MpiTSanAnnotations/MpiTSanAnnotations.cpp
+++ a/modules/MpiTSanAnnotations/MpiTSanAnnotations.cpp
@@ -24,8 +24,8 @@
// Constructor
//=============================
MpiTSanAnnotations::MpiTSanAnnotations(const char* instanceName)
+ : gti::ModuleBase<MpiTSanAnnotations, I_MpiTSanAnnotations, true>(instanceName), requestBlocklist(),
+ preparedBlocklists(), requestLocation()
- : gti::ModuleBase<MpiTSanAnnotations, I_MpiTSanAnnotations, true>(instanceName),
- requestBlocklist(), preparedBlocklists(), requestLocation()
{
// create sub modules
std::vector<I_Module*> subModInstances;
@@ -132,7 +132,7 @@
const MustMemIntervalListType& iList,
void* fp = nullptr)
{
+ assert(iList.size()==1);
- assert(iList.size() == 1);
void* pc;
PNMPI_Service_GetReturnAddress(&pc);
if (!fp) {
@@ -149,8 +149,7 @@
<< std::endl;
#endif
if (stridedBlock.isSend) {
+ if(!reqIsSend){ printf("annotateFromMemIntervalList: %i, size = %lu\n", reqIsSend, iList.size()); }
- // if(!reqIsSend){ printf("annotateFromMemIntervalList: %i, size = %lu\n", reqIsSend,
- // iList.size()); }
assert(reqIsSend);
if (stridedBlock.stride == 0) {
myTSanMod->annotateMemoryReadPC(
@@ -171,8 +170,7 @@
}
}
} else {
+ if(reqIsSend){ printf("annotateFromMemIntervalList: %i, size = %lu\n", reqIsSend, iList.size()); }
- // if(reqIsSend){ printf("annotateFromMemIntervalList: %i, size = %lu\n", reqIsSend,
- // iList.size()); }
assert(!reqIsSend);
if (stridedBlock.stride == 0) {
myTSanMod->annotateMemoryWritePC(
@@ -241,15 +239,14 @@
}
{
auto x_safe_requestBlocklist = xlock_safe_ptr(requestBlocklist);
+/* auto list = (*x_safe_requestBlocklist)[rank].find(request);
+ if (list == (*x_safe_requestBlocklist)[rank].end())
+ (*x_safe_requestBlocklist)[rank][request] = preparedList;
+ else {
+ printf("Found request (%li, %li) in requestBlocklist when it should not be there\n", pId&0xffffff, request);
+ assert(false && "Found request in requestBlocklist when it should not be there");
+ //list->second.insert(preparedList.begin(), preparedList.end());
+ }*/
- /* auto list = (*x_safe_requestBlocklist)[rank].find(request);
- if (list == (*x_safe_requestBlocklist)[rank].end())
- (*x_safe_requestBlocklist)[rank][request] = preparedList;
- else {
- printf("Found request (%li, %li) in requestBlocklist when it should not be
- there\n", pId&0xffffff, request); assert(false && "Found request in requestBlocklist when
- it should not be there");
- //list->second.insert(preparedList.begin(), preparedList.end());
- }*/
(*x_safe_requestBlocklist)[rank][request] = preparedList;
}
@@ -263,26 +260,22 @@
myTSanMod->annotateHappensBefore(pId, lId, newFiber);
}
#else
+/* myTSanMod->annotateIgnoreSyncBegin();
+ annotateFromMemIntervalList(pId, lId, preparedList, fp);
+ myTSanMod->annotateIgnoreSyncEnd();*/
- /* myTSanMod->annotateIgnoreSyncBegin();
- annotateFromMemIntervalList(pId, lId, preparedList, fp);
- myTSanMod->annotateIgnoreSyncEnd();*/
myTSanMod->annotateHappensBefore(pId, lId, rInfo);
#endif
#ifndef NDEBUG
bool isSend = preparedList.begin()->isSend;
+ for (const auto& i: preparedList)
- for (const auto& i : preparedList)
assert(i.isSend == isSend);
#endif
return GTI_ANALYSIS_SUCCESS;
}
+template<class T>
+std::pair<const T&,bool> getRequestRankElement(sf::contfree_safe_ptr<mustPidRequestMap<T>>& map, int rank, MustRequestType req){
-template <class T>
-std::pair<const T&, bool> getRequestRankElement(
- sf::contfree_safe_ptr<mustPidRequestMap<T>>& map,
- int rank,
- MustRequestType req)
-{
static T nullObj{};
auto ret = std::make_pair(nullObj, false);
auto smap = slock_safe_ptr(map);
@@ -299,21 +292,21 @@
MpiTSanAnnotations::makeBlocksInActive(MustParallelId pId, MustRequestType request)
{
int rank = myPIdMod->getInfoForId(pId).rank;
+ auto infoRes = getRequestRankElement(requestLocation,rank,request);
+ if(!infoRes.second)
- auto infoRes = getRequestRankElement(requestLocation, rank, request);
- if (!infoRes.second)
return GTI_ANALYSIS_SUCCESS;
const auto& info = infoRes.first;
I_Request* rInfo = myReqMod->getRequest(pId, request);
#ifdef USE_FIBERS
void* curFiber = myTSanMod->getCurrentFiber();
+ //int stackSize = myTSanMod->getStacksize(curFiber);
+ //assert(stackSize>0);
- // int stackSize = myTSanMod->getStacksize(curFiber);
- // assert(stackSize>0);
auto x_safe_fiberList = xlock_safe_ptr(fiberList);
void* rFiber = (*x_safe_fiberList)[rank][request];
+ if(rFiber)
- if (rFiber)
myTSanMod->switchToFiber(rFiber, 1);
myTSanMod->annotateHappensAfter(pId, info.lId, rFiber);
#else
@@ -323,29 +316,24 @@
// ignore any synchronization implied while annotating mem access (otherwise we might run
// into false negatives due to usage of safeptr etc.)
myTSanMod->annotateIgnoreSyncBegin();
+ //assert(bl.size()==1);
+// annotateFromMemIntervalList(info.pId, info.lId, bl, info.fp);
- // assert(bl.size()==1);
- // annotateFromMemIntervalList(info.pId, info.lId, bl, info.fp);
auto x_safe_requestBlocklist = xlock_safe_ptr(requestBlocklist);
+// printf("makeBlocksInActive(%li, %li)\n", pId&0xffffff, request);
+ assert((*x_safe_requestBlocklist)[rank].find(request) != (*x_safe_requestBlocklist)[rank].end());
+ annotateFromMemIntervalList(info.pId, info.lId, (*x_safe_requestBlocklist)[rank][request], info.fp);
- // printf("makeBlocksInActive(%li, %li)\n", pId&0xffffff, request);
- assert(
- (*x_safe_requestBlocklist)[rank].find(request) != (*x_safe_requestBlocklist)[rank].end());
- annotateFromMemIntervalList(
- info.pId,
- info.lId,
- (*x_safe_requestBlocklist)[rank][request],
- info.fp);
myTSanMod->annotateIgnoreSyncEnd();
#ifdef USE_FIBERS
// switch to current thread *with* synchronization
// (memory accesses afterwards do *not* conflict with *this* annotated call)
+ if(rFiber)
- if (rFiber)
myTSanMod->switchToFiber(curFiber, 0);
+// assert(curFiber == myTSanMod->getCurrentFiber());
+// int stackSize2 = myTSanMod->getStacksize(curFiber);
+// assert(stackSize == stackSize2);
+// assert(stackSize2 > 0);
+// myTSanMod->destroyFiber(rInfo->getFiber());
- // assert(curFiber == myTSanMod->getCurrentFiber());
- // int stackSize2 = myTSanMod->getStacksize(curFiber);
- // assert(stackSize == stackSize2);
- // assert(stackSize2 > 0);
- // myTSanMod->destroyFiber(rInfo->getFiber());
myTSanMod->destroyFiber(rFiber);
(*x_safe_fiberList)[rank].erase(request);
#endif
@@ -353,12 +341,10 @@
// after deleting the blocks from activeBlocks, delete the list of bookmarks
auto x_safe_requestLocation = xlock_safe_ptr(requestLocation);
(*x_safe_requestLocation)[rank].erase(request);
+// (*xlock_safe_ptr(requestBlocklist))[rank].erase(request);
+ assert((*x_safe_requestBlocklist)[rank].find(request) != (*x_safe_requestBlocklist)[rank].end());
- // (*xlock_safe_ptr(requestBlocklist))[rank].erase(request);
- assert(
- (*x_safe_requestBlocklist)[rank].find(request) != (*x_safe_requestBlocklist)[rank].end());
(*x_safe_requestBlocklist)[rank].erase(request);
+ assert((*x_safe_requestBlocklist)[rank].find(request) == (*x_safe_requestBlocklist)[rank].end());
- assert(
- (*x_safe_requestBlocklist)[rank].find(request) == (*x_safe_requestBlocklist)[rank].end());
return GTI_ANALYSIS_SUCCESS;
}
@@ -369,11 +355,9 @@
(*x_safe_requestLocation)[rank].erase(request);
auto x_safe_requestBlocklist = xlock_safe_ptr(requestBlocklist);
+ assert((*x_safe_requestBlocklist)[rank].find(request) != (*x_safe_requestBlocklist)[rank].end());
- assert(
- (*x_safe_requestBlocklist)[rank].find(request) != (*x_safe_requestBlocklist)[rank].end());
(*x_safe_requestBlocklist)[rank].erase(request);
+ assert((*x_safe_requestBlocklist)[rank].find(request) == (*x_safe_requestBlocklist)[rank].end());
- assert(
- (*x_safe_requestBlocklist)[rank].find(request) == (*x_safe_requestBlocklist)[rank].end());
#ifdef USE_FIBERS
auto x_safe_fiberList = xlock_safe_ptr(fiberList);
@@ -852,8 +836,7 @@
}
{
auto x_safe_preparedBlocklists = xlock_safe_ptr(preparedBlocklists);
+ (*x_safe_preparedBlocklists)[myPIdMod->getInfoForId(pId).rank][request] = calcIntervalList(typeinfo, buffer, count, request, true);
- (*x_safe_preparedBlocklists)[myPIdMod->getInfoForId(pId).rank][request] =
- calcIntervalList(typeinfo, buffer, count, request, true);
}
return GTI_ANALYSIS_SUCCESS;
}
@@ -880,9 +863,9 @@
return GTI_ANALYSIS_SUCCESS;
}
MustMemIntervalListType iList = calcIntervalList(typeinfo, buffer, count, request, true);
+ for (const auto& i: iList)
- for (const auto& i : iList)
assert(i.isSend);
+ assert(iList.size()==1);
- assert(iList.size() == 1);
makeBlocksActive(pId, lId, iList, request);
return GTI_ANALYSIS_SUCCESS;
@@ -913,11 +896,9 @@
int rank = myPIdMod->getInfoForId(pId).rank;
{
auto x_safe_preparedBlocklists = xlock_safe_ptr(preparedBlocklists);
+ (*x_safe_preparedBlocklists)[rank][request] = calcIntervalList(typeinfo, buffer, count, request, true);
- (*x_safe_preparedBlocklists)[rank][request] =
- calcIntervalList(typeinfo, buffer, count, request, true);
}
+// (*xlock_safe_ptr(preparedBlocklists))[pId][request] = calcIntervalList(typeinfo, buffer, count, request, false);
- // (*xlock_safe_ptr(preparedBlocklists))[pId][request] = calcIntervalList(typeinfo, buffer,
- // count, request, false);
return GTI_ANALYSIS_SUCCESS;
}
@@ -960,9 +941,9 @@
return GTI_ANALYSIS_SUCCESS;
}
MustMemIntervalListType iList = calcIntervalList(typeinfo, buffer, count, request, false);
+ for (const auto& i: iList)
- for (const auto& i : iList)
assert(!i.isSend);
+ assert(iList.size()==1);
- assert(iList.size() == 1);
makeBlocksActive(pId, lId, iList, request);
return GTI_ANALYSIS_SUCCESS;
@@ -986,9 +967,8 @@
if (reqMapPos == pIdMapPos->second.end()) {
return GTI_ANALYSIS_SUCCESS;
}*/
+ auto pblRes = getRequestRankElement(preparedBlocklists,myPIdMod->getInfoForId(pId).rank,request);
+ if(!pblRes.second)
- auto pblRes =
- getRequestRankElement(preparedBlocklists, myPIdMod->getInfoForId(pId).rank, request);
- if (!pblRes.second)
return GTI_ANALYSIS_SUCCESS;
const auto& pbl = pblRes.first;
@@ -1079,5 +1059,5 @@
buffer);
}
+// return ret;
- // return ret;
}
\ No newline at end of file
--- b/utility/mustrun2.sh
+++ a/utility/mustrun2.sh
@@ -734,7 +734,7 @@
if cmaketrue "@ENABLE_TSAN@" && [ $do_tsan -ne 0 ]
then
+ echo >> $printLayoutFile " <analysis name=\"TSanMessages\" group=\"MUST_TSanMessages\"/>"
- # echo >> $printLayoutFile " <analysis name=\"TSanMessages\" group=\"MUST_TSanMessages\"/>"
echo >> $printLayoutFile " <analysis name=\"MpiTSanAnnotations\" group=\"MUST_TSan\"/>"
fi
@@ -2434,7 +2434,7 @@
must_exports="${must_exports} PNMPI_CONF"
if cmaketrue "@ENABLE_TSAN@" && [ $do_tsan -ne 0 ]
then
+ export LD_PRELOAD=@CMAKE_INSTALL_PREFIX@/modules/libTSanMessages.so:$LD_PRELOAD
- # export LD_PRELOAD=@CMAKE_INSTALL_PREFIX@/modules/libTSanMessages.so:$LD_PRELOAD
must_exports="${must_exports} LD_PRELOAD"
fi
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment