Dec 31 2011

Advanced Computational Methods in Structural Engineering: by utilizing multiprocessors

Category: semihozmen @ 15:31

Purchase a copy!

Book Description

Publication Date: November 30, 2011
Author: Semih Özmen
The increase in the clock speeds of single processors almost stopped due to the space limitations, power, and cooling requirements for processors. These physical limitations forced the processor manufacturers to change their direction to produce processors having more than one processing unit. Therefore, to balance the expectations of the structural engineers, new solution strategies that can utilize the available multi-processor computers more efficiently are necessary. Parallel Computing techniques are one of the remedy to this problem. In this book, parallel computing techniques applied to the solution of system of linear equations are discussed in detail. Data storage schemes, most popular tools and theoretical background for the methods are presented. In addition to that a novel approach that utilizes dynamic data compression to handle the interactions among the processors is proposed.

Product Details

  • Paperback: 124 pages
  • ISBN-10: 3846598704
  • ISBN-13: 978-3846598702

Purchase a copy!


May 09 2015

Compiling PETSc on Windows with VC++/Intel Compilers

Category: semihozmen @ 20:24

Most recent version of this post is in here!
Installation:

Download cygwin
Install cygwin with
gcc,g++(required for making local Petsc tools sowing and c2html )
python
flex (required for making local Petsc tools sowing and c2html )
make
git
Get Petsc source
checkout petsc by git
git clone https://bitbucket.org/petsc/petsc.git
Optional:
git clone https://bitbucket.org/petsc/petsc.git petsc_bddc
if anything to merge:
git fetch && git checkout stefano_zampini/pcbddc-primalfixes
OR get Petsc tarball and untar to cygwin/petsc folder (use tar in cygwin!)
Install Microsoft Visual C++ 2012/2013 (I prefer 2010 since it has MPI Debugger)
Install Microsoft MPI on a path without spaces like C:\MSMPI
Open Cygwin.bat and add
For 32 bit : CALL “%VS110COMNTOOLS%\vsvars32.bat”
For 64 bit : CALL “%VS110COMNTOOLS%\..\..\VC\vcvarsall.bat” amd64
Open Developer Command Prompt for 2012 (just type in start)
Call Cygwin.bat: D:\cygwin\cygwin64\Cygwin.bat
Test if cl Test.cpp
in cygwin shell, go to petsc folder: (red means does not work)
./configure –with-cc=’win32fe cl’ –with-cxx=’win32fe cl’ –with-fc=0 –download-f2cblaslapack –with-mpi-dir=/cygdrive/c/MSMPI
./configure –with-cc=’win32fe cl’ –with-cxx=’win32fe cl’ –with-fc=0 –download-f2cblaslapack –with-mpi-include=/cygdrive/c/MSMPI/Inc/ –with-mpi-lib=\”[/cygdrive/c/MSMPI/Lib/amd64/msmpi.lib,/cygdrive/c/MSMPI/Lib/amd64/msmpifec.lib]\”
./configure –with-cc=’win32fe cl’ –with-cxx=’win32fe cl’ –with-fc=0 –download-f2cblaslapack –with-mpi-include=/cygdrive/c/MSMPI/Inc/ –with-mpi-lib='[/cygdrive/c/MSMPI/Lib/amd64/msmpi.lib,/cygdrive/c/MSMPI/Lib/amd64/msmpifec.lib]’
Cross your fingers and wait
If fails
“rm -rf /home/semih/petsc/arch-mswin-c-debug/”
For git users, clean the git repo with:
git reset –hard
git clean -f -d -x
and then rerun configure
make PETSC_DIR=/home/sozmen/petsc PETSC_ARCH=arch-mswin-c-debug all
make PETSC_DIR=/home/sozmen/petsc PETSC_ARCH=arch-mswin-c-debug test
make PETSC_DIR=/home/sozmen/petsc PETSC_ARCH=arch-mswin-c-debug streams NPMAX=4
You are done with it….

Usage:
export PETSC_DIR=~/petsc
export PETSC_ARCH=arch-mswin-c-debug
make ex2
make runex2
Update:
git pull
Once updated, you will usually want to rebuild completely
./$PETSC_ARCH/conf/reconfigure-$PETSC_ARCH.py
make

Additional options:

–with-openmp
–with-shared-libraries
–useThreads=0
–with-debugging=no
–with-pcbddc
Correct the error in bddcprivate.c @3208

Use for any problem with MKL;
https://software.intel.com/en-us/articles/intel-mkl-link-line-advisor/
Hypre:
– Download from http://acts.nersc.gov/hypre/
– Compile it! (MISSING PART: Compilation in Windows required!)
– Or you may use binaries from “Petsc For Windows”
Usage:
–with-hypre-include=/cygdrive/d/WorkDir/hypre-2.9.0b/src/hypre/include
–with-hypre-lib=/cygdrive/d/WorkDir/hypre-2.9.0b/src/hypre/lib/HYPRE.lib
BLAS/LAPACK:
– You need to install Intel MKL
– Usage:
–with-blas-lapack-dir=/cygdrive/d/HardLinks/PETSc/Intel2013/mkl/lib/intel64
ScaLAPACK:
– You need to install Intel MKL with cluster support
– Usage:
–with-scalapack-include=/cygdrive/d/HardLinks/PETSc/Intel2013/mkl/include
–with-scalapack-lib=\”[/cygdrive/d/HardLinks/PETSc/Intel2013/mkl/lib/intel64/mkl_scalapack_lp64.lib,/cygdrive/d/HardLinks/PETSc/Intel2013/mkl/lib/intel64/mkl_blacs_msmpi_lp64.lib]\”
METIS-PARMETIS:
-Download from http://glaros.dtc.umn.edu/gkhome/metis/parmetis/download
– Compile it! (MISSING PART: Compilation in Windows required!)
– Or you may use binaries from “Petsc For Windows”
-Usage:
–with-metis-include=/cygdrive/d/WorkDir/OtherPackages/parmetis-4.0.3_install/include
–with-metis-lib=/cygdrive/d/WorkDir/OtherPackages/parmetis-4.0.3_install/lib/metis.lib
–with-parmetis-include=/cygdrive/d/WorkDir/OtherPackages/parmetis-4.0.3_install/include
–with-parmetis-lib=\”[/cygdrive/d/WorkDir/OtherPackages/parmetis-4.0.3_install/lib/parmetis.lib,/cygdrive/d/WorkDir/OtherPackages/parmetis-4.0.3_install/lib/metis.lib]\”

Using Intel Compilers Instead of VSC

Append following alias to .bash_profile
alias ifort=’ifort -Qlocation,link,”$VCINSTALLDIR/bin”‘
alias icl=’icl -Qlocation,link,”$VCINSTALLDIR/bin”‘
Append following to icl.cfg
$VCINSTALLDIR/bin
mv /usr/bin/link.exe /usr/bin/cygwin_link.exe

Run Intel 64 bit Developer Command Prompt
Run Cygwin.bat
Get petsc source files etc.

Failes with;
– ifort could not find mpif.h !!!!
-Solution: copy C:\MSMPI\Inc\amd64\mpifptr.h to C:\MSMPI\Inc

./configure –with-cc=’win32fe icl’ –with-cxx=’win32fe icl’ –with-fc=’win32fe ifort’ –with-blas-lapack-dir=/cygdrive/c/MKL/lib/intel64 –with-hypre-include=/cygdrive/c/EXTRLIBS/include/HYPRE –with-hypre-lib=/cygdrive/c/EXTRLIBS/lib/HYPRE.lib –with-scalapack-include=/cygdrive/c/MKL/include –with-scalapack-lib='[/cygdrive/c/MKL/lib/intel64/mkl_scalapack_lp64.lib,/cygdrive/c/MKL/lib/intel64/mkl_blacs_msmpi_lp64.lib]’ –with-metis-include=/cygdrive/c/EXTRLIBS/include/parametis –with-metis-lib=/cygdrive/c/EXTRLIBS/lib/metis.lib –with-parmetis-include=/cygdrive/c/EXTRLIBS/include/parametis –with-parmetis-lib='[/cygdrive/c/EXTRLIBS/lib/parmetis.lib,/cygdrive/c/EXTRLIBS/lib/metis.lib]’ –with-mpi-include=/cygdrive/c/MSMPI/Inc/ –with-mpi-lib='[/cygdrive/c/MSMPI/Lib/amd64/msmpi.lib,/cygdrive/c/MSMPI/Lib/amd64/msmpifec.lib]’ –with-shared-libraries –useThreads=0

–with-openmp
————————————————————————————————————–

fp.c^M
C:\CYGWIN~1\PETSC-~1.2\src\sys\error\fp.c(425): error: expression must have arithmetic or pointer type^M
if (feclearexcept(FE_ALL_EXCEPT)) SETERRQ(PETSC_COMM_SELF,PETSC_ERR_LIB,”Cannot clear floating point exception flags\n”);^M
^^M
^M
C:\CYGWIN~1\PETSC-~1.2\src\sys\error\fp.c(436): error: expression must have arithmetic or pointer type^M
if (fesetenv(FE_DFL_ENV)) SETERRQ(PETSC_COMM_SELF,PETSC_ERR_LIB,”Cannot disable floating point exceptions”);^M

/cygdrive/c/cygwin_cache/petsc-3.4.2/arch-mswin-c-opt/include/petscconf.h.h
and remove the lines related to PETSC_HAVE_FENV_H
————————————————————————————————————–

Reconfigure PETSc to use ParMetis.
1 linux-c-debug/conf/reconfigure-linux-c-debug.py
-PETSC_ARCH=linux-parmetis
-download-metis -download-parmetis
2 PETSC_ARCH=linux-parmetis make
3 PETSC_ARCH=linux-parmetis make test

python ./config/builder2.py check
$PETSC_DIR/src/snes/examples/tutorials/ex5.c

put breakpoint PetscError() @ ./src/sys/error/err.c


May 17 2011

Best ifttt tasks / En güzel ifttt görevleri

Category: semihozmen @ 21:11

Hi, in this post I will try to gather the best, most useful tasks that you can create on the newest and probably the most helpful social media service for the time being, ifttt.com.

Firstly, this new service is not open to public right now, actually an invitation is required from an already member friend. The thing is that, with this easy to use service you can create an interaction among your social network accounts, email accounts and even with your cellular telephone.
Equation is really simple IF This happens Then do That. You can easily create a task by definin an trigger event, “This” and providing an action to do, “That”.
So, ifttt.com tracks the event you have as “This” and when it occurs, it triggers the “That” event for you. Easy, simple and exciting right?
For the time being it supports, email, RSS and the most famous social networks like Twitter, Facebook,Google Services etc.
As it says with 11 channels supported right now, 308 combinations can be defined.

Here we come, the some useful combinations that I have selected;

  1. When “I share an item in Google Reader“, “send it as a tweet” by shortening the ur to my Twitter accountl
  2. When “I post a new article on my blog“, “share it as a new item” in GoogleReader
  3. When “someone mentions me“, “send an sms to my cellular
  4. When “someone tagged me on a photo in Facebook”, “post a funny Facebook status message”
  5. When “I send a new status message to Facebook“,”send it as a tweet” on my Twitter account
  6. When “the weather forecast for my town is rainy“, “send an sms to my cellular
  7. When “I send sms to ifttt.com number with the #tweet tag“, “send it as a tweet” to my Twitter account
  8. When “I send an instant message to ifttt.com bot on GTalk“, “send it as a tweet” to my Twitter account
  9. When “I send an instant message to ifttt.com bot on GTalk“, “send it as a tweet” to my Twitter account
  10. more will be added soon…

I hope you will like this new service…


Jan 25 2011

CUDA Zone Entry

Category: semihozmen @ 21:26
Schur Complement Computation for Dense Matrices on GPU
In this paper, Schur complement computation for symmetric positive definite dense matrices by utilizing partial Cholesky factorization on graphical processors is presented. Either by using provided CUBLAS routines or implemented custom routines, well-known Cholesky algorithm in LAPACK is implemented for CUDA supported graphical processors. Performance of the algorithm is investigated on various input matrix sizes by utilizing various sizes of matrix blocks and compared with i7 family CPU.

This early research conducted through a lecture given in Turkey’s First Cuda Center and presented in here.

Paper
Author(s) S.Özmen Organization Type Academia Organization Middle East Technical University Platform N/A
Software License N/A Application Type N/A Date Released 01/25/2011


Feb 09 2010

Academy vs Industry by Stroustrup

Category: semihozmen @ 14:37

What Should We Teach New Software Developers? Why?

Fundamental changes to computer science education are required to better address the needs of industry.

by Bjarne Stroustrup


Apr 21 2009

A small misunderstanding about CFD

Category: semihozmen @ 07:20

In literature, you may see CFD stands for “Computational Fluid Dynamics”,

however, one of our colleague from Germany claimed that

it is also such a good abbrevation for

Colours For Directors”     🙂


Aug 14 2008

OpenMP in Visual C++

Category: OpenMP,Paralell/Concurrentsemihozmen @ 07:31

Here is a sample code given by MSDN and commented by me to remember the milestones of OpenMP which is one of the simplest ways of parallelizing a program.

// The OpenMP DLLs are in the Visual C++ redistributable directory and
// need to be distributed with applications that use OpenMP.
 
#include "stdafx.h"
 
#include <iostream>
#include <math .h>
#include <omp .h> 
// If _DEBUG is defined in a compilation and if #include omp.h is in source code,
// VCOMPD.LIB will be the default lib. Otherwise, VCOMP.LIB will be used.
 
#define NUM_THREADS 4
#define NUM_START 1
#define NUM_END 10
 
int main() {
int i, nRet = 0, nSum = 0, nStart = NUM_START, nEnd = NUM_END;
int nThreads = 0, nTmp = nStart + nEnd;
unsigned uTmp = (unsigned((abs(nStart - nEnd) + 1)) *
unsigned(abs(nTmp))) / 2;
int nSumCalc = uTmp;
 
if (nTmp < 0)
nSumCalc = -nSumCalc;
 
omp_set_num_threads(NUM_THREADS); 
// Sets the number of threads in subsequent parallel regions,
// unless overridden by a num_threads clause.
 
// parallel:: Defines a parallel region, which is code that will be executed by multiple threads in parallel.
// default::: shared, which is in effect if the default clause is not specified, means that any variable
// in a parallel region will be treated as if it were specified with the shared (OpenMP) clause.
// none means that any variables used in a parallel region that are not scoped with
// the private (OpenMP), shared (OpenMP), reduction, firstprivate, or lastprivate clause will
// cause a compiler error.
 
// private::: Specifies that each thread should have its own instance of a variable.
// shared::: Specifies that one or more variables should be shared among all threads.
 
#pragma omp parallel default(none) private(i) shared(nSum, nThreads, nStart, nEnd)
{
#pragma omp master 
// only master thread will run following statement
nThreads = omp_get_num_threads();
 
#pragma omp for 
// Causes the work done in a for loop inside a parallel region to be divided among threads.
for (i=nStart; i<=nEnd; ++i) {
#pragma omp atomic 
// The statement containing the lvalue whose
// memory location you want to protect against multiple writes.
nSum += i;
}
}
 
if (nThreads == NUM_THREADS) {
printf_s("%d OpenMP threads were used.\n", NUM_THREADS);
nRet = 0;
}
else {
printf_s("Expected %d OpenMP threads, but %d were used.\n",
NUM_THREADS, nThreads);
nRet = 1;
}
 
if (nSum != nSumCalc) {
printf_s("The sum of %d through %d should be %d, "
"but %d was reported!\n",
NUM_START, NUM_END, nSumCalc, nSum);
nRet = 1;
}
else
printf_s("The sum of %d through %d is %d\n",
NUM_START, NUM_END, nSum);
}

Tags: ,


Aug 14 2008

About the Future Of Software Development

Category: Papers and Journalssemihozmen @ 07:17

A statement by Grace Hopper, pioneer computer scientist and U.S Navy admiral.

“In pioneer days they used oxen for heavy pulling, and when one ox could not budge a log, they did not try to grow a larger ox but used more oxen, we should not be trying for bigger computers, but for more systems of computers.”

Here, there are interesting set of links about the future of software development:

1-) Free Lunch is Over

2-) The Future of Windows Is Manycore/Multicore

3-) A Fundamental Turn Toward Concurrency in Software

4-) Sharing Is the Root of All Contention

5-) http://www.ddj.com/hpc-high-performance-computing/214500435?cid=RSSfeed_DDJ_All

6-) Multicore and Parallelism: Catching Up

Tags: ,


Jul 19 2008

Notes on Computational Mechanics

Category: semihozmen @ 18:01


Computational engineering is growing

Tags: