What to do if I cannot complete my Masters dissertation tasks? I am doing my masters in the UK and at final stage of my dissertation. First I will have to confess that I regret that I selected this dissertation as it is something which I failed to get a clear idea about. I don't know if it is because I cannot understand the ideas that my supervisor is trying to communicate with me.
First my target was to implement an algorithm (I was given only a specific field and asked me to select an algorithm) using a language that I had never used before. I used to meet  regularly and given research papers to read to clarify any doubt I had. There was no support in the implementation other than the research papers. Also no one to guide  on the computer language I needed to use for the implementation.  By June, I was stuck a little bit in the implementation and when I expressed some doubts, I was told there is not enough time for implementation now as I am not able to understand it so take an existing software which implemented the said algorithm and create some performance improvements.
I spent a lot of time, more than a month for just setting up the work environment and understanding how that software works. I am not very confident to speak out so I thought I will eventually get a hang of it. After a thorough research I realised that the said software is widely used all over the world and has been optimised in all possible ways already. But it was already too late and at the end I am left with almost nothing but some failed trials. Now the deadline to submit my masters dissertation is in a week and when I spoke to my supervisor about the limitations of the software and why I cannot optimise it last week, I was given  a new research paper to read and asked  to try their approach.
I learned a lot in this research, many algorithms, some new software, computer languages etc, but it was not focussed. I don't know what I will write in my report as the project is supposed to be a study with evaluation and testing to show as a proof to my conclusions. I have already written a literature review of 35 pages and about 10 pages about the software I am trying to optimise. I cannot submit just that and I don't think it is a good idea to continue new trials now as I may not be able to complete writing my report (which needs to be around 60-65 pages) with just one week left.  I have distinction from the marks for my course units and all of the effort I took for an year will go in vain if I fail the dissertation as it has 50% weighting. What can I do to make sure I will pass my dissertation? Please advise.
NB: I know it is a long question, sorry about that. I felt I need to write the context to explain my situation.

Postscript:
I continued and completed my thesis with all the failed trials. Added some sections in the thesis comparing the different approaches I tried, findings based the trials and some suggestions for future work. Even though I was paranoid till the results came out, I passed with distinction.
The unpleasant reality is that it is entirely possible that you may not pass your dissertation. In fact, given what you've written here, I would be surprised if you did as of right now.

Graduate level work is hard. I mean if research were easy everyone would be doing it right? And so some of the things Graduate students need to learn early in their career is time management, planning and asking for help as needed. In an ideal world your advisor would have caught your floundering much earlier in the process but academia, as life, isn't always ideal. A good rule of thumb is if, by the halfway point of your timeline(so 1 year into a 2 year Masters for example) you don't have a solid plan for accomplishing your goal that includes timelines, goalposts and a plan to catch up on additional material you need... then you have a problem.

By June, then, warning bells should have been going off in your head. I have some sympathy(everyone has to learn this stuff on their own at some point) but not too much. Part of graduate level Computer Science work, at least, means figuring out languages and implementations on your own. It sounds like you were looking for something a little more guided, more like undergraduate courses, but that's not how it works for Graduate level research. That you are a week out and just now casting about for a solution, that you, after running into the exact same problem when asking for help too late in June, just now found out that you could not implement improvements on a preexisting software suite... these are massively problematic. Ideally after the issues in June you should have chosen low hanging fruit for your last ditch effort of improving someone elses' suite. The first thing your lit review on that software suite should have contained is a list of potential pitfalls or limitations of the software and rough ideas on improvements.

Now that's all rather negative. I've written it because, from what you've written, you seem to not get what the fundamental problem has been for your research experience. All that being said there may still be solutions but it's going to be hard work.

It sounds like these implementations(different softwares) are focused on a particular field or topic. An option, a hard to do going to take overnights for the next week, option would be to do benchmarks and comparisons of currently available software. A study of the limitations and weaknesses(and strengths) of currently available software can be a viable topic. That it took you a month to set up the environment to run the software you were trying to improve means that this would potentially be very hard for you to do in a week. An option is to take the software you have now and run exhaustive benchmarks and analysis on that specific software.

I'm not suggesting this as a 'run out and do it now!' sort of thing. Honestly even the most on-the-ball student who has had no issues would be hard pressed to write a decent dissertation in a week. That's a student who has all of their data. But a passing dissertation is a possiblity. Your first step is to go talk to your advisor as soon as possible. Explain the current situation, explain a potential solution(exhaustive benchmarks on a particular software or comparative benchmarks between different software implementations) and, finally, explain what you are going to do to make sure that the day before the dissertation is due you won't have another emergency situation like you have right now.