Multi-Locale Communications

Hi everyone,

I have a question regarding the "Communication" strategy among locales (e.g., Locale 1 with locale 2). I want to send some of the results I have got on Locale 1 to Locale 2. In this case, 1- Can I have a direct Locale1-Locale2 communication? 2- How should I call the target locale and call for example its function with giving the results I got on the other locale to it as its inputs?

Thanks in advance for any help!


A snippet that does what you ask specifically:

proc someFunction(data) {
// do something with data here

on Locales[1] {
var dataOnLoc1 = 10;
on Locales[2] {

In Chapel, you can refer to any variable as long as it is in the lexical scope. If the variable happens to be remote, the communication will be handled under-the-hood. e.g., here, dataOnLoc1 will be transferred via a GET by locale 2 from locale 1.

Hope this helps,

Thank you so much. In a case, that I am working with the forall loop, and I want to wrap the data in a CSV file (I have multiple lines (database rows)), should I work with SSH and Spawnshell to copy the CSV file on some path in the remote machine?

To be clear, that's not related to your original question, right?

And what you suggest sounds reasonable to me: spawn a process to scp/rsync the data, wait for the transfer to finish, then read the local data normally.