# NOTE: # # This file is an example user database. You have to copy this file # to "udb.pm", and then adapt it to your needs. You will mostly need # to set your account names on various machines, and the thorn lists # you want to use there. You may also need to add a description for # your local machine (workstation or notebook). package udb; # User database use strict; require cdb; require mdb; sub set_option ($$$); sub set_user_options (); # List of files and directories which should copied via sync. my @udb_rsync_sources = ( # Keep default entries @{$cdb::configuration_database{'rsync-sources'}}, # Additional entries '.gitignore', 'cactus.config', 'manifest', 'repos', 'simfactory', 'utils', ); # List of files and directories containing parameter files which # should copied via sync. my @udb_rsync_parfiles = ( # Keep default entries @{$cdb::configuration_database{'rsync-parfiles'}}, # Additional entries 'parfiles', ); # List of defines my %udb_defines = ( # Keep default entries %{$cdb::configuration_database{'defines'}}, # Additional entries #'CACTUS_CENTRAL_GIT_REPO' => '...', ); # List of replacements my %udb_replacements = ( # Keep default entries %{$cdb::configuration_database{'replacements'}}, # Additional entries #'Flickr::auth_token' => '"..."', #'Twitter::password' => '"..."', ); # Add a new entry to the machine database my $udb_generic = { 'nickname' => undef, 'name' => 'Something', 'location' => 'Somewhere', 'description' => 'A generic machine', 'status' => 'personal', 'hostname' => undef, 'aliaspattern' => undef, 'sourcebasedir' => undef, 'optionlist' => 'generic.cfg', 'thornlist' => 'wavetoy-generic.th', 'scriptfile' => 'generic.sh', 'basedir' => undef, 'quota' => 10, # don't use all disk space 'cpu' => 'Whatever', 'cpufreq' => 0.0, 'flop/cycle' => 1, 'ppn' => 1, 'spn' => 1, 'mpn' => 1, 'max-num-threads' => 1, 'num-threads' => 1, 'memory' => 1024, 'nodes' => 1, 'submit' => 'sh @SCRIPTFILE@ < /dev/null > /dev/null 2> /dev/null & echo $!', 'getstatus' => 'ps @JOB_ID@', 'stop' => 'kill @JOB_ID@', 'submitpattern' => '(.*)', 'statuspattern' => '^ *@JOB_ID@ ', 'queuedpattern' => '$^', # never queued 'runningpattern' => '^', # always running 'scratchdir' => 'scratchdir', 'exechost' => 'echo localhost', 'exechostpattern' => '(.*)', 'stdout' => 'cat @SIMULATION_NAME@.out', 'stderr' => 'cat @SIMULATION_NAME@.err', 'stdout-follow' => 'tail -n 100 -f @SIMULATION_NAME@.out @SIMULATION_NAME@.err', }; # Set one option for a machine sub set_option ($$$) { my ($machine, $option, $value) = @_; # Ensure that the machine exists if (! exists $mdb::machine_database{$machine}) { die "While setting user option [$machine][$option]=\"$value\": Machine \"$machine\" does not exist"; } # Set option ${$mdb::machine_database{$machine}}{$option} = $value; } # Override the user-specific options in the machine database sub set_user_options () { # Override some configuration options $cdb::configuration_database{'rsync-sources' } = \@udb_rsync_sources; $cdb::configuration_database{'rsync-parfiles'} = \@udb_rsync_parfiles; $cdb::configuration_database{'defines' } = \%udb_defines; $cdb::configuration_database{'replacements'} = \%udb_replacements; # Check the configuration database again cdb::check; #################################### ### Customise your accounts here ### #################################### # Add a new machine based on the generic template. My machine is # called Redshift; yours will have a different name. $mdb::machine_database{'redshift'} = $udb_generic; # Set default user name and email address for all machines foreach my $machine (keys %mdb::machine_database) { set_option $machine, 'user' , 'YOUR_LOGIN'; set_option $machine, 'email' , 'YOUR@EMAIL.ADDRESS'; set_option $machine, 'thornlist', 'wavetoy-generic.th'; } # Options for new machine # What you will refer to the machine as in simfactory commands set_option 'redshift', 'nickname', 'redshift'; # The host name of the machine (for remote use with ssh) set_option 'redshift', 'hostname', 'redshift.local'; # A regular expression which matches the output of the "hostname" command set_option 'redshift', 'aliaspattern', '^redshift(\.local)?$'; # Username on the machine set_option 'redshift', 'user', 'YOUR_LOGIN'; # The directory containing your Cactus directories set_option 'redshift', 'sourcebasedir', '/Users/@USER@'; # The directory which will contain your simulations set_option 'redshift', 'basedir', '/Users/@USER@/simulations'; # Options for Queen Bee set_option 'abe' , 'allocation', 'YOUR_ALLOCATION'; set_option 'kraken' , 'allocation', 'YOUR_ALLOCATION'; set_option 'queenbee', 'allocation', 'YOUR_ALLOCATION'; set_option 'ranger' , 'allocation', 'YOUR_ALLOCATION'; #################################### ### End of account customisation ### #################################### # Check the machine database mdb::check; } # Update database set_user_options; 1;