|  | 
| 24 | 24 | #include "ompi/mca/pml/pml.h" | 
| 25 | 25 | #include "ompi/communicator/communicator.h" | 
| 26 | 26 | #include "opal/datatype/opal_convertor.h" | 
|  | 27 | +#include "opal/util/show_help.h" | 
| 27 | 28 | 
 | 
| 28 | 29 | #include "mtl_psm.h" | 
| 29 | 30 | #include "mtl_psm_types.h" | 
| @@ -56,13 +57,19 @@ ompi_mtl_psm_send(struct mca_mtl_base_module_t* mtl, | 
| 56 | 57 |                                  &length, | 
| 57 | 58 |                                  &mtl_psm_request.free_after); | 
| 58 | 59 | 
 | 
|  | 60 | +    if (OMPI_SUCCESS != ret) return ret; | 
|  | 61 | + | 
|  | 62 | +    if (length >= 1ULL << sizeof(uint32_t) * 8) { | 
|  | 63 | +            opal_show_help("help-mtl-psm.txt", | 
|  | 64 | +                   "message too big", false, | 
|  | 65 | +                   length, 1ULL << sizeof(uint32_t) * 8); | 
|  | 66 | +            return OMPI_ERROR; | 
|  | 67 | +    } | 
| 59 | 68 | 
 | 
| 60 | 69 |     mtl_psm_request.length = length; | 
| 61 | 70 |     mtl_psm_request.convertor = convertor; | 
| 62 | 71 |     mtl_psm_request.type = OMPI_MTL_PSM_ISEND; | 
| 63 | 72 | 
 | 
| 64 |  | -    if (OMPI_SUCCESS != ret) return ret; | 
| 65 |  | - | 
| 66 | 73 |     if (mode == MCA_PML_BASE_SEND_SYNCHRONOUS) | 
| 67 | 74 | 	flags |= PSM_MQ_FLAG_SENDSYNC; | 
| 68 | 75 | 
 | 
| @@ -109,12 +116,20 @@ ompi_mtl_psm_isend(struct mca_mtl_base_module_t* mtl, | 
| 109 | 116 |                                  &length, | 
| 110 | 117 |                                  &mtl_psm_request->free_after); | 
| 111 | 118 | 
 | 
|  | 119 | + | 
|  | 120 | +    if (OMPI_SUCCESS != ret) return ret; | 
|  | 121 | + | 
|  | 122 | +    if (length >= 1ULL << sizeof(uint32_t) * 8) { | 
|  | 123 | +            opal_show_help("help-mtl-psm.txt", | 
|  | 124 | +                   "message too big", false, | 
|  | 125 | +                   length, 1ULL << sizeof(uint32_t) * 8); | 
|  | 126 | +            return OMPI_ERROR; | 
|  | 127 | +    } | 
|  | 128 | + | 
| 112 | 129 |     mtl_psm_request->length= length; | 
| 113 | 130 |     mtl_psm_request->convertor = convertor; | 
| 114 | 131 |     mtl_psm_request->type = OMPI_MTL_PSM_ISEND; | 
| 115 | 132 | 
 | 
| 116 |  | -    if (OMPI_SUCCESS != ret) return ret; | 
| 117 |  | - | 
| 118 | 133 |     if (mode == MCA_PML_BASE_SEND_SYNCHRONOUS) | 
| 119 | 134 | 	flags |= PSM_MQ_FLAG_SENDSYNC; | 
| 120 | 135 | 
 | 
|  | 
0 commit comments