Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Surprising additional communication happens with tuples versus varargs #26708

Open
jabraham17 opened this issue Feb 13, 2025 · 0 comments
Open

Comments

@jabraham17
Copy link
Member

while working with tuples and varargs, I found some surprising communication. My intuition would be that they are handled more or less the same, but that does not seem to be the case.

The following code has an extra GET

proc foo(args...) {
  for param i in 0..#args.size {
    on Locales[1] do
      const s = args[i].localize(); // 1 get for localize
  }
}
proc bar(args) {
  for param i in 0..#args.size {
    on Locales[1] do
      const s = args[i].localize(); // 2 gets: 1 for localize, 1 for ????
  }
}
proc callme(param useBar, args...) {
  if useBar then
    bar(args);
  else
    foo((...args));
}


use CommDiagnostics;
config const verboseComm = false;

if verboseComm then startVerboseComm();
else {
  resetCommDiagnostics();
  startCommDiagnostics();
}
callme(true, "hi", "there");
if verboseComm then stopVerboseComm();
else {
  stopCommDiagnostics();
  printCommDiagnosticsTable();
}

if verboseComm then startVerboseComm();
else {
  resetCommDiagnostics();
  startCommDiagnostics();
}
callme(false, "hi", "there");
if verboseComm then stopVerboseComm();
else {
  stopCommDiagnostics();
  printCommDiagnosticsTable();
}

After discussing with @bradcray and @e-kayrakli, here is what we think is happening.

  • The varargs to foo are being stamped out at resolution foo(_e0_arg, _e1_arg), while bar still has a tuple
  • During RVF (remote value forwarding), the individual args for foo get forwarded, while tuple for bar does not.

In general, while this is surprising, its not too concerning. But I am capturing it here so if someone ever hits it we have a record of it.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant