Skip to content

Commit

Permalink
Merge pull request #27 from jpwhite4/app_ident
Browse files Browse the repository at this point in the history
Improved application classification code.
  • Loading branch information
jpwhite4 authored Feb 13, 2017
2 parents 20d6583 + 305e36d commit 290f89d
Show file tree
Hide file tree
Showing 9 changed files with 1,065 additions and 104 deletions.
250 changes: 250 additions & 0 deletions db/migrations/6.5.0-6.6.0/modw_supremm.sql
Original file line number Diff line number Diff line change
@@ -0,0 +1,250 @@

USE `modw_supremm`;

DROP TRIGGER IF EXISTS `modw_supremm`.`executable_BUPD`;
DROP TRIGGER IF EXISTS `modw_supremm`.`executable_BINS`;
DROP TABLE IF EXISTS `application_hint`;

ALTER TABLE `application`
ADD `application_fosid` int(11) NOT NULL DEFAULT -1 AFTER `license_type`,
ADD `url` varchar(256) COLLATE utf8_unicode_ci DEFAULT NULL AFTER `application_fosid`;

CREATE TABLE `application_fos` (
`id` int(11) NOT NULL,
`description` varchar(256) COLLATE utf8_unicode_ci NOT NULL,
PRIMARY KEY (`id`)
) ENGINE=MyISAM DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci;

LOCK TABLES `modw_supremm`.`application_fos` WRITE, `modw_supremm`.`application` WRITE;
DELETE IGNORE FROM `modw_supremm`.`application_fos`;
DELETE IGNORE FROM `modw_supremm`.`application`;
INSERT INTO `modw_supremm`.`application` (id, name, license_type, application_fosid, url) VALUES
(-1,'NA','permissive',-1,NULL),
(0,'uncategorized','permissive',1,NULL),
(1,'adcirc','proprietary',1,NULL),
(2,'amber','permissive',2,'http://ambermd.org/'),
(3,'berkeleygw','permissive',1,NULL),
(4,'cactus','permissive',3,'http://cactuscode.org/'),
(5,'casino','proprietary',1,NULL),
(6,'ccsm','permissive',1,NULL),
(7,'cesm','permissive',4,'http://www.cesm.ucar.edu/'),
(8,'charmm','permissive',1,NULL),
(9,'cp2k','permissive',5,'https://www.cp2k.org/'),
(10,'cpmd','proprietary',5,NULL),
(11,'desmond','proprietary',1,NULL),
(12,'enzo','permissive',6,'http://enzo-project.org/'),
(13,'gadget','permissive',6,NULL),
(14,'gamess','permissive',7,NULL),
(15,'gpaw','permissive',1,NULL),
(16,'gromacs','permissive',2,'http://www.gromacs.org/'),
(17,'homme','permissive',4,'https://www.homme.ucar.edu/'),
(18,'lammps','permissive',2,'http://lammps.sandia.gov/'),
(19,'lattice boltzmann','permissive',1,NULL),
(20,'mcnpx','proprietary',1,NULL),
(21,'milc','permissive',8,'http://physics.indiana.edu/~sg/milc.html'),
(22,'mpiblast','permissive',1,NULL),
(23,'namd','permissive',2,'http://www.ks.uiuc.edu/Research/namd/'),
(24,'nwchem','permissive',7,'http://www.nwchem-sw.org/index.php/Main_Page'),
(25,'openfoam','permissive',9,'http://www.openfoam.com/'),
(26,'opensees','permissive',10,'http://opensees.berkeley.edu/'),
(27,'paratec','permissive',5,'http://www.nersc.gov/users/software/applications/materials-science/paratec/'),
(28,'q-espresso','permissive',5,'http://www.quantum-espresso.org/'),
(29,'siesta','permissive',5,'http://departments.icmab.es/leem/siesta/'),
(30,'specfem3d','permissive',10,'https://github.com/geodynamics/specfem3d'),
(31,'superlu','permissive',1,NULL),
(32,'vasp','proprietary',5,NULL),
(33,'wrf','permissive',4,NULL),
(34,'pegasus','proprietary',1,NULL),
(35,'rosetta','permissive',2,'https://www.rosettacommons.org'),
(36,'cybershake','unknown',1,NULL),
(37,'hpcc','permissive',11,'http://icl.cs.utk.edu/hpcc/'),
(38,'aesop','unknown',1,NULL),
(39,'qcff','unknown',1,NULL),
(40,'linpack','permissive',11,'http://www.netlib.org/linpack/'),
(41,'ior','permissive',11,'https://github.com/LLNL/ior'),
(42,'imb','permissive',1,NULL),
(43,'mpi-tile-io','permissive',1,NULL),
(44,'charm++','permissive',1,NULL),
(45,'wien2k','permissive',1,NULL),
(46,'pstgf','unknown',1,NULL),
(47,'stgf','unknown',1,NULL),
(48,'stgfz','unknown',1,NULL),
(49,'parsec','permissive',1,NULL),
(50,'enkf','permissive',1,NULL),
(51,'dsmc','permissive',1,NULL),
(52,'p-flapw','permissive',1,NULL),
(53,'hisq','unknown',1,NULL),
(54,'petsc','permissive',1,NULL),
(55,'h2mol','permissive',1,NULL),
(56,'numactl','permissive',1,NULL),
(57,'matmult','permissive',1,NULL),
(58,'mitgcm','proprietary',1,NULL),
(59,'dl_poly','permissive',2,'http://www.ccp5.ac.uk/DL_POLY_CLASSIC/'),
(60,'vmd','permissive',12,NULL),
(61,'gaussian','proprietary',7,'http://www.gaussian.com/'),
(62,'qmcchem','permissive',5,NULL),
(63,'olympus','unknown',1,NULL),
(64,'visit','permissive',12,'http://www.visitusers.org'),
(65,'meep','permissive',1,NULL),
(66,'sweep3d','permissive',1,NULL),
(67,'wannier90','permissive',1,NULL),
(68,'abinit','permissive',1,NULL),
(69,'qwalk','permissive',5,'http://qwalk.github.io/mainline/'),
(70,'octopus','permissive',1,NULL),
(71,'fdtd','proprietary',13,NULL),
(72,'gipaw','permissive',1,NULL),
(73,'acesiii','permissive',1,NULL),
(74,'q-chem','proprietary',5,NULL),
(75,'castep','proprietary',1,NULL),
(76,'rmhd','permissive',1,NULL),
(77,'aerosoft gasp','proprietary',1,NULL),
(78,'chroma','permissive',8,'http://jeffersonlab.github.io/chroma/'),
(79,'a.out','permissive',1,NULL),
(80,'stellarbox','permissive',1,NULL),
(81,'rocflo','unknown',1,NULL),
(82,'bsr hbd3','unknown',1,NULL),
(83,'mlrho','permissive',1,NULL),
(84,'harm3d','permissive',3,'http://dx.doi.org/10.1088/0004-637X/692/1/411'),
(85,'bsr','unknown',1,NULL),
(86,'nek5000','permissive',9,NULL),
(87,'cfdem','permissive',1,NULL),
(88,'spec','permissive',3,'https://www.black-holes.org/SpEC.html'),
(89,'cdp','unknown',1,NULL),
(90,'swan','permissive',1,NULL),
(91,'mpsolve','permissive',1,NULL),
(92,'openggcm','permissive',1,NULL),
(93,'fdl3di','permissive',1,NULL),
(94,'tmdmpi','unknown',1,NULL),
(95,'gh3d2m','permissive',1,NULL),
(96,'mc3dp','unknown',1,NULL),
(97,'fd3d','permissive',1,NULL),
(98,'3dsg','unknown',1,NULL),
(99,'cmaq_cctm','permissive',1,NULL),
(100,'zeus-mp','permissive',14,'http://www.netpurgatory.com/zeusmp.html'),
(101,'zasp','unknown',1,NULL),
(102,'ifortddwntl.om','unknown',1,NULL),
(103,'uts_ws','unknown',1,NULL),
(104,'transfer','unknown',1,NULL),
(105,'mangll_dgae_snell','unknown',1,NULL),
(106,'md1_mpi','unknown',1,NULL),
(107,'flash4','permissive',1,NULL),
(108,'mhd3d','permissive',14,NULL),
(109,'lesmpi_rankine.a','unknown',1,NULL),
(110,'graph500','permissive',1,NULL),
(111,'nrlmol','unknown',1,NULL),
(112,'PROPRIETARY','permissive',1,NULL),
(113,'adf','proprietary',1,NULL),
(114,'maker','permissive',1,NULL),
(115,'python','permissive',1,NULL),
(116,'nemo','permissive',5,'https://engineering.purdue.edu/gekcogrp/software-projects/nemo5/'),
(117,'lsms','permissive',1,NULL),
(118,'aims','proprietary',1,NULL),
(119,'cnvnator','permissive',1,NULL),
(120,'matlab','permissive',1,NULL),
(121,'arps','permissive',1,NULL),
(122,'chargemol','permissive',1,NULL),
(123,'rsqsim','permissive',1,NULL),
(124,'gizmo','permissive',1,'http://www.tapir.caltech.edu/~phopkins/Site/GIZMO.html'),
(125,'uspex','permissive',1,'http://uspex.stonybrook.edu/uspex.html'),
(126,'hoomd','permissive',1,NULL),
(127,'dumses','permissive',1,NULL),
(128,'titan2d','permissive',1,'https://vhub.org/resources/titan2d'),
(129,'astrogk','permissive',1,'http://newton.physics.uiowa.edu/~ghowes/astrogk/'),
(130,'snoopy','permissive',1,'http://ipag.osug.fr/~lesurg/snoopy_doc/html/index.html'),
(131,'r','permissive',15,'https://www.r-project.org/'),
(132,'unknown (ran under a debugger)','permissive',1,NULL),
(133,'ncbi-blast','permissive',1,'http://blast.ncbi.nlm.nih.gov/Blast.cgi'),
(134,'gnu-octave','permissive',1,'https://www.gnu.org/software/octave/'),
(135,'garli','permissive',1,'http://wiki.hpc.ufl.edu/doc/Garli'),
(136,'orca','permissive',1,'https://orcaforum.cec.mpg.de/'),
(137,'paraview','permissive',12,'http://www.paraview.org/'),
(138,'dirac','permissive',1,'http://diracprogram.org/doku.php'),
(139,'gatk','permissive',1,'https://www.broadinstitute.org/gatk/'),
(140,'varscan','permissive',1,'http://varscan.sourceforge.net/'),
(141,'picard','permissive',1,'http://broadinstitute.github.io/picard/'),
(142,'setsm','permissive',16,'http://www.pgc.umn.edu/elevation/stereo/'),
(143,'gdal','permissive',1,'http://www.gdal.org/'),
(144,'citcoms','permissive',10,'https://geodynamics.org/cig/software/citcoms/'),
(145,'adda','permissive',17,'https://www.openhub.net/p/adda'),
(146,'meld','permissive',2,'https://github.com/laufercenter/meld'),
(147,'osiris','permissive',17,'http://epp.ist.utl.pt/wp/osiris/'),
(148,'chimera','permissive',12,'https://www.cgl.ucsf.edu/chimera'),
(149,'rockstar-galaxies','permissive',6,'https://bitbucket.org/pbehroozi/rockstar-galaxies'),
(150,'swift','permissive',1,'http://swift-lang.org/'),
(151,'castro','permissive',18,'http://boxlib-codes.github.io/Castro/'),
(152,'mdtest','permissive',1,'https://sourceforge.net/projects/mdtest/'),
(153,'waveqlab3d','permissive',1,'https://www.scec.org/publication/7004'),
(154,'msflukss','permissive',14,'http://dl.acm.org/citation.cfm?id=2616499'),
(155,'awp-odc','permissive',10,'https://github.com/HPGeoC/awp-odc-os'),
(156,'fluent','proprietary',9,'http://www.ansys.com/'),
(157,'ls-dyna','permissive',1,'http://www.oasys-software.com/dyna/en/software/ls-dyna.shtml'),
(158,'psdns','permissive',19,'http://www.cs.odu.edu/~mln/ltrs-pdfs/conf-hpc-95-p1.pdf'),
(159,'openatom','permissive',2,'http://charm.cs.illinois.edu/OpenAtom/'),
(160,'changa','permissive',6,'http://www-hpcc.astro.washington.edu/tools/changa.html'),
(161,'maestro','permissive',18,'http://boxlib-codes.github.io/MAESTRO/'),
(162,'caffe','permissive',20,'http://caffe.berkeleyvision.org/'),
(163,'hpcg','permissive',11,'https://software.sandia.gov/hpcg/html/index.html'),
(164,'feap','permissive',21,'http://www.ce.berkeley.edu/~sanjay/FEAP/feap.html'),
(165,'system applications','permissive',22,NULL),
(166,'star-ccm+','proprietary',9,'http://www.ce.berkeley.edu/~sanjay/FEAP/feap.html'),
(167,'neo-rxchf','permissive',23,NULL),
(168,'episimdemics','permissive',24,'http://charm.cs.uiuc.edu/research/episim'),
(169,'alya','permissive',9,'http://www.bsc.es/es/computer-applications/alya-system'),
(170,'distuf','permissive',19,NULL),
(171,'eve','permissive',25,'https://tavazoielab.c2b2.columbia.edu/EVE/'),
(172,'moose','permissive',26,'http://mooseframework.org/'),
(173,'X11 applications','permissive',22,NULL),
(174,'specfem2d','permissive',10,'https://github.com/geodynamics/specfem2d'),
(175,'hadoop','permissive',27,'https://github.com/glennklockwood/myhadoop/'),
(176,'supremm','permissive',28,'http://xdmod.sourceforge.net/'),
(177,'vpic','permissive',29,'https://github.com/losalamos/vpic'),
(178,'rmgdft','permissive',5,'https://sourceforge.net/p/rmgdft/wiki/Home/'),
(179,'ramses','permissive',6,'http://dx.doi.org/10.1051/0004-6361:20011817'),
(180,'lsqr','permissive',10,'http://www.cs.ucf.edu/~lwang/LSQR.html'),
(181,'cg-md','permissive',2,'http://pubs.acs.org/doi/abs/10.1021/ct400727q'),
(182,'ppm','permissive',19,'https://www.xsede.org/documents/271087/586927/Woodward.pdf'),
(183,'wsmp','permissive',1,'http://researcher.watson.ibm.com/researcher/view_group.php?id=1426'),
(184,'lsu3shell','permissive',1,'https://arxiv.org/abs/1602.02965'),
(185,'sord','permissive',10,'http://gely.github.io/coseis/docs/SORD.html'),
(186,'grips','permissive',1,'https://bluewaters.ncsa.illinois.edu/documents/10157/c321b78f-5176-495c-b34b-a229dbbf96a4'),
(187,'plascomcm','permissive',17,'https://bitbucket.org/xpacc/plascomcm'),
(188,'mconv','permissive',14,'https://bluewaterssymposium2015.sched.org/event/38Pr/astro-robert-f-stein-ab-initial-models-of-solar-activity'),
(189,'INTERACTIVE','permissive',1,NULL),
(190,'cgmd','permissive',2,'https://vothgroup.uchicago.edu/research/multiscale-theory-and-simulations-biomolecular-systems'),
(191,'3dh','permissive',29,'http://www.ncsa.illinois.edu/news/stories/ESSsolar/'),
(192,'hmc','permissive',8,NULL),
(193,'SYSTEM TESTING','permissive',22,NULL);
INSERT INTO
`modw_supremm`.`application_fos` (id, description)
VALUES
(-1,'NA'),
(1,'uncategorized'),
(2,'Molecular Dynamics'),
(3,'General Relativity'),
(4,'Climate and Weather'),
(5,'Material Science'),
(6,'Cosmology'),
(7,'Computational Chemistry'),
(8,'Quantum Chromo Dynamics'),
(9,'Computational Fluid Dynamics'),
(10,'Earthquakes/Seismology'),
(11,'Benchmarking'),
(12,'Visualization'),
(13,'Atmostpheric Science'),
(14,'Magnetohydrodynamics'),
(15,'Statistical Analysis'),
(16,'Earth Science'),
(17,'Physics'),
(18,'Stellar Atmospheres and Supernovae'),
(19,'Turbulence'),
(20,'Machine Learning'),
(21,'Finite Element Analysis'),
(22,'None'),
(23,'Quantum Chemistry'),
(24,'Social Networks'),
(25,'Cellular Evolution'),
(26,'Computational Mechanics'),
(27,'Map Reduce'),
(28,'System Monitoring'),
(29,'Plasmas/Magnetosphere');
UNLOCK TABLES
118 changes: 118 additions & 0 deletions etl/js/config/supremm/app_ident.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,118 @@
"use strict";

module.exports = function(configfile) {

var fs = require("fs");
var appconf = JSON.parse(fs.readFileSync(configfile, 'utf8'));

var i;
for (i = 0; i < appconf.length; i++) {
appconf[i].realname = appconf[i].name;
if (appconf[i].license_type != "permissive") {
appconf[i].name = "PROPRIETARY";
}
}

var pathregex = [];
var execregex = [];
var simplematches = [];

var init = function() {

var pathmatch = [];
var pathappid = [];
var legacyexact = [];
var legacyappid = [];
var execmatch = [];
var execappid = [];

var i, j;
for (i = 0; i < appconf.length; i++) {
if (appconf[i].name == 'NA' || appconf[i].name == 'uncategorized') {
continue;
}

if (appconf[i].pathmatch) {
pathmatch.push('(' + appconf[i].pathmatch.join('\|') + ')');
pathappid.push(i);
}

if (appconf[i].execmatch) {
execmatch.push('(' + appconf[i].execmatch.join('\|') + ')');
execappid.push(i);
}

if (appconf[i].hints) {
var exact = [];
for (j = 0; j < appconf[i].hints.length; j++) {
exact.push('^' + appconf[i].hints[j] + '$');
simplematches.push({pattern: appconf[i].hints[j].toLocaleLowerCase(), appid: i});
}
if (exact.length > 0) {
legacyexact.push('(' + exact.join('\|') + ')');
legacyappid.push(i);
}
}
}

if (pathmatch.length > 0) {
pathregex.push({regex: new RegExp(pathmatch.join('\|'), 'i'), appid: pathappid});
}

if (execmatch.length > 0) {
execregex.push({regex: new RegExp(execmatch.join('\|'), 'i'), appid: execappid});
}

if (legacyexact.length > 0) {
execregex.push({regex: new RegExp(legacyexact.join('\|'), 'i'), appid: legacyappid});
}
};

var getmatch = function(regex, cmdline) {
var appindex = null;

var match = regex.exec(cmdline);
if (match) {
match.some(function(value, index) {
if (index > 0 && value) {
appindex = index - 1;
return true;
}
return false;
});
}

return appindex;
};

init();

return function(cmdline) {
var i, index, execstr, cmdtoks;

cmdtoks = cmdline.split('/');
execstr = cmdtoks[cmdtoks.length - 1];

for (i = 0; i < pathregex.length; i++) {
index = getmatch(pathregex[i].regex, cmdline);
if (index !== null) {
return appconf[pathregex[i].appid[index]];
}
}

for (i = 0; i < execregex.length; i++) {
index = getmatch(execregex[i].regex, execstr);
if (index !== null) {
return appconf[execregex[i].appid[index]];
}
}
var lowercmd = execstr.toLocaleLowerCase();
for (i = 0; i < simplematches.length; i++) {
if (lowercmd.indexOf(simplematches[i].pattern) !== -1) {
return appconf[simplematches[i].appid];
}
}
return null;
};
};

Loading

0 comments on commit 290f89d

Please sign in to comment.