Skip to content

Instantly share code, notes, and snippets.

View rkube's full-sized avatar

Ralph Kube rkube

View GitHub Profile
@rkube
rkube / postprocess.py
Created November 7, 2022 09:32
postprocessing of downloaded data
import argparse
import pickle
import yaml
import logging
import h5py
from os.path import join
import numpy as np
from tqdm import tqdm
import scipy.sparse as sp_sparse
@rkube
rkube / AE_pred_LSTMtest_1723xx.ipynb
Created September 21, 2022 20:47
AE_pred_LSTMtest_1723xx.ipynb
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.
Overhead ╎ [+additional indent] Count File:Line; Function
=========================================================
╎1 @Base/dict.jl:497; getindex(h::Dict{Symbol, Any}, key::Symbol)
╎ 1 @Base/dict.jl:281; ht_keyindex
1╎ 1 @Base/Base.jl:38; getproperty
1╎1 @Base/dict.jl:0; ht_keyindex(h::Dict{UInt32, AbstractPlot}, key::UInt32)
2╎2 @Base/sort.jl:549; partition!(v::Vector{Int64}, lo::Int64, hi::Int64, o::Base.Order.Perm{Base.Sort.Float.Right, Vector{Float32}})
1╎1 @Base/sort.jl:568; sort!(v::Vector{Int64}, lo::Int64, hi::Int64, a::Base.Sort.QuickSortAlg, o::Base.Order.Perm{Base.Sort.Float.Right, Vector{Float32}})
╎1 @Base/task.jl:484; (::VSCodeServer.JSONRPC.var"#1#3"{VSCodeServer.JSONRPC.JSONRPCEndpoint{Base.PipeEndpoint, Base.PipeEndpoint}})()
╎ 1 @JSONRPC/src/core.jl:103; macro expansion
@rkube
rkube / gist:45d799970fd2e7a0b93cc2991e48facf
Last active September 19, 2022 15:43
kinetic_anim.jl
# Try animation of particle trajectories
tail = 200
num_ptl = 1000
trg = 1:100*tail
# size(phase_rs) = [2, 8_000, 20_000]
anim_step(tidx, ptl) = GLMakie.Point2f(phase_rs[:, ptl, tidx])
traj_list = Any[]
@rkube
rkube / jl
Created August 28, 2022 14:32
Post-processing of tracer output
using Plots
using ADIOS2
using Random
#using BenchmarkTools
sim_name = "pe459_v7"
#sim_path = f"/global/cfs/cdirs/m499/rkube/xgc1-runs/tracers-em/{sim_name}"
sim_path = "/global/cscratch1/sd/rkube/xgc_runs/tracers-em/$(sim_name)"
# Number of particles that we track.
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
{
"cells": [
{
"cell_type": "code",
"execution_count": 1,
"id": "06beeb51",
"metadata": {},
"outputs": [],
"source": [
"%load_ext autoreload\n",
@rkube
rkube / diff
Created April 22, 2022 19:01
xgc_diff_tracerdiag
diff --git a/CMake/FindKokkos.cmake b/CMake/FindKokkos.cmake
index 3a62d58c..dd0f0e6a 100644
--- a/CMake/FindKokkos.cmake
+++ b/CMake/FindKokkos.cmake
@@ -1,18 +1,10 @@
find_package(Kokkos CONFIG)
if(Kokkos_FOUND)
- if(TARGET kokkos)
- # Kokkos' imported target doesn't give us its include path,
- # so we add it here.
// in tracer_diag.cpp
plasma.for_all_nonadiabatic_species([&](Species<DeviceType>& species){
// This is the syntax to access the Cabana AoSoA
// See example code in https://github.com/ECP-copa/Cabana/blob/master/core/unit_test/tstAoSoA.hpp
auto phase = Cabana::slice<0>(species.particles);
auto tracer = Cabana::slice<2>(species.particles);
auto gid = Cabana::slice<3>(species.particles);
auto flag = Cabana::slice<4>(species.particles);
written_ptls = 0;