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
#include <stdio.h> | |
#include <stdlib.h> | |
#include <sys/socket.h> | |
#include <netinet/in.h> | |
#include <string.h> | |
#include <arpa/inet.h> | |
#include <time.h> | |
int main(int argc, char ** argv){ | |
int sock; |
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
# Constants valid on Linux | |
const PROT_READ = 0x01 | |
const PROT_WRITE = 0x02 | |
const MAP_SHARED = 0x01 | |
@linux_only const MAP_ANONYMOUS = 0x20 | |
@osx_only const MAP_ANONYMOUS = 0x1000 | |
function anon_mmap(t::Type, n::Int) | |
x = ccall(:mmap, Ptr{Void}, (Ptr{Void}, Csize_t, Cint, Cint, Cint, FileOffset), C_NULL, sizeof(t) * n, PROT_READ | PROT_WRITE, MAP_SHARED | MAP_ANONYMOUS, -1, 0) |
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
_ | |
_ _ _(_)_ | A fresh approach to technical computing | |
(_) | (_) (_) | Documentation: http://docs.julialang.org | |
_ _ _| |_ __ _ | Type "help()" to list help topics | |
| | | | | | |/ _` | | | |
| | |_| | | | (_| | | Version 0.3.0-prerelease+1000 (2014-01-15 06:28 UTC) | |
_/ |\__'_|_|_|\__'_| | Commit 714fa07 (0 days old master) | |
|__/ | x86_64-linux-gnu | |
julia> function file_io(secs) |
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
I[00:00:00] Build started | |
[00:00:00] git config --global core.autocrlf input | |
[00:00:00] git clone -q --depth=50 https://github.com/JuliaLang/julia.git C:\projects\julia | |
[00:00:06] git fetch -q origin +refs/pull/17658/merge: | |
[00:00:08] git checkout -qf FETCH_HEAD | |
[00:00:11] Restoring build cache | |
[00:00:11] Restoring "i686-4.9.2-release-win32-sjlj-rt_v4-rev3.7z"... | |
[00:00:15] OK | |
[00:00:15] Restoring "llvm-3.7.1-i686-w64-mingw32-juliadeps-r09.7z"... | |
[00:00:17] OK |
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
travis_fold:start:worker_info | |
[0K[33;1mWorker information[0m | |
hostname: worker-jupiter-brain:169184e1-fd21-4dc3-8cfa-54f609400704 | |
version: v2.6.1 https://github.com/travis-ci/worker/tree/82ed3060354f6c4bedd90a7aeaf97950193697f1 | |
instance: 6fb12191-b801-4fd1-82fb-633c383a1cda:travis-ci-osx10.11-xcode8-1479248015 | |
startup: 1m19.348186616s | |
travis_fold:end:worker_info | |
[0Ktravis_fold:start:system_info | |
[0K[33;1mBuild system information[0m |
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) |
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
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
[00:00:00] Build started | |
[00:00:00] git config --global core.autocrlf input | |
[00:00:00] git clone -q --depth=50 https://github.com/JuliaLang/julia.git C:\projects\julia | |
[00:00:05] git fetch -q origin +refs/pull/21021/merge: | |
[00:00:07] git checkout -qf FETCH_HEAD | |
[00:00:14] Restoring build cache | |
[00:00:14] | |
[00:00:14] Cache 'x86_64-4.9.2-release-win32-seh-rt_v4-rev3.7z' - Downloading (63,558,997 bytes)...1% | |
[00:00:15] Cache 'x86_64-4.9.2-release-win32-seh-rt_v4-rev3.7z' - Downloading (63,558,997 bytes)...10% | |
[00:00:15] Cache 'x86_64-4.9.2-release-win32-seh-rt_v4-rev3.7z' - Downloading (63,558,997 bytes)...20% |
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
function foo(n) | |
for i in 1:10^n | |
produce(i) | |
end | |
end | |
function bar(t,n) | |
for i in 1:10^n | |
consume(t,i) | |
end |