Re: [gembud] Parallel gif creation scripts?

Here is a perl subroutine that will plot out images much faster than individual 
shell scripts:

605 sub pltlgtn() {
 606   my ($timeslice,$roi,$gfn,$pmxno,$pmxext,$roi_cnt,$count);
 607 #   open (PLTLGTN, "| $apps/gdplot3_gf > /dev/null") || die "Cannot run 
gdplot3_gf";
 608    open (PLTLGTN, "| $apps/gdplot3_gf") || die "Cannot run gdplot3_gf";
 609    print PLTLGTN "\$respond=yes\n";
 610    print PLTLGTN "GLEVEL   = 0\n";
 611    print PLTLGTN "GVCORD   = none\n";
 612    print PLTLGTN "PANEL    = 0\n";
 613    print PLTLGTN "SKIP     = 0\n";
 614    print PLTLGTN "SCALE    = 0\n";
 615    print PLTLGTN "GDPFUN   = $pltfun // AGE\n";
 616    print PLTLGTN "TYPE     = f\n";
 617    print PLTLGTN "CONTUR   = 0\n";
 618    print PLTLGTN "CINT     =  \n";
 619    print PLTLGTN "LINE     =  \n";
 620    print PLTLGTN "FINT     = $fint\n";
 621    print PLTLGTN "FLINE    = $fline\n";
 622    print PLTLGTN "HILO     =  \n";
 623    print PLTLGTN "HLSYM    =  \n";
 624 #   print PLTLGTN "CLRBAR   = -1/H/UC/.5;1/.5/-1|.8/2/111/1/l/hw\n";
 625    print PLTLGTN "CLRBAR   = 0\n";
 626    print PLTLGTN "WIND     =  \n";
 627    print PLTLGTN "REFVEC   =  \n";
 628    print PLTLGTN "TITLE    = 0\n";
 629    print PLTLGTN "TEXT     = 1/21//hw\n";
 630    print PLTLGTN "CLEAR    = yes\n";
 631    print PLTLGTN "IJSKIP   = 0\n";
 632    print PLTLGTN "MAP      = $gem_map\n";
 633    print PLTLGTN "MSCALE   = 0\n";
 634    print PLTLGTN "LATLON   =  \n";
 635    print PLTLGTN "BOXLIN   = 0\n";
 636    print PLTLGTN "REGION   = plot\n";
 637    print PLTLGTN "STNPLT   =  \n";
 638    print PLTLGTN "SATFIL   =  \n";
 639    print PLTLGTN "RADFIL   =  \n";
 640    print PLTLGTN "IMCBAR   =  \n";
 641    print PLTLGTN "LUTFIL   =  \n";
 642    print PLTLGTN "STREAM   =  \n";
 643    print PLTLGTN "POSN     = 0\n";
 644    print PLTLGTN "COLORS   = 1\n";
 645    print PLTLGTN "MARKER   = 0\n";
 646    print PLTLGTN "GRDLBL   = 0\n";
 647    print PLTLGTN "FILTER   = no\n";
 648    $roi_cnt=0;
 649    foreach $roi (@gem_garea) {
 650      printf("%d GAREA=%s\t",$gem_zone[$roi_cnt],$roi);
 651      printf("PROJ=%s\t",$gem_proj[$roi_cnt]);
 652      printf("bbox=%s\t",$bboxes[$roi_cnt]);
 653      printf("scale=%s\n",$gem_scale[$roi_cnt]);
 654      print PLTLGTN "PROJ     = $gem_proj[$roi_cnt]\n";
 655      print PLTLGTN "GAREA    = $roi\n";
 656      my $pmxno=${lightning_l};
 657      $count=0;
 658      foreach $timeslice (@dattimes) {
 659         $pmxext = sprintf("%03d",$pmxno++);
 660         $gfn="I${gem_zone[$roi_cnt]}${pmxext}.gif";
 661         print PLTLGTN "GDFILE   = ${tmp_grd}_${gem_zone[$roi_cnt]}\n";
 662         print PLTLGTN "GDATTIM  = $timeslice\n";
 663         print PLTLGTN "DEVICE   = gf|$gfn|$resol\n";
 664         print PLTLGTN "SAVE 
P_LGTN${dat_times[$count]}_${gem_zone[$roi_cnt]}.nts\n";
 665         print PLTLGTN "l\nr\n\n";
 666         $count++;
 667      }
 668     $roi_cnt++;
 669    }
 670    print PLTLGTN "e\n";
 671    close(PLTLGTN);
 672    return;
 673 }

- Stephen 

-----Original Message-----
From: gembud-bounces@xxxxxxxxxxxxxxxx [mailto:gembud-bounces@xxxxxxxxxxxxxxxx] 
On Behalf Of Matt Foster
Sent: Tuesday, May 10, 2011 7:24 AM
To: gembud@xxxxxxxxxxxxxxxx
Subject: [gembud] Parallel gif creation scripts?

I'm using a shell script that runs gdplot3 to generate many GIF images 
from our WRF model output.  This script is taking over 10 minutes to 
complete, and we would like to cut that runtime down some.  I've toyed 
with the idea of breaking the one script up into perhaps 4 scripts and 
launch them all in parallel.

What kind of issues might arise from this?

Is there a better way to accomplish our end goal?

TIA for any suggestions!

Matt

-- 
Do not go where the path may lead; go instead where there is no path and leave 
a trail.
-- Ralph Waldo Emerson



  • 2011 messages navigation, sorted by:
    1. Thread
    2. Subject
    3. Author
    4. Date
    5. ↑ Table Of Contents
  • Search the gembud archives: