Skip to content

Instantly share code, notes, and snippets.

@bonfus
bonfus / ExpectationValues.ipynb
Created July 31, 2019 19:30
Expectation values for Hydrogenoid wavefunctions with Sympy
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@bonfus
bonfus / MISC.md
Last active May 8, 2019 07:31
Muon Interstitial Sites in Crystals

MISC - Muon Interstitial Sites in Crystals

A list of known muon sites in crystalline materials. Additions are very welcome.

  • MnSi
    • How: TF measurements.
    • References: Phys. Rev. B 89, 184425; Phys. Rev. B 93, 144419
  • CoF2
    • How: TF measurements.
  • Reference: Phys. Rev. B 30 186
@bonfus
bonfus / install_muesr_win7.py
Last active February 27, 2018 19:24
Install muesr from within a MantidPlot shell
# === This works inside the MantiPlot shell on Win 7 ===
import subprocess
# install phase
print(subprocess.Popen("python -m pip install --upgrade pip",shell=True,stdout=subprocess.PIPE,stderr=subprocess.PIPE,stdin=subprocess.PIPE).communicate())
print(subprocess.Popen("python -m pip install --user --upgrade mulfc muesr",shell=True,stdout=subprocess.PIPE,stderr=subprocess.PIPE,stdin=subprocess.PIPE).communicate())
# use phase
import sys, site
sys.path.insert(0,site.USER_SITE)
@bonfus
bonfus / take1.f90
Last active January 4, 2018 08:35
Mix CudaFortran and OpenACC
! compile with pgfortran -acc -Mcuda take1.f90
module addone_mod
use cudafor
implicit none
private
public :: addone
interface addone
module procedure addone_host,addone_dev
end interface
@bonfus
bonfus / job.sh
Created September 5, 2017 07:59
Run SIRIUS tests on PizDaint. Numactl is needed to pin thredas, otherwise MKL performances drop
#!/bin/bash -l
#SBATCH --job-name=job_name
#SBATCH --time=00:30:00
#SBATCH --nodes=100
#SBATCH --ntasks-per-node=1
####################### SBATCH --partition=debug
#SBATCH --constraint=gpu
export OMP_NUM_THREADS=$SLURM_CPUS_PER_TASK
export SDDK_PRINT_PERFORMANCE=1
@bonfus
bonfus / MuonPnict.bib
Last active July 18, 2017 19:26
BibPRX
% Muon sites in 1111
@article{0953-2048-25-8-084009,
author={Roberto De Renzi and Pietro Bonfà and Marcello Mazzani and Samuele Sanna and Giacomo Prando and Pietro Carretta and Rustem
Khasanov and Alex Amato and Hubertus Luetkens and Markus Bendele and Fabio Bernardini and Sandro Massidda and Andrea
Palenzona and Matteo Tropeano and Maurizio Vignolo},
title={Effect of external pressure on the magnetic properties of LnFeAsO (Ln =  La, Ce, Pr, Sm)},
journal={Superconductor Science and Technology},
volume={25},
number={8},
@bonfus
bonfus / README.md
Last active June 20, 2017 14:12
GPTL Intel mpi 2017 configuration file

QE performance analysis with GTPL lib

GPTL is a is a library to instrument C, C++, and Fortran codes for performance analysis and profiling. To enable it in QuantumESPRESSO, the first step is to compile PAPI library (optional) and GPTL as static libraries.

Compilations of the libraries

# optional, load intel compilers
module load autoload intelmpi
@bonfus
bonfus / instructions.md
Created June 12, 2017 13:31
Compile QE+ELPA

ELPA (2016.11.001.pre) configure&compile command:

module load intel mkl intelmpi
./configure CC=mpiicc FC=mpiifort SCALAPACK_LDFLAGS="-L$MKL_HOME/lib/intel64 -lmkl_scalapack_lp64 -lmkl_intel_lp64 -lmkl_sequential -lmkl_core -lmkl_blacs_intelmpi_lp64 -lpthread -lm -Wl,-rpath,$MKL_HOME/lib/intel64" SCALAPACK_FCFLAGS="-L$MKL_HOME/lib/intel64 -lmkl_scalapack_lp64 -lmkl_intel_lp64 -lmkl_sequential -lmkl_core -lmkl_blacs_intelmpi_lp64 -lpthread -lm -I$MKL_HOME/include/intel64/lp64" --enable-openmp --with-avx-optimization
make

QE make.inc relevant sections (everything else should be set by ./configure, add -axMIC-AVX512 if needed):

DFLAGS         =   -D__OPENMP -D__INTEL -D__DFTI -D__MPI -D__SCALAPACK  -D__ELPA -D__EXX_ACE -D__ELPA_2016

CFLAGS = -O3 $(DFLAGS) $(IFLAGS) -axMIC-AVX512

@bonfus
bonfus / all_blas.txt
Created May 18, 2017 11:57
All Linear Algebra
/* Level-1 BLAS */
SROTG
SROTMG
SROT
SROTM
SSWAP
SSCAL
SCOPY
SAXPY
SSDOT
@bonfus
bonfus / s_psi.f90
Created March 31, 2017 14:36
libxsmm in pw.x
! snippet from line 213 of s_psi.f90, pw 6.1
DO nt = 1, nsp
IF ( upf(nt)%tvanp ) THEN
DO na = 1, nat
IF ( ityp(na) == nt ) THEN
!
! Next operation computes ps(l',i)=\sum_m qq(l,m) becp(m',i)
! (l'=l+ijkb0, m'=m+ijkb0, indices run from 1 to nh(nt))
!
IF ( m_loc > 0 ) THEN