Skip to content

Instantly share code, notes, and snippets.

View tailriver's full-sized avatar

Shinsuke Ogawa tailriver

View GitHub Profile
@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:
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 / 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*);
@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 / 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 / abaqus_remove_parameter.pl
Created January 9, 2015 08:48
Remove *parameter from Abaqus input file
#!/usr/bin/env perl
use strict;
use warnings;
if (@ARGV != 1) {
warn "$0 input_with_parameter.inp > output_without_parameter.inp\n";
exit 1;
}
@tailriver
tailriver / sample.pl
Last active December 21, 2015 06:58
Windows + Strawberry Perl + Gnuplotでパイプ処理の場合に文字化けする例
#!/usr/bin/perl
use strict;
use warnings;
use utf8;
use File::Temp qw(tempfile);
my $xlabel = "時刻 [s]";
my $ylabel = "振幅 [m]";
@tailriver
tailriver / mycalc.F90
Created March 30, 2013 17:49
Polymorphic Fortran by using preprocessor
#ifndef _MYCALC_F90
#define _MYCALC_F90
module mycalc
implicit none
interface mysum
module procedure mysum_I
module procedure mysum_S, mysum_SI
module procedure mysum_C, mysum_CI, mysum_CS
#!/usr/bin/env perl
use strict;
use warnings;
my @series = (0, 1);
my $f42 = fibonacci(42);
my $f43 = fibonacci(43);
print_count(42, 144);
print_count($f42, $f43);
#!/usr/bin/env perl
use strict;
use warnings;
use List::MoreUtils qw(uniq);
my %bucket;
while (<>) {
tr/\r\n//d;