| Les deux révisions précédentesRévision précédenteProchaine révision | Révision précédente |
| formation:astrosim2017para4dummies [2017/06/30 12:43] – [Principle, inputs & outputs] equemene | formation:astrosim2017para4dummies [2017/07/07 07:25] (Version actuelle) – [5 W/2H : Why ? What ? Where ? When ? Who ? How much ? How ?] equemene |
|---|
| * **Where ?** On workstations, cluster nodes, laptop (well configured), inside terminals | * **Where ?** On workstations, cluster nodes, laptop (well configured), inside terminals |
| * **Who ?** For people who want to open the hood | * **Who ?** For people who want to open the hood |
| * **How ?** Applying some simples commands (essentially shell ones) | * **How ?** Applying some simple commands (essentially shell ones) |
| |
| ===== Session Goal ===== | ===== Session Goal ===== |
| |
| One Solution:<code> | One Solution:<code> |
| echo $(/usr/bin/time /tmp/PiMC-jmylq.sh 100000 2>&1 | egrep '(Elapsed|Iterations)' | awk '{ print $NF }' | tr '\n' '/')1 | bc -l | echo $(/usr/bin/time /tmp/PiMC-$USER.sh 100000 2>&1 | egrep '(Elapsed|Iterations)' | awk '{ print $NF }' | tr '\n' '/')1 | bc -l |
| </code> | </code> |
| |
| |
| Example of code for previous results:<code> | Example of code for previous results:<code> |
| for i in $(seq 10 ) ; do echo $(/usr/bin/time /tmp/PiMC-jmylq.sh 100000 2>&1 | egrep '(Elapsed|Iterations)' | awk '{ print $NF }' | tr '\n' '/')1 | bc -l ; done</code> | for i in $(seq 10 ) ; do echo $(/usr/bin/time /tmp/PiMC-$USER.sh 100000 2>&1 | egrep '(Elapsed|Iterations)' | awk '{ print $NF }' | tr '\n' '/')1 | bc -l ; done</code> |
| |
| From 1000 to 1000000, 1 time: | From 1000 to 1000000, 1 time: |
| |
| Example of code for previous results:<code> | Example of code for previous results:<code> |
| for POWER in $(seq 3 1 6); do ITERATIONS=$((10**$POWER)) ; echo -ne $ITERATIONS'\t' ; echo $(/usr/bin/time /tmp/PiMC-jmylq.sh $ITERATIONS 2>&1 | egrep '(Elapsed|Iterations)' | awk '{ print $NF }' | tr '\n' '/')1 | bc -l ; done</code> | for POWER in $(seq 3 1 6); do ITERATIONS=$((10**$POWER)) ; echo -ne $ITERATIONS'\t' ; echo $(/usr/bin/time /tmp/PiMC-$USER.sh $ITERATIONS 2>&1 | egrep '(Elapsed|Iterations)' | awk '{ print $NF }' | tr '\n' '/')1 | bc -l ; done</code> |
| ==== Split the execution in equal parts ==== | ==== Split the execution in equal parts ==== |
| |
| Examples of statistics on estimators: | Examples of statistics on estimators: |
| With //magic// ''Rmmmms-$USER.r'' command, we can extract statistics on different times | With //magic// ''Rmmmms-$USER.r'' command, we can extract statistics on different times |
| * for //Elapsed time// : ''cat /tmp/PiMC-jmylq_201706291231.log | grep Elapsed | awk '{ print $NF }' | /tmp/Rmmmms-$USER.r'':<code>1.96 2.02 1.985 1.987 0.01888562 0.009514167</code> | * for //Elapsed time// : ''cat /tmp/PiMC-$USER_201706291231.log | grep Elapsed | awk '{ print $NF }' | /tmp/Rmmmms-$USER.r'':<code>1.96 2.02 1.985 1.987 0.01888562 0.009514167</code> |
| * for //System time// : ''cat /tmp/PiMC-jmylq_201706291231.log | grep System | awk '{ print $NF }' | /tmp/Rmmmms-$USER.r'':<code>0.09 0.22 0.14 0.139 0.03665151 0.2617965</code> | * for //System time// : ''cat /tmp/PiMC-$USER_201706291231.log | grep System | awk '{ print $NF }' | /tmp/Rmmmms-$USER.r'':<code>0.09 0.22 0.14 0.139 0.03665151 0.2617965</code> |
| * for //User time// : ''cat /tmp/PiMC-jmylq_201706291231.log | grep User | awk '{ print $NF }' | /tmp/Rmmmms-$USER.r'':<code>59.12 59.81 59.375 59.436 0.2179297 0.003670394</code> | * for //User time// : ''cat /tmp/PiMC-$USER_201706291231.log | grep User | awk '{ print $NF }' | /tmp/Rmmmms-$USER.r'':<code>59.12 59.81 59.375 59.436 0.2179297 0.003670394</code> |
| |
| The previous results show that the variability, in this cas, in | The previous results show that the variability, in this cas, in |
| </code> | </code> |
| |
| | {{ :formation:pimc_1_64.png?600 |}} |
| ==== Other sample codes (used for courses) ==== | ==== Other sample codes (used for courses) ==== |
| |