@@ -146,13 +146,13 @@ j_fabric_init_server(struct JConfiguration* configuration, struct JFabric** inst
146
146
res = fi_getname (& this -> pep -> fid , NULL , & addrlen );
147
147
if (res != - FI_ETOOSMALL ) { CHECK ("failed to fetch address len from libfabirc!" ); }
148
148
this -> fabric_addr_network .addr_len = addrlen ;
149
- g_message ("test: %u" , this -> fabric_addr_network .addr_len );
149
+ // g_message("test: %u", this->fabric_addr_network.addr_len);
150
150
this -> fabric_addr_network .addr = malloc (this -> fabric_addr_network .addr_len );
151
151
res = fi_getname (& this -> pep -> fid , this -> fabric_addr_network .addr ,
152
152
& addrlen );
153
153
CHECK ("failed to fetch address from libfabric!" );
154
154
155
- g_message ("wait for pep request!" );
155
+ // g_message("wait for pep request!");
156
156
res = fi_listen (this -> pep );
157
157
CHECK ("failed to start listening on pep!" );
158
158
@@ -188,7 +188,7 @@ j_fabric_init_client(struct JConfiguration* configuration, struct JFabricAddr* a
188
188
char * str = malloc (hints -> dest_addrlen * 3 + 1 );
189
189
size_t i ;
190
190
for (i = 0 ; i < hints -> dest_addrlen ; ++ i ) { snprintf (str + i * 3 , 4 , "%02x " , ((uint8_t * )hints -> dest_addr )[i ]); }
191
- g_message ("Addr: format: %u, len: %lu\n\t%s" , hints -> addr_format , hints -> dest_addrlen , str );
191
+ // g_message("Addr: format: %u, len: %lu\n\t%s", hints->addr_format, hints->dest_addrlen, str);
192
192
free (str );
193
193
}
194
194
@@ -203,7 +203,7 @@ j_fabric_init_client(struct JConfiguration* configuration, struct JFabricAddr* a
203
203
CHECK ("failed to initelize client fabric!" );
204
204
205
205
ret = TRUE;
206
- g_message ("initelize client!" );
206
+ // g_message("initelize client!");
207
207
end :
208
208
return ret ;
209
209
}
@@ -326,7 +326,7 @@ j_connection_init_client(struct JConfiguration* configuration, enum JBackendType
326
326
do {EXE (j_connection_sread_event (this , 1 , & event ),
327
327
"Failed to read event queue, waiting for CONNECTED signal!" );
328
328
} while (event == J_CONNECTION_EVENT_TIMEOUT );
329
- g_message ("Event FI: %u" , event );
329
+ // g_message("Event FI: %u", event);
330
330
331
331
if (event != J_CONNECTION_EVENT_CONNECTED ) {
332
332
g_warning ("Failed to connect to host!" );
@@ -354,16 +354,16 @@ j_connection_init_server(struct JFabric* fabric, GSocketConnection* gconnection,
354
354
355
355
* instance_ptr = malloc (sizeof (* this ));
356
356
this = * instance_ptr ;
357
- g_message ("debug: size(*this) = %lu, this = %p" , sizeof (* this ), (void * )this );
357
+ // g_message("debug: size(*this) = %lu, this = %p", sizeof(*this), (void*)this);
358
358
memset (this , 0 , sizeof (* this ));
359
359
360
360
// send addr
361
361
{ // DEBUG TODO
362
362
char * str = malloc (ntohl (addr -> addr_len ) * 3 + 1 );
363
363
size_t i ;
364
- g_message ("tada: addr_len: %u" , ntohl (addr -> addr_len ));
364
+ // g_message("tada: addr_len: %u", ntohl(addr->addr_len));
365
365
for (i = 0 ; i < ntohl (addr -> addr_len ); ++ i ) { snprintf (str + i * 3 , 4 , "%02x " , ((uint8_t * )addr -> addr )[i ]); }
366
- g_message ("Addr: format: %u, len: %u\n\t%s" , ntohl (addr -> addr_format ), ntohl (addr -> addr_len ), str );
366
+ // g_message("Addr: format: %u, len: %u\n\t%s", ntohl(addr->addr_format), ntohl(addr->addr_len), str);
367
367
free (str );
368
368
}
369
369
g_out = g_io_stream_get_output_stream (G_IO_STREAM (gconnection ));
@@ -373,28 +373,28 @@ j_connection_init_server(struct JFabric* fabric, GSocketConnection* gconnection,
373
373
G_CHECK ("Failed to write addr_len to stream!" );
374
374
g_output_stream_write (g_out , addr -> addr , ntohl (addr -> addr_len ), NULL , & error );
375
375
G_CHECK ("Failed to write addr to stream!" );
376
- g_message ("close g_stream" );
376
+ // g_message("close g_stream");
377
377
g_output_stream_close (g_out , NULL , & error );
378
378
G_CHECK ("Failed to close output stream!" );
379
379
380
- g_message ("wait for conrequest!" );
380
+ // g_message("wait for conrequest!");
381
381
do {EXE (j_fabric_sread_event (fabric , 2 , & event , & request ),
382
382
"Failed to wait for connection request" );
383
383
} while (event == J_FABRIC_EVENT_TIMEOUT );
384
384
if (event != J_FABRIC_EVENT_CONNECTION_REQUEST ) {
385
385
g_warning ("expected an connection request and nothing else! (%i)" , event );
386
386
goto end ;
387
387
}
388
- g_message ("inet connection!" );
388
+ // g_message("inet connection!");
389
389
this -> fabric = fabric ;
390
390
this -> info = request .info ;
391
391
392
392
EXE (j_connection_init (this ), "Failed to initelize connection server side!" );
393
393
394
- g_message ("Except!" );
394
+ // g_message("Except!");
395
395
res = fi_accept (this -> ep , NULL , 0 );
396
396
CHECK ("Failed to accept connection!" );
397
- g_message ("wait for connection !" );
397
+ // g_message("wait for connection !");
398
398
EXE (j_connection_sread_event (this , 2 , & con_event ), "Failed to verify connection!" );
399
399
if (con_event != J_CONNECTION_EVENT_CONNECTED ) {
400
400
g_warning ("expected and connection ack and nothing else!" );
@@ -450,7 +450,7 @@ j_connection_init(struct JConnection* this)
450
450
CHECK ("Failed to enable connection!" );
451
451
452
452
ret = TRUE;
453
- g_message ("enabled endpoint!" );
453
+ // g_message("enabled endpoint!");
454
454
end :
455
455
return ret ;
456
456
}
@@ -478,7 +478,7 @@ j_connection_create_memory_resources(struct JConnection* this)
478
478
size = 0 ;
479
479
480
480
if (this -> info -> domain_attr -> mr_mode & FI_MR_LOCAL ) {
481
- g_message ("Localmemory!" );
481
+ // g_message("Localmemory!");
482
482
size +=
483
483
(rx_prefix * prefix_size ) + J_CONNECTION_MAX_RECV * op_size
484
484
+ (tx_prefix * prefix_size ) + J_CONNECTION_MAX_SEND * op_size ;
@@ -522,7 +522,7 @@ j_connection_sread_event(struct JConnection* this, int timeout, enum JConnection
522
522
goto end ; /// \todo consider return TRUE on event queue error
523
523
}
524
524
CHECK ("Failed to read event of connection!" );
525
- g_message ("Event: %u" , fi_event );
525
+ // g_message("Event: %u", fi_event);
526
526
527
527
switch (fi_event ) {
528
528
case FI_CONNECTED : * event = J_CONNECTION_EVENT_CONNECTED ; break ;
@@ -583,7 +583,7 @@ j_connection_send(struct JConnection* this, const void* data, size_t data_len)
583
583
data , data_len );
584
584
size = data_len + this -> memory .tx_prefix_size ;
585
585
do {
586
- g_message ("send: prefix: %lu, size: %lu" , this -> memory .tx_prefix_size , size );
586
+ // g_message("send: prefix: %lu, size: %lu", this->memory.tx_prefix_size, size);
587
587
res = fi_send (this -> ep , segment , size , fi_mr_desc (this -> memory .mr ), 0 , segment );
588
588
} while (res == - FI_EAGAIN );
589
589
CHECK ("Failed to initelize sending!" );
@@ -611,10 +611,10 @@ j_connection_recv(struct JConnection* this, size_t data_len, void* data)
611
611
segment = (char * )this -> memory .buffer + this -> memory .used ;
612
612
size = data_len + this -> memory .rx_prefix_size ;
613
613
res = fi_recv (this -> ep , segment , size , fi_mr_desc (this -> memory .mr ), 0 , segment );
614
- g_message ("receive: prefix: %lu, size: %lu" , this -> memory .rx_prefix_size , size );
614
+ // g_message("receive: prefix: %lu, size: %lu", this->memory.rx_prefix_size, size);
615
615
CHECK ("Failed to initelized receiving!" );
616
616
this -> memory .used += size ;
617
- g_message ("memory useag: %lu/%lu" , this -> memory .used , this -> memory .buffer_size );
617
+ // g_message("memory useag: %lu/%lu", this->memory.used, this->memory.buffer_size);
618
618
g_assert_true (this -> memory .used <= this -> memory .buffer_size );
619
619
g_assert_true (this -> running_actions .len < J_CONNECTION_MAX_SEND + J_CONNECTION_MAX_RECV );
620
620
this -> running_actions .entry [this -> running_actions .len ].context = segment ;
@@ -635,7 +635,7 @@ j_connection_wait_for_completion(struct JConnection* this)
635
635
struct fi_cq_entry entry ;
636
636
int i ;
637
637
638
- g_message ("start waiting" );
638
+ // g_message("start waiting");
639
639
while (this -> running_actions .len ) {
640
640
bool rx ;
641
641
do {
@@ -678,7 +678,7 @@ j_connection_wait_for_completion(struct JConnection* this)
678
678
}
679
679
}
680
680
}
681
- g_message ("fin waiting" );
681
+ // g_message("fin waiting");
682
682
683
683
this -> running_actions .len = 0 ;
684
684
ret = TRUE;
@@ -692,20 +692,13 @@ j_connection_rma_register(struct JConnection* this, const void* data, size_t dat
692
692
int res ;
693
693
gboolean ret = FALSE;
694
694
695
- { // TODO: DEBUG
696
- for (unsigned i = 0 ; i < data_len ; ++ i ) {
697
- g_print ("%c " , ((const char * )data )[i ]);
698
- }
699
- g_print ("\n" );
700
- }
701
- void * ptr = g_strdup (data ); // TODO: change!
702
695
res = fi_mr_reg (this -> domain ,
703
- ptr ,
696
+ data ,
704
697
data_len ,
705
698
FI_REMOTE_READ ,
706
699
0 , 0 , 0 , & handle -> memory_region , NULL );
707
700
CHECK ("Failed to register memory region!" );
708
- handle -> addr = (guint64 )ptr ;
701
+ handle -> addr = (guint64 )data ;
709
702
handle -> size = data_len ;
710
703
711
704
ret = TRUE;
@@ -717,9 +710,9 @@ gboolean
717
710
j_connection_rma_unregister (struct JConnection * this , struct JConnectionMemory * handle )
718
711
{
719
712
int res ;
720
- g_message ("close memory start" );
713
+ // g_message("close memory start");
721
714
res = fi_close (& handle -> memory_region -> fid );
722
- g_message ("close memory fin" );
715
+ // g_message("close memory fin");
723
716
CHECK ("Failed to unregistrer rma memory!" );
724
717
return TRUE;
725
718
end :
@@ -745,7 +738,7 @@ j_connection_rma_read(struct JConnection* this, const struct JConnectionMemoryID
745
738
res = fi_mr_reg (this -> domain , data , memoryID -> size ,
746
739
FI_READ , 0 , 0 , 0 , & mr , 0 );
747
740
CHECK ("Failed to register receiving memory!" );
748
- g_message ("try to read: %lu, %lu" , memoryID -> offset , memoryID -> key );
741
+ // g_message("try to read: %lu, %lu", memoryID->offset, memoryID->key);
749
742
res = fi_read (this -> ep ,
750
743
data ,
751
744
memoryID -> size ,
0 commit comments