@@ -50,14 +50,16 @@ PMIX_EXPORT pmix_status_t PMIx_Notify_event(pmix_status_t status,
5050 cbfunc , cbdata );
5151 pmix_output_verbose (2 , pmix_globals .debug_output ,
5252 "pmix_server_notify_event source = %s:%d event_status = %d, rc= %d" ,
53- source -> nspace , source -> rank , status , rc );
53+ (NULL == source ) ? "UNKNOWN" : source -> nspace ,
54+ (NULL == source ) ? PMIX_RANK_WILDCARD : source -> rank , status , rc );
5455 } else {
5556 rc = notify_server_of_event (status , source , range ,
5657 info , ninfo ,
5758 cbfunc , cbdata );
5859 pmix_output_verbose (2 , pmix_globals .debug_output ,
5960 "pmix_client_notify_event source = %s:%d event_status =%d, rc=%d" ,
60- source -> nspace , source -> rank , status , rc );
61+ (NULL == source ) ? pmix_globals .myid .nspace : source -> nspace ,
62+ (NULL == source ) ? pmix_globals .myid .rank : source -> rank , status , rc );
6163 }
6264 return rc ;
6365}
@@ -95,10 +97,15 @@ static pmix_status_t notify_server_of_event(pmix_status_t status,
9597 pmix_event_chain_t * chain ;
9698 size_t n ;
9799
100+
101+ pmix_output_verbose (2 , pmix_globals .debug_output ,
102+ "client: notifying server %s:%d of status %s" ,
103+ pmix_globals .myid .nspace , pmix_globals .myid .rank ,
104+ PMIx_Error_string (status ));
105+
98106 if (!pmix_globals .connected ) {
99107 return PMIX_ERR_UNREACH ;
100108 }
101-
102109 /* create the msg object */
103110 msg = PMIX_NEW (pmix_buffer_t );
104111
@@ -156,6 +163,9 @@ static pmix_status_t notify_server_of_event(pmix_status_t status,
156163 cb -> op_cbfunc = cbfunc ;
157164 cb -> cbdata = cbdata ;
158165 /* send to the server */
166+ pmix_output_verbose (2 , pmix_globals .debug_output ,
167+ "client: notifying server %s:%d - sending" ,
168+ pmix_globals .myid .nspace , pmix_globals .myid .rank );
159169 rc = pmix_ptl .send_recv (& pmix_client_globals .myserver , msg , notify_event_cbfunc , cb );
160170 if (PMIX_SUCCESS != rc ) {
161171 PMIX_ERROR_LOG (rc );
@@ -170,6 +180,8 @@ static pmix_status_t notify_server_of_event(pmix_status_t status,
170180 return PMIX_SUCCESS ;
171181
172182 cleanup :
183+ pmix_output_verbose (2 , pmix_globals .debug_output ,
184+ "client: notifying server - unable to send" );
173185 PMIX_RELEASE (msg );
174186 /* we were unable to send anything, so we just return the error */
175187 return rc ;
@@ -339,6 +351,10 @@ void pmix_invoke_local_event_hdlr(pmix_event_chain_t *chain)
339351 pmix_default_event_t * def ;
340352 pmix_status_t rc = PMIX_SUCCESS ;
341353
354+ pmix_output_verbose (2 , pmix_globals .debug_output ,
355+ "%s:%d invoke_local_event_hdlr" ,
356+ pmix_globals .myid .nspace , pmix_globals .myid .rank );
357+
342358 /* sanity check */
343359 if (NULL == chain -> info ) {
344360 /* should never happen as the return object must
@@ -519,6 +535,10 @@ static pmix_status_t notify_client_of_event(pmix_status_t status,
519535 pmix_status_t rc ;
520536 size_t n ;
521537
538+ pmix_output_verbose (2 , pmix_globals .debug_output ,
539+ "pmix_server: notify client of event %s" ,
540+ PMIx_Error_string (status ));
541+
522542 cd = PMIX_NEW (pmix_notify_caddy_t );
523543 cd -> status = status ;
524544 if (NULL == source ) {
@@ -538,15 +558,20 @@ static pmix_status_t notify_client_of_event(pmix_status_t status,
538558 } else if (strncmp (info [n ].key , PMIX_EVENT_CUSTOM_RANGE , PMIX_MAX_KEYLEN )) {
539559 /* provides an array of pmix_proc_t identifying the procs
540560 * that are to receive this notification */
541- if (PMIX_DATA_ARRAY != info [n ].value .type ||
542- NULL == info [n ].value .data .darray ||
543- NULL == info [n ].value .data .darray -> array ) {
561+ if (PMIX_DATA_ARRAY == info [n ].value .type &&
562+ NULL != info [n ].value .data .darray &&
563+ NULL != info [n ].value .data .darray -> array ) {
564+ cd -> ntargets = info [n ].value .data .darray -> size ;
565+ PMIX_PROC_CREATE (cd -> targets , cd -> ntargets );
566+ memcpy (cd -> targets , info [n ].value .data .darray -> array , cd -> ntargets * sizeof (pmix_proc_t ));
567+ } else if (PMIX_PROC == info [n ].value .type ) {
568+ cd -> ntargets = 1 ;
569+ PMIX_PROC_CREATE (cd -> targets , cd -> ntargets );
570+ memcpy (cd -> targets , info [n ].value .data .proc , sizeof (pmix_proc_t ));
571+ } else {
544572 /* this is an error */
545573 return PMIX_ERR_BAD_PARAM ;
546574 }
547- cd -> ntargets = info [n ].value .data .darray -> size ;
548- PMIX_PROC_CREATE (cd -> targets , cd -> ntargets );
549- memcpy (cd -> targets , info [n ].value .data .darray -> array , cd -> ntargets * sizeof (pmix_proc_t ));
550575 }
551576 }
552577 }
0 commit comments