Tuesday, April 21, 2015

Installing Torque on debian 7

# DO the following after installation into default 

# Configure the trqauthd daemon to start automatically at system boot

cp contrib/init.d/debian.trqauthd.in /etc/init.d/trqauthd.in

# Fix the server_name in /var/spool/torque/server_name 

echo "$HOSTNAME" >/var/spool/torque/server_name 


echo '/usr/local/lib' > /etc/ld.so.conf.d/torque.conf

 ldconfig

cp contrib/init.d/debian.pbs_mom.in /etc/init.d/pbs_mom
update-rc.d pbs_mom defaults

cp contrib/init.d/debian.pbs_server.in /etc/init.d/pbs_server
update-rc.d pbs_server defaults

echo "\$pbsserver $HOSTNAME" | sudo tee /var/spool/torque/mom_priv/config

echo "$HOSTNAME np=`cat /proc/cpuinfo | grep processor | wc -l`" | sudo tee /var/spool/torque/server_priv/nodes

cp pbs_server pbs_mom pbs_sched /etc/init.d/

qterm
pbs_server
pbs_mom
pbs_sched


#  see if nodes are available:
qnodes -a

# setup database

pbs_server -t create

# create queue and set server settings in database
Code:

qmgr 
create queue batch
set queue batch queue_type = Execution
set queue batch max_running = 22
set queue batch resources_max.ncpus = 24
set queue batch resources_max.nodes = 1
set queue batch resources_default.ncpus = 1
set queue batch resources_default.neednodes = 1:ppn=24
set queue batch resources_default.walltime = 3600:00:00
set queue batch max_user_run = 6
set queue batch enabled = True
set queue batch started = True
set server default_queue = batch
set server scheduling = True

exit

# restart the server
trqauthd
qterm
pbs_server
pbs_sched  # this will give some warning about missing files
pbs_mom

#  important
sudo su   # login to root 
qterm -t quick
momctl -s  % shutdown pbs_mom
killall pbs_sched  % kill all sched
pbsnodes -a  %% all should be free

qmgr -a -c 'set node cvraman state=free' 

Rename files recursively in Linux


In the specified directory

find /my/directory/ -name "*.jpeg" -exec rename s/.jpeg/.jpg/ {} ;


% In all subdirectories 

% Rename '.gz%0D' extension to '.gz' 

find . -name "*.gz%0D" -exec rename s/.gz%0D/.gz/ {} \;


% Unzip recursievly  in all subdirectories


find . -name "*.gz" | xargs gunzip

% find number of file in all subdirectories


find . -type f | wc -l