Compile ollama in Ubuntu 22.04:
# Install and activate oneapi
sudo apt install intel-basekit
source /opt/intel/oneapi/setvars.sh
# You may need to install other build dependencies ...
# sudo apt install apt-utils
Compile ollama in Ubuntu 22.04:
# Install and activate oneapi
sudo apt install intel-basekit
source /opt/intel/oneapi/setvars.sh
# You may need to install other build dependencies ...
# sudo apt install apt-utils
""" | |
Example adapted from https://github.com/aamini/introtodeeplearning lab2 part2 | |
© MIT Introduction to Deep Learning | |
http://introtodeeplearning.com | |
""" | |
import tensorflow as tf | |
import matplotlib.pyplot as plt | |
import functools | |
import numpy as np |
""" | |
Simple Gantt chart implementation | |
""" | |
from datetime import datetime as dt | |
import matplotlib | |
import matplotlib.pyplot as plt | |
from matplotlib.dates import date2num | |
import matplotlib.dates as mdates | |
import numpy |
#!/bin/bash | |
# generate mp4 animation from still images with ffmpeg. | |
if [ $# != 2 ]; then | |
echo "Usage: $(basename "$0") \"image/file/pattern_*.png\" output.mp4" | |
exit -1 | |
fi | |
pattern=$1 | |
outputfile=$2 |
#!/bin/bash | |
# loop through days of month given the first day | |
startdate="2019-06-01" | |
enddate=$(date -d "$startdate + 1 month" +"%Y-%m-%d") | |
ndays=$(( ($(date -d "$enddate" +%s) - $(date -d "$startdate" +%s) )/(60*60*24) )) | |
for i in $(seq 0 $(($ndays - 1)) ); do |
""" | |
Python argparse example demonstrating the most common usage options. | |
""" | |
import argparse | |
parser = argparse.ArgumentParser( | |
description='Description of the routine', | |
# includes default values in help entries | |
formatter_class=argparse.ArgumentDefaultsHelpFormatter, | |
) |
#!/bin/bash | |
# Install SLIM on rigilk cluster | |
source ~/bin/activate_gcc6.4 | |
source ~/bin/activate_cmake-3.11.4 | |
source ~/bin/activate_openmpi.sh | |
export BASEDIR=/home/karnat/sources/slim/install-script | |
mkdir -p $BASEDIR |
from thetis import * | |
""" | |
Computes a "strong" vertical integral of a field with pyop2 | |
by integrating along the vertical 1D edges of the prism. | |
""" | |
def strong_integral_2d(source, output_2d, z_coords): | |
"""Computes strong integral of a P1DGxP1DG field onto P1DG 2D field""" |
lc = 1.0/25.0; | |
Point(1) = {0, 0, 0, lc}; | |
Point(2) = {1, 0, 0, lc}; | |
Point(3) = {1, 1, 0, lc}; | |
Point(4) = {0, 1, 0, lc}; | |
Line(1) = {4, 3}; | |
Line(2) = {3, 2}; | |
Line(3) = {2, 1}; | |
Line(4) = {1, 4}; | |
Line Loop(5) = {1, 2, 3, 4}; |