OpenMPI on Debian 6.0
A. Install OpenMPI
# apt-get install mpi-default-bin mpi-default-dev openmpi-doc
B. MPI Program Example
Filename: hello.c
#include <stdio.h>
#include <mpi.h>
int main(int argc, char** argv) {
int myrank, nprocs;
MPI_Init(&argc, &argv);
MPI_Comm_size(MPI_COMM_WORLD, &nprocs);
MPI_Comm_rank(MPI_COMM_WORLD, &myrank);
printf("Hello from processor %d of %d\n", myrank, nprocs);
MPI_Finalize();
return 0;
}
C. Compilation
$ mpicc hello.c -o hello
D. Execution
$ mpiexec -n 5 hello Hello from processor 1 of 4 Hello from processor 0 of 4 Hello from processor 3 of 4 Hello from processor 2 of 4
Comments (0) 12.03.2012. 04:13 EDT
Xfce Minimal Installation on Squeeze
This is my second note on installing minimal Xfce desktop on Debian. This time, I use the new Debian GNU/Linux 6.0 "Squeeze". As usual, you have to download Debian netinst CD (190 MB) to build this system from ground up. Internet connection is needed during the installation process.
1. Download and burn Debian netinst CD
2. Install Debian "standard system"
3. Install basic Xfce desktop
# apt-get install --no-install-recommends \ xorg xfce4 alsa-base alsa-utils cpufrequtils gamin xdg-utils \ desktop-base gnome-icon-theme dmz-cursor-theme
4. Install additional Xfce application
# apt-get install --no-install-recommends \ xfce4-terminal xfce4-power-manager xfce4-screenshooter \ thunar-archive-plugin thunar-media-tags-plugin \ xfburn htop squeeze bzip2 zip unzip unrar-free
Continue reading Comments (7) 06.05.2011. 11:46 EDT
Mount FAT32 Partition Automatically
This guide will show you how to mount FAT32 partition automatically. This guide also show you how to set the default file ownership and permission on this FAT32 partition.
1. Find your FAT32 partition name
# fdisk -l Disk /dev/sda: 320.0 GB, 320072933376 bytes 255 heads, 63 sectors/track, 38913 cylinders Units = cylinders of 16065 * 512 = 8225280 bytes Disk identifier: 0xcacacaca Device Boot Start End Blocks Id System /dev/sda1 * 1 3916 31455238+ 7 HPFS/NTFS /dev/sda2 3917 4047 1052257+ 82 Linux swap / Solaris /dev/sda3 8925 38912 240878610 f W95 Ext'd (LBA) /dev/sda4 4048 8924 39174502+ 83 Linux /dev/sda5 8925 34420 204796588+ b W95 FAT32 Partition table entries are not in disk order
The fdisk program output shows us that the name of FAT32 partition in the disk is /dev/sda5.
Continue reading Comments (0) 16.11.2010. 02:36 EST
ZTE AC2726i USB Modem Setup
1. Install usb-modeswitch
# apt-get install usb-modeswitch
2. Check USB modem detection
Plug-in the USB modem and check whether it is detected correctly by the system.
# lsusb Bus 001 Device 003: ID 19d2:fff1 ONDA Communication S.p.A. ... # dmesg ... [ 217.861635] usbcore: registered new interface driver usbserial [ 217.861674] usbserial: USB Serial support registered for generic [ 217.861805] usbcore: registered new interface driver usbserial_generic [ 217.861811] usbserial: USB Serial Driver core [ 217.889384] usbserial: USB Serial support registered for GSM modem (1-port) [ 217.889475] usbcore: registered new interface driver option [ 217.889482] option: USB Driver for GSM modems: v0.7.2 [ 217.900937] option 1-1:1.0: GSM modem (1-port) converter detected [ 217.901208] usb 1-1: GSM modem (1-port) converter now attached to ttyUSB0 [ 217.901248] option 1-1:1.1: GSM modem (1-port) converter detected [ 217.901340] usb 1-1: GSM modem (1-port) converter now attached to ttyUSB1 [ 217.901378] option 1-1:1.2: GSM modem (1-port) converter detected [ 217.901469] usb 1-1: GSM modem (1-port) converter now attached to ttyUSB2 [ 217.901505] option 1-1:1.3: GSM modem (1-port) converter detected [ 217.901823] usb 1-1: GSM modem (1-port) converter now attached to ttyUSB3 [ 217.901860] option 1-1:1.4: GSM modem (1-port) converter detected [ 217.901949] usb 1-1: GSM modem (1-port) converter now attached to ttyUSB4 ...
Continue reading Comments (0) 25.10.2010. 06:19 EDT
Remove Service from System Startup
I'll use PostgreSQL service (daemon) as an example for this guide.
1. Stop this service first
# /etc/init.d/postgresql-8.3 stop Stopping PostgreSQL 8.3 database server: main.
2. Remove this service from system startup
# update-rc.d -f postgresql-8.3 remove Removing any system startup links for /etc/init.d/postgresql-8.3 ... /etc/rc0.d/K21postgresql-8.3 /etc/rc1.d/K21postgresql-8.3 /etc/rc2.d/S19postgresql-8.3 /etc/rc3.d/S19postgresql-8.3 /etc/rc4.d/S19postgresql-8.3 /etc/rc5.d/S19postgresql-8.3 /etc/rc6.d/K21postgresql-8.3
Note the sequence number for start (S) and kill (K). In this example these numbers are 19 and 21. You will need them to restore this service as before.
Continue reading Comments (0) 15.10.2010. 09:20 EDT