Skip to content

Instantly share code, notes, and snippets.

View mcopik's full-sized avatar

Marcin Copik mcopik

View GitHub Profile
@mcopik
mcopik / build.sh
Created September 19, 2022 12:51
Reproducing GDB hanging on reading a shared library from memory-mapped file
#!/bin/bash
gcc -fPIC -shared -g lib.c -o lib.so
gcc -DLOAD_FROM_FILE main.c -g -o from_file
gcc main.c -g -o from_memory
@mcopik
mcopik / Dockerfile.manage.azure
Created January 21, 2020 23:43
Dockerifle for Azure CLI and Azure Function Tools
FROM python:3.7-slim-stretch
ARG USER
# disable telemetry by default
ENV FUNCTIONS_CORE_TOOLS_TELEMETRY_OPTOUT=1
RUN apt-get update\
&& apt-get install -y ca-certificates curl apt-transport-https lsb-release gnupg\
&& curl -sL https://packages.microsoft.com/keys/microsoft.asc | gpg --dearmor\
| tee /etc/apt/trusted.gpg.d/microsoft.asc.gpg > /dev/null\
&& AZ_REPO=$(lsb_release -cs)\
struct task_system
{
task_system(int start, int end, int step):
n_tasks(static_cast<int>(
std::floor((end-start)/step)
)),
_barrier(n_tasks)
{
}
#include <stdio.h>
#include <stdlib.h>
#include <mpi.h>
void f(double * b, double * e)
{
while(b != e) {
*b += 2;
++b;
}
#include <stdio.h>
#include <stdlib.h>
#include <mpi.h>
void f(double * b, double * e)
{
while(b != e) {
*b += 2;
++b;
}
@mcopik
mcopik / test.c
Last active January 7, 2019 13:41
#include <stdio.h>
#include <stdlib.h>
#include <mpi.h>
void f(double * b, double * e)
{
while(b != e) {
*b += 2;
++b;
}
@mcopik
mcopik / test_pgo.ll
Last active October 4, 2018 12:18
test.ll
; Function Attrs: inlinehint norecurse nounwind uwtable
define dso_local void @_Z1fPdi(double* nocapture, i32) local_unnamed_addr #0 !prof !29 {
%3 = icmp sgt i32 %1, 0
br i1 %3, label %4, label %6, !prof !30
; <label>:4: ; preds = %2
%5 = zext i32 %1 to i64
br label %7
; <label>:6: ; preds = %7, %2
In file included from /home/mcopik/projects/sycl/hpx_algorithms/executor_transform/sycl_tests/executor_tests/executor_test.cpp:10:
In file included from /home/mcopik/projects/sycl/hpx_algorithms/executor_transform/hpx/hpx.hpp:9:
In file included from /home/mcopik/projects/sycl/hpx_algorithms/executor_transform/hpx/exception.hpp:14:
In file included from /home/mcopik/projects/sycl/hpx_algorithms/executor_transform/hpx/error_code.hpp:14:
In file included from /home/mcopik/projects/sycl/hpx_algorithms/executor_transform/hpx/exception_fwd.hpp:69:
In file included from /home/mcopik/projects/sycl/hpx_algorithms/executor_transform/hpx/throw_exception.hpp:17:
In file included from /usr/include/boost/exception_ptr.hpp:9:
In file included from /usr/include/boost/exception/detail/exception_ptr.hpp:20:
In file included from /usr/include/boost/exception/info.hpp:18:
In file included from /usr/include/boost/shared_ptr.hpp:17:
#include <iostream>
#include <iterator>
#include <cassert>
#include <cmath>
#include <chrono>
#include <hpx/hpx_init.hpp>
#include <hpx/hpx.hpp>
#include <hpx/version.hpp>
#include <hpx/include/parallel_algorithm.hpp>
cmake_minimum_required(VERSION 2.8)
set(CMAKE_PREFIX_PATH ${HPX_LOCATION} ${CMAKE_PREFIX_PATH})
find_package(HPX REQUIRED)
add_hpx_executable(test SOURCES test.cpp)