Project

General

Profile

Bug #999

netlrts writeableDgrams is never reset to 0

Added by Jim Phillips over 3 years ago. Updated over 2 years ago.

Status:
Merged
Priority:
Normal
Assignee:
Category:
Machine Layers
Target version:
Start date:
03/01/2016
Due date:
% Done:

0%


Description

In src/arch/netlrts/machine-eth.c CommunicationServerNet():

if (writeableDgrams) {
CmiUnlock(Cmi_comm_var_mutex);
int temp;
if (0!=(temp=TransmitDatagram())) {
again=1;
CmiLock(Cmi_comm_var_mutex);
writeableDgrams = temp;
CmiUnlock(Cmi_comm_var_mutex);
}
} else CmiUnlock(Cmi_comm_var_mutex);

Note that writeableDgrams = temp only happens if temp != 0.

I assume that this grew out of an attempt to reduce the time holding the lock.

In any case, this defeats my efforts to allow the communication thread to sleep, since CheckSocketsReady sees that writeableDgrams (and writeableAcks) are set and returns immediately reporting that dataskt is writeable.

Related, in standalone mode CheckSocketsReady(int withDelayMs) returns 0 immediately. If withDelayMs is nonzero it should sleep for that long before returning.

History

#1 Updated by Jim Phillips over 3 years ago

I think simply inserting an optimistic "writeableDgrams = 0" as below fixes the first issue:

if (writeableDgrams) {
writeableDgrams = 0;
CmiUnlock(Cmi_comm_var_mutex);
int temp;
if (0!=(temp=TransmitDatagram())) {
again=1;
CmiLock(Cmi_comm_var_mutex);
writeableDgrams = temp;
CmiUnlock(Cmi_comm_var_mutex);
}
} else CmiUnlock(Cmi_comm_var_mutex);

#2 Updated by Eric Bohm over 3 years ago

  • Assignee set to Bilge Acun

#3 Updated by Bilge Acun over 2 years ago

  • Status changed from New to Implemented

#4 Updated by Phil Miller over 2 years ago

  • Target version set to 6.8.0

#5 Updated by Phil Miller over 2 years ago

  • Status changed from Implemented to Merged

The part of the above change that wasn't directly addressing this bug got reverted, but the fix for this is solidly in place.
https://charm.cs.illinois.edu/gerrit/#/c/2332/1

Also available in: Atom PDF