Software:CAM: Difference between revisions
Jump to navigation
Jump to search
No edit summary |
No edit summary |
||
(2 intermediate revisions by the same user not shown) | |||
Line 13: | Line 13: | ||
== Run CAM == | == Run CAM == | ||
Once CAM and its modules have been obtained, we can run it. | Once CAM and its modules have been obtained, we can run it. | ||
<ol> | |||
<li>To do this, change to the cime/scripts directory</li> | |||
<code> cd cime/scripts </code> | <code> cd cime/scripts </code> | ||
<li>Create a new case. Here I'm giving a test case as in the tutorial:</li> | |||
<code> ./create_newcase --case test_FHIST --res f09_f09_mg17 --compset FHIST </code> | <code> ./create_newcase --case test_FHIST --res f09_f09_mg17 --compset FHIST </code> | ||
<li>This will create the test_FHIST directory. Change to that directory </li> | |||
<code> cd test_FHIST </code> | <code> cd test_FHIST </code> | ||
<li>You can now setup the case. This will download any datasets needed, and setup directories for building code, etc.</li> | |||
<code> ./case.setup </code> | <code> ./case.setup </code> | ||
<li>Once the case has been setup, you can build the case similarly</li> | |||
<code> ./case.build </code> | <code> ./case.build </code> | ||
<li>To be able to submit and run the case, you need to modify one of the input files manually. | |||
<ol type="a"> | |||
<li> To do so edit the file env_batch.xml</li> | |||
<li> In the xml file, there is a section called <batch_system type="slurm">. In that section, add a directive specifying the account to the <directives> section. e.g Originally case.build had </li></ol></li> | |||
<nowiki> | <nowiki> | ||
<batch_system type="slurm"> | <batch_system type="slurm"> | ||
Line 76: | Line 78: | ||
<code> <directive> --account=rrg-itan</directive> </code> | <code> <directive> --account=rrg-itan</directive> </code> | ||
to the directives section. Please use a different account if you are using a different compute canada account. | to the directives section. Please use a different account if you are using a different compute canada account. | ||
<li>Once changes, the case can be submitted to beluga. run </li> | |||
<code> ./case.submit </code> | <code> ./case.submit </code> | ||
<li>This will schedule jobs to run on beluga. The output files wil be in your /scratch directory. e.g my output was in </li> | |||
<code> /scratch/ambrish/out/initial_port_test/test_FHIST/run </code> | <code> /scratch/ambrish/out/initial_port_test/test_FHIST/run </code> | ||
==Notes== | |||
<references /> |
Latest revision as of 23:43, 10 September 2021
This is about running CAM on the beluga calculquebec Cluster
Get CAM
- When connected to Beluga, get a copy of the CAM repository by running
- the CAM directory will have been created by the previous command. Change to that directory
- we only want one specific version of CAM, and this version is tagged in git. We checkout that specific version for the runs:
- CAM also needs external modules that need to be downloaded. This is done by going to the CAM directory, and running [1]
git clone https://github.com/ESCOMP/CAM
cd CAM
git checkout cam6_3_000
./manage_externals/checkout_externals
Run CAM
Once CAM and its modules have been obtained, we can run it.
- To do this, change to the cime/scripts directory
- Create a new case. Here I'm giving a test case as in the tutorial:
- This will create the test_FHIST directory. Change to that directory
- You can now setup the case. This will download any datasets needed, and setup directories for building code, etc.
- Once the case has been setup, you can build the case similarly
- To be able to submit and run the case, you need to modify one of the input files manually.
- To do so edit the file env_batch.xml
- In the xml file, there is a section called <batch_system type="slurm">. In that section, add a directive specifying the account to the <directives> section. e.g Originally case.build had
- Once changes, the case can be submitted to beluga. run
- This will schedule jobs to run on beluga. The output files wil be in your /scratch directory. e.g my output was in
cd cime/scripts
./create_newcase --case test_FHIST --res f09_f09_mg17 --compset FHIST
cd test_FHIST
./case.setup
./case.build
<batch_system type="slurm"> <batch_query per_job_arg="-j">squeue</batch_query> <batch_cancel>scancel</batch_cancel> <batch_directive>#SBATCH</batch_directive> <jobid_pattern>(\d+)$</jobid_pattern> <depend_string> --dependency=afterok:jobid</depend_string> <depend_allow_string> --dependency=afterany:jobid</depend_allow_string> <depend_separator>,</depend_separator> <walltime_format>%H:%M:%S</walltime_format> <batch_mail_flag>--mail-user</batch_mail_flag> <batch_mail_type_flag>--mail-type</batch_mail_type_flag> <batch_mail_type>none, all, begin, end, fail</batch_mail_type> <directives> <directive> --job-name={{ job_id }}</directive> <directive> --nodes={{ num_nodes }}</directive> <directive> --ntasks-per-node={{ tasks_per_node }}</directive> <directive> --output={{ job_id }} </directive> <directive> --exclusive </directive> </directives> </batch_system>
This needs to be changed to
<batch_system type="slurm"> <batch_query per_job_arg="-j">squeue</batch_query> <batch_cancel>scancel</batch_cancel> <batch_directive>#SBATCH</batch_directive> <jobid_pattern>(\d+)$</jobid_pattern> <depend_string> --dependency=afterok:jobid</depend_string> <depend_allow_string> --dependency=afterany:jobid</depend_allow_string> <depend_separator>,</depend_separator> <walltime_format>%H:%M:%S</walltime_format> <batch_mail_flag>--mail-user</batch_mail_flag> <batch_mail_type_flag>--mail-type</batch_mail_type_flag> <batch_mail_type>none, all, begin, end, fail</batch_mail_type> <directives> <directive> --job-name={{ job_id }}</directive> <directive> --nodes={{ num_nodes }}</directive> <directive> --ntasks-per-node={{ tasks_per_node }}</directive> <directive> --output={{ job_id }} </directive> <directive> --exclusive </directive> <directive> --account=rrg-itan</directive> </directives> </batch_system>
The change is the addition of the line
<directive> --account=rrg-itan</directive>
to the directives section. Please use a different account if you are using a different compute canada account.
./case.submit
/scratch/ambrish/out/initial_port_test/test_FHIST/run