From c0b67d186a461b251a0b5fbd28415876d9446dee Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Hern=C3=A1n=20Asorey?= <asoreyh@gmail.com> Date: Sun, 16 Oct 2022 15:38:33 +0200 Subject: [PATCH] This version transfer results to onedata --- eas/do_sims.sh | 13 ++++++++++--- eas/rain.pl | 12 ++++++------ 2 files changed, 16 insertions(+), 9 deletions(-) diff --git a/eas/do_sims.sh b/eas/do_sims.sh index c064271..5e19233 100755 --- a/eas/do_sims.sh +++ b/eas/do_sims.sh @@ -106,7 +106,7 @@ BZcomp=false defaults=false ecut=800 slurm=false - +onedataBase="/mnt/datahub.egi.eu/test8/fluka"; # need to change also at rain.pl echo while getopts 'w:k:p:t:v:u:f:h:s:j:c:b:m:n:r:i:o:q:a:?lydex' opt; do @@ -343,7 +343,7 @@ fi echo -e "# INFO : Executable file is ($corsika_bin)" # It is important to now the total time in onedata. Adding total simulation time to the project name... -prj="$prj_$(printf "%06d" $tim)" +prj="${prj}_$(printf "%06d" ${tim})" direct=$wdir/$prj basearti=${ARTI} #helium -> Usually for 1 hour flux, 4 different procces is enough @@ -434,8 +434,15 @@ if $slurm; then fi rain="$rain -r $wdir -v $ver -h $hig -f $lemodel -b $prj/\$i-*.run" -# echo -e "# INFO : rain command: $rain" +echo -e "# INFO : rain command: $rain" +oneout="$onedataBase/S3_${prj}_${site}_${lemodel}" +[[ ! -d $oneout ]] && mkdir $oneout +while ! cp -v $wdir/$prj/inject $oneout; do + sleep 5 +done +echo -e "# INFO : Results will be transferred to $oneout" echo -e "# INFO : Calculations done. Now run the go_${prj}_* scripts in $wdir/" + basenice=19 if $slurm; then basenice=0; diff --git a/eas/rain.pl b/eas/rain.pl index db66226..d021d86 100755 --- a/eas/rain.pl +++ b/eas/rain.pl @@ -90,7 +90,7 @@ my $imuaddi = 0; my $nofruns = 1; my $ecutshe = 800.; my $lemodel = "gheisha"; -my $onedataBase = "/mnt/datahub.egi.eu/test8/fluka/"; +my $onedataBase = "/mnt/datahub.egi.eu/test8/fluka"; # need to change also at do_sims.sh sub get_answer { my $question = $_[0]; @@ -577,7 +577,7 @@ EXIT my $binout = sprintf("$direct/DAT%06d",$run_nr); my $out = "$direct/DAT$name.lst"; my $script = "$home/run-$prj-$name.sh"; - my $oneout = "$onedataBase/S3_$prj_$site_$lemodel"; + my $oneout = "$onedataBase/S3_${prj}_${site}_${lemodel}"; unless ($debug != 0) { opendir(IMD, "$direct/") or system("mkdir $direct/"); closedir(IMD); @@ -596,10 +596,10 @@ EXIT print $fh "bzip2 -9v $binout\n"; print $fh "bzip2 -9v $out\n"; print $fh "echo \"tranferring to onedata...\"\n"; - print $fg "echo \"[[ ! -d $oneout ]] && mkdir $oneout\"\n"; - print $fg "echo \"while ! cp -av $binout.bz2 $wdir/; do sleep 5; done\"\n"; - print $fg "echo \"while ! cp -av $out.bz2 $wdir/; do sleep 5; done\"\n"; - print $fg "echo \"rm $binout.bz2 $out.bz2\"\n"; + print $fh "while ! cp -v $binout.bz2 $oneout; do sleep 5; done\n"; + print $fh "while ! cp -v $file $oneout; do sleep 5; done\n"; + print $fh "while ! cp -v $out.bz2 $oneout; do sleep 5; done\n"; + print $fh "rm $binout.bz2 $file $out.bz2\n"; print $fh "rm $script\n"; close($fh); system("chmod 777 $script"); -- GitLab