Return-Path: X-Original-To: apmail-singa-commits-archive@minotaur.apache.org Delivered-To: apmail-singa-commits-archive@minotaur.apache.org Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by minotaur.apache.org (Postfix) with SMTP id C9C4217EC2 for ; Sat, 20 Jun 2015 14:46:47 +0000 (UTC) Received: (qmail 75406 invoked by uid 500); 20 Jun 2015 14:46:47 -0000 Delivered-To: apmail-singa-commits-archive@singa.apache.org Received: (qmail 75388 invoked by uid 500); 20 Jun 2015 14:46:47 -0000 Mailing-List: contact commits-help@singa.incubator.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: dev@singa.incubator.apache.org Delivered-To: mailing list commits@singa.incubator.apache.org Received: (qmail 75378 invoked by uid 99); 20 Jun 2015 14:46:47 -0000 Received: from Unknown (HELO spamd2-us-west.apache.org) (209.188.14.142) by apache.org (qpsmtpd/0.29) with ESMTP; Sat, 20 Jun 2015 14:46:47 +0000 Received: from localhost (localhost [127.0.0.1]) by spamd2-us-west.apache.org (ASF Mail Server at spamd2-us-west.apache.org) with ESMTP id 4AB1A1A59D7 for ; Sat, 20 Jun 2015 14:46:47 +0000 (UTC) X-Virus-Scanned: Debian amavisd-new at spamd2-us-west.apache.org X-Spam-Flag: NO X-Spam-Score: 1.791 X-Spam-Level: * X-Spam-Status: No, score=1.791 tagged_above=-999 required=6.31 tests=[KAM_ASCII_DIVIDERS=0.8, KAM_LAZY_DOMAIN_SECURITY=1, T_RP_MATCHES_RCVD=-0.01, URIBL_BLOCKED=0.001] autolearn=disabled Received: from mx1-eu-west.apache.org ([10.40.0.8]) by localhost (spamd2-us-west.apache.org [10.40.0.9]) (amavisd-new, port 10024) with ESMTP id 1igqOGuoCJRd for ; Sat, 20 Jun 2015 14:46:33 +0000 (UTC) Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by mx1-eu-west.apache.org (ASF Mail Server at mx1-eu-west.apache.org) with SMTP id 6B3732541E for ; Sat, 20 Jun 2015 14:46:32 +0000 (UTC) Received: (qmail 74977 invoked by uid 99); 20 Jun 2015 14:46:31 -0000 Received: from git1-us-west.apache.org (HELO git1-us-west.apache.org) (140.211.11.23) by apache.org (qpsmtpd/0.29) with ESMTP; Sat, 20 Jun 2015 14:46:31 +0000 Received: by git1-us-west.apache.org (ASF Mail Server at git1-us-west.apache.org, from userid 33) id 5A134E35D6; Sat, 20 Jun 2015 14:46:31 +0000 (UTC) Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit From: wangwei@apache.org To: commits@singa.incubator.apache.org Date: Sat, 20 Jun 2015 14:46:33 -0000 Message-Id: <74ed415f44d24b01a1b053ea5505ce9a@git.apache.org> In-Reply-To: <3d09fd0a74664784b10515cef7b8b0c6@git.apache.org> References: <3d09fd0a74664784b10515cef7b8b0c6@git.apache.org> X-Mailer: ASF-Git Admin Mailer Subject: [3/4] incubator-singa git commit: SINGA-21 Code Review SINGA-21 Code Review add cpplint tool Project: http://git-wip-us.apache.org/repos/asf/incubator-singa/repo Commit: http://git-wip-us.apache.org/repos/asf/incubator-singa/commit/0f3a8ff4 Tree: http://git-wip-us.apache.org/repos/asf/incubator-singa/tree/0f3a8ff4 Diff: http://git-wip-us.apache.org/repos/asf/incubator-singa/diff/0f3a8ff4 Branch: refs/heads/master Commit: 0f3a8ff4827d927a0d05b6dc23c2647530aa0f2e Parents: a32102e Author: wang sheng Authored: Sat Jun 20 19:20:06 2015 +0800 Committer: wang sheng Committed: Sat Jun 20 19:20:06 2015 +0800 ---------------------------------------------------------------------- script/graph.py | 22 - script/node.sh | 71 - tool/cpplint.py | 6323 ++++++++++++++++++++++++++++++++++++++++++++++++++ tool/graph.py | 22 + tool/node.sh | 71 + 5 files changed, 6416 insertions(+), 93 deletions(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/incubator-singa/blob/0f3a8ff4/script/graph.py ---------------------------------------------------------------------- diff --git a/script/graph.py b/script/graph.py deleted file mode 100644 index 17aaea7..0000000 --- a/script/graph.py +++ /dev/null @@ -1,22 +0,0 @@ -import sys -import pygraphviz -import networkx as nx -from networkx.readwrite import json_graph -import json - - -if __name__=='__main__': - print sys.argv - if len(sys.argv)<3: - print 'usage: draw the network graph\npython graph.py JSON_DAT FIG_FILE' - sys.exit() - - with open(sys.argv[1]) as fd: - nodelink=json.load(fd) - G=json_graph.node_link_graph(nodelink) - A = nx.to_agraph(G) - A.layout('dot', args='-Nfontsize=10 -Nwidth=".2" -Nheight=".2" -Nmargin=0 \ - -Gfontsize=8') - A.draw(sys.argv[2]) - - http://git-wip-us.apache.org/repos/asf/incubator-singa/blob/0f3a8ff4/script/node.sh ---------------------------------------------------------------------- diff --git a/script/node.sh b/script/node.sh deleted file mode 100755 index 74e0d8a..0000000 --- a/script/node.sh +++ /dev/null @@ -1,71 +0,0 @@ -#!/bin/bash -if [[ $# < 2 || ! -f $2 ]] -then - echo "Usage: process/folder management" - echo "[cat, create, delete, kill, ls, ps, reset, scp, ssh] hostfile [args]" - echo " cat hostfile file--- cat the file on every node in hostfile" - echo " create hostfile folder--- create the folder on every node in hostfile" - echo " delete hostfile folder--- delete the folder on every node in hostfile" - echo " kill hostfile job_name--- kill the job on every node in hostfile" - echo " ls hostfile folder--- list the folder on every node in hostfile" - echo " ps hostfile job_name--- ps aux|grep job_name on every node in hostfile" - echo " reset hostfile folder--- delete and create the folder on every node in hostfile" - echo " scp hostfile local_dir [remote_dir]--- copy the local_dir to remote_dir on every node in hostfile, if remote_dir is omitted, remote_dir=local_dir" - echo " ssh hostfile--- test whether the nodes in hostfile are alive" - echo "each line in hostfile is a node name followed by a space and other fields" - exit -fi - -ssh_options="-oStrictHostKeyChecking=no \ --oUserKnownHostsFile=/dev/null \ --oLogLevel=quiet" - -hosts=(`cat $2 |cut -d ' ' -f 1`) - -for i in ${hosts[@]} -do - if [ $1 == "cat" ] - then - cmd="cat $3" - elif [ $1 == "create" -o $1 == "reset" ] - then - cmd="mkdir -p $3" - elif [ $1 == "delete" -o $1 == "reset" ] - then - cmd="rm -rf $3" - elif [ $1 == "kill" ] - then - cmd="ps ax|pgrep $3 |xargs kill" - elif [ $1 == "ls" ] - then - cmd="ls -l $3" - elif [ $1 == "scp" ] - then - local_dir=$3 - remote_dir=$3 - if [ $# -eq 4 ] - then - remote_dir=$4 - fi - r='' - if [[ -d $3 ]] - then - r='-r' - fi - echo "scp $r $local_dir $i:$remote_dir" - scp $r $local_dir $i:$remote_dir - elif [ $1 == "ssh" ] - then - cmd="exit" - elif [ $1 == "ps" ] - then - cmd="ps ax|pgrep $3" - else - echo "Incorrect commands:" $1 - fi - if [ $1 != "scp" ] - then - echo $cmd - ssh $i $cmd - fi -done