This file contains hidden or 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
| $ cat vadd.jl | |
| function vadd( a::NTuple{4,Float64}, b::NTuple{4,Float64} ) | |
| (a[1]+b[1],a[2]+b[2],a[3]+b[3],a[4]+b[4]) | |
| end | |
| function vadd_one!(arr::Array{Float64, 1}) | |
| len = length(arr) # assuming len multiple of 4 | |
| one = (1.0, 1.0, 1.0, 1.0) | |
| @inbounds for i = 1:4:len | |
| inp = (arr[i], arr[i+1], arr[i+2], arr[i+3]) |
This file contains hidden or 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
| $ cat v.jl | |
| function vadd_one!(arr::Array{Float32, 1}) | |
| @simd for i = 1:length(arr) | |
| @inbounds arr[i] += 1 | |
| end | |
| end | |
| code_llvm(vadd_one!,(Array{Float32, 1},)) | |
| $ julia v.jl |
This file contains hidden or 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
| L.preheader: ; preds = %top | |
| %.op = add i64 %0, 1, !dbg !9 | |
| %8 = select i1 %2, i64 %.op, i64 1, !dbg !9 | |
| %9 = sub i64 %8, %5, !dbg !9 | |
| %xtraiter = and i64 %9, 7 | |
| switch i64 %xtraiter, label %L.unr [ | |
| i64 0, label %L.preheader.split | |
| i64 1, label %L.unr22 | |
| i64 2, label %L.unr18 | |
| i64 3, label %L.unr14 |
This file contains hidden or 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/src/init.c | |
| +++ b/src/init.c | |
| @@ -64,6 +64,9 @@ extern BOOL (WINAPI *hSymRefreshModuleList)(HANDLE); | |
| #include <sched.h> // for setting CPU affinity | |
| #endif | |
| +#undef SIGSTKSZ | |
| +#define SIGSTKSZ (64*1024) | |
| + | |
| char *julia_home = NULL; |
This file contains hidden or 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
| :::::::::::::: | |
| test1.jl | |
| :::::::::::::: | |
| # Example from early discussion. | |
| # Has constant lower bound, expression as upper bound, and no reductions. | |
| function test1( a, x, y ) | |
| @simd for i=1:length(x) | |
| @inbounds y[i] = y[i]+a*x[i] | |
| end | |
| end |
This file contains hidden or 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
| $ cat y.jl | |
| cat: y.jl: No such file or directory | |
| $ cat /tmp/y.jl | |
| function saxpy( a, x, y ) | |
| @simd for i=1:length(x) | |
| @inbounds y[i] = y[i]+a*x[i] | |
| end | |
| end | |
| code_native( saxpy, (Float32,Array{Float32,1},Array{Float32,1}) ) |
This file contains hidden or 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
| --- IntelJITEventListener.cpp.orig 2014-05-15 13:45:30.079547337 -0500 | |
| +++ IntelJITEventListener.cpp 2014-05-15 13:46:43.647359854 -0500 | |
| @@ -174,6 +174,11 @@ | |
| FunctionMessage.line_number_table = 0; | |
| } | |
| +#define AMPLIFIER_BUG_WORKAROUND 1 | |
| +#if AMPLIFIER_BUG_WORKAROUND | |
| + for( unsigned i=FunctionMessage.line_number_size; i-->0; ) | |
| + FunctionMessage.line_number_table[i].LineNumber = i>0 ? FunctionMessage.line_number_table[i-1].LineNumber : 0; |
This file contains hidden or 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
| julia> Pkg.add("MPI") | |
| INFO: Installing MPI v0.2.2 | |
| INFO: Building MPI | |
| INFO: Attempting to Create directory /nfs/fx/disks/fx_home_disk2/adrobiso/.julia/v0.3/MPI/deps/build | |
| INFO: Directory /nfs/fx/disks/fx_home_disk2/adrobiso/.julia/v0.3/MPI/deps/build already created | |
| INFO: Changing Directory to /nfs/fx/disks/fx_home_disk2/adrobiso/.julia/v0.3/MPI/deps/build | |
| CMake Error at /usr/share/cmake/Modules/FindPackageHandleStandardArgs.cmake:108 (message): | |
| Could NOT find MPI_C (missing: MPI_C_LIBRARIES) | |
| Call Stack (most recent call first): | |
| /usr/share/cmake/Modules/FindPackageHandleStandardArgs.cmake:315 (_FPHSA_FAILURE_MESSAGE) |
This file contains hidden or 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
| $ rm -rf build | |
| $ julia build.jl | |
| INFO: Attempting to Create directory /nfs/fx/disks/fx_home_disk2/adrobiso/.julia/v0.3/MPI/deps/build | |
| INFO: Changing Directory to /nfs/fx/disks/fx_home_disk2/adrobiso/.julia/v0.3/MPI/deps/build | |
| -- The Fortran compiler identification is GNU | |
| -- The C compiler identification is GNU 4.8.2 | |
| -- Check for working Fortran compiler: /bin/f95 | |
| -- Check for working Fortran compiler: /bin/f95 -- works | |
| -- Detecting Fortran compiler ABI info | |
| -- Detecting Fortran compiler ABI info - done |
This file contains hidden or 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
| $ for f in *.jl; do echo $f; mpiexec -np 4 julia $f; done | |
| 01-hello.jl | |
| Hello world, I am 1 of 4Hello world, I am 3 of 4Hello world, I am 2 of 4Hello world, I am 0 of 4 | |
| 02-broadcast.jl | |
| ------------------------------------------------------------------------------ | |
| Running on 4 processes | |
| ------------------------------------------------------------------------------ |