|
10 | 10 | * University of Stuttgart. All rights reserved. |
11 | 11 | * Copyright (c) 2004-2005 The Regents of the University of California. |
12 | 12 | * All rights reserved. |
13 | | - * Copyright (c) 2007-2009 Cisco Systems, Inc. All rights reserved. |
| 13 | + * Copyright (c) 2007-2022 Cisco Systems, Inc. All rights reserved |
14 | 14 | * Copyright (c) 2013 Los Alamos National Security, LLC. All rights |
15 | 15 | * reserved. |
16 | 16 | * $COPYRIGHT$ |
@@ -38,8 +38,18 @@ int MPI_Allgather(const void *sendbuf, int sendcount, MPI_Datatype sendtype, |
38 | 38 | int rank; |
39 | 39 |
|
40 | 40 | PMPI_Comm_rank(MPI_COMM_WORLD, &rank); |
41 | | - PMPI_Type_get_name(sendtype, sendtypename, &len); |
42 | | - PMPI_Type_get_name(recvtype, recvtypename, &len); |
| 41 | + if (sendtype != MPI_DATATYPE_NULL) { |
| 42 | + PMPI_Type_get_name(sendtype, sendtypename, &len); |
| 43 | + } else { |
| 44 | + strncpy(sendtypename, "MPI_DATATYPE_NULL", |
| 45 | + sizeof(sendtypename)); |
| 46 | + } |
| 47 | + if (recvtype != MPI_DATATYPE_NULL) { |
| 48 | + PMPI_Type_get_name(recvtype, recvtypename, &len); |
| 49 | + } else { |
| 50 | + strncpy(recvtypename, "MPI_DATATYPE_NULL", |
| 51 | + sizeof(recvtypename)); |
| 52 | + } |
43 | 53 | PMPI_Comm_get_name(comm, commname, &len); |
44 | 54 |
|
45 | 55 | fprintf(stderr, "MPI_ALLGATHER[%d]: sendbuf %0" PRIxPTR " sendcount %d sendtype %s\n\trecvbuf %0" PRIxPTR " recvcount %d recvtype %s comm %s\n", |
|
0 commit comments