2014/04/04

(re)install sage(math) in aws

Some time a go, I followed a Scientific computing course and I've learn the basics to configure a Free tier machine in Amazon web services to have my own installation of Sage(math). But I've made a mistake in the configuration (because I didn't know it can be changed) and that machine has only 8GB of storage. The consequences of it has been to have an almost full disk and updates where almost impossible (uninstall required to update, and reinstall later on). In practice it has mean that i've been stack in sage 5.11 when today it's 6.11.

But this Free tier has up to 30GB of hard disk space! And I have configured a new machine with enough space and the service are being moved to that new machine.

As this machine has been set up from scratch, I like to write what I did in command line for my records. And if it would get useful for others, great.

After having a fresh ubuntu 13.10 64bit AMI (Amazon Machine Image) on a t1.micro, I've:
$ sudo apt-get update
$ sudo apt-get dist-upgrade
$ sudo apt-get install ipython python-numpy python-scipy python-matplotlib python-dev git gfortran openmpi-bin liblapack-dev apache2 gnutls-bin
This is to have an up to dated machine and some basic needed packages. Then is necessary to add the ppa (personal package archive) where sage's packages are stored:
$ sudo apt-add-repository -y ppa:aims/sagemath
$ sudo apt-get update
$ sudo apt-get install sagemath-upstream-binary
$ sudo apt-get install python-openssl openssl libssl-dev libssl-doc python-openssl-doc python3-openssl
$ sudo sage -i pyopenssl-0.13.p0
Once installed the main package and some optional packages first execution can be called:
$ sage -notebook interface=\'\' secure=True
In here, a command line interactive process will ask for the sage's admin user password. And after that the script for the init.d can be prepared and started, like described in a previous post.

2014/02/03

About scotland and catalonian process

Just a short thought that has come to my mind recently. A few years a go, in Belgium there where a huge political crisis that left the country without official government during 541 days (close to a year and a half). During this crisis the north (Flemish) and the south (Wallonia) were at the limit of rupture.

The European Union Treaties wasn't an extra problem then, and was also explained that they thought in a triple break, leaving the Bruxelles capital region as an special area as the EU capital. At that time no one have says that those two new possible countries should request a for (re)admission as state member.

Why, nowadays, the Scottish people are threatened that, depending on the result of the self-determination process, they will have to request their admission from scratch? Why also Catalonia people, whose process is an even worst situation because the Spanish government denies any right to vote, are threatened to be expelled from the Union?

2014/01/15

I see threads everywhere...

A very long time a go, when I was a cluster scheduler developer, I've seen my record of concurrent threads. In the stress test of the system, the scheduler had up to 480 threads consuming a 1% of the cpu. That was good and the objective because an scheduler shall not be doing anything else than planning (with in different levels an abstractions, managing restrictions and complains). The code was full of semaphoresevents and signals. The tests were succeed without deadlocks. Since then this has been my record in number of threads.

In my code I use very often threading. In a object oriented design many threads can be doing different things with those objects and it is fun when many of them are interacting and the application works as expected with a good performance. I've play with OpenMP and MPI, but I've never raised my record of concurrent threads, until now.

I'm following, in coursera, a subject about heterogeneous parallel programming with CUDA and this has broken the record in very very small pieces. In one of the exercises, a matrix multiplication, the data set is: A_{200,100}*B_{100,256} where the result is C_{200,256}. That is 200*256 cells and one thread each to do the underlying basic operations.

Using CUDA blocks and grids, where often the data doesn't fit exactly and you exceed a bit, this matrix, in my case I've used 16*16 blocks on a 17*12 grid of blocks. This rises my record of parallel threads up to 52224 threads. More than a hundred times...

Event this numbering, imho there are categories on this threading count. In this record, those threads where doing almost the same with different data. In my previous record, there where only a few of them doing the same thing. That splits also the threading count in two categories...

Update 20140202: Did I set my threading record to 52.224? Doing another exercise on this cuda course, I've break it again: a convolution of a 2k*2k coloured image (3 channels, and a 5*5 mask) 12.582.912 parallel threads did the job in 19ms...

2013/12/30

How did the NSA hack our emails? by Numberphile

I like to see the numberphile videos as often as they appear. I find them very interesting, but I didn't share before in this blog. This time is different.

They have talk about a field that likes me very much: elliptic curves (and a pseudorandom number generator made with them, the Dual_EC_DRBG), and the greatest point is that they have summarized in 11 minutes in a wonderful elegance:


But they have not only provide an explanation for not initiated, they have pointed the key of the weakness that could have been introduced.

Update: To often I forget to write the title of a post...

Update 20140116: For further reading, I stumbled a post with a proof of concept about how this affects all the users of this algorithm. It is still a suspicion that 'P' and 'Q' has been chosen from a known 'd' and no one has calculate it, but it is that: suspicious. If you are impatient (suppose not because you are at the end of this post) or you don't wanna see into the maths, go direct to the conclusions of the post.

2013/12/20

GnuPG launches crowdfunding campaign

Long time no see! But I've found a reason to write. Yesterday, Werner Koch has send an announcement into the GnuPG maillists


If you read Werner's email and/or saw the video, you may think in contribute to the project.

2013/09/28

About Spanish time region change

Recently have started in Spain a debate about change the time zone to recover the one used when the republic. I think, it's curious that I didn't heard since now about this change. I know that Greenwich meridian cuts the territory and even that we are not in the same zone than England (UK). But it was forgotten to mention to me by anyone that before it was.

According to what I have heard this days, was during the second world war, when the nazi German invade France, they have changed the time zone of France (who where also at Greenwich) to set the same than the invader and the Spanish dictator waved his ally changing the Spanish also.

So far so good? Up to this point there is nothing else in the matter of set back the time zone or not. Every year we change from winter time to summer time and vice-versa, with caring about time zone business.

But the justification I have heard to support this change I think is point less. You can read in the press, that this will help to improve productivity, or that the siesta have the will be gone, or that this will improve working habits...

This is not the solution on the working habits at all! How can think that if some one that is working from 8am to 7pm, will change its work time schedule if politicians change the time zone? The only effect on the change of the time zone, will be that the sun will shift the rise and the set, but will not point the real problem of the Spanish productivity. The exampled journey will be tagged between 7am to 6pm, that is useless for working habits!

There is a brain fire recorded thing in Spain: it is not much important how much you work, the important thing is how much hours are you at work (how much seems that you work). And this is the issue about the working habits and the productivity. Many bosses likes to see you heating the chair and they don't like to see you being the first that leave the office in the evening (even if you have been the first to arrive).

Until this issue is not fix, the working habits will still be bad... In this country, what the boss expect from you, is to see you doing unpaid extra-hours even if you don't have anything to do. And never thing in register those hours, I've work with a time clock machine than automatically signs you off after the 8 hours even if you are still in the office. If you do that, the boss will be happy with you, if you work hard but you don't stay more (except when something really unexpected happen) you will be classified as "not very committed to the project".

Once I had a boss that told me: "we don't want workers that only does eight hours". Put the time zone you want, if the origin of this sentence is not fixed, the balancing between work and family time will be lopsided hopeless...

In other European countries, there are companies points you an assistant when you trigger overtime alarms, to help you to organize your time or detect if you are overloaded.

2013/09/25

cloud.sagemath.org

After to follow the coursera's "High Performance Scientific Computing" I've learn about the Amazon Web Services and how to use them. Specially in the hook for new customers with 12 month free tier. I have mention it about a month a go.

I have there some sage sheets that in other alternatives didn't finish the calculation (there is a sheet timeout when there is no activity). With my own installation, I can be aware of when this instance is being crazy and forget this timeout to continue the calculations.

But there is something more with sage in the cloud. Further than install sage in a machine in the cloud, there is a new sage project to take advantage from the cloud: cloud.sagemath.com

I have started using it, not much yet, but I like specially to mention one of the talks than William Stein did:

I recommend this talk very much.