28
28
29
29
#include "rml_ofi.h"
30
30
31
+
31
32
static int rml_ofi_component_open (void );
32
33
static int rml_ofi_component_close (void );
33
34
static orte_rml_base_module_t * open_conduit (opal_list_t * attributes );
@@ -325,7 +326,6 @@ void print_provider_list_info (struct fi_info *fi )
325
326
* This returns all the supported transports in the system that support endpoint type RDM (reliable datagram)
326
327
* The providers returned is a list of type opal_valut_t holding opal_list_t
327
328
*/
328
- /*[Anandhi] old defn static int orte_rml_ofi_query_transports(opal_value_t **providers) */
329
329
static orte_rml_pathway_t * query_transports (void )
330
330
{
331
331
opal_list_t * ofi_prov = NULL ;
@@ -334,139 +334,11 @@ static orte_rml_pathway_t* query_transports(void)
334
334
int ret = 0 , ofi_prov_num = 0 ;
335
335
336
336
opal_output_verbose (10 ,orte_rml_base_framework .framework_output ,
337
- "\n%s:%d OFI Query Interface not implemented" ,__FILE__ ,__LINE__ );
338
- /* [Anandhi] comment fully for now, as this implementation is for old defn needs to be re-written
339
- opal_output_verbose(10,orte_rml_base_framework.framework_output,
340
- " %s -Begin of query_transports()",ORTE_NAME_PRINT(ORTE_PROC_MY_NAME) );
341
- if ( NULL == *providers)
342
- {
343
- *providers = OBJ_NEW(opal_value_t);
344
- }
345
-
346
- providers_list = *providers;
347
-
348
- //Create the opal_value_t list in which each item is an opal_list_t that holds the provider details
349
- opal_output_verbose(10,orte_rml_base_framework.framework_output,
350
- "Starting to add the providers in a loop from orte_rml_ofi.ofi_prov[] %s:%d",__FILE__,__LINE__);
337
+ "%s:%d OFI Query Interface not implemented" ,__FILE__ ,__LINE__ );
351
338
352
- for ( ofi_prov_num = 0; ofi_prov_num < orte_rml_ofi.ofi_prov_open_num ; ofi_prov_num++ ) {
353
- cur_fi = orte_rml_ofi.ofi_prov[ofi_prov_num].fabric_info;
354
- if( NULL != prev_provider)
355
- {
356
- //if there is another provider in the array, then add another item to the providers_list
357
- next_provider = OBJ_NEW(opal_value_t);
358
- providers_list->super.opal_list_next = &next_provider->super;
359
- providers_list->super.opal_list_prev = &prev_provider->super;
360
- providers_list = (opal_value_t *)providers_list->super.opal_list_next;
361
- }
362
-
363
- /* populate the opal_list_t *ofi_prov with provider details from the
364
- * orte_rml_ofi.fi_info_list array populated in the rml_ofi_component_init() fn.*/
365
- /* ofi_prov = OBJ_NEW(opal_list_t);
366
- opal_output_verbose(10,orte_rml_base_framework.framework_output,
367
- "\n loading the attribute ORTE_PROVIDER_ID");
368
- if( ORTE_SUCCESS !=
369
- (ret = orte_set_attribute( ofi_prov, ORTE_PROVIDER_ID, ORTE_ATTR_GLOBAL,
370
- (void *)&orte_rml_ofi.ofi_prov[ofi_prov_num].ofi_prov_id ,OPAL_UINT8))) {
371
- opal_output_verbose(1,orte_rml_base_framework.framework_output,
372
- "%s:%d Not able to add provider ofi_prov_id ",__FILE__,__LINE__);
373
- return ORTE_ERROR;
374
- }
375
- opal_output_verbose(10,orte_rml_base_framework.framework_output,
376
- "\n provider ofi_prov_id : %d",orte_rml_ofi.ofi_prov[ofi_prov_num].ofi_prov_id);
377
- opal_output_verbose(10,orte_rml_base_framework.framework_output,
378
- "\n loading the attribute ORTE_PROV_NAME");
379
- if( ORTE_SUCCESS ==
380
- (ret = orte_set_attribute( ofi_prov, ORTE_PROV_NAME, ORTE_ATTR_GLOBAL,cur_fi->fabric_attr->prov_name ,OPAL_STRING))) {
381
- opal_output_verbose(10,orte_rml_base_framework.framework_output,
382
- "\n loading the attribute ORTE_PROTOCOL %s",fi_tostr(&cur_fi->ep_attr->protocol,FI_TYPE_PROTOCOL));
383
- if( ORTE_SUCCESS ==
384
- (ret = orte_set_attribute( ofi_prov, ORTE_PROTOCOL, ORTE_ATTR_GLOBAL,(void *)&cur_fi->ep_attr->protocol ,OPAL_UINT32))) {
385
- // insert the opal_list_t into opal_value_t list
386
- opal_value_load(providers_list,ofi_prov,OPAL_PTR);
387
- opal_output_verbose(10,orte_rml_base_framework.framework_output,
388
- "\n loading the provider opal_list_t* prov=%x into opal_value_t list successful",
389
- ofi_prov);
390
- } else {
391
- opal_output_verbose(1,orte_rml_base_framework.framework_output,
392
- "%s:%d Not able to add provider name ",__FILE__,__LINE__);
393
- return ORTE_ERROR;
394
- }
395
- } else {
396
- opal_output_verbose(1,orte_rml_base_framework.framework_output,
397
- "%s:%d Not able to add provider name ",__FILE__,__LINE__);
398
- return ORTE_ERROR;
399
- }
400
-
401
- prev_provider = providers_list;
402
- cur_fi = cur_fi->next;
403
- }
404
-
405
- opal_output_verbose(10,orte_rml_base_framework.framework_output,
406
- "\n%s:%d Completed Query Interface",__FILE__,__LINE__);*/
407
339
return ORTE_SUCCESS ;
408
340
}
409
341
410
-
411
- /*debug routine to print the opal_value_t returned by query interface */
412
- /* [Anandhi] - this has to be re-written
413
- void print_transports_query()
414
- {
415
- opal_value_t *providers=NULL;
416
- char* prov_name = NULL;
417
- int ret;
418
- int32_t *protocol_ptr, protocol;
419
- int8_t* prov_num;
420
-
421
- protocol_ptr = &protocol;
422
-
423
- opal_output_verbose(10,orte_rml_base_framework.framework_output,
424
- "\n print_transports_query() Begin- %s:%d",__FILE__,__LINE__);
425
- opal_output_verbose(10,orte_rml_base_framework.framework_output,
426
- "\n calling the orte_rml_ofi_query_transports() ");
427
- if( ORTE_SUCCESS == orte_rml_ofi_query_transports(&providers))
428
- {
429
- opal_output_verbose(20,orte_rml_base_framework.framework_output,
430
- "\n query_transports() completed, printing details\n");
431
- while (providers)
432
- {
433
- //get the first opal_list_t;
434
- opal_list_t *prov;
435
- ret = opal_value_unload(providers,(void **)&prov,OPAL_PTR);
436
- if (ret == OPAL_SUCCESS) {
437
- if( orte_get_attribute( prov, ORTE_PROVIDER_ID, (void **)&prov_num,OPAL_UINT8)) {
438
- opal_output_verbose(10,orte_rml_base_framework.framework_output,
439
- "\n OFI Provider ofi_prov_id : %d",*prov_num);
440
- }
441
- if( orte_get_attribute( prov, ORTE_PROTOCOL, (void **)&protocol_ptr,OPAL_UINT32)) {
442
- opal_output_verbose(10,orte_rml_base_framework.framework_output,
443
- "\n Protocol : %d", *protocol_ptr);
444
- }
445
- if( orte_get_attribute( prov, ORTE_PROV_NAME, (void **)&prov_name ,OPAL_STRING)) {
446
- opal_output_verbose(10,orte_rml_base_framework.framework_output,
447
- "\n Provider name : %s",prov_name);
448
- } else {
449
- opal_output_verbose(10,orte_rml_base_framework.framework_output,
450
- "\n Error in getting Provider name");
451
- }
452
- } else {
453
- opal_output_verbose(1,orte_rml_base_framework.framework_output,
454
- "\n %s:%d opal_value_unload() failed, opal_list* prov = %x",
455
- __FILE__,__LINE__,prov);
456
- }
457
- providers = (opal_value_t *)providers->super.opal_list_next;
458
- }
459
- } else {
460
- opal_output_verbose(10,orte_rml_base_framework.framework_output,
461
- "\n query_transports() returned Error ");
462
- }
463
- opal_output_verbose(10,orte_rml_base_framework.framework_output,
464
- "\n End of print_transports_query() \n");
465
- }
466
- */
467
-
468
-
469
-
470
342
/**
471
343
ofi_prov [in]: the ofi ofi_prov_id that triggered the progress fn
472
344
**/
@@ -640,7 +512,7 @@ int cq_progress_handler(int sd, short flags, void *cbdata)
640
512
/*
641
513
* Returns the number of ofi-providers available
642
514
*/
643
- int rml_ofi_component_init ()
515
+ int rml_ofi_component_init (void )
644
516
{
645
517
int ret , fi_version ;
646
518
struct fi_info * hints , * fabric_info ;
@@ -1165,7 +1037,7 @@ static orte_rml_base_module_t* make_module( int ofi_prov_id)
1165
1037
* ORTE_RML_PROVIDER_ATTRIB */
1166
1038
static orte_rml_base_module_t * open_conduit (opal_list_t * attributes )
1167
1039
{
1168
- char * comp_attrib = NULL ;
1040
+ char * comp_attrib = NULL ;
1169
1041
char * * comps ;
1170
1042
int i ;
1171
1043
orte_attribute_t * attr ;
@@ -1220,6 +1092,7 @@ char *comp_attrib = NULL;
1220
1092
/* Alternatively, check the attributes to see if we qualify - we only handle
1221
1093
* "pt2pt" */
1222
1094
OPAL_LIST_FOREACH (attr , attributes , orte_attribute_t ) {
1095
+ /* [TODO] add any additional attributes check here */
1223
1096
1224
1097
}
1225
1098
@@ -1231,7 +1104,6 @@ char *comp_attrib = NULL;
1231
1104
}
1232
1105
1233
1106
1234
-
1235
1107
static void orte_rml_ofi_fini (void * mod )
1236
1108
{
1237
1109
opal_list_item_t * item ;
@@ -1370,9 +1242,9 @@ static void process_uri( char *uri)
1370
1242
* the first containing the process name of our peer
1371
1243
* and all others containing the OOB contact info
1372
1244
*/
1373
- ORTE_ERROR_LOG (ORTE_ERR_BAD_PARAM );
1245
+ //[Anandhi] debug -> ORTE_ERROR_LOG(ORTE_ERR_BAD_PARAM);
1374
1246
return ;
1375
- }
1247
+ }
1376
1248
* cptr = '\0' ;
1377
1249
cptr ++ ;
1378
1250
@@ -1474,9 +1346,10 @@ static void process_uri( char *uri)
1474
1346
/* converts the socket uri returned by get_contact_info into sockaddr_in */
1475
1347
void convert_to_sockaddr ( char * ofiuri , struct sockaddr_in * ep_sockaddr )
1476
1348
{
1477
- char * tmp , * sin_fly , * sin_port , * sin_addr ;
1478
- short port ;
1479
- int res ;
1349
+ char * tmp , * sin_fly , * sin_port , * sin_addr ;
1350
+ short port ;
1351
+ int res ;
1352
+
1480
1353
tmp = strchr (ofiuri ,':' );
1481
1354
sin_fly = tmp + 1 ;
1482
1355
tmp = strchr (sin_fly ,',' );
@@ -1494,7 +1367,8 @@ int res;
1494
1367
ep_sockaddr -> sin_port = htons (port );
1495
1368
res = inet_aton (sin_addr ,(struct in_addr * )& ep_sockaddr -> sin_addr );
1496
1369
1497
- opal_output_verbose (1 ,orte_rml_base_framework .framework_output ,
1498
- "%s OFI convert_to_sockaddr() port = 0x%x, InternetAddr = %s " ,
1499
- ORTE_NAME_PRINT (ORTE_PROC_MY_NAME ),ntohs (ep_sockaddr -> sin_port ),inet_ntoa (ep_sockaddr -> sin_addr ));
1370
+ opal_output_verbose (1 ,orte_rml_base_framework .framework_output ,
1371
+ "%s OFI convert_to_sockaddr() port = 0x%x, InternetAddr = %s " ,
1372
+ ORTE_NAME_PRINT (ORTE_PROC_MY_NAME ),ntohs (ep_sockaddr -> sin_port ),
1373
+ inet_ntoa (ep_sockaddr -> sin_addr ));
1500
1374
}
0 commit comments