User Tools

Site Tools


compute:tobegin

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Next revision
Previous revision
compute:tobegin [2024/08/16 11:12] – created bjornscompute:tobegin [2024/12/02 09:55] (current) bjorns
Line 1: Line 1:
-An How-To example for beginners. +===== An How-To example for beginners. ===== 
-Connect to the cluster with you user and pass +Connect to the cluster with you user and pass.\\ 
-To utilize the power of the cluster you to add you code (project files) onto your home directory, then run it. +To utilize the power of the cluster you to add you code (project files) onto your home directory, then run it.\\ 
-If you examine you home directory (use the command "ls" on the command line), use see a some files "readMe.1st" and "myJob.sh" The "readMe.1st" file list some helpful commands to start using the cluster, view the content of the file on command line by running "cat readMe.1st" +If you examine you home directory (use the command "ls" on the command line), use see a some files "readMe.1st" and "myJob.sh" The "readMe.1st" file list some helpful commands to start using the cluster, view the content of the file on command line by running "cat readMe.1st"\\ 
-In you working (home) directory create your project files for computing.  For example if using python create a python file "runSomeCode.py" with a editor.  Using VScode might be the easiest way for beginner to work on the cluster, setup. If using the command line you can use the editors vi(or vim) or nano. +\\ 
-After your coding file's are ready you need you test the code try them and resolve any issue, bugs(debug) +In you working (home) directory create your project files for computing.  For example if using python create a python file "runSomeCode.py" with a editor.  Using [[https://code.visualstudio.com/|VScode]] might be the easiest way for beginner to work on the cluster, setup. If using the command line you can use the editors [[https://www.vim.org/|vi]](or vim) or nano.\\ 
-When ready send your job(project) to cluster, using sbatch command+After your coding file's are ready you need you test the code try them and resolve any issue, bugs(debug)\\ 
 +When ready send your job(project) to cluster, using **sbatch** command.\\
 The cluster uses Slurm as a scheduler and workload manager. The cluster uses Slurm as a scheduler and workload manager.
 To submit your you need to create a file(batch file for Slurm), an example filed is already in your home directory called "myJob.sh", which can be used with minor adjustments. To submit your you need to create a file(batch file for Slurm), an example filed is already in your home directory called "myJob.sh", which can be used with minor adjustments.
-But user can also create their own batch file for Slurm, but the content of it must follow slurms ruleset to work and it must be executable. +But user can also create their own batch file for Slurm, but the content of it must follow slurms ruleset to work and it must be executable.\\ 
-Assuming your python file is called "" and the batch file for Slurm is myJob.sh +\\ 
-This is the content of myJob.sh. +Assuming your python file is called **runSomeCode.py** and the batch file for Slurm is **myJob.sh**\\ 
-When ready user submit his job to the cluster by running the command sbatch myJob.sh +This is the content of myJob.sh\\ 
-This should be the result user gets +''#!/bin/bash\\ 
-For user to see the status of his job issue the command squeue.+#SBATCH <nowiki>--</nowiki>account=student\\ 
 +#SBATCH %%--%%job-name=MyJob\\ 
 +#SBATCH %%--%%gpus-per-node=1\\ 
 +#SBATCH %%--%%mem-per-cpu=2G\\ 
 +#SBATCH <nowiki>--</nowiki>output=myBatch.log\\ 
 +python3 runSomeCode.py\\ 
 +''\\ 
 +To submit this job to the cluster you run the command **sbatch myJob.sh**.\\ 
 +This should be the result user gets\\ 
 +For user to see the status of his job issue the command squeue.\\ 
 +\\ 
 +\\ 
 +Beware if coping (uploading) files from Windows to the cluster, you might encounter issues because of different handling of character encoding (Linux/Windows) 
 +[[compute:venvpython|Python virtual]]\\
  
- 
-Beware if coping (uploading) files from Windows to the cluster, you might encounter issues because of different handling of character encoding (Linux/Windows) 
compute/tobegin.1723806744.txt.gz · Last modified: 2024/10/14 14:24 (external edit)