Graphviz/Example

From ScientificComputing
Jump to: navigation, search

As an example for using Graphviz, we are drawing a flow chart.

[leonhard@euler09 ~]$ ls
test.gv
[leonhard@euler09 ~]$ cat test.gv
digraph {
 label="Getting help with the Euler cluster"

 "Consult the wiki https://scicomp.ethz.ch"[shape="box",style=rounded];
 "Check the FAQ"[shape="box",style=rounded];
 "Use search box"[shape="box",style=rounded];
 "Look at application pages"[shape="box",style=rounded];
 "Problem solved ?"[shape="box",style=rounded];
 "Happy computing"[shape="box",style=rounded];
 "Contact cluster support"[shape="box",style=rounded];

 "Consult the wiki https://scicomp.ethz.ch" -> "Check the FAQ";
 "Consult the wiki https://scicomp.ethz.ch" -> "Use search box";
 "Consult the wiki https://scicomp.ethz.ch" -> "Look at application pages";
 "Check the FAQ" -> "Problem solved ?";
 "Use search box" -> "Problem solved ?";
 "Look at application pages" -> "Problem solved ?";
 "Problem solved ?" -> "Happy computing"[label="yes"];
 "Problem solved ?" -> "Contact cluster support"[label="no"];
}
[leonhard@euler09 ~]$ module load gcc/4.8.2 python/2.7.6 graphviz/2.38
Autoloading openblas/0.2.13_seq
[leonhard@euler09 ~]$ bsub -n 1 -W 0:05 -R "rusage[mem=50]" "dot -Tpng test.gv -o test.png"
Generic job.
Job <34267333> is submitted to queue <normal.4h>.
[leonhard@euler09 ~]$ bjobs
JOBID      USER       STAT  QUEUE      FROM_HOST   EXEC_HOST   JOB_NAME   SUBMIT_TIME
34267333   leonhard   PEND  normal.4h  euler09                 * test.png Dec 21 08:16
[leonhard@euler09 ~]$ bjobs
JOBID      USER       STAT  QUEUE      FROM_HOST   EXEC_HOST   JOB_NAME   SUBMIT_TIME
34267333   leonhard   RUN   normal.4h  euler09     e1021       * test.png Dec 21 08:16
[leonhard@euler09 ~]$ bjobs
No unfinished job found
[leonhard@euler09 ~]$ ls
lsf.o34267333  test.gv  test.png
[leonhard@euler09 ~]$

You can find the resource usage summary of the job in the LSF log file.

Simple flowchart created with Graphviz