fetchInto($row)) { $rkeys = array_keys($row); foreach ($rkeys as $rkey) { $systems[] = $row[$rkey]; } } # build case statement $retval = "CASE system "; foreach ($systems as $thissystem) { if ( $thissystem!="%" ) { $retval .= " WHEN '".$thissystem."' THEN ".cpuhours($db,$thissystem)."\n"; } } $retval .= " END"; } elseif ( $system=="nautilus" ) { $retval = "8*nodect*TIME_TO_SEC(walltime)/3600.0"; } else if ( $system=="kid" ) { $retval = "12*nodect*TIME_TO_SEC(walltime)/3600.0"; } else if ( $system=="x1" ) { $retval = "TIME_TO_SEC(cput)/3600.0"; } return $retval; } # sorting criteria for each metric # here mostly as an example of what's possible function sort_criteria($fn) { # if ( $fn=='cpuhours_vs_groupname' ) return "ORDER BY cpuhours DESC"; if ( isset($_POST['order']) ) return "ORDER BY ".$_POST['order']." DESC"; if ( xaxis($fn)=="institution" ) return "ORDER BY institution"; return ""; } # site-specific logic for determining institution function institution_match() { # OSC # return "SUBSTRING(username,1,3) AS institution"; # NICS return "SUBSTRING(account,1,2) AS institution"; } # bucket sizes function bucket_maxs($xaxis) { # if ( $xaxis=='nproc' ) return array("1","4","8","16","32","64","128","256","512","1024"); if ( $xaxis=='nproc' ) return array("512","2048","8192","16384","32768","65536"); if ( $xaxis=='nproc_norm' ) return array("0.01","0.10","0.25","0.5","0.75"); if ( $xaxis=='walltime' ) return array("1:00:00","4:00:00","8:00:00","24:00:00","48:00:00","96:00:00","168:00:00","320:00:00"); if ( $xaxis=='walltime_req' ) return array("1:00:00","4:00:00","8:00:00","24:00:00","48:00:00","96:00:00","168:00:00","320:00:00"); if ( $xaxis=='qtime' ) return array("1:00:00","4:00:00","8:00:00","24:00:00","48:00:00","96:00:00","168:00:00","320:00:00"); if ( $xaxis=='mem_kb' ) return array("262144","1048576","4194304","12582912","33554432"); if ( $xaxis=='vmem_kb' ) return array("262144","1048576","4194304","12582912","33554432"); return array(); } # list of software packages to look for in job scripts function software_list() { $list=array( "3dcavity", "3dh", "a_out", "abaqus", "abinit", "accorrsf", "aces2", "aces3", "adf", "agk", "airebo", "AliEn", "amber", "anolis", "ansys", "arps", "arts", "ash", "autodock", "awm", "bam", "berkeleygw", "blat", "bolztran", "brams-opt", "bugget", "cactus", "calc_group_stats", "cam", "cando", "casino", "cbl", "ccsm", "cctm", "cdo", "cdp", "cfd++", "cfl3d", "charmm", "chemshell", "chimera", "chroma", "cilk", "cluster", "coarsen", "compaware", "convectionimr", "cpmd", "cql3d", "crystal", "csurfs", "cvm", "dalexec", "dasquad", # "decypher", "delphi", "delta5d", "dghbc", "dhybrid", "dissens", "distuf", "dlpoly", "dns2d", "dock", "dolt", "dtms", "eden", "eigen.x", "enzo", "esmf", "eulacc", "ex_e", "f-plane", "falkon", "fd3d", "fedvr", "fidap", "fdl3di", "flotran", "flow3d", "fluent", "foam", "foxexe", "fsweep", "ftb", "gadget", "gamess", "gaussian", "gdl", "gen.v4", "genlatmu", "geosgcm", "glast", "GreenSolver", "grads", "grib", "grmhd", "gromacs", "gtc", "h2mol", "h3d", "halo", "harness", "harris", "hchbm", "hd", "hd_nonuma", "hdfsubdomain", "hf", "hfb", "hfodd", "hmc", "hmmer", "homme", "hoomd", "hpcc", "hpl", "hsi", "hsphere", "hy3s", "idl", "ifs", "imb", "inca", "intestine3d", "ior", "jaguar", "josephson", "jrmc", "ker_filter_par", "lammps", "lautrec", "lesmpi", "lfm", "lmf", "lsdyna", "lsms", "m2md", "madness", "maestro", "mathematica", "matlab", "mcrothers", "mctas", "mddriver", "mdsim", "measurements", "meep", "meta", "mhd3d", "mhdam", "milc", "mitgcmuv", "mkelly", "mlane", "mm5", "molaf3di", "molcas", "moldife", "moldive", "molpro", "mpcugles", "mpi_dgels", "mpi_dgesv", "mpi_dpos", "mpi_helium", "mpi-multi", "mpiasm", "mpiblast", "mrbayes", "mrobb6dipzz", "mykim9dgt", "nag", "namd", "ncbi", "nektar", "nemd", "newseriesrun", "nga_cfb", "nicam", "ntsolve", "nwchem", "octave", "omen", "omgred", "onepartm", # "openeye", "overlap", "p3dfft", "parallelEAM", # "param", "paratec", "paraview", "parsec", "paup", "pbar", "pcg", "perseus", "phasta", "pic-star", "pkdgrav", "pmcl3d", "polly", "pop", "preps", "preqx", "prog_ccm_sph", "prog_hf", "propagators", "psolve", "pstg", "pwscf", "python", "qb", "qchem", "qmc", "qwalk", "R", "radhyd", "readall_parallel", "reduce", "rosetta", "root", "roth", "s-param", "s3d", # "sable", "sas", "scalapack", "sddt", "sfeles", "sgf", "siesta", "sigma", "simpleio", "sms", "sne3d", "sord", "sovereign", "spdcp", "sses", "stata", "stationaryAccretionShock3D", "sus", "sweqx", "swh1b", "swiftwrap", "tantalus", "tbms", "tdcc2d", "tdse", "tetradpost", "testpio", "tfe", "tsc", "turbo", "turbomole", "upc", "vasp", "vbc", "vhone", "visit", "vmd", "vpic", "wrf", "xgc", "xmfdn", "yt", "zeus", "zk3", "zNtoM" ); return $list; } # REs to identify particular software packages in job scripts # if a RE is not specified, the package name from software_list() # is searched for instead function software_match_list() { # default to "script LIKE '%pkgname%' foreach (software_list() as $pkg) { $pkgmatch[$pkg]="script LIKE '%".$pkg."%' OR software LIKE '%".$pkg."%'"; } # exceptions # REGEXP match is ***MUCH*** slower than regular LIKE matching # in MySQL, so don't use REGEXP unless you really need it. $pkgmatch['3dh'] = "script LIKE '%./3dh%'"; $pkgmatch['a_out'] = "script LIKE '%a.out%'"; $pkgmatch['abaqus'] = "( script LIKE '%abaqus%' OR software LIKE '%abaqus%' )"; $pkgmatch['abinit'] = "( script LIKE '%abinit%' OR script LIKE '%abinis%' OR script LIKE '%abinip%' )"; $pkgmatch['aces2'] = "script LIKE '%xaces2%'"; $pkgmatch['adf'] = "script LIKE '%adf%'"; $pkgmatch['AliEn'] = "( script LIKE '%aliroot%' OR script LIKE '%agent.startup%' )"; $pkgmatch['amber'] = "( script LIKE '%amber%' OR script LIKE '%sander%' OR script LIKE '%pmemd%' OR script LIKE '%sviol%' OR script LIKE '%SingleJob%' OR script LIKE '%MINJob%' OR script LIKE '%run_md_mpi.csh%' OR script LIKE '%./MD%' )"; $pkgmatch['arts'] = "( script LIKE '%arts%' AND script NOT LIKE '%starts%' )"; $pkgmatch['ash'] = "script LIKE '%ash_1%'"; $pkgmatch['blat'] = "script LIKE '%blat %'"; $pkgmatch['boltztran'] = "(script LIKE '%boltzpar%')"; $pkgmatch['cbl'] = "( script LIKE '% cbl%' OR script LIKE '%pcbl%' OR script LIKE '%biolib%' )"; $pkgmatch['ccsm'] = "( script LIKE '%ccsm%' OR script LIKE '%cpl%csim%clm%pop%cam%' )"; $pkgmatch['chemshell'] = "script LIKE '%chemsh%'"; $pkgmatch['cpmd'] = "script LIKE '%cpmd%'"; $pkgmatch['crystal'] = "script LIKE '%Pcrystal%'"; $pkgmatch['decypher'] = "script REGEXP '(decypher|dc_(target|make|blast|phrap)|TimeLogic)'"; $pkgmatch['dipole'] = "( script LIKE '%dipole.cxx.op%' OR script LIKE '%asym4sp .cxx.op%' OR script LIKE '%asymm4sp.cxx.op%' )"; $pkgmatch['dissens'] = "script LIKE '%dissens.x%'"; $pkgmatch['dns2d'] = "( script LIKE '%DNS2d.x%' OR script LIKE '%DNS2d_%.x%' OR script LIKE '%code2.x%' OR script LIKE '%spcal2d.x%' )"; $pkgmatch['dock'] = "( script LIKE '%dock5%' OR script LIKE '%dock6%' OR script LIKE '%sphgen%' OR script LIKE '%mopac%' )"; $pkgmatch['esp'] = "script LIKE '%/esp %'"; $pkgmatch['ex_e'] = "script LIKE '%ex.e%'"; $pkgmatch['fluent'] = "( script like '%fluent%' OR software LIKE '%fluent%' )"; $pkgmatch['fsweep'] = "( script LIKE '%fsweep.exe%' OR script LIKE '%fsweep2.exe%' )"; $pkgmatch['gamess'] = "( script LIKE '%gamess%' OR script LIKE '%rungms%' OR script LIKE '%rungmx%' )"; $pkgmatch['gaussian'] = "( script LIKE '%g98%' OR script LIKE '%g03%' OR script LIKE '%g09%' )"; $pkgmatch['glast'] = "( script LIKE '%glast%' OR script LIKE '%gp run%' )"; $pkgmatch['gromacs'] = "( script LIKE '%gromacs%' OR script LIKE '%grompp%' OR script LIKE '%mdrun%' OR script LIKE '%rgmx%' )"; $pkgmatch['gtc'] = "( script LIKE '%gtc%' OR script LIKE '%gts%' )"; $pkgmatch['harness'] = "script LIKE '%test_harness_driver.py%'"; $pkgmatch['harris'] = "script LIKE '%harris.cxx.op%'"; $pkgmatch['hd'] = "script LIKE '%/HD %'"; $pkgmatch['hf'] = "script LIKE '%hf/hf%'"; $pkgmatch['hmmer'] = "( script LIKE '%hmmer%' OR script LIKE '%hmmp%' )"; $pkgmatch['hpl'] = "script LIKE '%xhpl%'"; $pkgmatch['idl'] = "( script LIKE '%idl %' OR software LIKE '%idl%' )"; $pkgmatch['ifs'] = "script LIKE '%ifsMASTER%'"; $pkgmatch['imb'] = "script LIKE '%IMB-%'"; $pkgmatch['ior'] = "script LIKE '%IOR %'"; $pkgmatch['lammps'] = "( script LIKE '%lammps%' OR script LIKE '% lmp_%' OR script LIKE '%/lmp_%' )"; $pkgmatch['madness'] = "( script LIKE '%m-a-d-n-e-s-s%' OR script LIKE '%slda%' )"; $pkgmatch['matlab'] = "( script LIKE '%matlab%' OR software LIKE '%matlab%' )"; $pkgmatch['meta'] = "( script LIKE '%anti.meta%' OR script LIKE '%para.meta%' OR script LIKE '%xray.meta%' )"; $pkgmatch['mm5'] = "( SCRIPT LIKE '%mm5%' AND NOT SCRIPT LIKE '%womm5%' )"; $pkgmatch['mrbayes'] = "( script LIKE '%mrbayes%' OR script LIKE '%mb-parallel%' )"; $pkgmatch['namd'] = "( script LIKE '%namd%' OR script LIKE '%md.sh%' )"; $pkgmatch['ncbi'] = "( script LIKE '%ncbi%' OR script LIKE '%blastall%' OR script LIKE '%blastpgp%' OR script LIKE '%fastacmd%' OR script LIKE '%formatdb%' OR script LIKE '%rpsblast%' OR script LIKE '%seqtest%' )"; $pkgmatch['nga_fb'] = "( script LIKE '%nga_fb%' OR script LIKE '%nga_cfb%' )"; $pkgmatch['openeye'] = "( script LIKE '%babel3%' OR script LIKE '%checkcff%' OR script LIKE '%chunker%' OR script LIKE '%fred2%' OR script LIKE '%fredPA%' OR script LIKE '%ligand_info%' OR script LIKE '%makefraglib%' OR script LIKE '%makerocsdb%' OR script LIKE '%nam2mol%' OR script LIKE '%omega2%' OR script LIKE '%szybki%' )"; $pkgmatch['paraview'] = "script LIKE '%pvserver%'"; $pkgmatch['pwscf'] = "( script LIKE '%pwscf%' OR script LIKE '%pw.x%' OR script LIKE '%dos.x%' )"; $pkgmatch['radhyd'] = "( script LIKE '%radhyd%' OR script LIKE '%rhd_hyb%' )"; $pkgmatch['reduce'] = "( script LIKE '%reduce_1%' OR script LIKE '%reduce_eta%' )"; $pkgmatch['root'] = "script LIKE '%\nroot -q%'"; $pkgmatch['rosetta'] = "( script LIKE '%rosetta.%' OR script LIKE '%/rr %' )"; $pkgmatch['roth'] = "script LIKE '%/ROTH%'"; $pkgmatch['sable'] = "( script LIKE '%sable%' AND script NOT LIKE '%DISABLE%' )"; $pkgmatch['sas'] = "( script LIKE '%\nsas%' OR software LIKE '%sas%' OR queue LIKE '%sas%' )"; $pkgmatch['tbms'] = "( script LIKE '%tbms%dvm%' OR script LIKE '%distr%dvm%' OR script LIKE '%jac%dvm%' OR script LIKE '%mt%dvm%' )"; $pkgmatch['turbo'] = "script LIKE '%pturbo.x%'"; $pkgmatch['upc'] = "script LIKE '%upcrun%'"; $pkgmatch['vasp'] = "script LIKE '%vasp%'"; $pkgmatch['visit'] = "( script LIKE '%visit%' AND script NOT LIKE '%revisit%' ) "; $pkgmatch['vpic'] = "( script LIKE '%npic%' OR script LIKE '%open.cxx.op%' )"; $pkgmatch['zeus'] = "( script LIKE '%/zeus%' OR script LIKE '%/pglobal%' )"; $pkgmatch['zNtoM'] = "( script LIKE '%z1to3%' OR script LIKE '%z4to6%' OR script LIKE '%z7to9%' OR script LIKE '%z10to12%' OR script LIKE '%z13to15%' )"; # package matches with dependencies on other package matches $pkgmatch['R'] = "( ( script LIKE '%\nR %' OR script LIKE '%Rscript %' ) AND NOT ( ".$pkgmatch['gaussian']." OR ".$pkgmatch['adf']." ) )"; $pkgmatch['arps'] = "( script LIKE '%arps%' AND NOT ( ".$pkgmatch['wrf']." ) )"; $pkgmatch['cam'] = "( script LIKE '%cam%' AND NOT ( ".$pkgmatch['ccsm']." ) AND NOT ( ".$pkgmatch['nicam']." ) )"; $pkgmatch['cdp'] = "( script LIKE '%cdp%' AND NOT ( ".$pkgmatch['ifs']." ) )"; $pkgmatch['charmm'] = "( script LIKE '%charmm%' AND NOT ( ".$pkgmatch['chemshell']." ) )"; $pkgmatch['hmc'] = "( ( script LIKE '%hmc%' OR script LIKE '%./run_%.sh%' ) AND NOT ( ".$pkgmatch['namd']." ) AND NOT ( ".$pkgmatch['tantalus']." ) )"; $pkgmatch['hsi'] = "( ( script LIKE '%hsi %' OR script LIKE '%htar %' ) AND NOT ( ".$pkgmatch['nicam']." ) AND NOT ( ".$pkgmatch['ifs']." ) )"; $pkgmatch['hy3s'] = "( ( script LIKE '%SSA%' OR script LIKE '%HyJCMSS-%' ) AND NOT ( ".$pkgmatch['ccsm']." ) AND NOT ( ".$pkgmatch['milc']." ) AND NOT ( ".$pkgmatch['wrf']." ) AND NOT ( ".$pkgmatch['nicam']." ) )"; $pkgmatch['milc'] = "( ( script LIKE '%milc%' OR script LIKE '%su3_%' OR script LIKE '%switch%.csh%' ) AND NOT ( ".$pkgmatch['nicam']." ) AND NOT ( ".$pkgmatch ['hmc']." ) )"; $pkgmatch['omen'] = "( script LIKE '%omen%' AND NOT ( ".$pkgmatch['milc']." ) )"; $pkgmatch['overlap']="( script LIKE '%overlap_%' AND NOT ( ".$pkgmatch['nicam']." ) )"; $pkgmatch['pcg'] = "( script LIKE '%pcg%' AND script NOT LIKE '%request%' AND NOT ( ".$pkgmatch['gen.v4']." ) )"; $pkgmatch['pop'] = "( script LIKE '%pop%' AND NOT ( ".$pkgmatch['ccsm']." ) AND NOT ( ".$pkgmatch['hmc']." ) )"; $pkgmatch['propagators'] = "( script LIKE '%propagators%' AND NOT ( ".$pkgmatch['milc']." ) )"; $pkgmatch['qb'] = "( script LIKE '%qb%' AND NOT ( ".$pkgmatch['milc']." ) AND NOT ( ".$pkgmatch['amber']." ) )"; $pkgmatch['quest'] = "( script LIKE '%quest%' AND script NOT LIKE '%request%' AND NOT ( ".$pkgmatch['gen.v4']." ) )"; $pkgmatch['radhyd'] = "( script LIKE '%radhyd%' AND NOT ( ".$pkgmatch['chimera']." ) )"; $pkgmatch['sses'] = "( script LIKE '%sses%' AND NOT ( ".$pkgmatch['milc']." ) )"; $pkgmatch['turbomole'] = "( script LIKE '%turbomole%' AND NOT ( ".$pkgmatch['chemshell']." ) )"; return $pkgmatch; } ?>