Skip to content

Instantly share code, notes, and snippets.

View AymenFJA's full-sized avatar
💫
Even though they criticize Secretly they fantasize

Aymen Alsaadi AymenFJA

💫
Even though they criticize Secretly they fantasize
View GitHub Profile
import dill
import sqlite3
def in_memory_serialization(obj, op):
if op == 'serialize':
try:
return dill.dumps(obj)
except:
Chapter One
A Stop on the Salt Route
1000 B.C.
As they rounded a bend in the path that ran beside the river, Lara recognized the silhouette of a fig tree atop a nearby hill. The weather was hot and the days were long. The fig tree was in full leaf, but not yet bearing fruit.
Soon Lara spotted other landmarks—an outcropping of limestone beside the path that had a silhouette like a man’s face, a marshy spot beside the river where the waterfowl were easily startled, a tall tree that looked like a man with his arms upraised. They were drawing near to the place where there was an island in the river. The island was a good spot to make camp. They would sleep on the island tonight.
Lara had been back and forth along the river path many times in her short life. Her people had not created the path—it had always been there, like the river—but their deerskin-shod feet and the wooden wheels of their handcarts kept the path well worn. Lara’s people were salt traders, and their livelihood took them on a continual journey.
@AymenFJA
AymenFJA / clean_py.sh
Created August 14, 2023 14:04 — forked from hbsdev/clean_py.sh
Recursively remove all .pyc files and __pycache__ directories in the current directory.
#!/bin/sh
# recursively removes all .pyc files and __pycache__ directories in the current
# directory
find . | grep -E "(__pycache__|\.pyc$)" | xargs rm -rf
@AymenFJA
AymenFJA / bash_app_for_rp.py
Last active March 3, 2022 21:21
Prepared for Logan Ward
import radical.pilot as rp
from parsl.app.app import python_app, bash_app
@bash_app
def mpi_simulate(x: float, ptype = rp.MPI,
nproc = 3, pre_exec = []):
return './simulate {0}'.format(x)
result = mpi_simulate(2, ptype = rp.MPI, nproc = 3, pre_exec = ['cd simulate_pre_exe'])
@AymenFJA
AymenFJA / test_multi_gpu_mpi.py
Last active January 15, 2022 02:06
test_multi_gpu_mpi.py
from __future__ import print_function
'''
Basic Multi GPU computation example using TensorFlow library.
Single/Multi-GPU non-MPI Author: Aymeric Damien
Multi-GPU Large scale/Multi-node MPI Author: Aymen Alsaadi
Project: https://github.com/aymericdamien/TensorFlow-Examples/
'''
'''
This tutorial requires your machine to have 2 GPUs
@AymenFJA
AymenFJA / ICEBERG-hackathon.md
Last active July 15, 2020 19:05
Hackathon_steps

1. Login to the VM.

2. Generate XSEDE certificate.

  • In order to be able to login to Bridges from your VM you need to generate XSEDE certificate using the following command:

    myproxy-logon -s myproxy.xsede.org -l user_name -t 72

#!/bin/bash
# Stop the MPS control daemon for each GPU and clean up /tmp
NGPUS=2 # Number of gpus with compute_capability 3.5 per server
for ((i=0; i< $NGPUS; i++))
do
echo $i
export CUDA_MPS_PIPE_DIRECTORY=/home/aymen/mps_$i
echo "quit" | nvidia-cuda-mps-control
rm -rf /home/aymen/mps_$i
rm -rf /home/aymen/mps_log_$i
#!/bin/bash
export CUDA_VISIBLE_DEVICES=0
lrank=$OMPI_COMM_WORLD_LOCAL_RANK
case ${lrank} in
[0])
export CUDA_MPS_PIPE_DIRECTORY=/home/aymen/mps_0; ./vector_add
;;
[1])
export CUDA_MPS_PIPE_DIRECTORY=/home/aymen/mps_1; ./vector_add
;;
#!/bin/bash
NGPUS=2 # Number of gpus with compute_capability 3.5 per server
# Start the MPS server for each GPU
for ((i=0; i< $NGPUS; i++))
do
mkdir /home/aymen/mps_$i
mkdir /home/aymen/mps_log_$i
export CUDA_VISIBLE_DEVICES=$i
export CUDA_MPS_PIPE_DIRECTORY=/home/aymen/mps_$i
export CUDA_MPS_LOG_DIRECTORY=/home/aymen/mps_log_$i
cnn_time img_name
10 Image1
12 Image2
14 Image3
23 Image4
30 Image5