Monthly Archives: November 2009

Some time my emails have responses; some times there are none for days

Standard

This is the problem faced by me. I sometimes feel that my email has important information or I am looking for important decision and I still do not have response. By the way I respond to all emails.  Some times I get responses immediately. Why? Some things that helped me get an answer are

  • Make the email personalized and be focussed on what you need
  • Make sure that the language of your email be well written and articulated. It is not unnecessarily long email
  • Make sure that the email clearly mention the course of action expected.

I would like to know more such practical tips.

How you can calculate the “real value” of future money:

Standard

I saw this formula in Shyam’s article “Beat inflation well ahead and copied the same for future reference. Thanks Shyam

Real value (in today’s money value) of Rs. X, which will be available Y years from now = X / (1+ annual inflation)ˆY. For example, the real value (in today’s money value) of Rs 1 crore, which will be available 20 years from now = 1 crore/ (1+6%)ˆ20 =31 lakhs= shrinkage of 3.2 times

Get Ready! Go Parallel!

Standard

:Once upon a time I used to build VC++ 5.0 applications .on computer that had a single processor,128 MB RAM and 1GB Hard disk space. Those days are bygone. Today there are already desktop computers and laptops with  multiple processors and multiple cores. OK, this is change in hardware, good. Does this change matter to software? Does this change affect the way I perform software development? Is there a change needed in the way I write software in the future compared to today.?

No matter how processors increase their output and speed, software consistently finds new ways to eat up the extra speed.  As a software developer, we keep riding the free performance due to processor/ hardware performance. We are of the major opinion that  “tomorrow’s processors will provide better performance and you see today’s application are constrained by CPU throughput and memory speed, but due to I/O-bound, network-bound, database-bound operations”.

Today as a software developer, we enjoy the free lunch wave of desktop computer performance. Will this continue in the future?  Processors have always optimized the clock speed and execution optimization or increased the size of chipset to provide better performance. These optimizations have lead to speedups in sequential (nonparallel, single-threaded, single-process) applications, as well as applications that do make use of concurrency. Effectively to run chips at higher speeds, there came a challenge of impractical quantities of cooling equipment that affects the climate and increases the cost of power consumption. As these optimizations might not continue for long without increasing power consumption, the hardware is taking the new approach to increase the performance by multi cores and multi processors in desktop computers.

To take advantage of parallelism, applications face the following challenges and need to be ready for change

  1. Applications need to be written concurrent if they want to fully exploit CPU throughput gains due to current availability of the multi –core machines today. Let us be prepared that there might be no single-core machines after a couple of years.
  2. Application tasks shall become CPU-bound in addition to being network-bound and data-bound. This does not rule of operations that are not CPU-bound
  3. Demand for efficiency and performance optimization will become more important. This will add with demand for performance-oriented practices and solutions.
  4. Programming languages and systems will increasingly be forced to deal well with concurrency.

Let us assume that business and individuals realize the potential of multi processor environment and need to take advantage of this opportunity, the first question is where do I start? How do I start? How to get ready my developers for writing parallel code? What are the out of box tools available in the market to help in this saga?What is the software development approach to be followed for writing parallel and concurrent code.?

I would think that we can take the first step towards writing parallel code is to migrate existing applications and products to take the advantage of going parallel. For an existing application, the approach to make the application parallel is as follows.

  • Have a strategy to find where to start looking whether parallelism can give raise to performance and where to start.. This includes performing a lot of different benchmark tests to measure current performance . This helps you to focus on identifying the serial steps in the system and possible steps that can be made parallel.
  • Design and Implement the functionality feasible  to be expressed as parallelism as parallel steps. Analyze the memory handling is prepared for parallelism and plan for its migration.
  • Debug the new parallel code and try to look for race conditions and deadlocks. Please remember that code not written for parallelism might reduce the existing performance of the system. Identify the suitable debugging environment  that shall help your developers  to find errors in implementation.
  • Measure the performance of the new system against the old benchmarks and analyze the difference and validate where the difference is actually driven by parallelism. A major leap in performance or major degrade in performance need to make the architect go back and re-evaluate all the above steps.

Getting the  developer ready to implement the development approach? The vast majority of programmers today do not think in terms of concurrency. Hence developers and architects need to be be prepared, ready and time should be planned for the investment in training and time. We need to learn learn concurrency (what’s a race? what’s a deadlock? how can it come up, and how do I avoid it? what constructs actually serialize the program that I thought was parallel? how is the message queue used to write parallel code? Beyond the “whats” and “hows,” why are the correct design practices? Are they actually correct?).

The developers who perform lock-free programming, where the framework takes charge of concurrency also needs to be aware of multi-core. Let us accept that concurrent lock-free programming is equally harder to understand and reason about than even concurrent lock-based programming. For a programmer used to write programs for sequential  control flow it is trickier and much harder to write programs for parallel flow. Developers also need to be aware of the  pitfall. Concurrent code that is completely safe might give same or less performance on a multi-core machine than on a single-core machine, typically because the threads aren’t independent enough and share a dependency on a single resource which re-serializes the program’s execution

Minority of people writing multithreaded applications today also need to understand the addition of multiple processor in your deployment environment. They write multi-threaded programs today to achieve one of three; to logically separate naturally independent control flows,to scale by taking advantage of multiple physical CPUs, to easily take advantage of latency in other parts of the application. Though the multi-threaded developer has advantage in multi-core era, but he still needs to learn and invest time to understand the difference between threaded model and the parallel model. Multi-threaded application testing shall discover new concurrency bugs or these bugs shall surface only on true multiprocessor systems, because of the conceptual difference that the threads aren’t just being switched around on a single processor but where they really do execute truly simultaneously and thus expose new classes of errors.

Getting the business aware ready to go for parallel?

  • if your application is threaded and is running , and you have a short timeframe to release your current version, it may be cost effective to simple the additional multi cores and multi processor’s.  Plan to focus on parallel for the next version release of the application.
  • Predictability of time estimation to write parallel code vs. the  actual time might have huge variance and thus there is all reason for increase in the cost and delay in shipment. Hence plan for risks and contingencies
  • Multi-threaded programs can be very difficult to debug. If your schedule is short, and if you’re already got a single-threaded code-base up and running, then it may well be cost effective to simply ignore the extra CPUs, at least for this version of the game. The decision to go single threaded can also greatly simplify the debugging process.
  • An application has both code that needs to un serial and ones that can run parallel. It is quite possible that a large portion of a the application is unavoidably serial. This means that the time taken no more matters on, no matter over how many processors you spread the execution of your parallelized code.
  • Please be aware of the impact of  Amdahl’s Law. The speedup of a program using multiple processors in parallel computing is limited by the time needed for the sequential fraction of the program. To understand better, let us consider that there is task that has two parts A and B. Let us assume that B roughly takes 25% of the time of the whole computation. You might not get much advantage by trying to make B parallel. you need to select the area that needs to be made parallel.
  • Get ready with the money and ROI to invest in the infrastructure and environment needed to go parallel

Getting the environment ready to go for parallel?

Development environment needs tools to write code and to perform testing. Lot of existing languages like C#,?Java and C++ are trying to add parallel capability code to help developers. Testing of dual core is possible, but do I test machine only for dual core. Business would like the same to be tested for 4-cores, 8-cores and 16-cores. What would be the cost of buying those machines? Will the product company or the deployment company user bear the cost. I have collected some links to do more research and train the folks at the place I work. Sharing the same

Can I allow another person mistakes to affect me?

Standard

Till recent times, I have become emotional on a another person’s mistake . The emotion affects me badly at work and with the right intention that I want to help my other person and the wrong assuming that other person is aware of the mistakes, the approach I have taken towards other person’s mistake has not been right. When a Colleague’s Mistakes Affect You helped me realize where I am getting lost in my emotion and me  building a wrong impression at my work and at my personal life.

I would be aware of the learning’s from the blog and copying the same for my future reference,

  1. Understand what’s really going on. Try to determine if the problem is short-term or long-term.
  2. Engage in conversation with the colleague  in an informal, private setting and you should always follow good feedback rules. Don’t accuse or blame your colleague. Use concrete examples to explain what you are seeing and its impact on you. Be direct and honest with your colleague about how the mistakes are affecting you .Never assume your colleague is aware of the mistakes
  3. Offer Help and Support.Offer help if the colleague is struggling with a short-term issue such as a heavy workload or a personal issue. Keep in mind that relationships matter

Let me also plan to protect myself, by taking credit where credit is due and Make my work visible. When I do this I would make use of the active voice instead of the passive voice. For example, try saying "I prepared these analyses that show where we should be investing resources" rather than "These analyses show where we should be investing resources."

Growing children is long process

Standard

My elder daughter is 6 years old. I still think she is a small baby, but she is growing and I am not growing and still thinking that she is the baby I picked at Mount Sinai Hospital. I should learn from the father in Abhiyum Naanum that I also need to grow.

We jointly do cycling over last few weekends. She had to some interesting activity towards her school and when I checked whether we will go out for a walk. she did not agree, but when I added for a cycle ride, she was all for it. I realized that I am taking her granted working on my personal work. She wants to go at high speed like vehicles Last week, I explained that vehicles run on petrol and cycle was running on energy provided by the person pedalling. Today  across cycling she asks me to go to petrol bunk and  put petrol for the cycle and  the cycle will go faster. Lot of times tussles with her seems to be a losing game for me

She is observing me and my communication and she is growing, but not me growing in the interaction with her.  I can see that she is taking control on small things. She now knows just what to do to get a rise out of you. I see nothing wrong to allow her to make choices over things appropriate for his age – what to wear, what friend to have over. Give him options whenever you can. when he truly has no choice, be firm and in control. But I need to learn the trick is to give her power without surrendering mine and also understand that the more I insist and get upset, she is going to become more adamant. I did the same with my father when I was young.

Learning these techniques takes practice and time, but start the practice.

I am making some notes for handing her environment the best for me and her. I have practised some of them already, started some, some are yet to start. 

  • She needs motivation. if you want her to read stories, you cannot ask her to read herself. I am learning to be there with her during the time she reads the  book, motivate her, help her to read words that are new to her. I see that she is more interested. I need to make time for this activity.
  • What you do is as important as what you say. If you expect your child to not see Television for a long time, the same thing applies to you too.
  • A child this age is fully capable of reasoning, so explain what is the purpose behind performing a task and why she should not exhibit a specific behaviour. She is more keen on body awareness. My wife emphasizes healthier food choices (including snacks), sensible portion sizes, and lots of exercise and she understands.
  • Look for games and activities that aren’t all about competition. We are teaching that games and sports  are for fun and one can be both winners and losers in a game. Losing is not bad and she needs to accept failure gracefully rather than crying. I still try to lose her sometimes to make her not to lose.
  • To stop a  behaviour of the child, try to stay away from negative statements. I find that it is easy for me to focus on what a child is doing wrong.
  • Be firm about what you do expect.  If she continues to perform opposite to your expectations, follow through on whatever consequences you’ve discussed.
  • My wife who is present all the time with here should be the one who is calling the shots in terms of discipline in any given situation; I should be aware that I do not undermine how my wife is handling a situation.
  • When there are big differences on any matters with my wife, negotiate them away from the child’s sight and earshot. It is best for me and my wife to have a united front, and not to have debates and arguments in right in front of our daughters.

“Is life so wretched? Isn’t it rather your hands which are too small, your vision which is muddied? You are the one who must grow up.”
– Dag Hammarskjöld

Arguments

Standard

There was a nice blog in LinkedIn on this topic and I started to think for myself.

I end up arguing for lot of things. Why? I fear that others might trick me out, they are exploiting the society for personal reasons, they are trying to not do the work, but try hiding behind process and policy.  This fear turns in to emotions and under emotion, I go in to argument that is not Results Oriented. I realize later that it would be better that you do not argue. Does this mean one should not ask no questions? NO . Fight Right

Before I argue, I should look answers for

  • Is the matter important enough to warrant an argument?
  • Is it appropriate to argue about the matter, or at this time?
  • Can anything be changed, made different by prevailing in the argument?
  • Is the issue worth arguing or what is the change I want to bring in spending my time

If you get a NO answer to any of these questions, there is no point in arguing.  when I perform analysis of some of my past arguments, I see the answer to my third question is NO and the answer to my second question is wrong time. If I eliminate the urge to argue, I think I am good and this means no emotions in my arguments. Learn to recognize when a discussion is no longer a discussion, but is escalating to an argument and some tips to help me are

  1. Don’t respond to the content of their remarks. The less you say, the less likely you are to get drawn into an argument. I always used to think the people who are silent do not have backbones to put their points. NO I have been wrong, they were smart and no there was nothing to argue.
  2. If you become angry, know that you won’t be able to think calmly, and you’ll probably say or do something you might regret. Think before you speak.
  3. It takes two or more to argue. By politely refusing to argue, you stay out of it
  4. Identify your "buttons". These are the things that typically set you off: For me the fear of getting cheated or beliefs shattered. Know that others know where to find your buttons. Recognize someone approaching your buttons, think to yourself, "Ah-hah! This is becoming an argument! :
  5. Raised voices, Crossing legs, means that i am entering argument.. A good mutual discussion involves both sides listening and attempting to understand each other