Showing posts with label greenfield. Show all posts
Showing posts with label greenfield. Show all posts

Saturday, January 2, 2016

(skipped) summary of greenfield work

ms02 network aging simulation were done using a single lambda with a connectivity cutoff.

I need to rerun the simulation with two lambda values. 

I moved the simulation job to Gordon instead. 

transfer file from byte to greenfield


A new directory
~/crucible/mc48o9p/hqin2/mactower-network-failure-simulation/


Wednesday, September 16, 2015

*** greenfield, netaging.pbs running results, each run is 6.5 SU

Conclusions: Each run is 8:30pm - 3am = 6.5 hours. 

20140914 8:30pm :: qsub netaging.pbs 

[hqin2@greenfield ms02GINPPI]$ cat netaging.pbs
#!/bin/bash
# Request 15 cores
#PBS -l nodes=1:ppn=15
#  Request 7days  of cpu time
#PBS -l walltime=7:00:00:00

module load R/3.2.1-mkl

echo hostname

pwd
cd /crucible/mc48o9p/hqin2/mactower-network-failure-simulation-master/ms02GINPPI
pwd

numactl -C +0 R --vanilla --slave -f net-aging-sim-20150915.R --args 92 92 0.02 1.0 2000  &
numactl -C +1 R --vanilla --slave -f net-aging-sim-20150915.R --args 93 93 0.02 1.0 2000  &
numactl -C +2 R --vanilla --slave -f net-aging-sim-20150915.R --args 94 94 0.02 1.0 2000  &
numactl -C +3 R --vanilla --slave -f net-aging-sim-20150915.R --args 95 95 0.02 1.0 2000  &
numactl -C +4 R --vanilla --slave -f net-aging-sim-20150915.R --args 96 96 0.02 1.0 2000  &
numactl -C +5 R --vanilla --slave -f net-aging-sim-20150915.R --args 97 97 0.02 1.0 2000  &
numactl -C +6 R --vanilla --slave -f net-aging-sim-20150915.R --args 98 98 0.02 1.0 2000  &
numactl -C +7 R --vanilla --slave -f net-aging-sim-20150915.R --args 99 99 0.02 1.0 2000  &
numactl -C +8 R --vanilla --slave -f net-aging-sim-20150915.R --args 100 100 0.02 1.0 2000  &
numactl -C +9 R --vanilla --slave -f net-aging-sim-20150915.R --args 101 101 0.02 1.0 2000  &
numactl -C +10 R --vanilla --slave -f net-aging-sim-20150915.R --args 102 102 0.02 1.0 2000  &
numactl -C +11 R --vanilla --slave -f net-aging-sim-20150915.R --args 103 103 0.02 1.0 2000  &
numactl -C +12 R --vanilla --slave -f net-aging-sim-20150915.R --args 92 92 0.01 1.0 2000  &


wait



[hqin2@greenfield ms02GINPPI]$ ll -th dipgin.ms02.output/9[2-9]/popages/*2000*
-rw-r--r-- 1 hqin2 mc48o9p 33K Sep 15 02:55 dipgin.ms02.output/96/popages/cutoff.4.p.1.lambda.0.02.popsize.2000.time.2015Sep15_025515.txt
-rw-r--r-- 1 hqin2 mc48o9p 33K Sep 15 02:55 dipgin.ms02.output/95/popages/cutoff.4.p.1.lambda.0.02.popsize.2000.time.2015Sep15_025509.txt
-rw-r--r-- 1 hqin2 mc48o9p 33K Sep 15 02:54 dipgin.ms02.output/98/popages/cutoff.4.p.1.lambda.0.02.popsize.2000.time.2015Sep15_025456.txt
-rw-r--r-- 1 hqin2 mc48o9p 34K Sep 15 02:54 dipgin.ms02.output/97/popages/cutoff.4.p.1.lambda.0.02.popsize.2000.time.2015Sep15_025451.txt
-rw-r--r-- 1 hqin2 mc48o9p 34K Sep 15 02:54 dipgin.ms02.output/94/popages/cutoff.4.p.1.lambda.0.02.popsize.2000.time.2015Sep15_025442.txt
-rw-r--r-- 1 hqin2 mc48o9p 33K Sep 15 02:54 dipgin.ms02.output/99/popages/cutoff.4.p.1.lambda.0.02.popsize.2000.time.2015Sep15_025409.txt
-rw-r--r-- 1 hqin2 mc48o9p 33K Sep 15 02:52 dipgin.ms02.output/92/popages/cutoff.4.p.1.lambda.0.01.popsize.2000.time.2015Sep15_025240.txt
-rw-r--r-- 1 hqin2 mc48o9p 33K Sep 15 02:52 dipgin.ms02.output/93/popages/cutoff.4.p.1.lambda.0.02.popsize.2000.time.2015Sep15_025211.txt
-rw-r--r-- 1 hqin2 mc48o9p 33K Sep 15 02:50 dipgin.ms02.output/92/popages/cutoff.4.p.1.lambda.0.02.popsize.2000.time.2015Sep15_025058.txt

[hqin2@greenfield ms02GINPPI]$ ll -th dipgin.ms02.output/10[234]/popages/*2000*
-rw-r--r-- 1 hqin2 mc48o9p 33K Sep 15 02:54 dipgin.ms02.output/102/popages/cutoff.4.p.1.lambda.0.02.popsize.2000.time.2015Sep15_025438.txt
-rw-r--r-- 1 hqin2 mc48o9p 33K Sep 15 02:53 dipgin.ms02.output/103/popages/cutoff.4.p.1.lambda.0.02.popsize.2000.time.2015Sep15_025353.txt



[hqin2@greenfield ms02GINPPI]$ cat netaging.pbs.o2350 | grep 2000 | grep "1.0"
[1] "101"  "101"  "0.02" "1.0"  "2000"
 "100"  "100"  "0.02" "1.0"  "2000"
[1] "94"   "94"   "0.02" "1.0"  "2000"
[1] "92"   "92"   "0.02" "1.0"  "2000"
 "103"  "0.02" "1.0"  "2000"
 "102"  "0.02" "1.0"  "2000"
 "1.0"  "2000"
[1] "97"   "97"   "0.02" "1.0"  "2000"
 "1.0"  "2000"
[1] "95"   "95"   "0.02" "1.0"  "2000"
[1] "96"   "96"   "0.02" "1.0"  "2000"
 "99"   "99"   "0.02" "1.0"  "2000"
 "92"   "92"   "0.01" "1.0"  "2000"


Monday, September 14, 2015

(in progress)(to do) network aging popSize=2000


[hqin2@greenfield ms02GINPPI]$ cat netaging.pbs 
#!/bin/bash
# Request 15 cores
#PBS -l nodes=1:ppn=15
#  Request 2:30 minutes of cpu time
#PBS -l walltime=7:00:00:00

module load R/3.2.1-mkl

echo hostname

pwd
cd /crucible/mc48o9p/hqin2/mactower-network-failure-simulation-master/ms02GINPPI
pwd

numactl -C +0 R --vanilla --slave -f net-aging-sim-20150915.R --args 92 92 0.02 1.0 2000  &
numactl -C +1 R --vanilla --slave -f net-aging-sim-20150915.R --args 93 93 0.02 1.0 2000  &
numactl -C +2 R --vanilla --slave -f net-aging-sim-20150915.R --args 94 94 0.02 1.0 2000  &
numactl -C +3 R --vanilla --slave -f net-aging-sim-20150915.R --args 95 95 0.02 1.0 2000  &
numactl -C +4 R --vanilla --slave -f net-aging-sim-20150915.R --args 96 96 0.02 1.0 2000  &
numactl -C +5 R --vanilla --slave -f net-aging-sim-20150915.R --args 97 97 0.02 1.0 2000  &
numactl -C +6 R --vanilla --slave -f net-aging-sim-20150915.R --args 98 98 0.02 1.0 2000  &
numactl -C +7 R --vanilla --slave -f net-aging-sim-20150915.R --args 99 99 0.02 1.0 2000  &
numactl -C +8 R --vanilla --slave -f net-aging-sim-20150915.R --args 100 100 0.02 1.0 2000  &
numactl -C +9 R --vanilla --slave -f net-aging-sim-20150915.R --args 101 101 0.02 1.0 2000  &
numactl -C +10 R --vanilla --slave -f net-aging-sim-20150915.R --args 102 102 0.02 1.0 2000  &
numactl -C +11 R --vanilla --slave -f net-aging-sim-20150915.R --args 103 103 0.02 1.0 2000  &
numactl -C +12 R --vanilla --slave -f net-aging-sim-20150915.R --args 92 92 0.01 1.0 2000  &


wait



[hqin2@greenfield ms02GINPPI]$ qsub netaging.pbs 
2350.greenfield.psc.xsede.org
[hqin2@greenfield ms02GINPPI]$ qstat
Job ID                    Name             User            Time Use S Queue
------------------------- ---------------- --------------- -------- - -----
2104.greenfield            newRunNew.job    ismini          134:54:1 R batch          
2314.greenfield            runjob           hchen7          21:41:25 R batch          
2350.greenfield            netaging.pbs     hqin2                  0 R batch          
[hqin2@greenfield ms02GINPPI]$ qstat
Job ID                    Name             User            Time Use S Queue
------------------------- ---------------- --------------- -------- - -----
2104.greenfield            newRunNew.job    ismini          134:54:1 R batch          
2314.greenfield            runjob           hchen7          21:41:25 R batch          
2350.greenfield            netaging.pbs     hqin2                  0 R batch          
[hqin2@greenfield ms02GINPPI]$ 
[hqin2@greenfield ms02GINPPI]$ 
[hqin2@greenfield ms02GINPPI]$ 
[hqin2@greenfield ms02GINPPI]$ qstat -a

greenfield.psc.xsede.org: 
                                                                                  Req'd    Req'd       Elap
Job ID                  Username    Queue    Jobname          SessID  NDS   TSK   Memory   Time    S   Time
----------------------- ----------- -------- ---------------- ------ ----- ------ ------ --------- - ---------
2104.greenfield.psc.xs  ismini      batch    newRunNew.job     83468     1     30    --  150:00:00 R 116:11:48
2314.greenfield.psc.xs  hchen7      batch    runjob           139085     1     15    --   24:00:00 R  21:41:55
2350.greenfield.psc.xs  hqin2       batch    netaging.pbs      48203     1     15    --  168:00:00 R  00:00:12

[hqin2@greenfield ms02GINPPI]$ 

backup files from crucial to my data directory (in progress)



$ tar cf /arc/users/hqin2/ms02GINPPI.tar ms02GINPPI/ & 
[1] 17265
[hqin2@greenfield mactower-network-failure-simulation-master]$ ps
  PID TTY          TIME CMD
 1519 pts/10   00:00:00 bash
17265 pts/10   00:00:00 tar

17280 pts/10   00:00:00 ps

There some runtime errors during the tar operation. Maybe some simulation jobs were killed prematurely. 
$ tar: ms02GINPPI/dipgin.ms02.output/43/ms02_43.tab: Read error at byte 0, while reading 7680 bytes: Connection timed out
$ tar: ms02GINPPI/dipgin.ms02.output/49/popages/cutoff.4.p.1.lambda.0.02.popsize.2000.time.2014Oct22_043941.txt: Read error at byte 0, while reading 8192 bytes: Connection timed out
$ tar: ms02GINPPI/dipgin.ms02.output/133/ms02_133.tab: Read error at byte 0, while reading 1536 bytes: Connection timed out
$ tar: ms02GINPPI/dipgin.ms02.output/372/ms02_372.tab: Read error at byte 0, while reading 1536 bytes: Connection timed out
tar: ms02GINPPI/dipgin.ms02.output/71/popages/cutoff.4.p.1.lambda.0.02.popsize.2000.time.2015Feb17_113337.txt: Read error at byte 0, while reading 6656 bytes: Connection timed out
tar: ms02GINPPI/dipgin.ms02.output/71/ms02_71.tab: Read error at byte 0, while reading 8704 bytes: Connection timed out
tar: ms02GINPPI/dipgin.ms02.output/645/ms02_645.tab: Read error at byte 0, while reading 6656 bytes: Connection timed out
tar: ms02GINPPI/dipgin.ms02.output/324/ms02_324.tab: Read error at byte 0, while reading 9216 bytes: Connection timed out
tar: ms02GINPPI/dipgin.ms02.output/50/ms02_50.tab: Read error at byte 0, while reading 5632 bytes: Connection timed out
tar: ms02GINPPI/dipgin.ms02.output/68/popages/cutoff.4.p.1.lambda.0.02.popsize.2000.time.2015Feb05_212237.txt: Read error at byte 0, while reading 2048 bytes: Connection timed out
tar: ms02GINPPI/dipgin.ms02.output/86/popages/cutoff.4.p.0.6.lambda.0.02.popsize.2000.time.2015Feb01_021709.txt: Read error at byte 0, while reading 512 bytes: Connection timed out
tar: ms02GINPPI/dipgin.ms02.output/62/popages/cutoff.4.p.0.6.lambda.0.01.popsize.2000.time.2014Dec04_123712.txt: Read error at byte 0, while reading 7168 bytes: Connection timed out
tar: ms02GINPPI/dipgin.ms02.output/528/ms02_528.tab: Read error at byte 0, while reading 512 bytes: Connection timed out
tar: ms02GINPPI/dipgin.ms02.output/7/ms02_7.tab: Read error at byte 0, while reading 8704 bytes: Connection timed out
tar: ms02GINPPI/dipgin.ms02.output/428/ms02_428.tab: Read error at byte 0, while reading 1024 bytes: Connection timed out

tar: ms02GINPPI/dipgin.ms02.output/18/ms02_18.tab: Read error at byte 0, while reading 4096 bytes: Connection timed out








*** parallel runs of net-aging-sim-20150915.R -> net-aging-sim-2015Sep15.R



[hqin2@greenfield ms02GINPPI]$ cat netaging.pbs
#!/bin/bash
# Request 15 cores
#PBS -l nodes=1:ppn=15
#  Request 2:30 minutes of cpu time
#PBS -l walltime=7:00:00:00

module load R/3.2.1-mkl

echo hostname

pwd
cd /crucible/mc48o9p/hqin2/mactower-network-failure-simulation-master/ms02GINPPI
pwd

numactl -C +0 R --vanilla --slave -f net-aging-sim-20150915.R --args 95 95 0.02 1.0 50  &
numactl -C +1 R --vanilla --slave -f net-aging-sim-20150915.R --args 96 96 0.02 1.0 50  &
numactl -C +2 R --vanilla --slave -f net-aging-sim-20150915.R --args 97 97 0.02 1.0 50  &


wait



[hqin2@greenfield ms02GINPPI]$ qstat -u hqin2 -a

greenfield.psc.xsede.org: 
                                                                                  Req'd    Req'd       Elap
Job ID                  Username    Queue    Jobname          SessID  NDS   TSK   Memory   Time    S   Time
----------------------- ----------- -------- ---------------- ------ ----- ------ ------ --------- - ---------
2343.greenfield.psc.xs  hqin2       batch    netaging.pbs      44687     1     15    --  168:00:00 R  00:03:56



[hqin2@greenfield ms02GINPPI]$ ll -t dipgin.ms02.output/9[567]/popages/*0.02*
-rw-r--r-- 1 hqin2 mc48o9p 848 Sep 14 19:26 dipgin.ms02.output/97/popages/cutoff.4.p.1.lambda.0.02.popsize.50.time.2015Sep14_192617.txt
-rw-r--r-- 1 hqin2 mc48o9p 845 Sep 14 19:26 dipgin.ms02.output/95/popages/cutoff.4.p.1.lambda.0.02.popsize.50.time.2015Sep14_192616.txt

-rw-r--r-- 1 hqin2 mc48o9p 846 Sep 14 19:26 dipgin.ms02.output/96/popages/cutoff.4.p.1.lambda.0.02.popsize.50.time.2015Sep14_192613.txt



[hqin2@greenfield ms02GINPPI]$ cat netaging.pbs
#!/bin/bash
# Request 15 cores
#PBS -l nodes=1:ppn=15
#  Request 2:30 minutes of cpu time
#PBS -l walltime=7:00:00:00

module load R/3.2.1-mkl

echo hostname

pwd
cd /crucible/mc48o9p/hqin2/mactower-network-failure-simulation-master/ms02GINPPI
pwd

numactl -C +0 R --vanilla --slave -f net-aging-sim-20150915.R --args 95 95 0.02 1.0 150  &
numactl -C +1 R --vanilla --slave -f net-aging-sim-20150915.R --args 96 96 0.02 1.0 150  &
numactl -C +2 R --vanilla --slave -f net-aging-sim-20150915.R --args 97 97 0.02 1.0 150  &


wait



[hqin2@greenfield ms02GINPPI]$ qstat -u hqin2

greenfield.psc.xsede.org: 
                                                                                  Req'd    Req'd       Elap
Job ID                  Username    Queue    Jobname          SessID  NDS   TSK   Memory   Time    S   Time
----------------------- ----------- -------- ---------------- ------ ----- ------ ------ --------- - ---------

2344.greenfield.psc.xs  hqin2       batch    netaging.pbs      45653     1     15    --  168:00:00 R  00:21:47

[hqin2@greenfield ms02GINPPI]$ qstat
Job ID                    Name             User            Time Use S Queue
------------------------- ---------------- --------------- -------- - -----
2344.greenfield            netaging.pbs     hqin2           01:07:54 R batch 

/*Great. The Elapse time is 21 minutes but my CPU time is 3 times of it. So, I am running job in paralle. */

[hqin2@greenfield ms02GINPPI]$ ll -th dipgin.ms02.output/9[567]/popages/*txt
-rw-r--r-- 1 hqin2 mc48o9p 2.5K Sep 14 20:05 dipgin.ms02.output/95/popages/cutoff.4.p.1.lambda.0.02.popsize.150.time.2015Sep14_200529.txt
-rw-r--r-- 1 hqin2 mc48o9p 2.5K Sep 14 20:05 dipgin.ms02.output/96/popages/cutoff.4.p.1.lambda.0.02.popsize.150.time.2015Sep14_200528.txt
-rw-r--r-- 1 hqin2 mc48o9p 2.5K Sep 14 20:05 dipgin.ms02.output/97/popages/cutoff.4.p.1.lambda.0.02.popsize.150.time.2015Sep14_200527.txt
-rw-r--r-- 1 hqin2 mc48o9p  848 Sep 14 19:26 dipgin.ms02.output/97/popages/cutoff.4.p.1.lambda.0.02.popsize.50.time.2015Sep14_192617.txt
-rw-r--r-- 1 hqin2 mc48o9p  845 Sep 14 19:26 dipgin.ms02.output/95/popages/cutoff.4.p.1.lambda.0.02.popsize.50.time.2015Sep14_192616.txt


-rw-r--r-- 1 hqin2 mc48o9p  846 Sep 14 19:26 dipgin.ms02.output/96/popages/cutoff.4.p.1.lambda.0.02.popsize.50.time.2015Sep14_192613.txt
/*The three popsize.150 files are generated simultaneously. */



*** parallel runs on greenfield, example.R and example.pbs



helen:ms02GINPPI hqin$ cat example.R 
#20150914 testing parallel jobs on greenfield
# R CMD BATCH ./example.R --args 2 35 red
rm(list=ls())

source("lifespan.r")
source("network.r")

#R -f file --args start end
options(echo=TRUE) # if you want see commands in output file
args <- commandArgs(trailingOnly = TRUE)
print(args)
# trailingOnly=TRUE means that only your arguments are returned, check:
# print(commandsArgs(trailingOnly=FALSE))
start = as.integer(args[1]); start; 
end = as.integer(args[2]); end; 
tag = args[3]
  
myhost = 'greenfield'  # 'byte' 'blacklight' 'mactower'
myhost = 'byte'  # 'byte' 'blacklight' 'mactower'
myhost = 'helen'  # 'byte' 'blacklight' 'helen'

mydir = "/crucible/mc48o9p/hqin2/mactower-network-failure-simulation-master/ms02GINPPI"
if (myhost == 'byte') {  mydir = "/Users/hqin/github/mactower-network-failure-simulation/ms02GINPPI"
} else if (myhost == 'helen') { mydir = "/Users/hqin/github/mactower-network-failure-simulation/ms02GINPPI";  
}

print(paste("current dir is:", mydir))
list.files()
getwd()

print(paste("Now setwd"))
setwd(mydir)
list.files()

debug = 0; 
x = start:end 
outfile = paste( tag, start, end, "tab", sep='.')

write.csv( x, outfile, row.names=F)



[hqin2@greenfield ms02GINPPI]$ cat example.pbs
#!/bin/bash
# Request 15 cores
#PBS -l nodes=1:ppn=15
#  Request 1hr of cpu time
#PBS -l walltime=0:00:01:00

module load R/3.2.1-mkl
echo hostname

pwd
cd /crucible/mc48o9p/hqin2/mactower-network-failure-simulation-master/ms02GINPPI
pwd

numactl -C +0 R --vanilla --slave -f ./example.R --args 1 199999 '_zero' &
numactl -C +1 R --vanilla --slave -f ./example.R --args 2 299999 '_one' &
numactl -C +2 R --vanilla --slave -f ./example.R --args 3 399999 '_two' &
numactl -C +3 R --vanilla --slave -f ./example.R --args 4 499999 '_three' &
numactl -C +4 R --vanilla --slave -f ./example.R --args 4 499999 '_four' &
numactl -C +5 R --vanilla --slave -f ./example.R --args 4 499999 '_five' &
numactl -C +6 R --vanilla --slave -f ./example.R --args 4 499999 '_six' &
numactl -C +7 R --vanilla --slave -f ./example.R --args 4 499999 '_seven' &
numactl -C +8 R --vanilla --slave -f ./example.R --args 4 499999 '_eight' &
numactl -C +9 R --vanilla --slave -f ./example.R --args 4 499999 '_nine' &

wait

*** network aging simulation, net-aging-sim-2015Sep15.R


helen:ms02GINPPI hqin$ ll net-aging-sim-2014Sep*
-rw-r--r--  1 hqin  staff   4.2K Sep 14 18:37 net-aging-sim-2015Sep15.R
-rw-r--r--  1 hqin  staff   6.1K Sep 14 13:17 net-aging-sim-2015Sep7b.R


net-aging-sim-2015Sep15.R (aka net-aging-sim-20150915.R)
This script now takes argument for start and end ms02 networks, lambda, p and popSize
# R -f file --args start end lambda p popSize
#  R -f net-aging-sim-2014Sep15.R --args 1 1 0.002 0.95 10
# the network processing working inside of this work should be move outside of this script. 
# This script can iterate over ms02 networks with the same lambda, p, and popSize


#20150915Mon add argument for lambda, p, popSize

# 2014 Feb 17, change name "20131221.DIPandGIN.sim.aging_v2.R" to "net-aging-sim-2014Feb17.R"

# 2013 Dec 20, merge DIP PPI and Genetic Inxt Net -> Multi-net approach
rm(list=ls())

source("lifespan.r")
source("network.r")

#for debug
#  start =1; end = 1; lambda= 1/100; p = 0.95; popSize=5;


# R -f file --args start end lambda p popSize
#  R -f net-aging-sim-2014Sep15.R --args 1 1 0.002 0.95 10
options(echo=TRUE) # if you want see commands in output file
args <- commandArgs(trailingOnly = TRUE)
print(args)
# trailingOnly=TRUE means that only your arguments are returned, check:
# print(commandsArgs(trailingOnly=FALSE))
start = as.integer(args[1]); start; 
end = as.integer(args[2]); end; 
lambda = as.numeric(args[3]); lambda;
p = as.numeric(args[4]); p;
popSize = as.numeric(args[5]); popSize;


myhost = 'greenfield'  # 'byte' 'blacklight' 'mactower'
#myhost = 'byte'  # 'byte' 'blacklight' 'mactower'
myhost = 'helen';

mydir = "/crucible/mc48o9p/hqin2/mactower-network-failure-simulation-master/ms02GINPPI"
if (myhost == 'byte') {  mydir = "/Users/hqin/github/mactower-network-failure-simulation/ms02GINPPI"
} else if (myhost == 'helen') { mydir = "/Users/hqin/github/mactower-network-failure-simulation/ms02GINPPI";  
} 

mydir
setwd(mydir)

debug = 0; 

#essential gene info
essenTb = read.csv('SummaryRegressionHetHom2013Oct29.csv', colClasses=rep('character', 9))


for ( i in start:end) {
  path = paste('dipgin.ms02.output/', i, sep='')
  ms02file = paste('ms02_', i, ".tab", sep='')
  infile = paste( path, '/', ms02file, sep=""); print(infile)
  pairs = read.table( infile, header=T, sep="\t", colClass = c("character", "character", NA) )
  print(head(pairs))
  if(debug==9) {     pairs = pairs[1:1000,]  }
  pairs = pairs[ pairs$id1 != pairs$id2, ]  

  # How do the two data set overlap? DIP seems to contain some questionable orfs
  uniq.orf.from.pairs = unique(c(pairs$id1, pairs$id2)) #5496 ORF
  matches = uniq.orf.from.pairs %in% unique(essenTb$orf)
  table(matches)
  
  # label essential nodes, remove nonesse-nonessen pairs
  essentialORFs = essenTb$orf[essenTb$essenflag=='essential']
  pairs$essen1 = pairs$id1 %in% essentialORFs
  pairs$essen2 = pairs$id2 %in% essentialORFs
  #remove nonessen <-> nonessen intxn because they do not affect aging. 
  pairs$remove = ifelse( pairs$essen1==F & pairs$essen2==F, T, F  )
  pairs= pairs[! pairs$remove, ]  
  # 34052 for one ms02 network
  
  #how many essen <--> essen intxn? 
  pairs$inxnEE = pairs$essen1 & pairs$essen2
  table(pairs$inxnEE)
  #How many essen genes? 
  tmp = essentialORFs %in% unique(c(pairs$id1, pairs$id2)) 
  table(tmp)
  essentialORFsPPI = essentialORFs[tmp] #?????
  
  #get connectivities per node
  degreeTb = data.frame( table(c(pairs[,1], pairs[,2])))
  summary(degreeTb)
  degreeTb$ORF = as.character( degreeTb[,1])
  
  degreeCutoff = 4; #######!!!!!! degree=5 is the median
  tmp = essentialORFsPPI %in% degreeTb$ORF[degreeTb$Freq>degreeCutoff]
  GooddEssentialORFsPPI = essentialORFsPPI[tmp]
    
  if(debug >= 5){GooddEssentialORFsPPI = GooddEssentialORFsPPI[1:100]  }
  
  sim_names = c( "degreeCutoff","p", "lambda", "meanLS", "medianLS", "R","G", "GompAIC", "WeibAIC")
  sim       = t( c(NA,     NA,   NA,       NA,       NA,        NA,  NA,   NA,      NA))
  sim = data.frame(sim)
  names(sim) = sim_names

  full_age_dir = paste(path, '/', 'popages', sep='')
  system(paste('mkdir ', full_age_dir ))
  
      popAges = numeric(popSize)
      time1 = date()
      j=1; count = 0; 
      while ((j <= popSize) && ( count < popSize*30)) {
        count = count + 1;      
        print(paste("count=",count))
        currentNetworkAge = single_network_failure(lambda, p, pairs, GooddEssentialORFsPPI)
        if (currentNetworkAge > 0) {
          popAges[j] = currentNetworkAge      
          j = j+1
        } 
      }# end of j while-loop, population loop
            
      
      timestamp = format(Sys.time(), "%Y%b%d_%H%M%S")
      age.file.name=paste("cutoff", degreeCutoff, "p", p, "lambda", lambda, 'popsize',popSize, "time",timestamp, "txt", sep="." )
      full_age_file = paste( full_age_dir,'/', age.file.name, sep='')
      
      write.csv( popAges, full_age_file, row.names=F)
        
}  

Monday, September 7, 2015

greenfield, netaging simulation test run, 8SU for each file generated with 2000 cells



[hqin2@greenfield ms02GINPPI]$ cat netagingd.pbs 
#!/bin/bash
# Request 15 cores
#PBS -l nodes=1:ppn=15
#  Request 6 days of cpu time
#PBS -l walltime=6:00:00:00

module load R/3.2.1-mkl

echo hostname

pwd
cd /crucible/mc48o9p/hqin2/mactower-network-failure-simulation-master/ms02GINPPI
pwd


R --vanilla --slave -f net-aging-sim-2014Sep7.R

[hqin2@greenfield ms02GINPPI]$ qstat
Job ID                    Name             User            Time Use S Queue
------------------------- ---------------- --------------- -------- - -----
1816.greenfield            newRunNew.job    ismini          132:07:5 R batch          
1985.greenfield            run_idba_ud.bash sczyrba         170:42:1 R batch          
1999.greenfield            netaging.pbs     hqin2           00:00:41 R batch    

1pm. problem. Local run of net-aging-sim-2014Sep7b.R works, but pbs does not.
[hqin2@greenfield ms02GINPPI]$ R -f net-aging-sim-2014Sep7b.R --args 105 106 
by 1:10pm, I removed old files and cleaned up the directory. Everything seems to work now. Perhaps I probably qsub a wrong file. 


[hqin2@greenfield ms02GINPPI]$ cat netagingd.pbs 
#!/bin/bash
# Request 15 cores
#PBS -l nodes=1:ppn=15
#  Request 7days of cpu time
#PBS -l walltime=7:00:00:00

module load R/3.2.1-mkl

echo hostname

pwd
cd /crucible/mc48o9p/hqin2/mactower-network-failure-simulation-master/ms02GINPPI
pwd

numactl -C +0 R --vanilla --slave -f net-aging-sim-2014Sep7b.R --args 90 90
numactl -C +1 R --vanilla --slave -f net-aging-sim-2014Sep7b.R --args 91 91
numactl -C +2 R --vanilla --slave -f net-aging-sim-2014Sep7b.R --args 92 92

[hqin2@greenfield ms02GINPPI]$ qstat 
Job ID                    Name             User            Time Use S Queue
------------------------- ---------------- --------------- -------- - -----
1816.greenfield            newRunNew.job    ismini          137:17:5 R batch          
1985.greenfield            run_idba_ud.bash sczyrba         245:35:3 R batch          
2007.greenfield            netagingc.pbs    hqin2           03:30:22 R batch          
2011.greenfield            netagingd.pbs    hqin2                  0 R batch 


20150915Monday, Note that the three jobs were run in sequential, not in parallel! 

[hqin2@greenfield ms02GINPPI]$ ll -t dipgin.ms02.output/90/popages/
total 142
-rw-r--r-- 1 hqin2 mc48o9p 33803 Sep 10 05:17 cutoff.4.p.1.lambda.0.02.popsize.2000.time.2015Sep10_051711.txt
-rw-r--r-- 1 hqin2 mc48o9p 33790 Sep  9 22:12 cutoff.4.p.0.9.lambda.0.02.popsize.2000.time.2015Sep09_221225.txt
-rw-r--r-- 1 hqin2 mc48o9p 33815 Sep  9 15:04 cutoff.4.p.0.8.lambda.0.02.popsize.2000.time.2015Sep09_150443.txt
-rw-r--r-- 1 hqin2 mc48o9p 33885 Sep  9 07:49 cutoff.4.p.0.7.lambda.0.02.popsize.2000.time.2015Sep09_074906.txt
-rw-r--r-- 1 hqin2 mc48o9p 33802 Sep  8 23:27 cutoff.4.p.1.lambda.0.01.popsize.2000.time.2015Sep08_232736.txt
-rw-r--r-- 1 hqin2 mc48o9p 33779 Sep  8 16:21 cutoff.4.p.0.9.lambda.0.01.popsize.2000.time.2015Sep08_162114.txt
-rw-r--r-- 1 hqin2 mc48o9p 33827 Sep  8 09:15 cutoff.4.p.0.8.lambda.0.01.popsize.2000.time.2015Sep08_091521.txt
-rw-r--r-- 1 hqin2 mc48o9p 33814 Sep  8 02:01 cutoff.4.p.0.7.lambda.0.01.popsize.2000.time.2015Sep08_020109.txt

[hqin2@greenfield ms02GINPPI]$ ll -t dipgin.ms02.output/91/popages/
total 142
-rw-r--r-- 1 hqin2 mc48o9p 33795 Sep 12 17:34 cutoff.4.p.1.lambda.0.02.popsize.2000.time.2015Sep12_173458.txt
-rw-r--r-- 1 hqin2 mc48o9p 33788 Sep 12 10:25 cutoff.4.p.0.9.lambda.0.02.popsize.2000.time.2015Sep12_102544.txt
-rw-r--r-- 1 hqin2 mc48o9p 33840 Sep 12 03:16 cutoff.4.p.0.8.lambda.0.02.popsize.2000.time.2015Sep12_031655.txt
-rw-r--r-- 1 hqin2 mc48o9p 33886 Sep 11 19:57 cutoff.4.p.0.7.lambda.0.02.popsize.2000.time.2015Sep11_195758.txt
-rw-r--r-- 1 hqin2 mc48o9p 33776 Sep 11 11:31 cutoff.4.p.1.lambda.0.01.popsize.2000.time.2015Sep11_113115.txt
-rw-r--r-- 1 hqin2 mc48o9p 33778 Sep 11 04:18 cutoff.4.p.0.9.lambda.0.01.popsize.2000.time.2015Sep11_041814.txt
-rw-r--r-- 1 hqin2 mc48o9p 33778 Sep 10 21:08 cutoff.4.p.0.8.lambda.0.01.popsize.2000.time.2015Sep10_210855.txt
-rw-r--r-- 1 hqin2 mc48o9p 33808 Sep 10 13:51 cutoff.4.p.0.7.lambda.0.01.popsize.2000.time.2015Sep10_135103.txt


[hqin2@greenfield ms02GINPPI]$ ll -t dipgin.ms02.output/92/popages/
total 107
-rw-r--r-- 1 hqin2 mc48o9p 33761 Sep 13 16:43 cutoff.4.p.0.9.lambda.0.01.popsize.2000.time.2015Sep13_164355.txt
-rw-r--r-- 1 hqin2 mc48o9p 33801 Sep 13 09:33 cutoff.4.p.0.8.lambda.0.01.popsize.2000.time.2015Sep13_093348.txt
-rw-r--r-- 1 hqin2 mc48o9p 33822 Sep 13 02:17 cutoff.4.p.0.7.lambda.0.01.popsize.2000.time.2015Sep13_021713.txt


Conclusions: Each run took 7-8 hours for popSize=2000. 




estimate greenfield SU for Gordon




[hqin2@greenfield ms02GINPPI]$ cat ms02.pbs
#!/bin/bash
# Request 15 cores
#PBS -l nodes=1:ppn=15
#  Request 2:30 minutes of cpu time
#PBS -l walltime=02:30:00

module load R/3.2.1-mkl

echo hostname

pwd
cd /crucible/mc48o9p/hqin2/mactower-network-failure-simulation-master/ms02GINPPI
pwd

R --vanilla --slave -f ms02-2015Aug27.R --args 900 999


10:10am






Using  "ls -l", find out that each ms02 network took 3 minutes on greenfield.
100 permutation means 300minutes = 5 SUs.


Thursday, August 27, 2015

greenfield job run (successful)

[hqin2@greenfield ~]$ cat foo.pbs 
#!/bin/bash
#PBS -l nodes=1:ppn=15
#PBS -l walltime=5:00
#PBS -o test1.out
#PBS -j oe
set echo
echo hostname
module load R/3.2.1-mkl
R --vanilla --slave CMD BATCH ./myR.R



[hqin2@greenfield ms02GINPPI]$ cat ms02.pbs
#!/bin/bash
# Request 15 cores
#PBS -l nodes=1:ppn=15
#  Request 30 minutes of cpu time
#PBS -l walltime=30:00

module load R/3.2.1-mkl

echo hostname

pwd
cd /crucible/mc48o9p/hqin2/mactower-network-failure-simulation-master/ms02GINPPI
pwd


R --vanilla --slave -f ms02-2015June24.R --args 1000 1001




I also updated the path in ms02-2015Aug27.R
Some input files were removed during the transfer and I put them back.












Greenfield, sample pbs job scripts



This  is an example to run a serial job on Greenfield using PBS: 

#!/bin/csh
#  Request 15 cores 
#  Note that this means the job will be allocated 750GB of memory 
#PBS -l nodes=1:ppn=15
#  Request 5 minutes of cpu time
#PBS -l walltime=30:00
#  Combine standard output and error into one file
#PBS -j oe 
set echo
cd $PBS_O_WORKDIR
module load R/3.2.1-mkl
# run my executable
R --vanilla --slave CMD BATCH ./example.R


And here is an example of “packing” several runs in one job,
so that they all run simultaneously. The output files should be all named different:


#!/bin/csh
#  Request 15 cores 
#  Note that this means the job will be allocated 750GB of memory 
#PBS -l nodes=1:ppn=15
#  Request 5 minutes of cpu time
#PBS -l walltime=30:00
#  Combine standard output and error into one file
#PBS -j oe 
set echo
cd $PBS_O_WORKDIR
# Define where /tmp files will be written
 setenv TMPDIR $PBS_O_WORKDIR
module load R/3.2.1-mkl
# run my executable
numactl -C +0 R --vanilla --slave CMD BATCH ./example0.R &
numactl -C +1 R --vanilla --slave CMD BATCH ./example1.R &
numactl -C +2 R --vanilla --slave CMD BATCH ./example2.R &
numactl -C +3 R --vanilla --slave CMD BATCH ./example3.R &
numactl -C +4 R --vanilla --slave CMD BATCH ./example4.R &
numactl -C +5 R --vanilla --slave CMD BATCH ./example5.R &
numactl -C +6 R --vanilla --slave CMD BATCH ./example6.R &
numactl -C +7 R --vanilla --slave CMD BATCH ./example7.R &
numactl -C +8 R --vanilla --slave CMD BATCH ./example8.R &
numactl -C +9 R --vanilla --slave CMD BATCH ./example9.R &
numactl -C +10 R --vanilla --slave CMD BATCH ./example10.R &
numactl -C +11 R --vanilla --slave CMD BATCH ./example11.R &
numactl -C +12 R --vanilla --slave CMD BATCH ./example12.R &
numactl -C +13 R --vanilla --slave CMD BATCH ./example13.R &
numactl -C +14 R --vanilla --slave CMD BATCH ./example14.R &
wait