<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<style type="text/css" style="display:none;"> P {margin-top:0;margin-bottom:0;} </style>
</head>
<body dir="ltr">
<div style="font-family: Calibri, Arial, Helvetica, sans-serif; font-size: 12pt; color: rgb(0, 0, 0);">
Hi Kurt,</div>
<div style="font-family: Calibri, Arial, Helvetica, sans-serif; font-size: 12pt; color: rgb(0, 0, 0);">
<br>
</div>
<div style="font-family: Calibri, Arial, Helvetica, sans-serif; font-size: 12pt; color: rgb(0, 0, 0);">
Did you build mpich with Fortran disabled? MPI_LOGICAL is a Fortran datatype and is unavailable when Fortran binding is disabled. Try use
<code>MPI_C_BOOL</code>​ instead. If you didn't disable <code>cxx</code>​, you may also try use
<code>MPI_CXX_BOOL</code>​ since you are programming in C++.</div>
<div style="font-family: Calibri, Arial, Helvetica, sans-serif; font-size: 12pt; color: rgb(0, 0, 0);">
<br>
</div>
<div style="font-family: Calibri, Arial, Helvetica, sans-serif; font-size: 12pt; color: rgb(0, 0, 0);">
Hui<br>
</div>
<div id="appendonsend"></div>
<hr style="display:inline-block;width:98%" tabindex="-1">
<div id="divRplyFwdMsg" dir="ltr"><font face="Calibri, sans-serif" style="font-size:11pt" color="#000000"><b>From:</b> Mccall, Kurt E. (MSFC-EV41) via discuss <discuss@mpich.org><br>
<b>Sent:</b> Saturday, November 13, 2021 2:56 PM<br>
<b>To:</b> discuss@mpich.org <discuss@mpich.org><br>
<b>Cc:</b> Mccall, Kurt E. (MSFC-EV41) <kurt.e.mccall@nasa.gov><br>
<b>Subject:</b> Re: [mpich-discuss] Maximum number of inter-communicators?</font>
<div> </div>
</div>
<style>
<!--
@font-face
        {font-family:"Cambria Math"}
@font-face
        {font-family:Calibri}
p.x_MsoNormal, li.x_MsoNormal, div.x_MsoNormal
        {margin:0in;
        font-size:11.0pt;
        font-family:"Calibri",sans-serif}
a:link, span.x_MsoHyperlink
        {color:blue;
        text-decoration:underline}
p.x_xmsonormal, li.x_xmsonormal, div.x_xmsonormal
        {margin:0in;
        font-size:11.0pt;
        font-family:"Calibri",sans-serif}
span.x_EmailStyle20
        {font-family:"Calibri",sans-serif;
        color:windowtext}
.x_MsoChpDefault
        {font-size:10.0pt}
@page WordSection1
        {margin:1.0in 1.0in 1.0in 1.0in}
div.x_WordSection1
        {}
-->
</style>
<div lang="EN-US" link="blue" vlink="purple" style="word-wrap:break-word">
<div class="x_WordSection1">
<div>
<div style="border:none; border-top:solid #E1E1E1 1.0pt; padding:3.0pt 0in 0in 0in">
<p class="x_MsoNormal">Hui,</p>
<p class="x_MsoNormal"> </p>
<p class="x_MsoNormal">I built MPICH 4.0a2 with gcc 4.8.5, and included the -enable-g=all flag to “configure” so that debugging symbols would be present.   The code is crashing my call to MPI_Type_commit, in libpthreads.so.   gdb give this stack trace below. 
 Since MPICH 3.3.2, has there been changes in how custom types are created (the code worked in 3.3.2)?   I included my type-creating code after the stack trace.</p>
<p class="x_MsoNormal"> </p>
<p class="x_MsoNormal">Program received signal SIGSEGV, Segmentation fault.</p>
<p class="x_MsoNormal">MPIR_Typerep_create_struct (count=count@entry=8, array_of_blocklengths=array_of_blocklengths@entry=0x128b6b0,
</p>
<p class="x_MsoNormal">    array_of_displacements=array_of_displacements@entry=0x7fffcaa243c0,
</p>
<p class="x_MsoNormal">    array_of_types=array_of_types@entry=0x7fffcaa24410, </p>
<p class="x_MsoNormal">    newtype=newtype@entry=0x7fec8bedd258 <MPIR_Datatype_direct+1400>)</p>
<p class="x_MsoNormal">    at ../mpich-4.0a2/src/mpi/datatype/typerep/src/typerep_dataloop_create.c:659</p>
<p class="x_MsoNormal">659                 MPIR_Ensure_Aint_fits_in_int(old_dtp->builtin_element_size);</p>
<p class="x_MsoNormal"> </p>
<p class="x_MsoNormal">(gdb) where</p>
<p class="x_MsoNormal"> </p>
<p class="x_MsoNormal">#0  MPIR_Typerep_create_struct (count=count@entry=8, array_of_blocklengths=array_of_blocklengths@entry=0x128b6b0,
</p>
<p class="x_MsoNormal">    array_of_displacements=array_of_displacements@entry=0x7fffcaa243c0,
</p>
<p class="x_MsoNormal">    array_of_types=array_of_types@entry=0x7fffcaa24410, </p>
<p class="x_MsoNormal">    newtype=newtype@entry=0x7fec8bedd258 <MPIR_Datatype_direct+1400>)</p>
<p class="x_MsoNormal">    at ../mpich-4.0a2/src/mpi/datatype/typerep/src/typerep_dataloop_create.c:659</p>
<p class="x_MsoNormal">#1  0x00007fec8b9b2608 in type_struct (count=count@entry=8, blocklength_array=blocklength_array@entry=0x128b6b0,
</p>
<p class="x_MsoNormal">    displacement_array=displacement_array@entry=0x7fffcaa243c0, oldtype_array=oldtype_array@entry=0x7fffcaa24410,
</p>
<p class="x_MsoNormal">    newtype=newtype@entry=0x7fffcaa242dc) at ../mpich-4.0a2/src/mpi/datatype/type_create.c:206</p>
<p class="x_MsoNormal">#2  0x00007fec8b9b4b9e in type_struct (newtype=0x7fffcaa242dc, oldtype_array=0x7fffcaa24410,
</p>
<p class="x_MsoNormal">    displacement_array=0x7fffcaa243c0, blocklength_array=0x128b6b0, count=8)</p>
<p class="x_MsoNormal">    at ../mpich-4.0a2/src/mpi/datatype/type_create.c:227</p>
<p class="x_MsoNormal">#3  MPIR_Type_struct (count=count@entry=8, blocklength_array=0x128b6b0,
</p>
<p class="x_MsoNormal">    displacement_array=displacement_array@entry=0x7fffcaa243c0, oldtype_array=oldtype_array@entry=0x7fffcaa24410,
</p>
<p class="x_MsoNormal">    newtype=newtype@entry=0x7fffcaa242dc) at ../mpich-4.0a2/src/mpi/datatype/type_create.c:235</p>
<p class="x_MsoNormal">#4  0x00007fec8b9b7b08 in MPIR_Type_create_struct_impl (count=count@entry=8,
</p>
<p class="x_MsoNormal">    array_of_blocklengths=array_of_blocklengths@entry=0x7fffcaa24440,
</p>
<p class="x_MsoNormal">    array_of_displacements=array_of_displacements@entry=0x7fffcaa243c0,
</p>
<p class="x_MsoNormal">    array_of_types=array_of_types@entry=0x7fffcaa24410, newtype=newtype@entry=0x12853fc)</p>
<p class="x_MsoNormal">    at ../mpich-4.0a2/src/mpi/datatype/type_create.c:908</p>
<p class="x_MsoNormal">#5  0x00007fec8b85ad26 in internal_Type_create_struct (newtype=0x12853fc, array_of_types=0x7fffcaa24410,
</p>
<p class="x_MsoNormal">    array_of_displacements=<optimized out>, array_of_blocklengths=0x7fffcaa24440, count=8)</p>
<p class="x_MsoNormal">    at ../mpich-4.0a2/src/binding/c/datatype/type_create_struct.c:79</p>
<p class="x_MsoNormal">#6  PMPI_Type_create_struct (count=8, array_of_blocklengths=0x7fffcaa24440, array_of_displacements=0x7fffcaa243c0,
</p>
<p class="x_MsoNormal">    array_of_types=0x7fffcaa24410, newtype=0x12853fc)</p>
<p class="x_MsoNormal">    at ../mpich-4.0a2/src/binding/c/datatype/type_create_struct.c:164</p>
<p class="x_MsoNormal">#7  0x0000000000438dfb in needles::MpiMsgBasic::createMsgDataType (this=0x12853fc) at src/MsgBasic.cpp:97</p>
<p class="x_MsoNormal">#8  0x0000000000412b77 in needles::NeedlesMpiManager::init (this=0x12853a0, argc=23, argv=0x7fffcaa24e08, rank=20,
</p>
<p class="x_MsoNormal">    world_size=21) at src/NeedlesMpiManager.cpp:204</p>
<p class="x_MsoNormal">#9  0x000000000040605f in main (argc=23, argv=0x7fffcaa24e08) at src/NeedlesMpiManagerMain.cpp:142</p>
<p class="x_MsoNormal">(gdb) </p>
<p class="x_MsoNormal"> </p>
<p class="x_MsoNormal"> </p>
<p class="x_MsoNormal"> </p>
<p class="x_MsoNormal">Here is my code that creates the custom type and then calls MPI_Type_commit:</p>
<p class="x_MsoNormal"> </p>
<p class="x_MsoNormal">    MsgBasic obj;</p>
<p class="x_MsoNormal">    int struct_len = 8, i;</p>
<p class="x_MsoNormal"> </p>
<p class="x_MsoNormal">    int block_len[struct_len];</p>
<p class="x_MsoNormal">    MPI_Datatype types[struct_len];</p>
<p class="x_MsoNormal">    MPI_Aint displacements[struct_len];</p>
<p class="x_MsoNormal"> </p>
<p class="x_MsoNormal">    i = 0;</p>
<p class="x_MsoNormal">    block_len[i] = 1;</p>
<p class="x_MsoNormal">    types[i] = MPI_LOGICAL;</p>
<p class="x_MsoNormal">    displacements[i] = (size_t) &obj.tuple_valid_  - (size_t) &obj;</p>
<p class="x_MsoNormal"> </p>
<p class="x_MsoNormal">    ++i;</p>
<p class="x_MsoNormal">    block_len[i] = 1;</p>
<p class="x_MsoNormal">    types[i] = MPI_LOGICAL;</p>
<p class="x_MsoNormal">    displacements[i] = (size_t) &obj.tuple_seq_valid_  - (size_t) &obj;</p>
<p class="x_MsoNormal"> </p>
<p class="x_MsoNormal">    // the int array "start_" member</p>
<p class="x_MsoNormal">    ++i;</p>
<p class="x_MsoNormal">    block_len[i] = Tuple::N_INDICES_MAX_;</p>
<p class="x_MsoNormal">    types[i] = MPI_SHORT;</p>
<p class="x_MsoNormal">    displacements[i] = (size_t) &obj.start_  - (size_t) &obj;</p>
<p class="x_MsoNormal"> </p>
<p class="x_MsoNormal">    // the int array "end_" member</p>
<p class="x_MsoNormal">    ++i;</p>
<p class="x_MsoNormal">    block_len[i] = Tuple::N_INDICES_MAX_;</p>
<p class="x_MsoNormal">    types[i] = MPI_SHORT;</p>
<p class="x_MsoNormal">    displacements[i] = (size_t) &obj.end_  - (size_t) &obj;</p>
<p class="x_MsoNormal"> </p>
<p class="x_MsoNormal">    // the integer "opcode_" member</p>
<p class="x_MsoNormal">    ++i;</p>
<p class="x_MsoNormal">    block_len[i] = 1;</p>
<p class="x_MsoNormal">    types[i] = MPI_INT;</p>
<p class="x_MsoNormal">    displacements[i] = (size_t) &obj.opcode_ - (size_t) &obj;</p>
<p class="x_MsoNormal"> </p>
<p class="x_MsoNormal">    // the boolean "success_" member</p>
<p class="x_MsoNormal">    ++i;</p>
<p class="x_MsoNormal">    block_len[i] = 1;</p>
<p class="x_MsoNormal">    types[i] = MPI_LOGICAL;  // NOTE: might be MPI_BOOLEAN in later version</p>
<p class="x_MsoNormal">    displacements[i] = (size_t) &obj.success_  - (size_t) &obj;</p>
<p class="x_MsoNormal"> </p>
<p class="x_MsoNormal">    // the double "run_time_sec_" member</p>
<p class="x_MsoNormal">    ++i;</p>
<p class="x_MsoNormal">    block_len[i] = 1;</p>
<p class="x_MsoNormal">    types[i] = MPI_DOUBLE;</p>
<p class="x_MsoNormal">    displacements[i] = (size_t) &obj.run_time_sec_ - (size_t) &obj;</p>
<p class="x_MsoNormal"> </p>
<p class="x_MsoNormal">    // the char array "error_msg_" member</p>
<p class="x_MsoNormal">    ++i;</p>
<p class="x_MsoNormal">    block_len[i] = NeedlesMpi::ERROR_MSG_LEN_ + 1;</p>
<p class="x_MsoNormal">    types[i] = MPI_CHAR;</p>
<p class="x_MsoNormal">    displacements[i] = (size_t) &obj.error_msg_[0] - (size_t) &obj;</p>
<p class="x_MsoNormal"> </p>
<p class="x_MsoNormal">    MPI_Type_create_struct(struct_len, block_len, displacements,</p>
<p class="x_MsoNormal">        types, &msg_data_type_);</p>
<p class="x_MsoNormal">    MPI_Type_commit(&msg_data_type_);</p>
<p class="x_MsoNormal"> </p>
<p class="x_MsoNormal">Thanks,</p>
<p class="x_MsoNormal">Kurt</p>
<p class="x_MsoNormal"><b> </b></p>
<p class="x_MsoNormal"><b>From:</b> Zhou, Hui <<a href="mailto:zhouh@anl.gov">zhouh@anl.gov</a>>
<br>
<b>Sent:</b> Sunday, October 24, 2021 6:46 PM<br>
<b>To:</b> <a href="mailto:discuss@mpich.org">discuss@mpich.org</a><br>
<b>Cc:</b> Mccall, Kurt E. (MSFC-EV41) <<a href="mailto:kurt.e.mccall@nasa.gov">kurt.e.mccall@nasa.gov</a>><br>
<b>Subject:</b> [EXTERNAL] Re: Maximum number of inter-communicators?</p>
</div>
</div>
<p class="x_MsoNormal"> </p>
<div>
<p class="x_MsoNormal"><span style="font-size:12.0pt; color:black">Hi Kurt,</span></p>
</div>
<div>
<p class="x_MsoNormal"><span style="font-size:12.0pt; color:black"> </span></p>
</div>
<div>
<p class="x_MsoNormal"><span style="font-size:12.0pt; color:black">There is indeed a limit on maximum number of communicators that you can have, including both intra communicators and inter-communicators. Try free the communicators that you no longer need.
 In older version of MPICH, there may be additional limit on how many dynamic processes one can connect. If you still hit crash after making sure there isn't too many simultaneous active communicators, could you try the latest release --
</span><a href="https://gcc02.safelinks.protection.outlook.com/?url=http%3A%2F%2Fwww.mpich.org%2Fstatic%2Fdownloads%2F4.0a2%2Fmpich-4.0a2.tar.gz&data=04%7C01%7Ckurt.e.mccall%40nasa.gov%7Cf784f0a87c7245e8a5f808d99855e822%7C7005d45845be48ae8140d43da96dd17b%7C0%7C0%7C637708316997034873%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C1000&sdata=P2D25y9EReF3fLdicTKBU5N1k5tzRtAH2a9ZbOLf3cs%3D&reserved=0"><span style="font-size:12.0pt">http://www.mpich.org/static/downloads/4.0a2/mpich-4.0a2.tar.gz</span></a><span style="font-size:12.0pt; color:black">,
 and see if the issue persist?</span></p>
</div>
<div>
<p class="x_MsoNormal"><span style="font-size:12.0pt; color:black"> </span></p>
</div>
<div>
<p class="x_MsoNormal"><span style="font-size:12.0pt; color:black">-- </span></p>
</div>
<div>
<p class="x_MsoNormal"><span style="font-size:12.0pt; color:black">Hui</span></p>
</div>
<div class="x_MsoNormal" align="center" style="text-align:center">
<hr size="2" width="98%" align="center">
</div>
<div id="x_divRplyFwdMsg">
<p class="x_MsoNormal"><b><span style="color:black">From:</span></b><span style="color:black"> Mccall, Kurt E. (MSFC-EV41) via discuss <</span><a href="mailto:discuss@mpich.org">discuss@mpich.org</a><span style="color:black">><br>
<b>Sent:</b> Sunday, October 24, 2021 2:37 PM<br>
<b>To:</b> </span><a href="mailto:discuss@mpich.org">discuss@mpich.org</a><span style="color:black"> <</span><a href="mailto:discuss@mpich.org">discuss@mpich.org</a><span style="color:black">><br>
<b>Cc:</b> Mccall, Kurt E. (MSFC-EV41) <</span><a href="mailto:kurt.e.mccall@nasa.gov">kurt.e.mccall@nasa.gov</a><span style="color:black">><br>
<b>Subject:</b> [mpich-discuss] Maximum number of inter-communicators?</span> </p>
<div>
<p class="x_MsoNormal"> </p>
</div>
</div>
<div>
<div>
<p class="x_xmsonormal">Hi,</p>
<p class="x_xmsonormal"> </p>
<p class="x_xmsonormal">Based on a paper I read about giving an MPI job some fault tolerance, I’m exclusively connecting my processes with inter-communicators.</p>
<p class="x_xmsonormal">I’ve found that if I increase the number of processes beyond a certain point, many processes don’t get created at all and the whole job
</p>
<p class="x_xmsonormal">crashes.   Am I running up against an operating system limit (like the number of open file descriptors – it is set at 1024), or some sort of
</p>
<p class="x_xmsonormal">MPICH limit?</p>
<p class="x_xmsonormal"> </p>
<p class="x_xmsonormal">If it matters, my process architecture (a tree)  is as follows:  one master process connected to 21 manager processes on 21 other nodes,
</p>
<p class="x_xmsonormal">and each manager connected to 8 worker processes on the manager’s own node.   This is the largest job I’ve been able to create
</p>
<p class="x_xmsonormal">without it crashing.    Attempting to increase the number of workers beyond 8 results in a crash.</p>
<p class="x_xmsonormal"> </p>
<p class="x_xmsonormal">I’m using MPICH 3.3.2 on Centos 3.10.0.   MPICH was compiled with the Portland Group compiler pgc++ 19.5-0.</p>
<p class="x_xmsonormal"> </p>
<p class="x_xmsonormal">Thanks,</p>
<p class="x_xmsonormal">Kurt</p>
</div>
</div>
</div>
</div>
</body>
</html>