From 0de1b5da494fb8e85faa558a3f2e50c961664b07 Mon Sep 17 00:00:00 2001 From: Taehyo Kim Date: Fri, 5 Jul 2019 10:24:44 +0800 Subject: [PATCH 1/2] processHippocampus.sh can now run hmmsort or osort --- processHippocampus.sh | 40 ++++++++++++++++++++++++++++------------ transfersession.sh | 4 +++- 2 files changed, 31 insertions(+), 13 deletions(-) diff --git a/processHippocampus.sh b/processHippocampus.sh index 9009414..00747f6 100755 --- a/processHippocampus.sh +++ b/processHippocampus.sh @@ -1,19 +1,35 @@ #!/bin/bash -# input: foldername, HPCaccountname +# input: foldername, HPCaccountname, sortType +# sortType: hmmsort | osort -# transfer data to hippocampus -scp -r $1 $2@atlas7:~/hpctmp/Data/ && +if [ “$3” == “hmmsort” ] ; then + # transfer data to hippocampus + # scp -r $1 $2@atlas7:~/hpctmp/Data/ && -# create a transferdone.txt file as indication -ssh $2@atlas7 "cd ~/hpctmp/Data/$1 && touch transferdone.txt" + # create a transferdone.txt file as indication + ssh $2@atlas7 "cd ~/hpctmp/Data/$1 && touch transferdone.txt" -# copy the general info to Hippocampus -targetDir="/volume1/Hippocampus/Data/picasso/$1" -ssh -p 8398 hippocampus@cortex.nus.edu.sg mkdir -p $targetDir -scp -P 8398 $1/{*.edf,*.txt,*.xlsx,*.mat} hippocampus@cortex.nus.edu.sg:$targetDir && -ssh $2@atlas7 "cd ~/hpctmp/Data/$1 && touch transferredGeneralInfo.txt" + # copy the general info to Hippocampus + targetDir="/volume1/Hippocampus/Data/picasso/$1" + ssh -p 8398 hippocampus@cortex.nus.edu.sg mkdir -p $targetDir + scp -P 8398 $1/{*.edf,*.txt,*.xlsx,*.mat} hippocampus@cortex.nus.edu.sg:$targetDir && + ssh $2@atlas7 "cd ~/hpctmp/Data/$1 && touch transferredGeneralInfo.txt" -# run Process Level -ssh $2@atlas7 'cd ~/hpctmp/Data/'$1' && echo $PWD && matlab2016a2 -nojvm -nosplash -nodisplay -r "ProcessLevel(rplsplit,'\''Levels'\'','\''Day'\'','\''SaveLevels'\'',3,'\''SkipLFP'\'','\''UseHPC'\'','\''HPCCmd'\'','\''source ~/.bash_profile; source /etc/profile.d/rec_modules.sh; module load pbs; qsub $GITHUB_MATLAB/Hippocampus/Compiler/rplsplit/rsHPC_submit_file.txt'\''); exit" && touch submitprocessdone.txt' + # run Process Level + ssh $2@atlas7 'cd ~/hpctmp/Data/'$1' && echo $PWD && matlab2016b2 -nojvm -nosplash -nodisplay -r "ProcessLevel(rplsplit,'\''Levels'\'','\''Day'\'','\''SaveLevels'\'',3,'\''SkipLFP'\'','\''SkipOSort'\'', '\''Channels'\'', 1:124,'\''UseHPC'\'','\''HPCCmd'\'','\''source ~/.bash_profile; source /etc/profile.d/rec_modules.sh; module load pbs; qsub $GITHUB_MATLAB/Hippocampus/Compiler/rplsplit/rsHPC_submit_file.txt'\''); exit" && touch submitprocessdone.txt' +elif [ “$3” == “osort” ] ; then + # transfer data to hippocampus + # scp -r $1 $2@atlas7:~/hpctmp/Data/ && + # create a transferdone.txt file as indication + ssh $2@atlas7 "cd ~/hpctmp/Data/$1 && touch transferdone.txt" + # copy the general info to Hippocampus + targetDir="/volume1/Hippocampus/Data/picasso/$1" + ssh -p 8398 hippocampus@cortex.nus.edu.sg mkdir -p $targetDir + + # run Process Level + ssh $2@atlas7 'cd ~/hpctmp/Data/'$1' && echo $PWD && matlab2016b2 -nojvm -nosplash -nodisplay -r "ProcessLevel(rplsplit,'\''Levels'\'','\''Day'\'','\''SaveLevels'\'',3,'\''SkipLFP'\'','\''SkipSort'\'','\''Channels'\'',1:124,'\''UseHPC'\'','\''HPCCmd'\'','\''source ~/.bash_profile; source /etc/profile.d/rec_modules.sh; module load pbs; qsub $GITHUB_MATLAB/Hippocampus/Compiler/rplsplit/rsHPC_submit_file.txt'\''); exit" && touch submitprocessdone.txt' +else + echo invalid sortType +fi diff --git a/transfersession.sh b/transfersession.sh index 99f25c7..a442d77 100755 --- a/transfersession.sh +++ b/transfersession.sh @@ -2,7 +2,9 @@ cwd=$PWD -sessionDir=${cwd:`expr index "$cwd" 2018`-1} +year="2018" +index="${cwd%%$year*}" +sessionDir=${cwd:${#index}} targetDir='/volume1/Hippocampus/Data/picasso/' targetDir+=$sessionDir From 5ab34f8bb802d38bc90f7cfa55e876c39942688c Mon Sep 17 00:00:00 2001 From: Taehyo Kim Date: Thu, 11 Jul 2019 16:17:15 +0800 Subject: [PATCH 2/2] uncommented line for initial data transfer --- processHippocampus.sh | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/processHippocampus.sh b/processHippocampus.sh index 00747f6..5fb21a6 100755 --- a/processHippocampus.sh +++ b/processHippocampus.sh @@ -4,7 +4,7 @@ if [ “$3” == “hmmsort” ] ; then # transfer data to hippocampus - # scp -r $1 $2@atlas7:~/hpctmp/Data/ && + scp -r $1 $2@atlas7:~/hpctmp/Data/ && # create a transferdone.txt file as indication ssh $2@atlas7 "cd ~/hpctmp/Data/$1 && touch transferdone.txt" @@ -19,7 +19,7 @@ if [ “$3” == “hmmsort” ] ; then ssh $2@atlas7 'cd ~/hpctmp/Data/'$1' && echo $PWD && matlab2016b2 -nojvm -nosplash -nodisplay -r "ProcessLevel(rplsplit,'\''Levels'\'','\''Day'\'','\''SaveLevels'\'',3,'\''SkipLFP'\'','\''SkipOSort'\'', '\''Channels'\'', 1:124,'\''UseHPC'\'','\''HPCCmd'\'','\''source ~/.bash_profile; source /etc/profile.d/rec_modules.sh; module load pbs; qsub $GITHUB_MATLAB/Hippocampus/Compiler/rplsplit/rsHPC_submit_file.txt'\''); exit" && touch submitprocessdone.txt' elif [ “$3” == “osort” ] ; then # transfer data to hippocampus - # scp -r $1 $2@atlas7:~/hpctmp/Data/ && + scp -r $1 $2@atlas7:~/hpctmp/Data/ && # create a transferdone.txt file as indication ssh $2@atlas7 "cd ~/hpctmp/Data/$1 && touch transferdone.txt"