Thursday, April 9, 2015

P3DFFT timers

P3DFFT is one of the fastest parallel Fourier transform (https://code.google.com/p/p3dfft/). In output of P3DFFT, 12 timers are printed. These are time takes by various parts of it. The following table lists the timer number and corresponding function.


timer[1]Alltoallv in XY transpose
timer[2]Alltoallv in YZ transpose
timer[3]Alltoallv in ZY transpose
timer[4]Alltoallv in YX transpose
timer[5]FFT transform (R2C) in X for all z and y
timer[6]local rearrangement of data in XY transpose
timer[7]FFT transform (C2C) in Y for all x and z, one Z plane at a time
timer[8]local rearrangement of data in YZ transpose
timer[9]local rearrangement of data in ZY transpose
timer[10]FFT Transform (C2C) in y dimension for all x, one z-plane at a time
timer[11]local rearrangement of data in YX transpose
timer[12]Perform Complex-to-real FFT in x dimension for all y and z

Note: Description of timer[8], and timer[9] may not be accurate.

Thursday, February 12, 2015

HDF5 get mode and header


##########################################################
#example:
#
#$ getmode U.V1 31,31,15
#
#      (31,31,15): {
#            0.000210922,
#            -0.000870292
#         }
##########################################################
function getmode {
    h5dump -d /$1 -s "$2" -S "1,1,1" -c "1,1,1" -k "1,1,1" $1.h5 | sed -n '14,17p'
}
#########################################################
#example:
#
#$ getheader U.V1
#
#HDF5 "U.V1.h5" {
#GROUP "/" {
#   DATASET "U.V1" {
#      DATATYPE  H5T_COMPOUND {
#         H5T_IEEE_F32LE "real";
#         H5T_IEEE_F32LE "imag";
#      }
#      DATASPACE  SIMPLE { ( 32, 32, 17 ) / ( 32, 32, 17 ) }
#   }
#}
#}
##########################################################
function getheader {
    h5dump --header $1.h5
}

#Reference:
http://davis.lbl.gov/Manuals/HDF5-1.4.3/Tutor/util.html
http://stackoverflow.com/questions/6022384/bash-tool-to-get-nth-line-from-a-file 

Wednesday, February 11, 2015

Execute python in an external terminal in sublime

Open $HOME/.config/sublime-text-2/Packages/User/Python.sublime-build
and write.
{
    "cmd": ["python", "-u", "$file"],
    "file_regex": "^[ ]*File \"(...*?)\", line ([0-9]*)",
    "working_dir": "${file_path}",
    "selector": "source.python",

    "variants":
    [
        {
            "name": "Run",
            "cmd": ["gnome-terminal", "-x", "bash", "-c", "python '$file'; echo -e \"\n\nPress any key to exit\"; read"],
            "file_regex": "^[ ]*File \"(...*?)\", line ([0-9]*)",
            "working_dir": "${file_path}",
            "selector": "source.python"
        }
    ]
}
you may either use the second line for using internal build terminal or the first line for external terminal.

Tuesday, May 27, 2014

X11 forwarding after sudo/su

$ ssh -X userA@host
password: <userA password>

$ xauth list ${DISPLAY#localhost}
host/unix:15  MIT-MAGIC-COOKIE-1  e7956ac62f6f5c3448cef9b14783d4ff


$ sudo su userB
password: <userB password>

$ xauth add  host/unix:15  MIT-MAGIC-COOKIE-1  e7956ac62f6f5c3448cef9b14783d4ff

$ #done. :) ## :)
$ #To verify
$ xterm

Sunday, July 15, 2012

Notifty when a computer is on

This function pings the givem IP once in every 10 mins. When ping succeeds it does echo and gives a bubble notification in ubuntu

function notify_when_on {
 ping -w1 $1 &> /dev/null
 RC=$?
 while [ $RC -eq 1 ]
 do
  sleep 600
  ping -w1 $1 &> /dev/null
  RC=$?
 done
 mesg="$1 is ON"
 echo ${mesg}
 notify-send -i /usr/share/icons/gnome/32x32/apps/gnome-terminal.png "${mesg}"
}
Add this function to .bashrc and use it as
notify_when_on 172.24.56.143

Saturday, July 7, 2012

openMPI compile static libraries

./configure --without-memory-manager --enable-static --prefix=$HOME/local


??--without-libnuma

Friday, July 6, 2012

tentative cmake static linking

set(BUILD_SHARED_LIBS FALSE)
set(CMAKE_EXE_LINKER_FLAGS "-static")