@@ -220,8 +220,8 @@ int orte_util_nidmap_create(opal_pointer_array_t *pool,
220220
221221int orte_util_decode_nidmap (opal_buffer_t * buf )
222222{
223- uint8_t u8 , * vp8 = NULL , * flags = NULL ;
224- uint16_t * vp16 = NULL , * slots = NULL ;
223+ uint8_t u8 , * vp8 = NULL ;
224+ uint16_t * vp16 = NULL ;
225225 uint32_t * vp32 = NULL , vpid ;
226226 int cnt , rc , nbytes , n ;
227227 bool compressed ;
@@ -364,98 +364,6 @@ int orte_util_decode_nidmap(opal_buffer_t *buf)
364364 vp8 = NULL ;
365365 }
366366
367-
368- /* unpack compression flag for slots */
369- cnt = 1 ;
370- if (OPAL_SUCCESS != (rc = opal_dss .unpack (buf , & compressed , & cnt , OPAL_BOOL ))) {
371- ORTE_ERROR_LOG (rc );
372- goto cleanup ;
373- }
374-
375- /* if compressed, get the uncompressed size */
376- if (compressed ) {
377- cnt = 1 ;
378- if (OPAL_SUCCESS != (rc = opal_dss .unpack (buf , & sz , & cnt , OPAL_SIZE ))) {
379- ORTE_ERROR_LOG (rc );
380- goto cleanup ;
381- }
382- }
383-
384- /* unpack the slots object */
385- cnt = 1 ;
386- if (OPAL_SUCCESS != (rc = opal_dss .unpack (buf , & boptr , & cnt , OPAL_BYTE_OBJECT ))) {
387- ORTE_ERROR_LOG (rc );
388- goto cleanup ;
389- }
390-
391- /* if compressed, decompress */
392- if (compressed ) {
393- if (!opal_compress .decompress_block ((uint8_t * * )& slots , sz ,
394- boptr -> bytes , boptr -> size )) {
395- ORTE_ERROR_LOG (ORTE_ERROR );
396- if (NULL != boptr -> bytes ) {
397- free (boptr -> bytes );
398- }
399- free (boptr );
400- rc = ORTE_ERROR ;
401- goto cleanup ;
402- }
403- } else {
404- slots = (uint16_t * )boptr -> bytes ;
405- boptr -> bytes = NULL ;
406- boptr -> size = 0 ;
407- }
408- if (NULL != boptr -> bytes ) {
409- free (boptr -> bytes );
410- }
411- free (boptr );
412-
413-
414- /* unpack compression flag for node flags */
415- cnt = 1 ;
416- if (OPAL_SUCCESS != (rc = opal_dss .unpack (buf , & compressed , & cnt , OPAL_BOOL ))) {
417- ORTE_ERROR_LOG (rc );
418- goto cleanup ;
419- }
420-
421- /* if compressed, get the uncompressed size */
422- if (compressed ) {
423- cnt = 1 ;
424- if (OPAL_SUCCESS != (rc = opal_dss .unpack (buf , & sz , & cnt , OPAL_SIZE ))) {
425- ORTE_ERROR_LOG (rc );
426- goto cleanup ;
427- }
428- }
429-
430- /* unpack the node flags object */
431- cnt = 1 ;
432- if (OPAL_SUCCESS != (rc = opal_dss .unpack (buf , & boptr , & cnt , OPAL_BYTE_OBJECT ))) {
433- ORTE_ERROR_LOG (rc );
434- goto cleanup ;
435- }
436-
437- /* if compressed, decompress */
438- if (compressed ) {
439- if (!opal_compress .decompress_block ((uint8_t * * )& flags , sz ,
440- boptr -> bytes , boptr -> size )) {
441- ORTE_ERROR_LOG (ORTE_ERROR );
442- if (NULL != boptr -> bytes ) {
443- free (boptr -> bytes );
444- }
445- free (boptr );
446- rc = ORTE_ERROR ;
447- goto cleanup ;
448- }
449- } else {
450- flags = (uint8_t * )boptr -> bytes ;
451- boptr -> bytes = NULL ;
452- boptr -> size = 0 ;
453- }
454- if (NULL != boptr -> bytes ) {
455- free (boptr -> bytes );
456- }
457- free (boptr );
458-
459367 /* if we are the HNP, we don't need any of this stuff */
460368 if (ORTE_PROC_IS_HNP ) {
461369 goto cleanup ;
@@ -478,12 +386,6 @@ int orte_util_decode_nidmap(opal_buffer_t *buf)
478386 nd = OBJ_NEW (orte_node_t );
479387 nd -> name = names [n ];
480388 opal_pointer_array_set_item (orte_node_pool , n , nd );
481- /* set the #slots */
482- nd -> slots = slots [n ];
483- /* set the flags */
484- if (1 == flags [n ]) {
485- ORTE_FLAG_SET (nd , ORTE_NODE_FLAG_SLOTS_GIVEN );
486- }
487389 /* set the topology - always default to homogeneous
488390 * as that is the most common scenario */
489391 nd -> topology = t ;
@@ -526,6 +428,18 @@ int orte_util_decode_nidmap(opal_buffer_t *buf)
526428 }
527429
528430 cleanup :
431+ if (NULL != vp8 ) {
432+ free (vp8 );
433+ }
434+ if (NULL != vp16 ) {
435+ free (vp16 );
436+ }
437+ if (NULL != vp32 ) {
438+ free (vp32 );
439+ }
440+ if (NULL != names ) {
441+ opal_argv_free (names );
442+ }
529443 return rc ;
530444}
531445
0 commit comments