Skip to content

Instantly share code, notes, and snippets.

View tailriver's full-sized avatar

Shinsuke Ogawa tailriver

View GitHub Profile
@tailriver
tailriver / omp_get_wtime_example.c
Last active November 18, 2015 04:22
An example of omp_get_wtime.
#include <stdio.h>
#include <stdlib.h>
#include <unistd.h>
#include <omp.h>
int main(int argc, char** argv)
{
int n, nth, njobs, *jobs, i;
double *elapsed;
@tailriver
tailriver / hook.c
Last active June 15, 2020 11:14
A sample to hook an applocation.
#include <stdio.h>
#include <unistd.h>
void hook_start() __attribute__((constructor));
void hook_end() __attribute__((destructor));
void hook_start()
{
printf("hook_start. PID=%d, PPID=%d\n", getpid(), getppid());
}
@tailriver
tailriver / dlopen_sample.c
Created November 18, 2015 04:21
A sample of using dlopen library.
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <dlfcn.h>
int main(int argc, char** argv)
{
void *handle;
void (*func_print_name)(const char*);
program main
character(len=32) :: argv
integer(8) :: size_of_a, n
integer, allocatable :: a(:)
call get_command_argument(1, argv)
read (argv,*) size_of_a
allocate(a(size_of_a))
n = size(a)
@tailriver
tailriver / Makefile.inc
Last active April 16, 2019 10:14
MUMPS 5.1.2 factorization issue
#
# This file is part of MUMPS 5.1.2, released
# on Mon Oct 2 07:37:01 UTC 2017
#
#Begin orderings
# NOTE that PORD is distributed within MUMPS by default. It is recommended to
# install other orderings. For that, you need to obtain the corresponding package
# and modify the variables below accordingly.
# For example, to have Metis available within MUMPS: