1. Introduction I will show how to create subversion repository. 2. Preliminalies We assume the followings. Our repository is on External hard driveOS is CentOS8Subversion version is 1.10.2I use my repositoris in privateoperation user is root 3. Mounting external hard drive (1) Get device no of my external hard drive. I got sdb1. dmesg | […]
Category Archives: programming
Spark Sample Codes in Scala
1. Preliminaries Scala code is build by Maven. For an example, refer to [1].For a way to install Spark, refer to [2]. OS is CentOS7CPU: AMD Ryzen 7 3700X 8-Core Processor 2. Sample codes 2.1 Accumulation (1) Build the following code. This code is based on [3]. package package1 import org.apache.spark.SparkContext import org.apache.spark.SparkConf object App […]
Calculate π in PostgreSQL
(1) Perform the followings. select set_seed(1); prepare calculate_pi as select 4 * (count(*)::float8 / $1) from (select random() as x, random() as y from generate_series(1,$1,1)) a where ((x * x) + (y * y) < 1); execute calculate_pi(100); execute calculate_pi(1000); execute calculate_pi(10000); execute calculate_pi(100000); execute calculate_pi(1000000); execute calculate_pi(10000000); execute calculate_pi(100000000); (2) I got the following […]
Various ways to print “Hello world” in Scala
1. Introduction I will show the way to build and run program which prints “hello world” without sbt, with sbt, with maven. Here, sbt is “Scala Build Tool”. 2. Preliminaries Scala Version:2.12 sbt:1.2.7 OS:CentOS7 Java:OpenJDK8 Maven:3.6.3 3. Install Scala and Maven Refer to [3] 4. Hello world without sbt Execute the following procedures[1]. (1) Create […]
A little experiment for CPU vs GPU using CUDA
1. Introduction I am a begineer of GPGPU. For performance comparison of CPU and GPU I did a little experiment using CUDA Toolkit. 2. Prerequities GPU: GeForce GTX 1060 6GB *CPU: AMD Ryzen 7 3700X 8-Core ProcessorOS: CentOS7.7CUDA: CUDA11.2Programing Language: C language* I bought this GPU according to [1] 3. Installing CUDA (1) Install CUDA11.2 […]
SIMD sample code using AVX
1. Setup OS: CentOS7CPU: Ryzen 7 3700XMemory: TEAM DDR4 3200Mhz PC4-25600 32GBx 4x 2. Source (1) no_simd.c which multiple two vectors without SIMD #include <stdio.h> #include <stdlib.h> #include <time.h> void normal_mul(long long vec_len, float *ret, const float *v1, const float *v2){ for(long long elem_idx = 0; elem_idx < vec_len; elem_idx++) ret[elem_idx] = v1[elem_idx] * v2[elem_idx]; […]
LLVM JIT sample code
1. Introduction I wrote and run LLVM JIT sample program by refering to [1] and the LLVM official page. 2. Prerequities clang: version 5.0.1llvm: version 5.0.1* I installed the above softwares according to [1]implementation language: C language 3. Sample Code itself This program (i)create LLVM IR(Intermidiate Representation) program which multiples two values.(ii) Call (i) IR […]