| změnit na češtinu
Please switch off AdBlock for this webside to display it correctly (there are no ads here).

newAD2 - optical characterization software

Linux system, preferably with X86_64 processor, is required for installation. In principle, it is possible to use also 32 bit system, however, there will be problems during cross-compilation of 64 bit slave programs and the whole clusters will have to be composed of 32 bit processors. The possibility to use 32 bit processors is nowadays only theoretical and probably no one will use it. For proper function of the cluster 1 Gbit/s network is recommended. If a slower 100 Mbit/s network is used, its bandwidth is relatively quickly saturated and computational speed is bottlenecked. Also, newAD2 requires user to have the same user name on all computers in the cluster.

Installation on the main computer (Master) for more users

Group newad

Installation is done into common directories accessible by group newad. Therefore, it is necessary to create this group and to add all users developing models, who will have permission to install newAD2 (thus usually only you). Other newAD2 users do not have to be included in the group. Log in with root permissions or ask system administrator and type following:

groupadd newad
usermod -a -G newad username

newAD2 directory

Now create directory for programs and data:

mkdir -p /usr/local/share/newAD2
chown root:newad /usr/local/share/newAD2
chmod 2775 /usr/local/share/newAD2

Install packages

Together with listed packages, around 100 more will be installed depending on your Linux distribution. Installation commands for some distribution are given below:

openSUSE Leap 15.4
zypper addrepo https://download.opensuse.org/repositories/science/15.4/science.repo
zypper refresh
zypper -n install gcc gcc-c++ make boost-devel gsl-devel readline-devel gwyddion-devel libtirpc-devel

Baličky pvm a pvm-devel po stažení nainstalujeme pomocí příkazu:

rpm -ihv pvm-3.4.6-lp154.0.0.x86_64.rpm pvm-devel-3.4.6-lp154.0.0.x86_64.rpm

pvm-3.4.6-lp154.0.0.src.rpm

Ubuntu 20.04
sudo apt-get install gcc g++ libboost-all-dev libgsl0-dev pvm-dev libreadline-dev libgwyddion20-dev libgtkglext1-dev libfftw3-dev libgtk2.0-dev libtirpc-dev gawk

sudo ln -s /usr/lib/x86_64-linux-gnu/libGL.so.1 /usr/lib/x86_64-linux-gnu/libGL.so
sudo mkdir /usr/lib/pvm3/lib/LINUX64
sudo ln -s /usr/lib/x86_64-linux-gnu/libpvm3.a /usr/lib/pvm3/lib/LINUX64/libpvm3.a

When finished, check the installation in user regime by:

echo halt | pvm

If it returns:

pvm> halt
Terminated

Everything is alright and you can proceed to next step on installation. If terminal returns error "Console: Can't start pvmd" something is wrong:

Download

newAD2-1.tar.bz2

Extract

tar jxf newAD2-1.tar.bz2

Create file clusterAD2.ini

If you are going to install newAD2 only to one computer you can skip this step. In directory newAD2-1 create file clusterAD2.ini with one line in the following format:

hostname:pvm_arch/proc_arch

If this file does not exist, it will be created automatically after first calling of make. In extracted directory execute following command:

make clean

If make clean writes error "gensub function never defined", install gawk. The file clusterAD2.ini can stay as it is generated if you are going to use newAD2 on only one computer with X86_64 processor. Otherwise edit the file:

Note that the file clusterAD2.ini defines computer cluster on which newAD2 will be installed. Thus, so far there is only one computer in the cluster.

Compilation

Compilation of the parts necessary on main computer is done by command:

make

Installation

Installation on everything essential on main computer is done by command:

make local

If everything went alright, newAD2 is now installed on the computer in directory /usr/local/share/newAD2/bin. In Ubuntu, make may have a problem locating pvm library. Probably the easiest workaround is to make the expected directory and include there a link to the pvm library:

sudo mkdir -p /usr/lib/pvm3/lib/LINUX64/
sudo ln -s /usr/lib/libpvm3.a /usr/lib/pvm3/lib/LINUX64/libpvm3.a

Also, in directory /usr/local/share/newAD2 file hostfileAD2 was generated, which contains information about the cluster in the following format:

&hostname sp=corenumber ep=/usr/local/share/newAD2/bin

where corenumber in number of cores on the respective computer and is generated automatically.

Set path

In order to avoid calling the program by full path, it is convenient to set directory /usr/local/share/newAD2/bin into system variable PATH. In the home directory, users should edit file .bashrc and add following line:

export PATH=$PATH:/usr/local/share/newAD2/bin

Log off and on to apply the changes. Text console of newAD2 can be started by command:

newAD2

or you can start newAD2 with graphical user interface by command:

newAD2gui

Installation on Slave computers for more users

Group newad and newAD2 directories

In order to extend your cluster to another computer ask administrator to create user accounts, newAD2 directories and group newad with users with installation permissions (same as for Master). Also it is essential to have package pvm installed. Other developer packages are not necessary, compilation was already done on the main computer.

Key generation

Next, it is necessary for both installation and running newAD2 to generate on Slave computers public and private key for all users (every user has to do this on his own). This allows to log Slave computers without entering password. In home directory run command:

ssh-keygen -t rsa

For requests of keygen command press three times by Enter, which will generate in directory .ssh public key id_rsa.pub and private key id_rsa which will be usable without password. If you don't have any keys on the Slave computer with name slavehostname you can copy key from your hostname to file authorized_keys in directory .ssh on both Master and Slave computer:

cp .ssh/id_rsa.pub .ssh/authorized_keys
scp .ssh/id_rsa.pub slavehostname:.ssh/authorized_keys

Finally, check if it is possible to log without password or any other requests by command:

ssh slavehostname

Modification of clusterAD2.ini file

In directory newAD2-1 it is necessary to add lines with information about Slave computers into clusterAD2.ini file. This serves compilation of corresponding parts of newAD2 and generation hostfileAD2 file. Format of line for Slave computer is the same as for Master, but on the end of the definition line path to pvmd on the Slave computer is added:

masterhostname:master_pvm_arch/master_proc_arch
slave1hostname:slave1_pvm_arch/slave1_proc_arch:slave1_pvmd_path
slave2hostname:slave2_pvm_arch/slave2_proc_arch:slave2_pvmd_path
slave3hostname:slave3_pvm_arch/slave3_proc_arch:slave3_pvmd_path
...

Values ..._proc_arch will differ according to the processor type and values ..._pvmd_path will depend on the particular system distribution:

Same as for Master, ..._pvm_arch can have on modern X86_64 platforms values LINUX64 or LINUXX86_64.

Compilation

For compilation of relevant parts of newAD2 that will be executed on Slave computers run command:

make

Installation of the whole cluster is done by command:

make cluster

This will copy required files into directories on Slave computers and will generate updated hostfileAD2, which contains all necessary information about the cluster in format:

&masterhostname sp=mastercorenumber dx= ep=/usr/local/pvm3/bin
&slave1hostname sp=slave1corenumber dx=slave1_pvmd_path ep=/usr/local/pvm3/bin
&slave2hostname sp=slave2corenumber dx=slave2_pvmd_path ep=/usr/local/pvm3/bin
&slave3hostname sp=slave3corenumber dx=slave3_pvmd_path ep=/usr/local/pvm3/bin
...

Note that dx= in the first line (path to pvdm in Master computer) is not set, because it is not required. If some value in clusterAD2.ini is edited, it is ignored because pvdm is already running on the Master computer. Also it must be noted that compilation and installation of whole newAD2 can be done only by command make cluster or make install which is synonym. If only Master computer is listed in slaveAD2.ini, then make local and make cluster (make install) are equivalent. Logically, even if clusterAD2.ini lists more computers, command make local will make cluster only with Master computer. Furthermore, this commands differ by method of compiled programs coping into target directories. Command make local uses install command which doesn't require authentication. Command make cluster (make install) uses for file coping slaveAD2-OTF and inspectorAD2 command rsync which requires password in case that authentication on Master computer is done without password (even if you are technically copying from computer on the same computer). Lets sum up. Command make has several targets set:

If pvm runs on Slave computer (can be checked by echo halt | pvm) and it is possible to log on from Master computer without password, it is necessary to check if pvm can add Slave computer into cluster (start pvm daemon). This can be done by following commands:

pvm /usr/local/share/newAD2/hostfileAD2
pvm> add slavehostname
1 successful
                    HOST     DTID
                    ...      ...
pvm> halt

If command add in pvm console fails, you can resolve the problem by following:

Although, cluster can be started by command add slavehostname, then quiting pvm console by quit and subsequently starting newAD2, it is not necessary. Program newAD2 can start cluster by similar commands:

newAD2
newAD2> add slavehostname
...
newAD2> quit

Installation for model developer

Program newAD2 has three different levels of users:

If you are interested in development of your own models which you would like to compile, it is necessary to make sure that you will not affect other users. This is ensured by defining variable CLUSTERNAME in .bashrc, for example to value of your user name:

export CLUSTERNAME=$USER

Variable CLUSTERNAME defines cluster (file hostfileAD2$CLUSTERNAME) and models (processes slaveAD2-OTF$CLUSTERNAME), which are used during newAD2 start. Variable SUFFIX = $(CLUSTERNAME) defined in file Makefile choses which cluster and models will be compiled. In this way, any number of clusters can be compiled, including unnamed with stable models, which can serve to standard users. If the variable CLUSTERNAME is set we can compile unnamed cluster and run commands:

export CLUSTERNAME=
make install
newAD2gui