Skip to content

Instantly share code, notes, and snippets.

View minrk's full-sized avatar

Min RK minrk

View GitHub Profile
import sys
import argparse
import time
from mpi4py import MPI
import petsc4py
# petsc4py.init("-log_view", comm=MPI.COMM_WORLD)
from petsc4py import PETSc
parser = argparse.ArgumentParser(

env report: /global/common/software/nersc/pe/conda-envs/24.1.0/python-3.10/nersc-python

  • collected on: 2024-01-29T12:47:19.053109+00:00
  • envreport version: 0.0.1.dev

paths

  • PREFIX: /global/common/software/nersc/pe/conda-envs/24.1.0/python-3.10/nersc-python
  • CONDA_PREFIX: /global/common/software/nersc/pe/conda-envs/24.1.0/python-3.10/nersc-python
  • HOME: /global/homes/m/minrk
def default_url(handler):
user = handler.current_user
if not user:
# not logged in, send to login, no ?next
# that way, default_url will be called again after successful login
return handler.get_login_url()
if "admin-ui" in handler.expanded_scopes:
# has permission to view the admin page
return handler.base_url + "hub/admin"
else:
#include <stdio.h>
// #include <zlib.h>
#include "libfoo.h"
int main() {
// printf("libz version: %s\n", zlibVersion());
printf("libz version via libfoo: %s\n", zlibv());
}
================================================================================
================================================================================
linux-armv7l
================================================================================
================================================================================
win-32
================================================================================
================================================================================
osx-arm64
osx-arm64::coda-2.25.1-py310h1db3a1d_0.conda
#!/usr/bin/env python3
r"""
Count frequency of git alias use, including expanded alias in count output
run with `alias | python3 countalias.py`
for https://social.jvns.ca/@b0rk/111535523669398292
Almost enough (doesn't recover original alias) in bash:
@minrk
minrk / DependencyGraphs.ipynb
Last active November 21, 2023 14:03 — forked from msarahan/DependencyGraphs.ipynb
graphs from conda repodata.json
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
#!/usr/bin/env bash
set -ex
deployments="$@"
if [[ -z "$deployments" ]]; then
deployments="staging prod ovh2"
fi
helm dep up mybinder
chartpress --no-build
#include "mpi.h"
#include "petsc.h"
#include "petscmat.h"
#include <assert.h>
// subset of PETScBaseMatrix and PETScBaseMatrix
// namespace dolfin {
class PETScBaseMatrix {
public:
/// Constructor
@minrk
minrk / Dockerfile
Last active November 1, 2023 10:32
FROM condaforge/miniforge3
# allow native testing on intel or arm
COPY conda-linux-64.lock /tmp/
COPY conda-linux-aarch64.lock /tmp/
RUN \
PLAT=$(conda info --json | python -c 'import json, sys; print(json.load(sys.stdin)["platform"])') \
&& mamba create --name test --file /tmp/conda-${PLAT}.lock
COPY test.py /tmp/
# run test with mpi
# but it fails the same in serial