Skip to content

Commit 919ff5c

Browse files
committed
Rebase to master, set libfabric version to 1.6
1 parent a15b56b commit 919ff5c

File tree

5 files changed

+38
-6
lines changed

5 files changed

+38
-6
lines changed

.github/workflows/ci.yml

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -193,8 +193,12 @@ jobs:
193193
exclude:
194194
# GLib is too old for TAP on Ubuntu 18.04
195195
- os:
196-
dist: ubuntu-18.04
196+
dist: ubuntu-18.04
197197
dependencies: system
198+
# libfaibrc 1.11 is not available on Ubuntu 20.04
199+
# - os:
200+
# dist: ubuntu-20.04
201+
# depednencies: system
198202
steps:
199203
- name: Checkout
200204
uses: actions/checkout@v2

include/core/jconfiguration.h

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -116,9 +116,6 @@ guint64 j_configuration_get_message_inject_size(JConfiguration*);
116116
guint32 j_configuration_get_max_connections(JConfiguration*);
117117
guint64 j_configuration_get_stripe_size(JConfiguration*);
118118

119-
/// network port to communicate
120-
guint16 j_configuration_get_port(JConfiguration*);
121-
122119
gint64 j_configuration_get_libfabric_version(JConfiguration*);
123120
struct fi_info* j_configuration_get_libfabric_hints(JConfiguration*);
124121

lib/core/jconfiguration.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -374,7 +374,7 @@ j_configuration_new_for_data(GKeyFile* key_file)
374374
configuration->max_connections = max_connections;
375375
configuration->stripe_size = stripe_size;
376376
configuration->ref_count = 1;
377-
configuration->libfabric.version = FI_VERSION(1, 11);
377+
configuration->libfabric.version = FI_VERSION(1, 6);
378378
configuration->libfabric.hints = fi_allocinfo();
379379
configuration->libfabric.hints->caps =
380380
FI_MSG | FI_SEND | FI_RECV | FI_READ | FI_RMA | FI_REMOTE_READ;

lib/object/jdistributed-object.c

Lines changed: 21 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -72,6 +72,7 @@ struct JDistributedObjectBackgroundData
7272
struct
7373
{
7474
JList* bytes_written;
75+
guint64 total_bytes_written;
7576
} write;
7677
};
7778
};
@@ -440,6 +441,7 @@ j_distributed_object_write_background_operation(gpointer data)
440441
guint64* bytes_written = j_list_iterator_get(it);
441442

442443
nbytes = j_message_get_8(reply);
444+
background_data->write.total_bytes_written += nbytes;
443445
j_helper_atomic_add(bytes_written, nbytes);
444446
}
445447
}
@@ -983,13 +985,17 @@ j_distributed_object_write_exec(JList* operations, JSemantics* semantics)
983985
gsize name_len = 0;
984986
gsize namespace_len = 0;
985987
guint32 server_count = 0;
988+
guint64 total_data_length = 0;
989+
JSemanticsSafety safety;
986990

987991
/// \todo
988992
//JLock* lock = NULL;
989993

990994
g_return_val_if_fail(operations != NULL, FALSE);
991995
g_return_val_if_fail(semantics != NULL, FALSE);
992996

997+
safety = j_semantics_get(semantics, J_SEMANTICS_SAFETY);
998+
993999
{
9941000
JDistributedObjectOperation* operation = j_list_get_first(operations);
9951001
g_assert(operation != NULL);
@@ -1075,10 +1081,14 @@ j_distributed_object_write_exec(JList* operations, JSemantics* semantics)
10751081
new_data += new_length;
10761082

10771083
// Fake bytes_written here instead of doing another loop further down
1078-
if (j_semantics_get(semantics, J_SEMANTICS_SAFETY) == J_SEMANTICS_SAFETY_NONE)
1084+
if (safety == J_SEMANTICS_SAFETY_NONE)
10791085
{
10801086
j_helper_atomic_add(bytes_written, new_length);
10811087
}
1088+
else
1089+
{
1090+
total_data_length += new_length;
1091+
}
10821092
}
10831093
}
10841094
else
@@ -1114,13 +1124,15 @@ j_distributed_object_write_exec(JList* operations, JSemantics* semantics)
11141124
data->operations = NULL;
11151125
data->semantics = semantics;
11161126
data->write.bytes_written = bw_lists[i];
1127+
data->write.total_bytes_written = 0;
11171128
data->ret = TRUE;
11181129

11191130
background_data[i] = data;
11201131
}
11211132

11221133
j_helper_execute_parallel(j_distributed_object_write_background_operation, background_data, server_count);
11231134

1135+
guint64 total_written= 0;
11241136
for (guint i = 0; i < server_count; i++)
11251137
{
11261138
JDistributedObjectBackgroundData* data;
@@ -1132,9 +1144,17 @@ j_distributed_object_write_exec(JList* operations, JSemantics* semantics)
11321144

11331145
data = background_data[i];
11341146
ret = data->ret && ret;
1147+
total_written += data->write.total_bytes_written;
11351148

11361149
g_slice_free(JDistributedObjectBackgroundData, data);
11371150
}
1151+
if(safety == J_SEMANTICS_SAFETY_STORAGE || safety == J_SEMANTICS_SAFETY_NETWORK)
1152+
{
1153+
if(total_written != total_data_length)
1154+
{
1155+
ret = FALSE;
1156+
}
1157+
}
11381158
}
11391159
else
11401160
{

lib/object/jobject.c

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -607,6 +607,7 @@ j_object_write_exec(JList* operations, JSemantics* semantics)
607607
g_autoptr(JMessage) message = NULL;
608608
JObject* object;
609609
gpointer object_handle;
610+
guint64 total_data_length = 0;
610611

611612
/// \todo
612613
//JLock* lock = NULL;
@@ -677,6 +678,10 @@ j_object_write_exec(JList* operations, JSemantics* semantics)
677678
{
678679
j_helper_atomic_add(bytes_written, length);
679680
}
681+
else
682+
{
683+
total_data_length += length;
684+
}
680685
}
681686
else
682687
{
@@ -710,6 +715,7 @@ j_object_write_exec(JList* operations, JSemantics* semantics)
710715

711716
if (j_message_get_count(reply) > 0)
712717
{
718+
guint64 total_received_length = 0;
713719
it = j_list_iterator_new(operations);
714720

715721
while (j_list_iterator_next(it))
@@ -718,10 +724,15 @@ j_object_write_exec(JList* operations, JSemantics* semantics)
718724
guint64* bytes_written = operation->write.bytes_written;
719725

720726
nbytes = j_message_get_8(reply);
727+
total_received_length += nbytes;
721728
j_helper_atomic_add(bytes_written, nbytes);
722729
}
723730

724731
j_list_iterator_free(it);
732+
733+
if(total_data_length != total_received_length) {
734+
ret = FALSE;
735+
}
725736
}
726737
else
727738
{

0 commit comments

Comments
 (0)