Skip to content

Commit

Permalink
CHG: gzip'ing sim files is now default
Browse files Browse the repository at this point in the history
  • Loading branch information
zoglauer committed Oct 12, 2023
1 parent 6a70623 commit fe7c818
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 7 deletions.
13 changes: 9 additions & 4 deletions bin/mcosima
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,8 @@ help() {
#echo " -p: use this parallel ID without checking for the cosima output files"
#echo " -i: use this incarnation ID without checking for the cosima output files"
#echo " -r: use random IDs"
echo " -z: zip the simulations files"
echo " -z: Not used: zgip the simulations files (already default)"
echo " -u: Do not gzip the simulations files (default is gzip them)"
echo " -e: Use the given special cosima executable instead"
echo " -a: Abstain from creating a concatenation sim file"
echo " -w: If set, wait until all jobs have finished."
Expand Down Expand Up @@ -71,7 +72,7 @@ RandomIDs="no"
Nice=0;
Wait="no"
Concatenate="yes"
Zip="no"
Zip="yes"
Delay=0.5
ExecuteString="cosima"
Executable="cosima"
Expand Down Expand Up @@ -124,6 +125,10 @@ while [ $# -gt 0 ] ; do
Found=1;
Zip="yes"
;;
-u|--unzip)
Found=1;
Zip="no"
;;
-r|--random)
Found=1;
RandomIDs="yes"
Expand Down Expand Up @@ -405,8 +410,8 @@ for (( i=1; i <= ${Threads}; i+=1 )); do
for N in `seq 1 16`; do Tag="${Tag}$(( 1 + RANDOM%9 ))"; done

Cmd="${ExecuteString} -v 0 -s ${Seed} -p ${ThreadsID} -f ${i} -t ${Tag}"
if [[ "${Zip}" == "yes" ]]; then
Cmd="${Cmd} -z"
if [[ "${Zip}" == "no" ]]; then
Cmd="${Cmd} -u"
fi
if [[ ${ParallelID} -gt 0 ]]; then
Cmd="${Cmd} -p ${ParallelID}"
Expand Down
10 changes: 7 additions & 3 deletions src/cosima/src/MCMain.cc
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@ MCMain::MCMain()
m_HasMacro = false;
m_Interactive = false;
m_UseDebug = false;
m_Zip = false;
m_Zip = true;

m_Verbosity = 1;

Expand Down Expand Up @@ -254,7 +254,8 @@ unsigned int MCMain::ParseCommandLine(int argc, char** argv)
Usage<<" -c: convert to MEGAlib (file name)"<<endl;
Usage<<" -s: seed (integer > 0)"<<endl;
Usage<<" -m: macro file name (type: *.mac)"<<endl;
Usage<<" -z: gzip *.sim files"<<endl;
Usage<<" -u: do not gzip *.sim files (default is to gzip them)"<<endl;
Usage<<" -z: Not used: gzip *.sim files (already default, use -u to not zip them)"<<endl;
//Usage<<" -p: parallel ID (used by mcosima)"<<endl;
//Usage<<" -f: incarnation ID (used by mcosima)"<<endl;
//Usage<<" -t: unique tag ID (used by mcosima)"<<endl;
Expand Down Expand Up @@ -340,7 +341,10 @@ unsigned int MCMain::ParseCommandLine(int argc, char** argv)
m_HasMacro = true;
} else if (Option == "-z") {
m_Zip = true;
mout<<"All simulation file are going to be gzip'ed!"<<endl;
mout<<"All simulation files are going to be gzip'ed!"<<endl;
} else if (Option == "-u") {
m_Zip = false;
mout<<"Simulation files are NOT going to be gzip'ed!"<<endl;
} else if (Option == "-s") {
m_Seed = atol(argv[++i]);
if (m_Seed <= 0) {
Expand Down

0 comments on commit fe7c818

Please sign in to comment.