Skip to content

Instantly share code, notes, and snippets.

@nazavode
nazavode / rmsd.py
Created September 6, 2023 21:31
Compute optimal RMSD between two molecular structures
#!/usr/bin/env python3
from rdkit.Chem.rdmolfiles import MolFromMol2File
from rdkit.Chem.rdMolAlign import AlignMol
import argparse
if __name__ == "__main__":
PARSER = argparse.ArgumentParser(
description="""Compute optimal RMSD of two structures.
@nazavode
nazavode / Makefile
Last active June 8, 2023 14:54
mlir-func-snitch-runtime
# Snitch runtime
SNRT_BANSHEE = /root/src/mlir/snRuntime-banshee
SNRT_VERILATOR = /root/src/mlir/snRuntime-cluster
CC1 = /tools/riscv-llvm/bin/clang-12 -cc1
LD = /tools/riscv-llvm/bin/riscv32-unknown-elf-clang
CC1FLAGS =
CC1FLAGS += -triple riscv32-unknown-unknown-elf
@nazavode
nazavode / perf.bib
Last active December 19, 2021 14:03
Bibliography for "WTF is my processor doing?" lecture @ UniBo
@inproceedings{nowak_establishing_2015,
title = {Establishing a Base of Trust with Performance Counters for Enterprise Workloads},
booktitle = {{USENIX} Annual Technical Conference},
author = {Nowak, Andrzej and Yasin, Ahmad and Mendelson, Avi and Zwaenepoel, Willy},
date = {2015},
}
@inproceedings{yasin_top-down_2014,
location = {{CA}, {USA}},
title = {A Top-Down method for performance analysis and counters architecture},
WARNING: ThreadSanitizer: data race (pid=18138)
Read of size 8 at 0x7b2800000130 by thread T2:
#0 std::__1::deque<std::__1::function<void ()>, std::__1::allocator<std::__1::function<void ()> > >::empty() const /src/install/llvm-debug-omptsan/bin/../include/c++/v1/deque:1401 (sycl-helloworld.x+0x50525a)
#1 std::__1::queue<std::__1::function<void ()>, std::__1::deque<std::__1::function<void ()>, std::__1::allocator<std::__1::function<void ()> > > >::empty() const /src/install/llvm-debug-omptsan/bin/../include/c++/v1/queue:291 (sycl-helloworld.x+0x502668)
#2 hipcpu::detail::async_queue::work() /src/install/hipSYCL-debug-omptsan/bin/../include/hipSYCL/contrib/hipCPU/hip/detail/queue.hpp:173 (sycl-helloworld.x+0x502325)
#3 hipcpu::detail::async_queue::work() /src/install/hipSYCL-debug-omptsan/bin/../include/hipSYCL/contrib/hipCPU/hip/detail/queue.hpp:171 (sycl-helloworld.x+0x502310)
#4 operator() /src/install/hipSYCL-debug-omptsan/bin/../include/hipSYCL/contrib/hipCPU/hip/detail/queue.hpp:98
WARNING: ThreadSanitizer: data race (pid=8682)
Read of size 8 at 0x7b2800000130 by thread T2:
#0 std::__1::deque<std::__1::function<void ()>, std::__1::allocator<std::__1::function<void ()> > >::empty() const /src/install/llvm-debug-omptsan/bin/../include/c++/v1/deque:1401 (sycl-helloworld.x+0x50557a)
#1 std::__1::queue<std::__1::function<void ()>, std::__1::deque<std::__1::function<void ()>, std::__1::allocator<std::__1::function<void ()> > > >::empty() const /src/install/llvm-debug-omptsan/bin/../include/c++/v1/queue:291 (sycl-helloworld.x+0x502868)
#2 hipcpu::detail::async_queue::work() /src/install/hipSYCL-debug-omptsan/bin/../include/hipSYCL/contrib/hipCPU/hip/detail/queue.hpp:182 (sycl-helloworld.x+0x5024da)
#3 hipcpu::detail::async_queue::work() /src/install/hipSYCL-debug-omptsan/bin/../include/hipSYCL/contrib/hipCPU/hip/detail/queue.hpp:180 (sycl-helloworld.x+0x5024c5)
#4 operator() /src/install/hipSYCL-debug-omptsan/bin/../include/hipSYCL/contrib/hipCPU/hip/detail/queue.hpp:98 (
@nazavode
nazavode / opa2json.py
Last active October 30, 2019 16:28
Convert a network graph from opareport (Intel Omni-Path) format to JSON
#!/usr/bin/python
# -*- coding: utf-8 -*-
import sys
import json
import argparse
import xml.etree.ElementTree as et
import networkx as nx
FROM ubuntu:18.04
LABEL name="spack-linux-ubuntu18.04-x86_64"
####################################################
# Spack Setup #
####################################################
ARG SPACK_GIT_URL=https://github.com/spack/spack.git
ARG SPACK_GIT_BRANCH=develop
ARG SPACK_GIT_HASH=af65146ef69fcde10d53b2ee12f82a9c28361e23
####################################################
@nazavode
nazavode / tablegen
Last active September 25, 2019 21:15
Generate C++ periodic table of elements
#!/usr/bin/env python3
###########################################################
# This is free and unencumbered software released into the public domain.
# Anyone is free to copy, modify, publish, use, compile, sell, or
# distribute this software, either in source code form or as a compiled
# binary, for any purpose, commercial or non-commercial, and by any
# means.
# In jurisdictions that recognize copyright laws, the author or authors
@nazavode
nazavode / redate
Last active March 10, 2019 22:01
Remap a timepoint to a given time frame in the same day, meant to be used to move git commits to another point in time
#!/usr/bin/env python
# Copyright: (c) 2019, Federico Ficarelli <federico.ficarelli@gmail.com>
# GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt)
import argparse
import datetime as dt
TIME_FORMAT = "%H:%M"
parser = argparse.ArgumentParser(
@nazavode
nazavode / Dockerfile
Created August 31, 2018 08:09
LLVM nightly build
FROM ubuntu:18.04
LABEL name="llvm-nightly-ubuntu18.04-x86_64"
LABEL maintainer="federico.ficarelli@gmail.com"
ENV LANG C.UTF-8
RUN apt-get update &&\
apt-get install -f -y apt-utils &&\
apt-get -f -y upgrade &&\