| 1 | <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN"> |
|---|
| 2 | <HTML><HEAD> |
|---|
| 3 | <META content="text/html; charset=us-ascii" http-equiv=Content-Type> |
|---|
| 4 | <META name=GENERATOR content="MSHTML 8.00.6001.18783"></HEAD> |
|---|
| 5 | <BODY> |
|---|
| 6 | <DIV dir=ltr align=left><FONT color=#0000ff size=2 |
|---|
| 7 | face=Arial></FONT> </DIV><FONT color=#0000ff size=2 face=Arial></FONT><BR> |
|---|
| 8 | <DIV dir=ltr lang=en-us class=OutlookMessageHeader align=left> |
|---|
| 9 | <HR tabIndex=-1> |
|---|
| 10 | <FONT size=2 face=Tahoma><B>From:</B> mpich2-dev-bounces@mcs.anl.gov |
|---|
| 11 | [mailto:mpich2-dev-bounces@mcs.anl.gov] <B>On Behalf Of </B>Joe |
|---|
| 12 | Ratterman<BR><B>Sent:</B> Tuesday, June 09, 2009 3:14 PM<BR><B>To:</B> MPICH2 |
|---|
| 13 | Dev<BR><B>Subject:</B> [mpich2-dev] Problem with MPI_Type_commit() and assert |
|---|
| 14 | insegment_ops.c<BR></FONT><BR></DIV> |
|---|
| 15 | <DIV></DIV>The specifics of this test come from an MPI excerciser that gathered |
|---|
| 16 | (using MPIR_Gather) a variety of types, including MPI_SHORT_INT. The |
|---|
| 17 | way that gather is implemented, it created and then sent a struct datatype of |
|---|
| 18 | the tmp-data from the software tree and the local-data. I pulled out the |
|---|
| 19 | important bits, and got this test-case. It asserts on PPC32 Linux 1.1 and |
|---|
| 20 | BGP 1.1rc0, but runs fine on 1.0.7. The addresses/displacements are fake, |
|---|
| 21 | but were originally based on the actual values used inside MPIR_Gather. It |
|---|
| 22 | does the type-create on the first two types just to show that it doesn't always |
|---|
| 23 | fail. |
|---|
| 24 | <DIV><BR></DIV> |
|---|
| 25 | <DIV><BR></DIV> |
|---|
| 26 | <DIV>Error message:</DIV> |
|---|
| 27 | <DIV><BR></DIV> |
|---|
| 28 | <BLOCKQUOTE |
|---|
| 29 | style="BORDER-BOTTOM: medium none; BORDER-LEFT: medium none; PADDING-BOTTOM: 0px; MARGIN: 0px 0px 0px 40px; PADDING-LEFT: 0px; PADDING-RIGHT: 0px; BORDER-TOP: medium none; BORDER-RIGHT: medium none; PADDING-TOP: 0px" |
|---|
| 30 | class=webkit-indent-blockquote>Creating addr=[0x1,0x2] |
|---|
| 31 | types=[8c000003,4c00010d] struct_displs=[1,2] |
|---|
| 32 | blocks=[256,256] MPI_BOTTOM=(nil)<BR>foo:25<BR>Assertion failed in |
|---|
| 33 | file segment_ops.c at line 994: *lengthp > 0<BR>internal ABORT - process |
|---|
| 34 | 0</BLOCKQUOTE> |
|---|
| 35 | <DIV> |
|---|
| 36 | <DIV><BR></DIV> |
|---|
| 37 | <DIV><FONT color=#0000ff size=2 face=Arial></FONT><BR></DIV> |
|---|
| 38 | <DIV>Code</DIV> |
|---|
| 39 | <DIV><BR></DIV></DIV> |
|---|
| 40 | <BLOCKQUOTE |
|---|
| 41 | style="BORDER-BOTTOM: medium none; BORDER-LEFT: medium none; PADDING-BOTTOM: 0px; MARGIN: 0px 0px 0px 40px; PADDING-LEFT: 0px; PADDING-RIGHT: 0px; BORDER-TOP: medium none; BORDER-RIGHT: medium none; PADDING-TOP: 0px" |
|---|
| 42 | class=webkit-indent-blockquote>#include <stdio.h><BR>#include |
|---|
| 43 | <stdlib.h><BR>#include <unistd.h><BR>#include |
|---|
| 44 | <mpi.h><BR><BR>void foo(void *sendbuf,<BR> |
|---|
| 45 | MPI_Datatype sendtype,<BR> void |
|---|
| 46 | *recvbuf,<BR> MPI_Datatype |
|---|
| 47 | recvtype)<BR>{<BR> int blocks[2];<BR> MPI_Aint |
|---|
| 48 | struct_displs[2];<BR> MPI_Datatype types[2], |
|---|
| 49 | tmp_type;<BR><BR> blocks[0] = 256;<BR> struct_displs[0] |
|---|
| 50 | = (size_t)sendbuf;<BR> types[0] = |
|---|
| 51 | sendtype;<BR> blocks[1] = 256;<BR> struct_displs[1] = |
|---|
| 52 | (size_t)recvbuf;<BR> types[1] = |
|---|
| 53 | MPI_BYTE;<BR><BR> printf("Creating addr=[%p,%p] |
|---|
| 54 | types=[%x,%x] struct_displs=[%x,%x] blocks=[%d,%d] |
|---|
| 55 | MPI_BOTTOM=%p\n",<BR> sendbuf, recvbuf, |
|---|
| 56 | types[0], types[1], struct_displs[0], struct_displs[1], blocks[0], blocks[1], |
|---|
| 57 | MPI_BOTTOM);<BR> MPI_Type_create_struct(2, blocks, struct_displs, |
|---|
| 58 | types, &tmp_type);<BR> printf("%s:%d\n", __func__, |
|---|
| 59 | __LINE__);<BR> MPI_Type_commit(&tmp_type);<BR> printf("%s:%d\n", |
|---|
| 60 | __func__, __LINE__);<BR> MPI_Type_free |
|---|
| 61 | (&tmp_type);<BR> puts("Done");<BR>}<BR><BR><BR>int |
|---|
| 62 | main()<BR>{<BR> MPI_Init(NULL, |
|---|
| 63 | NULL);<BR><BR> foo((void*)0x1,<BR> |
|---|
| 64 | MPI_FLOAT_INT,<BR> (void*)0x2,<BR> |
|---|
| 65 | |
|---|
| 66 | MPI_BYTE);<BR> sleep(1);<BR> foo((void*)0x1,<BR> |
|---|
| 67 | MPI_DOUBLE_INT,<BR> |
|---|
| 68 | (void*)0x2,<BR> |
|---|
| 69 | MPI_BYTE);<BR> sleep(1);<BR> foo((void*)0x1,<BR> |
|---|
| 70 | MPI_SHORT_INT,<BR> |
|---|
| 71 | (void*)0x2,<BR> |
|---|
| 72 | MPI_BYTE);<BR><BR> MPI_Finalize();<BR> return |
|---|
| 73 | 0;<BR>}</BLOCKQUOTE> |
|---|
| 74 | <DIV> |
|---|
| 75 | <DIV> |
|---|
| 76 | <DIV><BR></DIV></DIV> |
|---|
| 77 | <DIV><BR></DIV> |
|---|
| 78 | <DIV><BR></DIV> |
|---|
| 79 | <DIV>I don't know anything about how this might be fixed, but we are looking |
|---|
| 80 | into it as well.</DIV> |
|---|
| 81 | <DIV><BR></DIV> |
|---|
| 82 | <DIV>Thanks,</DIV> |
|---|
| 83 | <DIV>Joe Ratterman</DIV> |
|---|
| 84 | <DIV><A |
|---|
| 85 | href="mailto:jratt@us.ibm.com">jratt@us.ibm.com</A></DIV></DIV></BODY></HTML> |
|---|