Skip to content

Instantly share code, notes, and snippets.

View DaisukeMiyamoto's full-sized avatar

Daisuke Miyamoto DaisukeMiyamoto

  • Tokyo, Japan
View GitHub Profile
@DaisukeMiyamoto
DaisukeMiyamoto / setup_slurm_accounting_parallelcluster.sh
Last active January 30, 2024 14:29
set up Slurm Accounting feature (sacct) with slurmdbd/MySQL on AWS ParallelCluster
#!/bin/bash -xe
# Setting up Slurm Accounting feature with slurmdbd/MySQL for AWS ParallelCluster
# Daisuke Miyamoto [email protected]
#
# Test Condition:
# - 20200312
# - ParallelCluster 2.6.0
# - CentOS7/Slurm
#
# ParallelCluster config example:
@DaisukeMiyamoto
DaisukeMiyamoto / Make.pcluster-centos
Last active November 4, 2019 18:53
settings for HPL on ParallelCluster
#
# -- High Performance Computing Linpack Benchmark (HPL)
# HPL - 2.3 - December 2, 2018
# Antoine P. Petitet
# University of Tennessee, Knoxville
# Innovative Computing Laboratory
# (C) Copyright 2000-2008 All Rights Reserved
#
# -- Copyright notice and Licensing terms:
#
@DaisukeMiyamoto
DaisukeMiyamoto / get-idtoken.sh
Last active July 31, 2019 06:27
Amazon Cognito CLI utilities
#!/bin/bash
CLIENT_ID=
USERNAME=
PASSWORD=
aws cognito-idp initiate-auth --auth-flow USER_PASSWORD_AUTH --client-id ${CLIENT_ID} --auth-parameters USERNAME=${USERNAME},PASSWORD=${PASSWORD}
#!/bin/bash -xe
mkdir 1m_10000
mkdir 10m_1000
mkdir 100m_100
for i in {0000..9999}; do dd if=/dev/urandom of=1m_10000/1m_$i.dat count=1024 bs=1K; done
for i in {0000..999}; do dd if=/dev/urandom of=10m_1000/10m_$i.dat count=10240 bs=1K; done
for i in {000..99}; do dd if=/dev/urandom of=100m_100/100m_$i.dat count=102400 bs=1K; done
@DaisukeMiyamoto
DaisukeMiyamoto / hpcg.md
Last active April 30, 2019 05:53 — forked from sean-smith/hpcg.md
AWS ParallelCluster + AWS Batch

AWS ParallelCluster + AWS Batch

Today I'm going to demonstrate running High Performance Conjucate Grandients (HPCG) in a containerized workload. This takes advantage of AWS ParallelCluster, AWS Batch, and OpenMPI.

First install aws-parallelcluster:

$ pip install aws-parallelcluster
@DaisukeMiyamoto
DaisukeMiyamoto / mpi_hello.c
Created December 2, 2018 15:37
test mpi job for AWS ParallelCluster
#include <mpi.h>
#include <stdio.h>
int main() {
int size;
int rank;
MPI_Init(NULL, NULL);
MPI_Comm_size(MPI_COMM_WORLD, &size);
MPI_Comm_rank(MPI_COMM_WORLD, &rank);
@DaisukeMiyamoto
DaisukeMiyamoto / get-product-list.py
Last active November 30, 2018 17:45
get products and prices on Amazon EC2
# coding: utf-8
import json
import os
import boto3
import pandas as pd
def main():
price_list = []
@DaisukeMiyamoto
DaisukeMiyamoto / unixbench_a1.md
Last active November 27, 2018 15:41
UnixBench for AWS a1 (ARM) instance

a1.large

========================================================================
   BYTE UNIX Benchmarks (Version 5.1.3)

   System: ip-172-31-35-85.us-west-2.compute.internal: GNU/Linux
   OS: GNU/Linux -- 4.14.77-81.59.amzn2.aarch64 -- #1 SMP Mon Nov 12 21:28:57 UTC 2018
   Machine: aarch64 (aarch64)
@DaisukeMiyamoto
DaisukeMiyamoto / sns-lambda.py
Last active December 5, 2021 19:48
Send message from Amazon SNS to Slack by AWS Lambda
import boto3
import json
import logging
import os
from urllib.request import Request, urlopen
from urllib.error import URLError, HTTPError
SLACK_CHANNEL = os.environ['slackChannel']
HOOK_URL = os.environ['slackUrl']
@DaisukeMiyamoto
DaisukeMiyamoto / s3_bench.sh
Created November 20, 2018 06:12
bash script for benchmark multi-file and multi-part for Amazon S3
#!/bin/bash
dd if=/dev/zero of=abcd10000mb_1 bs=1M count=10000
dd if=/dev/zero of=efgh10000mb_2 bs=1M count=10000
dd if=/dev/zero of=ijkl10000mb_3 bs=1M count=10000
dd if=/dev/zero of=mnop10000mb_4 bs=1M count=10000
dd if=/dev/zero of=qrst10000mb_5 bs=1M count=10000
dd if=/dev/zero of=uvwx10000mb_6 bs=1M count=10000
dd if=/dev/zero of=yzab10000mb_7 bs=1M count=10000
dd if=/dev/zero of=cdef10000mb_8 bs=1M count=10000