Skip to content

Commit

Permalink
Use PMI for topology on Cray EX (#3616)
Browse files Browse the repository at this point in the history
* Use PMI to query topology information on Cray EX

* Check if simplepmi is used before copying headers
  • Loading branch information
rbuch committed Jun 13, 2022
1 parent f499fbd commit 9f17915
Show file tree
Hide file tree
Showing 7 changed files with 16 additions and 11 deletions.
8 changes: 5 additions & 3 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -810,10 +810,12 @@ if(${NETWORK} MATCHES "ucx" OR ${NETWORK} MATCHES "ofi")
configure_file(${filename} include/ COPYONLY)
endforeach()

# FIXME: this should be in include/proc_management/simple_pmi
foreach(filename ${proc_management-simple_pmi-sources})
if(${LRTS_PMI} MATCHES "simplepmi")
# FIXME: this should be in include/proc_management/simple_pmi
foreach(filename ${proc_management-simple_pmi-sources})
configure_file(${filename} include/ COPYONLY)
endforeach()
endforeach()
endif()
endif()

# Charmxi
Expand Down
2 changes: 1 addition & 1 deletion cmake/detect-features-c.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -292,7 +292,7 @@ int main()
" CMK_HAS_NUMACTRL)

set(tmp ${CMAKE_REQUIRED_LIBRARIES})
set(CMAKE_REQUIRED_LIBRARIES $ENV{CRAY_PMI_POST_LINK_OPTS} $ENV{CRAY_UGNI_POST_LINK_OPTS} -lugni -lpmi)
set(CMAKE_REQUIRED_LIBRARIES $ENV{CRAY_PMI_POST_LINK_OPTS} -lpmi)
check_c_source_compiles("
#include <pmi.h>
int main() {
Expand Down
2 changes: 2 additions & 0 deletions src/arch/mpi-crayshasta/conv-mach.h
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,8 @@
#ifndef _CONV_MACH_H
#define _CONV_MACH_H

#define CMK_CRAYEX 1

#define CMK_CONVERSE_MPI 1

#define CMK_MEMORY_PREALLOCATE_HACK 0
Expand Down
3 changes: 2 additions & 1 deletion src/arch/ofi-crayshasta/conv-mach.h
Original file line number Diff line number Diff line change
@@ -1,7 +1,8 @@
#ifndef _CONV_MACH_H
#define _CONV_MACH_H

#define CMK_OFI 1
#define CMK_CRAYEX 1
#define CMK_OFI 1

/* define the default linker, together with its options */
#define CMK_DLL_CC "g++ -shared -O3 -o "
Expand Down
4 changes: 2 additions & 2 deletions src/conv-core/cpuaffinity.C
Original file line number Diff line number Diff line change
Expand Up @@ -799,7 +799,7 @@ static int search_pemap(char *pecoremap, int pe)
return i;
}

#if CMK_CRAYXE || CMK_CRAYXC
#if CMK_CRAYXE || CMK_CRAYXC || CMK_CRAYEX
CLINKAGE int getXTNodeID(int mpirank, int nummpiranks);
#endif

Expand Down Expand Up @@ -1144,7 +1144,7 @@ void CmiInitCPUAffinity(char **argv)
}
else
{
#if CMK_CRAYXE || CMK_CRAYXC
#if CMK_CRAYXE || CMK_CRAYXC || CMK_CRAYEX
int numCores = CmiNumCores();

int myid = getXTNodeID(CmiMyNodeGlobal(), CmiNumNodesGlobal());
Expand Down
4 changes: 2 additions & 2 deletions src/conv-core/cputopology.C
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@
#include <stdlib.h>
#include <stdio.h>

#if CMK_CRAYXE || CMK_CRAYXC
#if CMK_CRAYXE || CMK_CRAYXC || CMK_CRAYEX
extern "C" int getXTNodeID(int mpirank, int nummpiranks);
#endif

Expand Down Expand Up @@ -406,7 +406,7 @@ extern "C" void LrtsInitCpuTopo(char **argv)
strcpy(hostname, "");
}
#endif
#if CMK_CRAYXE || CMK_CRAYXC
#if CMK_CRAYXE || CMK_CRAYXC || CMK_CRAYEX
if(CmiMyRank() == 0) {
int numPes = cpuTopo.numPes = CmiNumPes();
int numNodes = CmiNumNodes();
Expand Down
4 changes: 2 additions & 2 deletions src/util/topomanager/CrayNid.c
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@
# endif
#endif

#if CMK_CRAYXE || CMK_CRAYXC
#if CMK_CRAYXE || CMK_CRAYXC || CMK_CRAYEX

#if XT3_TOPOLOGY
#else /* if it is a XT4/5 or XE */
Expand All @@ -49,7 +49,7 @@ CLINKAGE int getXTNodeID(int mpirank, int nummpiranks)
return nid;
}

#endif /* CMK_CRAYXE || CMK_CRAYXC */
#endif /* CMK_CRAYXE || CMK_CRAYXC || CMK_CRAYEX */

#if XT4_TOPOLOGY || XT5_TOPOLOGY || XE6_TOPOLOGY

Expand Down

0 comments on commit 9f17915

Please sign in to comment.