Software:CAM: Difference between revisions
No edit summary |
No edit summary |
||
Line 1: | Line 1: | ||
This is about running CAM on the beluga calculquebec Cluster | This is about running CAM on the beluga calculquebec Cluster | ||
# When connected to Beluga, get a copy of the CAM repository by running | # When connected to Beluga, get a copy of the CAM repository by running | ||
<code> git clone https://github.com/ESCOMP/CAM </code> | |||
# the CAM directory will have been created by the previous command. Change to that directory | # the CAM directory will have been created by the previous command. Change to that directory | ||
<code> cd CAM </code> | |||
# we only want one specific version of CAM, and this version is tagged in git. We checkout that specific version for the runs: | # we only want one specific version of CAM, and this version is tagged in git. We checkout that specific version for the runs: | ||
<code> git checkout cam6_3_000 </code> | |||
# CAM also needs external modules that need to be downloaded. This is done by going to the CAM directory, and running <ref name="ncar" /> | # CAM also needs external modules that need to be downloaded. This is done by going to the CAM directory, and running <ref name="ncar" /> | ||
<code> ./manage_externals/checkout_externals </code> | |||
Once CAM and its modules have been obtained, we can run it. | Once CAM and its modules have been obtained, we can run it. | ||
# To do this, change to the cime/scripts directory | # To do this, change to the cime/scripts directory | ||
<code> cd cime/scripts </code> | |||
# Create a new case. Here I'm giving a test case as in the tutorial: | # Create a new case. Here I'm giving a test case as in the tutorial: | ||
<code> ./create_newcase --case test_FHIST --res f09_f09_mg17 --compset FHIST </code> | |||
# This will create the test_FHIST directory. Change to that directory | # This will create the test_FHIST directory. Change to that directory | ||
<code> cd test_FHIST </code> | |||
# You can now setup the case. This will download any datasets needed, and setup directories for building code, etc. | # You can now setup the case. This will download any datasets needed, and setup directories for building code, etc. | ||
<code> ./case.setup </code> | |||
# Once the case has been setup, you can build the case similarly | # Once the case has been setup, you can build the case similarly | ||
<code> ./case.build </code> | |||
# To be able to submit and run the case, you need to modify one of the input files manually. | # 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 | ## To do so edit the file env_batch.xml |
Revision as of 18:52, 10 September 2021
This is about running CAM on the beluga calculquebec Cluster
- When connected to Beluga, get a copy of the CAM repository by running
git clone https://github.com/ESCOMP/CAM
- the CAM directory will have been created by the previous command. Change to that directory
cd CAM
- we only want one specific version of CAM, and this version is tagged in git. We checkout that specific version for the runs:
git checkout cam6_3_000
- CAM also needs external modules that need to be downloaded. This is done by going to the CAM directory, and running [1]
./manage_externals/checkout_externals
Once CAM and its modules have been obtained, we can run it.
- To do this, change to the cime/scripts directory
cd cime/scripts
- Create a new case. Here I'm giving a test case as in the tutorial:
./create_newcase --case test_FHIST --res f09_f09_mg17 --compset FHIST
- This will create the test_FHIST directory. Change to that directory
cd test_FHIST
- You can now setup the case. This will download any datasets needed, and setup directories for building code, etc.
./case.setup
- Once the case has been setup, you can build the case similarly
./case.build
- 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
<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>
Change this 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=Template:Job id</directive> <directive> --nodes=Template:Num nodes</directive> <directive> --ntasks-per-node=Template:Tasks per node</directive> <directive> --output=Template: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. 11. Once changes, the case can be submitted to beluga. run ./case.submit 12. This will schedule jobs to run on beluga. The output files wil be in your /scratch directory. e.g my output was in /scratch/ambrish/out/initial_port_test/test_FHIST/run