(--- Good One!.... Just for fun---) 21. Tries to use credit cards in a road side hotel. 20. Drinks and carries mineral water and always speaks of being health conscious. 19. Sprays deo so that he doesn't need to take bath. 18. Sneezes and says 'Excuse me'. 17. Says "Hey" instead of "Hi". says "Yogurt" instead of "Curds". Says "Cab" instead of "Taxi". Says "Candy" instead of "Chocolate". Says "Cookie" instead of "Biscuit". Says "Free Way" instead of "Highway". Says "got to go" instead of "Have to go". Says "Oh" instead of "Zero", (for 704, he will say Seven Oh Four Instead of Seven Zero Four) 16. Doesn't forget to crib about the air pollution. Keeps cribbing every time he steps out. 15. Says all the distances in Miles (Not in Kilo Meters), and counts in Millions. (Not in Lakhs) 14. Tries to figure all the prices in Dollars as far as possible (but deep inside multiplies by 43). 13. Tries to see the % of fat on the cover of a milk pocket. 12. When he needs to say Z (zed), he never says Z (Zed), instead repeats "Zee" several times, and if the other person is unable to get it, then says X, Y Zee(but never says Zed) 11. Writes the date in MM/DD/YYYY. On watching traditional DD/MM/YYYY, says "Oh! British Style!!!!" 10. Makes fun of Indian Standard Time and the Indian Road Conditions. 9. Even after 2 months, complaints about "Jet Lag". 8. Avoids eating spicy food. 7. Tries to drink "Diet Coke", instead of Normal Coke. Eats Pizza instead of Dosa. 6. Tries to complain about any thing in India as if he is experiencing it for the first time. Asks questions etc. about India as though its his first visit to India. 5. Pronounces "schedule" as "skejule", and "module" as "mojule". 4. Looks suspiciously towards any Hotel/Dhaba food.Few more important ones: 3. From the luggage bag, does not remove the stickers of the Airways by which he traveled back to India, even after 4 months of arrival. 2. Takes the cabin luggage bag to short visits in India and tries to roll the bag on Indian Roads.The Ultimate one 1. Tries to begin any conversation with "In US ...." or "When I was in US..."
Algorithms, Theory, Spirituality, Life, Technology, Food and Workout : trying to sort these deterministically in $\Theta(1)$ time (constant time).
Monday, March 05, 2007
[FUN] Top 21 things an Indian does after returning from U.S
Tuesday, February 27, 2007
[Tech] How to determine the bus bandwidth.
Hi recently I had a need to find out the bus bandwidth. The bus had 64 lines and assume that the speed of the bus is xMHz. This implies the bandwidth = (no.of lines) * (speed of each line). Bus Bandwidth = ((64/8)*x*10^6)/(2^20) MBytes/sec. A simple use of this metric is suppose you have SMP(Shared memory processors) with a common bus and the bandwidth of the bus is 1 GBytes/sec and you have several processors which have an (memory) Instruction bandwidth of 250 MBytes/sec you cannot connect more than 4 processors to saturate the bus.
Thursday, February 22, 2007
[Tech] Pathetic non unix standard matlab editor
Monday, February 19, 2007
[SPICE2LAYOUT] 40% Complete
Need to get back home and study some stuff for a upcoming Friday jury.
Sunday, February 18, 2007
Algorithm for Permuting in place
I don't like explaining things just code it., here's code below
#include#include #include int a[10]; int b[10]; void ResetArray(){ unsigned int i; for(i=0;i<10;i++){ a[i] = i; } } void swap_elements(unsigned int i,unsigned int j){ int temp; temp = a[i]; a[i] = a[j]; a[j] = temp; } /*b is the swap list*/ void InplacePermute(int *perm){ unsigned int i; for(i=0;i<10;i++){ if(perm[i] < i){ perm[i] = perm[perm[i]]; } if(a[i] < i){ perm[a[i]] = perm[i]; } swap_elements(i,perm[i]); } } void PrintPermutation(void){ unsigned int i; for(i=0;i<10;i++){ printf("%d ",a[i]); } } int main(){ int runs=10; unsigned int i; do{ ResetArray(); printf("Please enter the permutation of size 10, 10 unique digits from 0-9\n"); for(i=0;i<10;i++){ if(scanf("%d",&b[i])<=0){ break; } assert(b[i] >=0 && b[i] <=10); } if(i<10){ break; } InplacePermute(b); printf("The permutation is::"); PrintPermutation(); }while(1); }
The following are testcases
7 3 2 1 4 8 9 0 5 6 8 9 1 2 5 6 7 3 4 0 1 2 3 4 5 6 7 8 0 9 1 3 4 8 9 0 7 6 5 2Well this week has been a little productive, got the space for http://phaedrus.sourceforge.net a library of randomized algorithms
Have Fun.... Vamsi.
Thursday, February 15, 2007
Passing multidimensional arrays to functions
int a[10][20];
int main(){
print_array(a); /*results in a crash.*/
}
void print_array(int **a,int i,int j){
printf("%d",a[i][j]); /*How stupid this can be?*/
}
Monday, February 12, 2007
I love PHP
Tuesday, January 30, 2007
[Tech] One more reason why MACRO's are Not Preferred over inlines.
...macro.h....
/***Dangerouse Macro1***/
#define print_int_value_twice(c) do{\
printf("first time %c second time %c\n",c,c);\
}while(0);
/***Stupid Preprocessor***/
#define my_error(c) do{\
fprintf(stderr,"Error::");
fprintf(stderr,c);
fprintf(stderr,"\n");
exit(1);
}while(0);
.....macro user ....
j=0;
print_int_value_twice(j++);
/*j incremented twice by the preprocessor*/
/*In this case the preprocessor is stupid
not treat the string spanned across several lines
as a incomplete macro argument and fails compilation.*/
my_error(" My error spans three lines
line1
line2");
Avoid MACROS start using inlines , if you define macros the users should use them with caution
Monday, January 29, 2007
[Personal] I was not good and never have been.....
Wednesday, January 24, 2007
[TECH-NON-TECH] SPICE2LAYOUT should I use BGL?
A Warm Welcome to a great new year 2007! This is my first blog after 24 days in the new year. Last time I had written my blog was on Dec 31, 2006, well this was the coldest new year eve I had. I just went to bed on Dec 31 night 2006. Its because I was with puppy taking care of puppy...we were really afraid on whats going to happen next....but it was great what happened next day was really a new begining in a new year things went excatly how I wanted (In fact I did'nt know what would be the best solution and just prayed "God! Please do something so that I will be comfortable after that")...a great going new year 2007 from there on, really had great time in Hyd from Jan-1 to Jan-6.....after that I took pathetic AeroSvit flight (Never Ever Take this shoddy airline) back to JFK, travelled all the way from NewYork to Hartford and took a cab to my place....its quite a tiresome journey to travel from India to U.S, next time I will travel by either BA ,Lufthansa or Emirates..... Now I need startoff my coding for the SPICE2LAYOUT project its been a while I took a break and its really a long one....Tomorrow Is a SRM from TopCoder....I was having a dilemma to use Boost Graph library or not...but I guess it will be fine if I write it on my own. Take care...keep Warm :) Cheers! Vamsi
Sunday, December 31, 2006
[PERSONAL] Lets solve the problem.....
I guess I have become a little bit more matured now, because I have to do things more responsibly now. I have a big responsibility now, I don't worry about it but I welcome it into my life, I'am ready to solve it and all the consequences...I will never run-away from the problem. But I need to be a little bit more practical also, well for any problem now there is no way out except to solve it.
So...LETS SOLVE THE PROBLEM RATHER RUNNING AWAY FROM IT....
And when you are solving problem's you need to be very methodological...I know its all spelling mistakes my blog...I may not be a great genius but I'll try my part to solve the problem. And when I solve the problem there will be no shortcuts.
Frankly I have been not getting great results for my Dynamic Programming based Border Length Minimization Problem. What to do I don't know I cannot really fake up any results. It's bad really bad. I leave it
Today puppy came out, she has been not liking the place where she is living but she has to for sometime, she should feel free and I'am a very lucky guy interms of that. I will always care for puppy and will solve the problem and not run away from it.
Happy new year 2007.....LETS SOLVE IT....that's the quote of this year.
Take care guys and keep having fun.....mean while I will lay back and keep thinking....
Friday, December 08, 2006
[NON-TECH] Travelling to india....
I should be indeed thankful to sudha for a ride from Storrs to Stamford. When I reached Stamford it was a little difficult to find out where ravi is and finally found ravi, went to circuit city to buy some stuff, later toured manhattan,brooklyn went to a great Italian restaurant, I really liked the hot bread and that olive oil to eat the bread, I never tried any Italian food apart from the normal pizza. Its really windy today in New York with -7 Centigrade, really had a hard time pulling all my luggage into the airport.....well found a wireless connection at the food court here, IT WORKS...well I'am writing this from that connection only, I need to wait till 4:00 PM to take my flight. Its a long wait.
Good that I got some charge on my laptop so that I can do some work today, I have many things pending, mac,tim,ion and raj. I need to get all the work done in this break good if I could make a proper schedule to fix up all the things.
Lets see how things work......luv....Vamsi
Thursday, December 07, 2006
I have not started any packing
Sunday, November 26, 2006
[TECH] Algorithm to find euler circuit in a graph in O(|E|)
Important observation I found is that, if we delete a cycle (delete all the edges which form a cycle) from the graph which has a Euler circuit, the property of the graph still remains, i.e the necessary and sufficient condition for the graph to have a Euler cycle is that every vertex should have even degree. And also there has to be a cycle at every vertex.
INPUT: G =(E,V) v = veuler_cycle = NULL; while(|E| > 0){ /*Find a cycle in G, start the search at v, returns c0 around which cycle is formed*/ c0 = FIND_CYCLE(G,v); v = GET_NON_ZERO_DEGREE_VERTEX(c0); /*Above can be done in constant time, using some space while finding the cycle */ MERGE(c0,euler_cyle); /*constant time operation, put c0 after an edge e1 in euler cycle which ends at vertex 'v', we can just remember the position of v n euler_cycle every time we merge*/ }
[TECH] Building tags on the complete source code...
I see that sometimes
$ctags -R *don't work. I just typed
$ctags -R *
in my cygwin it crashed
ctags.exe.stackdum. Well now the question is how do I build the tags on the complete source recursively if
-Rdon't work, we can use the the following to build the tags
$find . -name "*.c" -exec ctags -a \{\} \; -print; sort tags > tags1; mv tags1 tags;
The -a option appends to the existing tags file build
I initially thought that ctags keeps some seek information of the file in tags file,but just was amazed its a 3 column multientry text file, the first column is the tag which you are searching, second column is the file where is tag is and the most interesting part the 3 column is the search string for vim....hmmm see every one takes advantage of the plethora of things vim can do :)
Make_bp_profile ./RNAlib/ProfileDist.c /^PUBLIC float *Make_bp_profile(int length)$/ Make_swString ./RNAlib/stringdist.c /^PUBLIC swString *Make_swString(char *string)$/
.........luv.......Vamsi
Saturday, November 25, 2006
[TECH] Never use a file stream for lookahead reading while using lex.....
Just got the parser working....I did a lot of modification to mac's code, especially the grammar rules which have the lookahead information while parsing. The code tries to read from the
yyinfile stream of lex, but that is really pathetic because lex code is now optimize and it position in the lex buffer may not correspond to the position in the filestream...well this is what is the bug in code, well it took a while to fix. But its a good one.
I added lookahead rules
(st,bt)\n[\+]{linenum++;}
(st,bt)\n[\*].*${linenum++;} for lookahead extensions and comments in the spice syntax.
Tomorrow I'll get the layout printed ,,,,,,
Apart from this folks from india called and were telling me about the issues regarding priya pickles, well I think its really a slander against Ramoji Rao, any way I support this guy...yes may be after that great 3 day party at ramoji film city makes me baised, I guess you too will be baised once you receive that wonderful hospitality at hotel sitara in ramoji film city...when our team (verification group) went out there I saw mithun chakraborthy
..........luv..........Vamsi
Thursday, November 23, 2006
[TECH] SPICE layout generator.......
I have been a bit of slackish this week, but sure I want to start running soon.
Last night I read about the BPlane (Binned Plane datastructure used in micromagic, I need to implement that in magic soon).
Tonight, I thought about backing up my CVS repository regularly into my external hardrive, so that I can keep all my projects safe.
SPICE Layout generator
My new project, which generates cell layout from by reading from the SPICE files (transistor netlist) directly. I need to rewrite some of the code for the algorithm which tries to find the EULER trace in the transistors graph (and also its p-stack dual graph). Its exiting for me start it today....I'am in love with my life for the first time.......writing code is what I loved apart from all other tensions in life I love it
Tomorrow morning I'll be running for the sale in circuit city and best buy
[TECH] SRM327
http://www.topcoder.com/stat?c=problem_statement&pm=6871&rd=10007
/*
* topcoder_class1.java
*
* Created on November 22, 2006, 1:41 AM
*
* To change this template, choose Tools | Template Manager
* and open the template in the editor.
*/
package topcoder_srm1;
/**
*
* @author vamsi
*/
import java.lang.Math;
public class NiceOrUgly{
private boolean checkNice(char[] s_arr,int len){
int vcount=0;
int ccount=0;
int i;
for(i=0;i
I challenged some guy in this SRM got 50 bonus points.
..........luv......vamsi
Monday, November 20, 2006
[TECH] DAG's and Dynamic Programming......
Directed Acyclic Graph (DAG), directly embeds into dynamic programming....as from Vazirani's notes, the useful property of the DAG is that its nodes can be linearized (topologically). So if we process these nodes in the topological order we have sub-problems solved and the solution can be used for the next level. In the simple example of shortest path, we need (u1,v) , (u2,v) are the edges adjacent on the node v. To solve the shortest path problem we need the shortest path to u1, u2 to get the shortest path to v. The wonderful property of the DAG's is that if we start with the topological SOURCE (may be hypothetical by adding 0 weight edges), we are sure that we solved u1,u2 before solving v (if we process the nodes in topological order)
Longest monotonic subsequence in a given sequence, suppose the given sequence is '5,2,8,6,3,6,9,7' (The longest monotonically increasing sequence) in this is 2,3,6,9.
On the first look, it appears that it doesn't have sub-optimality inside it. In the sense take a subsequence '5,2,8' the longest monotonically increasing subsequence in this is is (5,8) or (2,8) but neither (5,8) and (2,8) is not in the overall longest monotonic subsequence, so the question is how dynamic programming works here??.....well people don't talk about the sub-optimality here......but still this can be solved by dynamic programming...
Let me restate the principle of optimality here...."If a optimization problem involves of sequences of decisions d1,d2,d3,d4...dn . The principle of suboptimality states that what ever decision you make initially the rest of the decisions should still optimize whats remaining after making decision d1...i.e
Any way I wrote the following code segment , S[i] = length of the longest monotonic subseqence ending at index i, input is a array of integers A[i].
global_max_length=-INFINITY;
PATH[N];
for(i=0;i
global_max_length , returns the length of the longest monotonic increasing sequence, and also prints the sequence
Apart from this life has been very cold, man today was REALLY_ __FREEZING__ here, I have cold the damn cold, I cannot drink cool drinks, eat any cold stuff it sucks......Well , I'll be going to India soon meet swapna,chamu...just talked to chamu on the phone, hope to see her and swappy soon...............THE LIFE GOES ON ON ON...by the way the GYM is closed till 26th and its cold outside I cannot even jog its really HELL out here
With love ...............Vamsi...............Tuesday, November 14, 2006
[TECH] Channel Router for cell synthesis......
Its quite an effort to get this thing working.....started on saturday night , worked on sunday, and monday night its done
perl had lot of kookups especially my $a,$b and my ($a,$b) are not the same, I pulled it from the manual. sometimes its really hard to fix this kind of errors, thanks for that wonderful debugger 'perl -d' , its really great to work with.
But I did'nt see if perl debugger has a backtrace kind of facility? just a gdb?
Life apart for my passion of the CGEN2MAGIC project, is quite slow need to study a lot about that Border Minimization Problem, also got the home work done on parallel algorithms and network flows.
I guess I'have started loving algorithms/problem solving...its really kewl
Take care....HAPPY CHILDRENS DAY.
Saturday, November 11, 2006
[TECH] Setting up VNC on LAN
Today I got my laptop dell-inspiron-640m, I have linux desktop running fedora connected to a wireless router which my friend uses, so totally we have 3 computers connected to the wireless router. Actually we have cloned the MAC address of my desktop onto the wireless router. Now I want to use my laptop and start working with vnc on my desktop. By default the port 5901 was firewalled, I had to setup the firewall to accept the tcp:5901. After which I had the probelems with the window manager, by default kde starts the twm& . So I edited the xstartup file to get the kde.
kwin & kdesktop & kicker &
You need all the three things to get the kde desktop up and running
Well thats all the infrastructure work, now I'am back to write the CHANNEL ROUTER for CGEN which I have not worked on for the last three days, due that motif-algorithm which I have been working on, last week I also had the polynomial algorithm for FINDING OUT ALL THE CUTS in the network flow graph.
Take care guys, I also had a long chat with swapna and that was really wonderful.
Monday, November 06, 2006
[TECH]Crippled mmap
I was trying to use a anonymous memory mapping to use in the first version of the Tile database memory manager which I was writing,
mmap(void *start_address,size_t length,int prot,int flags,int fd,off_t offset)
. I had prot = MAP_ANONYMOUS , (I thought its equivalent to MAP_ANON | MAP_PRIVATE , the man page says MAP_ANON , is depreciated). Well any way I got it fixed by MAP_ANONYMOUS | MAP_PRIVATE.Last time I had problem with this syscall is when I need to mmap to actual address's , i.e the start_address argument is not NULL, once again WHEN YOU DO A MMAP FOR A STATIC ADDRESS YOU NEED TO HAVE OFFSET OF THE FILE ALIGNED TO THE PAGE BOUNDARY.
Friday, October 27, 2006
Fridays seems to coming very quickly.
Sunday, October 08, 2006
A melancholic 24th birthday....but I think I have started to think
The other day I was returning back from the bus I broke within my heart, I knew I was a little more capable of getting into a better school, all my friends I have studied are now in better schools and me at UCONN making that hasty desicion to move from UCR....
I could certainly feel that I have a really hard luck, I don't know I think I have a nac for the SELF PITY for myself...first time in my life I feel I need to compromise, really I feel very low every day dont know why. May be I'am missing people very much, more than I could ever think of...mom told me to come back to india if I dont feel good here....you know at the same time I feel that by doing that I'am running away from the problem, ok now I'am in the problem a big complex problem the only way I can overcome this just by solving it....I say to myself I'AM TRANSFORMING TO MYSELF TO ATTAIN STRENGTH AND ENERGY TO SOLVE PROBLEMS....God please give me STRENGTH to face this problem. I know that I'am not a genius to come up with some idea to create a revolution but I'am trying sincerely...I don't do things to impress any one...
I don't feel any selfish any more the other day I was thinking about the change in me, I don't know I started feeling happiness in others happiness, sometimes I just did things that people are happy, although I don't expect anything from them.....
What ever it might be its really a rocky ride ahead of me....
Sunday, September 10, 2006
[TECH] Buffer insertion and signal integrity.
Well its a well studied problem after all this should have been done, but I'am loving it application of algorithms. The basic principles I need to stick to is honesty. I want to carry on like this feel good about it every day I sleep.....Well Its becoming a habit for me.
Delay modeling is a totally different research area, but the classic paper assumes a simple Elmore delay modeling...I guess I need to design a good algorithm which strikes a right balance on delay estimation and timing minimization.
Apart from that I wanted to see how much I can think backward. I tried to recall what I have done in my last few new years.
2006--> Partied in escape pub, hyderabad [I got a wildest dancer prize :)]
2005--> Freaked out on the roads boozing, my friend veeru with me he was annoyed a little that day :(
2004--> Well I was interning at Oracle this time, drank bacardi and made a mess, I guess I was frustrated that I was not having a grilfriend :))
2003--> Well I was with my parents in railclub. 2002--> I think I did nothing, but tasted beer for the first time...
Cheers! Vamsi
Saturday, September 02, 2006
Yes I cannot cheat myself......I never had...I'am proud that I was myself
Although I couldnt blame the professor for bringing me this far I need to blame myself. I know I want to do more fundamental things rather then jumping in something which I claimed to know, I told people that I had been working in a mixed signal simulation tool development. The word DEVELOPMENT here meant a different thing, I never really wrote anything core, what I was doing was just doing all system realted work to make the tool work. Well I guess I was somewhat doing well in what ever I had done. When I got admission at UCR with this background I started feeling guilty, I want to make up for it by looking into books on how fastspice was implemented, although I had a very high level of understanding on how fastspice worked I thought I could make it and decided to come to riverside. But when I talked to the professor I felt bad that he want to make use only programming skills which I had, he never expected me to design new algorithms, create new paradigms to revolutionize the research. Just at this moment I decided to leave this place RIVERSIDE. I CANNOT JUST DO SOMETHING JUST TO BELONG TO A UC AND BELONG TO CALIFORNIA AND TELL THAT PROUDLY FOR ALL THE PEOPLE OVER THAT WORLD...........I THOUGHT I'AM CHEATING MYSELF I CANNOT TAKE IT I DECIDED TO MOVE TO UCONN.
I know Dr.Raj was a great prof but people dont want me to go there when I said I got admit in a UC, well now I really dont give a damn shit on which university I belong I want to really learn the ART OF ALGORITHM DESIGN and apply in much more elegant manner with more CS pedagogy.....I FELT IF I COULD MASTER THE ART OF SOLVING PROBLEMS WITH A COMPUTER.....IT DOESNT KEEP MYSELF JUST TO CAD I CAN APPLY MY ALGORITHM DESIGN SKILLS TO ANY PROBLEM....I'AM EXCITED TO WORK UNDER DR.RAJ....
Well this is excatly what happens in pheadrus's book.......BUT I ADMIRE MY GUTS TO NOT TO CHEAT MYSELF EVEN TILL THE LAST MINUTE....ITS NEVER TO LATE TO GET IT BACK....,,,,,,NOW I NEED TO LIE SAYING SOMETHING TO THE OLD PROF AND MAKE SURE THE BRIDGES ARE NOT BURNT......
Tuesday, June 27, 2006
Problems for which "Principle of Optimality" does not hold??
o If the aim of a descision sequence(d1,d2,d3,d4........dn) is to minimize/maximize some objective function, then for any di , 1<=i<=n , the subsequence (di,di+1,....dn) should also minimize/maximize the objective function respectively.
o One problem for which the "Principle of Optimality" is when we have a KNAPSACK problem which both negative and postive profits, we might well ask ourself if a Item has negative profit then why we select that Item? well you might have forgotten the other factor which is the size of item...
I dont know of any other problems.
Tuesday, June 20, 2006
[NON-TECH] Marriage is buying conditional LOVE its for loosers, unconditional LOVE is what winners get.
I just think its bullshit if you marry you get to loose the fire in you, I just don't beleive in SETTLING in life. I just believe that "ITS JUST A JOURNEY which goes on and on and on......." , I don't think there is a destination where you think you have reached the NIRVANA and just bullshit marry and have SEX.....
I live a life for myself, I just beleive I just want to be happy without causing others any trouble (ofcourse envy and jealous are some thing I cannot help).
Any way reiterating things my aim is just to create technology for real good, not for building research papers or making a huge sum of money. Feel technology as an art and contribute without any motive. Some time I see that people tend to use my high energy levels, thats what I tell myself "Don't take it damn seriously, when can people expolit something ? if something is in abundance (high energy here) people exploit it. If I crib about people who expolit I'll loose my abundance of energy, I want more people to exploit me so that indirectly they are helping me to create a lot of abundance of energy to create things...."
Well if I keep all things aside (all but technology), people's egoes, money, holidays etc... life just ROCKS for me I love it.
Friday, June 09, 2006
Yet another memory corruption on linuxipf, new FAT POINTERS on IA-64
Well IA-64 had been a real good thing to work with, it has a real helpful kernel maintainers especially at ia64-linux@kernel.org, Well these guys gave me a lot of insight into several things RES backing store [60000fff80000000-60000fff80004000 rw-p 0000000000000000 00:00 0] this segment maps for every process on IA64 kernel.
Well other intresting thing is about the FAT POINTERS, the IA64 ABI mandates that the call to functions should be done via FAT POINTERS. do a google search if you want more details about this....
All in all a good productive week also fixed a couple of HSIM issues..
I really love it.
Wednesday, June 07, 2006
IA64 different virual memory layout
Thursday, June 01, 2006
How SIGINFO structure makes our life easy...
Writing siginfo handlers will help you get the culprit virtual address which causes the problem. See the following handy code.
=======================================
struct sigaction action;
action.sa_sigaction = my_handler;
action.sa_flags = SA_RESTART | SA_SIGINFO | SA_RESETHAND;
if(sigaction(SIGBUS,&action,NULL)<0) {
printf("Cannot register handler\n");
}
HANDLER:
void my_handler(int sig,siginfo_t *siginfo,void *ucontext){
if(sig == SIGBUS){
printf("SIGBUS Caught\n");
switch(siginfo->si_code){
case BUS_ADRALN:
printf("SIGBUS due to address alignment at %x\n",siginfo->si_addr);
break;
case BUS_ADRERR:
printf("SIGBUS due to BUS_ADRERR%08lx\n",siginfo->si_addr);
break;
case BUS_OBJERR:
printf("SIGBUS due to hardware\n");
} q
Cheers!
V.
Wednesday, May 31, 2006
Gives some solace.....
Sunday, May 28, 2006
ELF CORE file optimizations in Linux, problems with non standardization of core files.
o After my deep observation of the fact why core files have some program headers which have phdr.p_filesiz==0, found that David Miller, had added some changes to the core file which the linux kernel dumps, the optimizations are ofcourse to reduce the core file size, so I guess these guys are taking off the text part of the executable and the text part of the dyanmic shared libraries.
o My Question is WHY?? WHY?? do these people just dont try to stick to standards (if some standard dont exist they should create one, and once they enhance some stuff then update the standard rather than just flushing the changes into the code), in this opensource community this is really bad that the current standard of the core file depends on few induviduals.
I checked the PHDRS (readelf --segments) the following are the PHDRS of the core.exe
================================= Elf file type is EXEC (Executable file) Entry point 0x8048364 There are 11 program headers, starting at offset 52 Program Headers: Type Offset VirtAddr PhysAddr FileSiz MemSiz Flg Align NOTE 0x000194 0x00000000 0x00000000 0x00a48 0x00000 0 **LOAD 0x001000 0x08048000 0x00000000 0x00000 0x01000 R E 0x1000 LOAD 0x001000 0x08049000 0x00000000 0x01000 0x01000 RWE 0x1000 LOAD 0x002000 0xf649b000 0x00000000 0x01000 0x01000 RWE 0x1000 **LOAD 0x003000 0xf649c000 0x00000000 0x00000 0x132000 R E 0x1000 LOAD 0x003000 0xf65ce000 0x00000000 0x03000 0x03000 RWE 0x1000 LOAD 0x006000 0xf65d1000 0x00000000 0x03000 0x03000 RWE 0x1000 LOAD 0x009000 0xf65e8000 0x00000000 0x01000 0x01000 RWE 0x1000 **LOAD 0x00a000 0xf65e9000 0x00000000 0x00000 0x15000 R E 0x1000 LOAD 0x00a000 0xf65fe000 0x00000000 0x01000 0x01000 RWE 0x1000 LOAD 0x00b000 0xfeffe000 0x00000000 0x02000 0x02000 RWE 0x1000 ====================== ============= o As I said earlier I see some of the PHDRS are having FileSiz as zero, the first (1st **ed ) PHDR which is having virtual address 0x08048000 (this is obviously) the start of the text of the program, and its not having any memory in the core file. o The other PHDRS for which FileSiz is zero correspond to the dynamic shared objects (.so) text , example in the above we see (2 **ed ) PHDR with VirtAddr as 0xf649c000 , so this means the text of some shared .so has been mapped here. o I had a question about the memory mapping with permissions r--s or r--p (gconv used by glibc gets mapped like this some time) , so does the core file contains this information of the memory mappings? IMO this content is also mapped as PROGBITS I guess not sure. o Is there a way I can findout the standard which the OS follows to write the core file? No absolutely no, solaris dumps the entire core. o Rather than depending on the OS core file, hows your opinion on writing out all the mappings form /proc/ /maps as PT_LOAD into a elf formatted file of type ET_EXEC, do you think this works? rather than converting core file to exe? Should I start working to write the standard. ======================== =============================== #include #include #include #include #include #ifndef __64_BIT__ #define __32_BIT__ #endif #ifdef __32_BIT__ #define ELF_EHDR Elf32_Ehdr #else #define ELF_EHDR Elf64_Ehdr #endif ELF_EHDR place_holder; /*Chages the elf_header in the file with ptr */ int ChangeElfHeader(int CoreFd, int WriteFd, unsigned long vaddr){ unsigned long got_len=0; if((got_len = read(CoreFd,&place_holder,sizeof(ELF_EHDR))) != sizeof(ELF_EHDR)){ perror("Unable to read the ELF Header::"); exit(1); } /*Change the ET_CORE tto ET_EXEC*/ if(place_holder.e_type == ET_CORE) { place_holder.e_type = ET_EXEC; } else { fprintf(stderr,"The file is not of ELF core file"); exit(1); } /*Change the entry */ place_holder.e_entry = vaddr; /*Write back the header*/ got_len = 0; if (( got_len = write(WriteFd,&place_holder,sizeof(ELF_EHDR))) != sizeof(ELF_EHDR)) { perror("Unable to write the header::"); exit(1); } return 1; } static void finishWriting(int coreFd, int writeFd) { unsigned char write_buffer[4*1024]; int got_len = -1; while( (got_len = read(coreFd,write_buffer,4096)) != 0) { if(write(writeFd,write_buffer,got_len) != got_len ){ perror("Unable to to write the length which was read:"); exit(1); } } close(writeFd); close(coreFd); } int main(int argc,char* argv[]){ int coreFd; int writeFd; unsigned long vaddr; if( argc < 3 ) { fprintf(stderr,"Usage core2elf core.file exe.file.name"); exit(1); } if( (coreFd = open(argv[1],O_RDONLY)) < 0) { perror("Unable to open the core file:"); exit(1); } if ((writeFd = open(argv[2],O_WRONLY| O_CREAT)) < 0) { perror("Unable to open the write file::"); exit(1); } sscanf(argv[3],"%lx",&vaddr); ChangeElfHeader(coreFd,writeFd,vaddr); finishWriting(coreFd,writeFd); } ========================= ===========================
Sunday, May 07, 2006
My F1 student visa.....
Saturday, March 18, 2006
Life through ELF loaders.....
o My current problem boils down to create a executable from the running program itsself. To get this working I have been studying the kernels code in 'fs/binfmt_elf.c' especially code around 'load_elf_binary', The following are my finding might find it useful (for myself to look after some time).
-----1.)The kernels loader does not do any great , it basically gets all the metadata from the elf headers and just does the dirty work of just mapping and transferring the control. The summary of what excatly the kernel does is
a.) set the entry point from the (Elf32_Ehdr *).e_entry as the start jump to the program
b.) Load all the segments (PHDRS) the loader just deals with the program headers, it does not use any section headers. It loads all the segments with type (Elf32_Phdr *).type == PT_LOAD. If you do a 'readelf --segments a.out' you can see the segments
(gdb) shell readelf --segments a.out
Elf file type is EXEC (Executable file)
Entry point 0x80482a0
There are 7 program headers, starting at offset 52
Program Headers:
Type Offset VirtAddr PhysAddr FileSiz MemSiz Flg Align
PHDR 0x000034 0x08048034 0x08048034 0x000e0 0x000e0 R E 0x4
INTERP 0x000114 0x08048114 0x08048114 0x00013 0x00013 R 0x1
[Requesting program interpreter: /lib/ld-linux.so.2]
LOAD 0x000000 0x08048000 0x08048000 0x004cc 0x004cc R E 0x1000
LOAD 0x0004cc 0x080494cc 0x080494cc 0x00104 0x00198 RW 0x1000
DYNAMIC 0x0004dc 0x080494dc 0x080494dc 0x000c8 0x000c8 RW 0x4
NOTE 0x000128 0x08048128 0x08048128 0x00020 0x00020 R 0x4
STACK 0x000000 0x00000000 0x00000000 0x00000 0x00000 RWE 0x4
Section to Segment mapping:
Segment Sections...
00
01 .interp
02 .interp .note.ABI-tag .hash .dynsym .dynstr .gnu.version .gnu.version_r .rel.dyn .rel.plt .init .plt .text .fini .rodata .eh_frame
03 .data .dynamic .ctors .dtors .jcr .got .bss
04 .dynamic
05 .note.ABI-tag
06
(gdb)
c.) One more important thing about how excatly it sets the 'brk' base I guess to set up the 'brk' base the kernel only (also see the copy of the email posted on linux-kernel mailing list
Hello All,
I have been working on an idea of creating an executable from a
running process image.
MOTIVATION:
Process migration among the nodes in distributed computing,
checkpointing process state.
BASIS:
The basis of my idea would be update the existing executable with
extra PHDRS (Program Headers) with type PT_LOAD and each of these
headers corresponding the vaddr mapping from /proc//maps.
I have done some basic study of kernels loders code in
'fs/binfmt_elf.c' especially code in 'load_elf_binary' function, the
following is my understanding.
-----------------------------
bss=0;
brk=0;
foreach (phdr in elf_header){
if(phdr->type == PT_LOAD){
if( phdr->filesize <>memsize){
/* Segment with .bss, so update brk and bss*/
}
else {
/* Just map it*/
}
}
/*Update brk bss*/
}
------------------------------------
from the above the kernel is updating brk, thus creating the start of
sbrk(0) only when it sees a PT_LOAD segment with filesize less than memsize.
The kernel will set brk base i.e sbrk(0) to the value phdr.vaddr+phdr.memsize
of the last PT_LOAD
segment its mapping? so do I need to reoder my PT_LOAD segments so
that the heap goes as the last PT_LOAD segment?
Is there any way we can tell the elf loader to force the vaddr for
sbrk(0) i.e brk base ?
Let me know your suggestion on this idea?
Really appreciate your valuable comments.
Sincerely,
Vamsi
[PS: I dont know if some one has already implemented this idea??]
-----2.) Also found out that the virtual address's for the sections in the segments are the excat virtual address if they are within the range of corresponding phdr. that is I found that if .bss section has a vaddr of 0x00001000 and .data has 0x00000010 and there is a corresponding mapping (rw-p) in /proc//maps as 0x00000004-0x00010000 which includes segment to section mapping in the order '.data ...... .bss' note that .data will not start at 0x00000004 it infact still starts at 0x00000010 same with .bss. This is very logical since if the kernel's loader changes the mapping of the .data section the all the code referencing the virtual address's has to be changes. So the segments in /proc//maps file are not the segments excatly corresponding to 'readelf --segments a.out' infact they are bigger carousels with wrap around the the excat segment address's for page alignment.
More ideas next time..........
Cheers
Vamsi
Wednesday, February 08, 2006
Presumption is a Programming Perversity..... [Discovery of new GUMPTION TRAP]
I cannot imagine this presumption cost me 2 valuable weeks of time, which I wasted in meeting my bullshit girlfriend who has been bugging me all the way. Suddenly today after fight with her I went back (Filled with gumption) and got time to look at the code which I had left for 2 weeks with a presumption which I made that night when I saw that the debugger (gdb) itself crashed when I tried to something tricky on that sleepy night, I lost my gumption that night and presumed that its a very big problem, I was telling my self "Come on man there should be something really nasty in the code causing the debugger to crash............huh " this presumption made me very apprehensive to touch the code for two weeks :( , I have screwed the schedule with this just a crazy apprehension.
Rather than attacking the problem, I took a conventional root of comfort bought a TV to play on the XBOX with I bought it did'nt work researched on the voltage differences between india and U.S wasted my time and also wasted......Hey this reminds the the time when pheadrus took a break from answering the basic question of QUALITY, rather he went and married and forgot about QUALITY for sometime until he started thinking about it again and the mistake he made of the Presumption that QUALITY cannot be defined and took a comfort root of the question haunting him....later on he realized how big mistake it was left his wife and went on the journey of QUALITY again.
Yes even me also with this crazy prejudice lost my QUALITY track for a while.....But "Its never too late to get back..." (My Old Slang :)) ). Today I discovered a new "GUMPTION TRAP" ---> "PRESUMPTION and APPREHENSION" , probably we should have a course "GUMPTIONOLOGY101" in our school to know about all these traps rather than discovering them ourself. The problem was very silly when I got back into my QUALITY track its just that "I have been using old instructions and accessing/writing into a virtual address of the program in optimized mode when the instructions/code came from debug executable" (May be u should send me an email to explain the problem), but in a lucid manner its a very basic problem which I overlooked, its ok as long as I discover more gumption traps like this...........One thing is never presumption is bad and also evil....its a LOW QUALITY LIFE.
So today Its the 9th revision of the file just cvs commited and wanted to save my feeling to my harddisk before I forget about it......
Take care guys.....
Its always a journey no destination, you will get of QUALITY track when you say you have reached a destination
Reminds me of a quote from prisig "When you are filled with gumption there is no one stopping you from fixing the motorcycle"
Keep going guys make it a habit and enjoy it
Tuesday, November 29, 2005
Life of a hyderabadi....
Script2Executable project....
So now my ideal is to create a program which takes the interpreter name and the file (script) and create a compiled executable file, which can run standalone. There are several advantages of this program one thing is that this hepls the developers to hide the code of the scripts, what are the other advantages??....
To create this generic solution, I started thinking about this idea
STEP1:
o I'll create a dummy executable file compiled, with a placeholder for the script as follows
#include
static char buffer_space_for_script[MAX_SCRIPT_FILE_SIZE]="#Cheating perl hahaha...";
/*Driver program to launch the script, similar to piping except the program reads from static buffer and writes into the pipe.*/
int main(){
int fd[2], pid;
/*create a pipe all finer details avoided*/
pipe(fd);
dup2(1,fd[1]);
pid = fork()
........
if(pid==0){
dup2(0,fd[0]);
exec(perl/other interpreter);
.....
}
else{
write(1,buffer_space_for_script,MAX_SCRIPT_SIZE); /*write into stdout will be read by interpreter in the child*/
}
Now I wanted to compile this program and use 'hexdump -c a.out" find the seek location(byte in the physical file of the buffer_space_for_script and write the contents of the script file into the file a.out)....
I almost coded it but suddently realized that the major objective of this has been breached since hexdump -c will read out the ascii, thus a intelligent user can read the script using hexdump, even though we have created a compiled executable from the script.....
:(
Monday, November 07, 2005
Algorithm to build DFA's to test divisibility
Problem: Create a DFA to test the divisibility of a binary string by 3. (Assume the string can be scanned from left to right....ex 11 , 110 )
During the scan of the binary string the current state (Value of the binary string scanned till now) can be in one of the following states
1. 3K 2. 3K+1 3. 3K+2
So if the current state of the DFA is 3K+1 and we scan a '0' the value becomes 2*(3K+1) == 3k+2. If we scan a '1' it becomes 2*(3K+1)+1 == 3K. Similarly if we scan '0' in state '3k+2' it becomes 2*(3k+2) == 6k+4 == 3k+1. So now we have 3 states and move according to the following table.
CURRENT STATE SCAN_LITERAL NEXT_STATE
3k (final state) 1 3k+1
3k (final state) 0 3k
3k+1 1 3k
3k+1 0 3k+2
3k+2 1 3k+2
3k+2 0 3k+1
We can now extened this for the divisibility test for any 'k' that requires a D.F.A of kstates (can we minimize?). With this we can solve problems like the following.
Problem: Design a DFA for the set of string in {0,1,2}* that are ternary(base 3) representations, leading zeros permitted, of numbers that are not multiples of four.
Thought that this would be a useful piece of information.......Cheers Vamsi.
Sunday, September 18, 2005
Small observation in our life
Sunday, September 11, 2005
klists an ideal way for building asynchronous applications.......
Ok let me put this in much lucid terms... 1. I have some data to be shared across process's (not threads). 2. This shared data is accessed asynchronously. We get this type of context typically in telecom applications ( I recall from my experience from moto****). They have a unix based system, with several process's running each communicating with each other.
Ok talked a lot about the problem so whats a unix way of solving it. BTW way the data should be consistent and pocess the ACID (Atomic .....dont remember :-p) behaviour i.e a typical transcational behavior, basically the solution should'nt be error prone to race conditions occuring due to asynchronous behaviour within the process's. So how do you architect this kind of applications?
Ok let me give you some really shoddy professional solution which MOTOSHIT has sold to _NEXTEL_ (being soooo dump bought it from moto***a). 1. Moto***a had a real dumb soultion, to make sure that the data is consistent across the process's they seem to use a DATABASE :)).... 2. I have seen code which tries to access a shared variable as a row in the database table. 3. They just dumbly put every shared suff in the database...to make sure that the data is having ACID properties during the modification of the data by these asynchronous process's. 4. And more ludicrously they buy a database from a shoddy database vendor informix....and just heard that they are lobbying for support form IBM for this outdated product. really amazed by the quality (the romantic quality form zen and art of motorcycle maintenance :-p) of the approach to this problem. After knowing about klists I just felt that kernel which also has asychronous stuff inside does it in a much smarter way using KLIST. (KLIST is worth a reading please use the link above).
Monday, August 22, 2005
Solving serious problems....
Surely this kind of attitude will not help serious problems. But I have that innate feeling that I'am not doing any challenging and substantial stuff at work, so during the last few months I adopted an attitude shift in my thought "rather than complaining about the dark try to light a candle", I took all the pain to refactor every thing except the inane attitude of the superiors around, but they seem to have an attitude similar to some examples in my last post.
I quickly realised that they were just using me to their own glorification. Surely my managers are not my ideals but try to force that thought on people that they are great role models, I just keep mum. I really feel that they could really drive innovation and conceive innovative things, rather than drinking that materialistic vine.
Maan I just feel that I should do something different.
Friday, August 19, 2005
The power of intention.
1. A tiny and thin beam of sunlight suddenly thought that is was the sun...
2. A mild ripple in the middle of the ocean suddenly beleives that its the ocean...
Yes its really true on how ego can really doom a person. If you are reading this just dont be egoistic ever in your life, just relax and think about it again.
Thursday, July 28, 2005
Why this vacuous discernment between senior and junior?
All my mood is off when I see this guy walking ostentatiously all around, with a sneer unfurling those perverse insinuations, to motrify me. I guess his vanity has reached a zenith. All this is because of the discrimination the management shows between experienced and people with little experience. They just seems to despise our ideas with a prejudice that only experienced people only can make successful things and get things working, the management seems tout excessively that they will give weight to everyones views.
Its just because they think they are really privileged , they demand obligation....I really feel these are not the ideal people, no one is a junk. I'am not writing this out of jealously that they are getting paid more and are accessible to more stuff, these are words right out of a morbid mind twarthed by such inane seniors guys working along....I just learned one thing out of it although its a hard way to learn, I will never show that attitude when I become experienced. In fact I will never become a manager, its really a job with massive sagacity not to create any internal humilation among the people working under the manager.....I strongly feel that there should'nt be any discrimination among people interms of experience.
Thursday, June 30, 2005
Verminous ego stench .........
BTW the book I'am studying this week is "If tomorrow comes" , really a good one by sheldon makes us feel how a sapped, anguish and vindictive mind with a sedative torso feels. It was a story of a dejected lover tracy withney who tries to endure with a slender hope to seek vengeance.
TGIT (Thank God Its Thursday)
V@msi
Sunday, June 26, 2005
Fervent gaming hermit....
Tuesday, June 21, 2005
Don't be afraid of making mistakes.......
Tuesday, June 07, 2005
Transmeta lessons.......
I feel it as a small practical reminder about how one should always keep track of the infliction points, at any instance there are millions and millions of people competing with you and a slight negligence might create a infliction point with negative slope............ Think big to conceive a marvel.
Monday, May 23, 2005
Podcasting with itunes...
BTW the following are radiostations I'have been listening all my downtime
http://feeds.feedburner.com/ITConversations-EverythingMP3
http://www.hackermedia.net/wp-rss2.php
http://www.binrev.com/radio/podcast/
http://daily-horoscope.libsyn.com/rss/
Sunday, May 15, 2005
Its podcasting revolution.....
Monday, May 09, 2005
Love you momma!!
Hmmm......have been thinking about too many things these days, finally I got some time to write about momma.
I just shut my mind up for few minutes and start thinking about momma feeling a little nostalgic. Momma made me realise that "success is going from failure to failure with out loss of enthusiasm", without her motivation, I would'nt have accomplished any thing till now. In fact every day is a mothers day for me.......I love you momma!!!
Wishing all of you a happy mothers day
Friday, April 29, 2005
Solace for the weekend.....
Tuesday, April 26, 2005
Corporate victimization of enthusiasm.......
Tuesday, April 19, 2005
IPOD Mini on the go......
Recently bought an IPOD mini for just
$199 . I felt this to be really great no hassles of batteries, no hassles of space (4GB). I really feel like throwing my samsung YEPP-90S (64 MB) mp3 player.
The great thing about IPOD's is their integration with audible ( click here). I could really play all my audiobooks in audible format without converting them into mp3's. Yes now I turned out into an audible freak listening tons of audio books in my down time.....guys wondering why I have photo of mine rather than an IPOD mini here??......keep guessing
Monday, March 14, 2005
Turned into a RSS Freak
:-p Vamsi
Tuesday, February 22, 2005
There is no AI only RI (Real Intelligence)
Jeff Hawkins, the man who created the PalmPilot, Treo smart phone, and other handheld devices, has reshaped our relationship to computers. Now he stands ready to revolutionize both neuroscience and computing in one stroke, with a new understanding of intelligence itself.
Hawkins develops a powerful theory of how the human brain works, explaining why computers are not intelligent and how, based on this new theory, we can finally build intelligent machines.
The brain is not a computer, but a memory system that stores experiences in a way that reflects the true structure of the world, remembering sequences of events and their nested relationships and making predictions based on those memories. It is this memory-prediction system that forms the basis of intelligence, perception, creativity, and even consciousness.
Monday, February 21, 2005
The Aviator........
-- Howard Hughes describing his way of working and the mistakes made in building the "Spruce Goose."
Monday, January 31, 2005
How to avoid BROKEN PIPE errors in code (SIGPIPE)
void *stream = (FILE *)......;
............
............
//To make sure the data is written to disk (HA)
if(!fflush((FILE *)stream)){
printf("Flush failed due to %d error refer error.h\n",errno);
}
//This is really very dangerous code if you dont have a signal handler
//written for SIGPIPE (either you write a sig handler for SIGPIPE) or
//use the following code//
/*Safe Code*/
if(!fsync(fileno((FILE *)stream)))){
printf("Sync failed due to %d error refer error.h\n",errno);
}
I found the standards guide on context of libc functions really useful http://www.opengroup.org/onlinepubs/009695399/functions/xsh_chap02_05.html
Hope you will not go through the same pain....
Vamsi
Monday, January 17, 2005
Symbol referencing errors for static variable in C++
What could be wrong in the following definition of a c++ class to find out how many instances of MyClass are created??
class MyClass{
private:
static int __instance_count;
public:
MyClass(){
__instance_count++;
}
int getInstances(){
return __instance_count;
}
};
main(){
....
}
When complied with g++ says that __instance_count is not defined...this can be resolved by defining __instance_count outside the class definition,as follows.int MyClass::__instance_count;Why do we need this seperate definiton of static variables?
Saturday, January 01, 2005
04 to 05 with a 4-5 puzzle....
here cut it into 5 pieces and solve it.....finally keep track of how much time you took to solve this and this will be proportional to the hard times you will have to face in 2005....how about people who solved this already :)) not problems at all in 2005??
Saturday, December 18, 2004
L-TREE a new datastructure for efficient hierarchy representation in a database.....
One quick solution is create a table in the database
CREATE TABLE ORG_DIR (int EMP_ID NOT_NULL,VARCHAR(10) EMP_NAME, int SUP_ID);
To answer that you might query the database like
SELECT T1.EMP_NAME FROM ORG_DIR T1, ORG_DIR T2 WHERE T1.SUP_ID == T2.EMP_ID && T2.EMP_ID = &INPUTFinally you have got a workaround...Unfortunately this kind of workarounds seem to be very inefficient for storing and retriving Structured Hierarchical Data hmm...I know you are thinking about some thing right??? XML :)) Yes its XML. How can I store XML in my database and answer my queries on the Hierarchical data. My Idea is to make HIERARCHY as a datatype itself rather than some thing else. That is just as we have primitive datatype support within a database..ie every column in the database would be of some primitive datatype supported by the database...so The idea is can we make HIERARCHY a datatype.....hey wait a sec just figured out I'am not the only one who thought about it....yes Oleg has alreay added a great Contrib Module for postgresql. Oleg made is generic so that you can persist any label based HIERARCHY...now I have a good Idea in extending L-TREE to support XML....its really great to have such an optimized HIERARCHY representation for structured data...people have been talking about indexing and datastructures for XML Databases but this seems to me as a really good contribution from Oleg..... Vamsi
Tuesday, December 14, 2004
Useful unix command for finding all the files recusively which contain a string
Sound simple but thought it would be useful....
Saturday, December 04, 2004
Moving from STL to GTL
1. Circuit Partitioning: The stage where the designer had come up with a netlist and technology mapping being done. Now want to partition the circuit so that highly connected blocks stay together.....So when I talk about netlist....there it goes the HYPERGRAPH. The most fundamental netlist representation so to make systems which process these hypergraphs (netlist's) you need to write code in a very generic manner because the partioned hypergraph by the partitioning algorithms will be used by the placement algorithms and it goes on and on.......hmmmm now I recollect the network stack where pointer to the packet is passed across several layers and its done in such a way that to avoid redundancy involved in copying over the stack (process stack not network stack) they use a pointer to some heap space.......similarly in EDA tools where the netlist is taken through several stages(involves verification also) and finally realized into physical geometry, the developers especially EDA tool developers need some generic implementations like STL....its really great TEMPLATE LIBRARY lets you quickly do your tasks and modify only appropriate parts of the algorithms.....but STL has no support of hypergraphs...I mean not even graphs....you need to create your own Graph Container on the existing framework.....so now to avoid this we have got GTL a great libray.....I came across it while helping a friend in implementing KLM circuit partitioning algorithm...I feel that it would be really helpful for may other computer science domains apart from CAD....
Cheers
Vamsi
Monday, November 22, 2004
Trying to start a new life(Genetic Algorithms).....but those old memories(Deterministic Algorithms) still make me feel emotional.........
Tuesday, November 16, 2004
Never count on anyone except your self..........(Dont trust the runtime it will never behave ideally for your programs)
Friday, November 12, 2004
what you feel when __L_I_F_E__ daemon receives signal 11...
Tuesday, November 09, 2004
Some thing about research.
Saturday, November 06, 2004
External Memory Geometric Datastructures
Tuesday, November 02, 2004
How to represent INFINITY in ur programs
Example: -----------
Most candid use of INFINITY is to use them in graphs to represent two nodes which are not connected ie if we dont have any edge between two nodes N1 and N2 then we represent the cost of the edge as INFINITY. in the implementation of the dijkstra's algorithm on a graph we generally, come across a condition 'CURRENT_COST > CURRENT_COST + WEIGHT_OF_EDGE' then update the path. Theoritically INFINITY+1 = INFINITY. So if some one just does a #define INFINITY __SOME_LARGE_NUMBER, then INFINITY+1 will not be INFINITY. And the conditions just as the ones illustrated above will become buggy. The following representation of infinity is more shrewd than the ordinary #def's
/* * The following coordinate, INFINITY, is used to represent a * tile location outside of the tile plane. * * It must be possible to represent INFINITY+1 as well as * INFINITY. * * Also, because locations involving INFINITY may be transformed, * it is desirable that additions and subtractions of small integers * from either INFINITY or MINFINITY not cause overflow. * * Consequently, we define INFINITY to be the largest integer * representable in wordsize - 5 bits. */ #undef INFINITY #define INFINITY ((1 << (8*sizeof (int) - 6)) - 4) #define MINFINITY (-INFINITY)
Monday, October 18, 2004
Moving towards Scalable Distributed and High Available Data Structures
Commodity computers, interconnected through the high- speed networks are becoming the basic hardware. Such configurations, called multicomputers, clusters, superservers... include dozens, often hundreds or even thousands of clients and servers . Their cumulative resources are impressive: dozens of GBytes of distributed RAM, and TBytes of disks accessible for the GMips-highly parallel and distributed processing. They offer potentially unbeatable performance and price/performance ratio, opening up new perspectives for the applications . Major hardware and software makers present multicomputers as the next step of their business strategy. This was, among others, the subject of Microsoft Scalability Day organized in May 1997 for the US professionals. The technology is also felt as the next step for the Internet that should evolve from a data providing utility today, into a computing utility . One also foresees very large multicomputers coming as new tools for the academia, e.g., a 10.000 node multicomputer for Stanford University in 5-10 years . Finally, the domain was recently declared as strategic to the US computer science supremacy in 21st century by the US Government, and become the object of nationwide research program PACI .
Multicomputers need new system software, fully taking advantage of the distributed RAM, and of parallel and processing on multiple CPUs,. One especially needs new data structures, allowing files to span over multiple servers, and to scale to as many sites as needed. Such files should reside for processing in the distributed RAM, providing then access performance inaccessible to disk files. They should be accessible to multiple autonomous clients, including the mobile ones. Finally, they should not require any centralized data access computation or directories, too avoid hot-spots.
One solution is a new class of data structures called Distributed Scalable Data Structures (SDDSs). First proposed in 1992-1993, SDDSs gave rise to important research effort, materialized by several algorithms, papers and implementations. It was shown that SDDS files are able to scale to thousands of sites, and terabytes in distributed RAM, with constant access performance, and search times under a millisecond. Multi-key searches requiring an hour or so in a traditional file, e.g., a k-d file, may succeed in less than a second in an SDDS file . All these properties should be of prime importance for the applications, especially in the DBMS design arena, . They open new perspective for the VLDB design, for multimedia databases, for real-time and high-availability databases, for decision support systems, and for high performance computing in general.