anarchy (version 1.0, 22 July 2004)
index
http://sepwww.stanford.edu/data/media/public/sep/antoine/Research/communism/anarchy.py

 Set of functions used by Communism.py

 
Modules
            
commands
os
re
string
sys
time
 
Classes
            
date
 
class date
      Class Date
 
   Methods defined here:
__init__(self, year, month, day, hour, min, sec)
Date and Time
year
momth
day
hour
min
sec

Data and non-method functions defined here:
__doc__ = 'Class Date'
__module__ = 'anarchy'
 
Functions
            
catmanyresults(command, outfile, proc, auxfile, f, cataxis, ncpus, naux)
Cat the tmp output files 
 
Input:
 
 command=Class used_command
 outfile=output file name
 proc=Class process
 auxfile=Class auxilliary_file
 f=log file name
 cataxis=axis along which the cat is done
 ncpus=number of processors
 naux=number of auxilliary files
countmachines(machinelist, ncomputers)
Count the number of processors
 
Input:
 
 machinelist=Class machine
 ncomputers=number of boxes
 
Output:
 
 totalspeed=grand total of power we get
 ncpus=number of processors to be used
createproc(ncpus, proc, naux, auxfile)
Create tmp file name
 
Input:
 
 ncpus=number of processors
 proc=Class process
 naux=number of temp files
 auxfile=Class auxilliary_file
divideup(machinelist, process, f, totalspeed, ncomputers, ncpus, ngathers)
Divides the load amongst the processors according to their speed
 
Input:
 
 machinelist=Class machine
 process=Class process
 f=log file name
 totalspeed=totalspeed
 ncomputers=number of boxes
 ncpus=number of processors
 ngather=number of gathers to split
doworkload(infile, outfile, auxfile, proc, order, command, f, winaxis, cataxis, ngathers, start, nprocess, naux)
Send the command to the processors and collect/cat the results 
 
Input:
 
 infile=input file name
 outfile=output file name
 auxfile=Class auxilliary_file
 proc=Class process
 order=command to be ran by the processors
 command=Class used_command
 f=log file name
 winaxis=axis along which the window is done
 cataxis=axis along which the cat is done
 ngathers=total number of gathers
 start=first gather to process
 nprocess=number of processors
 naux=number of auxilliary files
 
Output:
 
 return 0 if success
from_sep(infile, winaxis)
Read sep dimension
 
Input:
 
 infile=name of the sep file
 winaxis=winaxis from which we get the dimensions
 Output:
 n=dimensio of winaxis
patch(proc, nprocess, overlap, ngathers, f)
Change the share according to overlap
 
Input:
 
 proc=Class process
 nprocess=number of processors
 overlap=number of gathers to overla
 ngathers=total number of gathers
 f=log file name
read_comrades()
 Read the list of machines to be used
 
Convention is as follows:
 filename to read=.comrades
 
Format example:
 machine name/speed/#cpus
 
 sep211 2. 2.
 sep210 2. 1.
read_politburo()
 Read the overlap/order/axis/different file names
 
Convention is as follows:
 filename to read=.politburo
 
Format example:
 
overlap=0        # size of the overlap window
order=Agc        # command to be ran by the nodes
winaxis=3        # axis over which the data are divided
cataxis=3        # axis over which the data are merged
inputfile=in.H   # input file
outputfile=ou.H  # output file
recons=re.H in   # tagname=filename type
out2=ou2.H ou    # tagname=filename type
 
Notes:
 
 1-type for input can be i,in,input or 1
 2-type for output can be o,ou,out,output or 0
 3-can have many auxilliary in/ou files
time_start(f)
Compute start time
 
Input:
f=file name where the start time is printed on
time_stop(f)
Compute stop time
 
Input:
 
 f=file name where the start time is printed on
winpatch(proc, auxfile, command, f, cataxis, ncpus, naux)
Window the tmp output files if there is overlap
 
Input:
 
 proc=Class process
 auxfile=Class auxilliary_file
 command=Class used_command
 f=log file name
 cataxis=axis along which the window is done
 ncpus=number of processors
 naux=number of auxilliary files
 
Data
             __author__ = 'Antoine Guitton'
__date__ = '22 July 2004'
__file__ = './anarchy.py'
__name__ = 'anarchy'
__version__ = '1.0'
 
Author
             Antoine Guitton