Skip to content

Instantly share code, notes, and snippets.

View TApplencourt's full-sized avatar
🇷🇪

Thomas Applencourt TApplencourt

🇷🇪
View GitHub Profile
# This code will be executed by multiple processes
# each process will have a RANKID
MPI_RANK=$PALS_RANKID
# UUID for each process
THAPI_LOCK_DIR=$HOME/.lttng_mpi/$MPI_RANK
rm -rf $THAPI_LOCK_DIR
mkdir -p $THAPI_LOCK_DIR/
# Independ lttng session
@TApplencourt
TApplencourt / filer.cpp
Created October 14, 2022 21:14
bt2_filter
#include "utlist.h"
#include <babeltrace2/babeltrace.h>
#include <stdio.h>
#include <stdlib.h>
struct el {
const bt_message *message;
struct el *next, *prev;
};
@TApplencourt
TApplencourt / diff.txt
Created March 22, 2022 00:03
Adding new queue querry
diff --git a/adoc/chapters/programming_interface.adoc b/adoc/chapters/programming_interface.adoc
index cea90170..f0402c37 100644
--- a/adoc/chapters/programming_interface.adoc
+++ b/adoc/chapters/programming_interface.adoc
@@ -3215,6 +3215,39 @@ requested by the template parameter [code]#param#.
error code if the <<backend>> that corresponds with [code]#param# is different
from the <<backend>> that is associated with this [code]#queue#.
+a@
+[source]
#define MAD_4(x, y) \
x = y * x + y; \
y = x * y + x; \
x = y * x + y; \
y = x * y + x;
#define MAD_16(x, y) \
MAD_4(x, y); \
MAD_4(x, y); \
MAD_4(x, y); \
MAD_4(x, y);
#include <vector>
#include <iostream>
#include <algorithm>
#include <omp.h>
#include <math.h>
#include <assert.h>
bool almost_equal(float x, float gold, float tol) {
return abs(gold) * (1-tol) <= abs(x) && abs(x) <= abs(gold) * (1 + tol);
}
#include <level_zero/ze_api.h>
#include <iostream>
#include <fstream>
#include <memory>
#include <vector>
#include <chrono>
#include <limits>
#include <unistd.h>
#define zeCall(myZeCall) \
@TApplencourt
TApplencourt / topo.cpp
Created July 22, 2021 15:13
RankToAccelerator
#include <iostream>
#define GPOLICY_INTERLEAVE 0
#define GPOLICY_COMPACT 1
static int map_compact(const unsigned rank_id, const unsigned num_ranks, const unsigned num_gpus,
unsigned *gpu_id, unsigned *bin_size, unsigned *bin_id) {
const unsigned small_bin_size = num_ranks / num_gpus;
const unsigned big_bin_size = small_bin_size + 1;
@TApplencourt
TApplencourt / main.py
Created February 15, 2019 19:54
Remove cycle from DAG
#!/usr/bin/env python3
# _ _ _ _ _
# | | | | | (_) |
# | | | | |_ _| |___
# | | | | __| | / __|
# | |_| | |_| | \__ \
# \___/ \__|_|_|___/
#
@TApplencourt
TApplencourt / order_gms.py
Created January 11, 2016 11:01
For gamess programm, the order of primitive for the AO
def same_character(item1):
return item1==item1[0]* len(item1)
def compare_gamess_style(item1, item2):
if len(item1) < len(item2):
return -1
elif len(item1) > len(item2):
return 1
elif same_character(item1) and same_character(item2):
if item1 < item2:
@TApplencourt
TApplencourt / get_bibtex.sh
Last active August 29, 2015 14:24
From a isbn or a doi get the bibtex
#!/bin/bash
str_utilisation="$0 (doi|isbn) <value>"
if [ "$#" -ne 2 ];then
echo ${str_utilisation}
exit 1
fi
if [ "$1" == "doi" ];then
doi_raw=$2