simulhope_grid

PURPOSE ^

"grid computing"

SYNOPSIS ^

function simulhope_grid(ui,dir)

DESCRIPTION ^

 "grid computing"
 $Id: simulhope_grid.m,v 1.21 2004/07/17 13:31:22 dalai Exp $

CROSS-REFERENCE INFORMATION ^

This function calls: This function is called by:

SOURCE CODE ^

0001 % "grid computing"
0002 % $Id: simulhope_grid.m,v 1.21 2004/07/17 13:31:22 dalai Exp $
0003 
0004 function simulhope_grid(ui,dir)
0005 
0006 % set an ID number to the simulation
0007 sim_nb = input('| enter the simulation number : ','s');
0008 
0009 % some local settings :
0010 % the "simulhope root folder"
0011 pref.dir = dir;
0012 % the host id number
0013 pref.hostid = sim_nb;
0014 % the temporary folder for the mat file
0015 pref.tmp  = [pref.dir,'/temp/', sim_nb,'/'];
0016 % the temporary folder for the tar.gz file
0017 pref.tar  = [pref.dir,'/results/', sim_nb,'/'];
0018 
0019 % export settings
0020 % export via scp
0021 pref.scp = 1;
0022 % the server address to export the achived results
0023 pref.server = 'dalai.linux.dk';
0024 % the login on this server
0025 pref.user = 'dalai';
0026 % path to store the exported results on remote host
0027 pref.remote = ['results/' pref.hostid '/'];
0028 
0029 
0030 % setting model
0031 models = { 'street' 'city' 'hexagonal' };
0032 % model = 3;
0033 % setting users
0034 nb_mobs = [20 50 100];
0035 % setting speeds
0036 pspeed = 3;
0037 vspeed = 50;
0038 % arrival rate
0039 lambda = 6;
0040 % time of simulation
0041 tmax = 60;
0042 
0043 
0044 for model = 1:3
0045 for i=1:3
0046     % number of users
0047     nb_mob = nb_mobs(i);
0048     nb_pedestrian = nb_mob/2;
0049     nb_vehicular = nb_mob/2;
0050     
0051     % coverage from 5% to 100% by step of 5
0052     for coverage=5:5:100
0053     
0054     filename_stat=sprintf('%s-%dmin-%02dcov-%dusr-stat.tar.gz',char(models(model)),tmax,coverage,nb_mob);
0055     [state,warning] = unix(['ssh dalai@dalai.linux.dk ./bin/simulhope-check '  pref.remote filename_stat]);
0056     if str2num(warning) == 0
0057         [par,bs,mob,msg_mcn,msg_std,stats] = simulhope_cmd(ui,model,coverage,nb_mob,nb_pedestrian,pspeed,nb_vehicular,vspeed,lambda,tmax);
0058         stats = simulhope_stats(par,bs,mob,msg_mcn,msg_std);
0059     
0060         % assign to the "par" structure
0061         assignin('base','par',par);
0062         % assign to the "bs" structure
0063         assignin('base','bs',bs);
0064         % assign to the "mob" structure
0065         assignin('base','mob',mob);
0066         % assign to the "msg_mcn" structure
0067         assignin('base','msg_mcn',msg_mcn);
0068         % assign to the "msg_std" structure
0069         assignin('base','msg_std',msg_std);
0070         % assign to the "stats" structure
0071         assignin('base','stats',stats);
0072     
0073         simulhope_export(par,bs,mob,msg_mcn,msg_std,stats,pref);
0074         disp(dispconsole('|','=','|'));
0075         disp(dispconsole('|','Simulations',':','finished','|'));
0076         disp(dispconsole('|','=','|'));
0077         clear par bs mob msg_mcn msg_std stats
0078     elseif str2num(warning) == 1
0079         disp(dispconsole('|',['simulation ' filename_stat],':','already done','|'));
0080     end
0081     end
0082 
0083     [state,warning] = unix('ssh dalai@dalai.linux.dk ./bin/beep-up');
0084 end
0085 end
0086 
0087 % just keep connection to not loose the AFS token
0088 for i=1:100000
0089     pause(60);
0090     disp(dispconsole('|',['simulation ' pref.hostid],':','finished','|'));
0091 end

Generated on Sun 15-Aug-2004 22:13:10 by m2html © 2003