This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env python | |
# License: MIT Open Source | |
# Copyright (c) 2016 Joe Linoff | |
''' | |
The tool runs ssh or scp as a child process with a connected psuedo | |
terminal (pty). | |
It will automatically answer yes to the "Are you sure you want to | |
continue connecting (yes/no)?" if it comes up. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
addprocs(1) | |
const rr1=RemoteRef() | |
const rr2=RemoteRef(2) | |
@everywhere function do_sendrecv(N, rr1, rr2) | |
myid() == 1 && print("$N : ") | |
if myid() == 1 | |
rr_put = rr2 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
addprocs(1) | |
@everywhere function echo_on_sock(s, N) | |
while true | |
try | |
read(s, Float64, (N,)) | |
write(s, fill(Float64(myid()), N)) | |
catch e | |
#println("closed by remote $e") |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import MPI | |
function do_sendrecv(N) | |
comm = MPI.COMM_WORLD | |
MPI.Barrier(comm) | |
rank = MPI.Comm_rank(comm) | |
size = MPI.Comm_size(comm) |