Skip to content

Instantly share code, notes, and snippets.

View cako's full-sized avatar
🐢

Carlos da Costa cako

🐢
View GitHub Profile
@cako
cako / example_qrsh.jl
Last active December 14, 2017 00:58
Asynchronous submission of jobs using addprocs_qrsh
#!/usr/bin/env julia
using ClusterManagers
function submit_task()
# Complex task goes here
function mytask(x)
return sinint(x)
end
#!/usr/bin/env julia
function sdot(n, x, y)
a = 0
@inbounds @fastmath @simd for i=1:n
a += x[i]*y[i]
end
a
end
@cako
cako / hierarchy.json
Last active July 16, 2018 11:53
Hierarchical Edge Bundling for Courses
[{"name":"EASC08001","size":1,"title":"Earth Dynamics","color":"#1b9e77","imports":[]},{"name":"EASC08014","size":1,"title":"Earth Materials","color":"#1b9e77","imports":[]},{"name":"GESC08002","size":1,"title":"Earth Modelling and Prediction","color":"#9b58a5","imports":[]},{"name":"EASC08018","size":2,"title":"Earth Modelling and Prediction 2","color":"#1b9e77","imports":["GESC08002"]},{"name":"EASC08022","size":3,"title":"Earth Science Fundamentals for Geophysicists","color":"#1b9e77","imports":["EASC08001","EASC08008"]},{"name":"EASC08024","size":1,"title":"Environmental Geochemistry of the Earth's Surface","color":"#1b9e77","imports":[]},{"name":"EASC08023","size":1,"title":"Evolution of the Living Earth","color":"#1b9e77","imports":[]},{"name":"EASC08021","size":2,"title":"Geomaterials","color":"#1b9e77","imports":["EASC08001"]},{"name":"EASC08007","size":1,"title":"Global Environmental Processes","color":"#1b9e77","imports":[]},{"name":"EASC08020","size":2,"title":"Global Tectonics and the Rock Cycle",
@cako
cako / hierarchy.json
Last active July 16, 2018 11:50
Hierarchical Edge Bundling for Courses (Subset)
[{"name":"EASC08001","size":10,"title":"Earth Dynamics","color":"#00004c","imports":["EASC08022","EASC08021","EASC08020","EASC08017","EASC09019","EASC09003","EASC09021","EASC10107","EASC10091"]},{"name":"GESC08002","size":2,"title":"Earth Modelling and Prediction","color":"#800000","imports":["EASC08018"]},{"name":"EASC08018","size":5,"title":"Earth Modelling and Prediction 2","color":"#00004c","imports":["EASC10118","EASC10098","EASC10102","EASC10103"]},{"name":"EASC08022","size":2,"title":"Earth Science Fundamentals for Geophysicists","color":"#00004c","imports":["EASC09021"]},{"name":"EASC08024","size":3,"title":"Environmental Geochemistry of the Earth's Surface","color":"#00004c","imports":["EASC10048","EASC10103"]},{"name":"EASC08021","size":8,"title":"Geomaterials","color":"#00004c","imports":["EASC09031","EASC09050","EASC09008","EASC10118","EASC10107","EASC10112","EASC10103"]},{"name":"EASC08020","size":12,"title":"Global Tectonics and the Rock Cycle","color":"#00004c","imports":["EASC09031","EASC09029
@cako
cako / benchmark_LinearMaps_change.jl
Last active October 24, 2018 02:36
Benchmark pull request introduced to LinearMaps
using BenchmarkTools
using Statistics
using Plots
_flags(A::Array) = unsafe_load(convert(Ptr{UInt16}, pointer_from_objref(A)), 9)
_isshared(A::Array) = !(_flags(A) & 0x4000 == 0x0000)
function create_and_resize_flag(n)
a = Array{Float64}(undef, 1000)
if !_isshared(a)
using LinearMaps
using Test
function f1(source)
dest = zeros(9)
tmp = reshape(source, 5, 2)
return dest
end
function f2(source)
dest = zeros(6)
tmp = reshape(source, 3, 3)
{
"cells": [
{
"cell_type": "code",
"execution_count": 1,
"id": "destroyed-operations",
"metadata": {},
"outputs": [],
"source": [
"import matplotlib.pyplot as plt\n",
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.