Skip to main content

a silhouette of a person's head and shoulders, used as a default avatar

Livros - As Fontes do Paraíso

Vanevar Morgan é um engenheiro responsável por construir pontes bem famosas, como por exemplo, uma ligando o Marrocos à Espanha passando pelo Mar Mediterrâneo. Em uma de suas viagens, ele acaba indo p/ Taprobana (nome histórico p/ uma ilha no Oceano Índico) [sup]1[/sup], onde será construído um elevador espacial. Tipo esse daqui: Moravam nessa região os principes Kalidasa e Malgara. P/

a silhouette of a person's head and shoulders, used as a default avatar

Livros - O diário de Jack, o estripador

Assim como outros personagens reais que foram parar no quase imaginário popular, Jack, o estripador, sempre me deixou curiosa. Refrescando: Inglaterra vitoriana, século 19. Havia um assassino de prostitutas à solta no distrito de Whitechapel em Londres. 5 mulheres foram mortas, com direito à evisceração. Não sou muito chegada em livros policiais nem em jornalecos sensacionalistas da TV, mas gosto

a silhouette of a person's head and shoulders, used as a default avatar

Livros - O fim da infância

Outro livro de Arthur C. Clarke na minha mão. Apesar de não ter gostado do filme "2001 -- Uma odisséia no espaço" (achei massante por se concentrar apenas no HAL-9000 e o final, apressado) o livro foi uma boa surpresa. E acabei gostando da forma com a qual Clarke escreve. No prefácio, o autor, morto em 2008, já diz que se Hollywood fizer um filme baseado em "O fim da infância", todos irão achar

a silhouette of a person's head and shoulders, used as a default avatar

Livros - From this moment on

Desta vez, uma biografia. Só p/ interromper o ciclo de ficção científica, senão fica muito massante. Shania Twain foi uma das minhas "descobertas" na época da CMT (Country Music Television). O "sertanejo gringo". Junto com Reeba McEntire, Garth Brooks, Tracy Bird, Alan Jackson, entre outros. Mas ao contrário de personalidades como Chaplin, Hitler, Jobs e Disney, nunca me interessei por sua vida.

a silhouette of a person's head and shoulders, used as a default avatar

Livro - Androides sonham com ovelhas elétricas?

Terminei de ler o livro que foi base para o filme Blade Runner. Foi o segundo do meu ciclo de ficção científica, que espero que seja longo o suficiente pra me manter entretida. O primeiro problema que vejo é: não sei pra onde correr quando terminar de ler os clássicos. Algum autor contemporâneo desse gênero? Como não lembro muito bem do filme (tenho o péssimo hábito de assistir filmes deitada, o

a silhouette of a person's head and shoulders, used as a default avatar

"Incursões violinísticas" - Mark O'Connor

Não lembro se foi em 2013, mas depois de uns 10 anos parada devido à faculdade, voltei a fazer aulas de violino. Para tentar minimizar o problema do som ruim característico de iniciantes comprei um violino elétrico. Assim posso fazer a desgraça que for: quem estiver em redor vai ouvir um som muito baixo (e os vizinhos provavelmente são poupados até disso). Sim. Comprei um Stagg. Porque não

a silhouette of a person's head and shoulders, used as a default avatar

Primeira frustração do ano - Scraping de dados de convênio

Esses dias minha mãe me pediu p/ imprimir todos os médicos conveniados da Itaipu, porque eles não enviam mais o livrinho impresso. P/ minha infelicidade, os dados são paginados e se você for fazer isso na mão, vai ter que ficar copiando, colando e formatando no editor de texto. Não, né.... Meu desespero começou quando vi que usam frameset na página. 1994 ligou e pediu o livrinho de HTML de volta

a silhouette of a person's head and shoulders, used as a default avatar

2014 - Final de ano

Passei o resto do ano sem muito assunto p/ ter o que escrever aqui. Pelo menos algo que possa ser interessante p/ alguém.Uma das partes boas do ano é que conheci e consegui manter algum contato com pessoas da área. Sendo mais específica, com o Júlio de Lima, após um curso que ele ministrou no SEBRAE. Isso p/ mim é um puta avanço porque, por exemplo, na Python Brasil em Curitiba passei pelo evento

a silhouette of a person's head and shoulders, used as a default avatar

Be careful with Intel turbo boost! It can screw your benchmarking! And run slower when dealing with parallel programs!

I wrote several months ago a little application called machPQ.py (I’ll open the code soon…) which calculates the active, reactive and also the apparent power in machine terminal’s over the time domain, for electromagnetic transients analysis. The files that this program have to crunch often have 1.E6 lines or more.



MANAUARA_PQFig. 1: All this work to generate this kind of images.


Due to those large files this application was taking long time to finish it’s calculations 1h-3h, hence I started to transcript it into a parallel paradigm using python as well.

The problem begins when I tried to benchmark the parallel version and compare with the single threaded one. The single threaded in some runs was being faster than the parallel version! That was driving me crazy! I don’t know why, but something told me that I should take a look at the processor state (my laptop is a Dell XPS 15 L502x with i7 processor).

And damn! I was right! With the turbo boost enabled [3] the computer running multiple threads got hotter faster and then slowed the clock speed, therefore being slower than the single thread version, or just slightly faster (depending on how hot the day was).

So, to disable the turbo boost, I used, from [1]:

# echo 1 > /sys/devices/system/cpu/intel_pstate/no_turbo

And then the magic happened! In this way, with the parallel version fighting in fair conditions with single thread version the expected results came up.

I’ll not do a long discussion over the data, but just to summarize:

  • When the code was running with turbo boost enable, the time needed to complete the simulation using the parallel version was only by 4.13 % smaller than the single threaded version (Simulation 1);
  • Now, with turbo boost disable, the non parallel version took 42.02 % more time time than the parallel version – Oh, yeah! – (Simulation 3);
  • Running the code into n-crap-vidia, with optimus [2], again, we got a nice speed up of 48.34 % (comparing the bigger time to the smaller) (Simulation 4);
  • The parallel code running directly into cpu (Simulation 3) took 2.61 % more time than into n-crap-vidia (Simulation 4). However, this mismatch is so small and I just performed a single simulation that it is not possible to verify any trend here;
  • The single thread version running with turbo boost enabled (Simulation 1) was 24.21 % faster than the single threaded version when turbo boost was disabled (Simulation 3);
  • The parallel version with turbo boost disabled (Simulation 3) was 8.77 % faster than the parallel version with turbo boost enabled (Simulation 1);

From the above analysis we can conclude:

  • This variable clock speed is a pain in the ass when doing benchmarks!!! Even disabling the turbo boost, the clock can also be reduced if the temperature is high;
  • As the major programs are still single threaded leaving the turbo boost enabled is a good idea;
  • For very demanding multiple process or multiple threaded programs, it’s a good idea disabling the turbo boost;
  • Using the GPU through bumblebee seems interesting and deserves further tests.

All the data used to analyze the performance and speed up due to the code parallelism are shown clicking here ->

Simulation 1: With turbo boost enabled

single_threadFig. 2: Simulation 1 – Single thread version.


multi_threadFig. 3: Simulation 1: Parallel threads version.


leonardo@AL:~/projects/machPQ$ time python machPQ_s_plot.py teste.adf 1.E-6 63. ; time python machPQ_teste_parallel.py teste.adf 1.E-6 63.
Abrindo arquivo de dados…
…OK!
Iniciando processamento…
…OK!
Gravando resultados em disco…
…OK!

Tempo de processamento: 186.784282

real 3m7.005s
user 3m7.135s
sys 0m0.079s
Abrindo arquivo de dados…
…OK!
Iniciando processamento…
…OK!
Gravando resultados em disco…
…OK!

Tempo de processamento: 179.066593

real 2m59.248s
user 5m14.349s
sys 1m11.704s


Simulation 2: With turbo boost enabled and running into n-crap-vidia

leonardo@AL:~/projects/machPQ$ time optirun python machPQ_s_plot.py teste.adf 1.E-6 63. ; time optirun python machPQ_teste_parallel.py teste.adf 1.E-6 63.
Abrindo arquivo de dados…
…OK!
Iniciando processamento…
…OK!
Gravando resultados em disco…
…OK!

Tempo de processamento: 203.956192

real 3m52.100s
user 3m24.476s
sys 0m0.228s
Abrindo arquivo de dados…
…OK!
Iniciando processamento…
…OK!
Gravando resultados em disco…
…OK!

Tempo de processamento: 183.662801

real 3m20.575s
user 5m29.300s
sys 0m58.710s


Simulation 3: With turbo boost disabled

single_thread_noturboFig. 4: Simulation 3 – Single thread version.


multi_thread_noturboFig. 5: Simulation 3 – Parallel threads version.


leonardo@AL:~/projects/machPQ$ time python machPQ_s_plot.py teste.adf 1.E-6 63. ; time python machPQ_teste_parallel.py teste.adf 1.E-6 63.Abrindo arquivo de dados…
…OK!
Iniciando processamento…
…OK!
Gravando resultados em disco…
…OK!

Tempo de processamento: 232.012078

real 3m52.313s
user 3m52.349s
sys 0m0.107s
Abrindo arquivo de dados…
…OK!
Iniciando processamento…
…OK!
Gravando resultados em disco…
…OK!

Tempo de processamento: 163.367201

real 2m43.608s
user 4m36.375s
sys 1m22.991s


Simulation 4: With turbo boost disabled and running into n-crap-vidia

leonardo@AL:~/projects/machPQ$ time optirun python machPQ_s_plot.py teste.adf 1.E-6 63. ; time optirun python machPQ_teste_parallel.py teste.adf 1.E-6 63.
Abrindo arquivo de dados…
…OK!
Iniciando processamento…
…OK!
Gravando resultados em disco…
…OK!

Tempo de processamento: 236.172199

real 3m59.293s
user 3m56.594s
sys 0m0.125s
Abrindo arquivo de dados…
…OK!
Iniciando processamento…
…OK!
Gravando resultados em disco…
…OK!

Tempo de processamento: 159.207409

real 2m41.755s
user 4m35.806s
sys 1m18.623s


References:

[1] – http://luisjdominguezp.tumblr.com/post/19610447111/disabling-turbo-boost-in-linux
[2] – http://bumblebee-project.org/
[3] – http://en.wikipedia.org/wiki/Intel_Turbo_Boost

Acknowledgements

English revised by my love @anielampm =) Thank you!!

a silhouette of a person's head and shoulders, used as a default avatar

Após 1 ano sem postar absolutamente nada, precisei "forçar" um pouco as coisas: - Tirei uma certificação (ISTQB CTFL); - Parei um pouco o desenvolvimento e estou me concentrando em criar um processo p/ a equipe de teste na empresa onde trabalho.

Após 1 ano sem postar absolutamente nada, precisei "forçar" um pouco as coisas: - Tirei uma certificação (ISTQB CTFL); - Parei um pouco o desenvolvimento e estou me concentrando em criar um processo p/ a equipe de teste na empresa onde trabalho. A idéia é uniformizar o modus operandi e termos ferramentas e índices para não esquentarmos mais a cabeça com artefatos de qualidade questionável, como