Salome HOME
Update doc
[modules/jobmanager.git] / doc / job.rst
1 Main JOBMANAGER concept: Job
2 ============================
3
4 This chapter explains the main JOBMANAGER concept: a job. 
5
6 What is a job?
7 ++++++++++++++
8
9 A job is a work that a user wants to perform on a computation resource (single computer or a cluster).
10 The JOBMANAGER provides different types of job depending of what a user wants to do.
11
12 There are three types of described in the table below.
13
14 ======================== ==============================================================================
15 **Type of job**          **Description**
16 ======================== ==============================================================================
17 **Command script**       It's a shell script containing the user's commands. This kind of job is not 
18                          related to SALOME. It could be used to launch any codes.
19 **SALOME Python script** It's a Python script that will be launched into a SALOME session dedicated to 
20                          this script.
21 **YACS schema**          It's a YACS schema that will be launched into a SALOME session dedicated to this
22                          schema.
23 ======================== ==============================================================================
24
25 Job content description
26 +++++++++++++++++++++++
27
28 All types of job share some attributes. There could be specific attributes for some types of jobs. These exceptions
29 will be indicated in the future in this documentation. A job has two kinds of attributes:
30 attributes that describes the job himself, and attributes that describes the computation requirements.
31
32 The first table below describes the attributes of a job.
33
34 ======================== ================ ==============================================================================
35 **Attribute**            **Mandatory**    **Description**
36 ======================== ================ ==============================================================================
37 **Name**                 Yes              This is the name of the job. It's unique into a SALOME session.
38 **Type**                 Yes              This is the type of the job. Currently, there are three types: *command*,
39                                           *python_salome* and *yacs_file*.
40 **Job file**             Yes              This is the name, with the location, of the file containing the job's data.
41                                           Depending of the type it could a *shell* script, a *Python script* or
42                                           a *YACS schema*, e.g. **/home/user/work.sh**.
43 **Env file**             No               An environment file could be attached to the job. It will be executed before
44                                           the job.
45 **Input files**          No               A list of files or directories in the user computer that have to copied into 
46                                           the job's *work directory*.
47 **Output files**         No               A list of files or directories that have to be copied from the job's resource
48                                           to the user computer into the *result directory*.
49 **Work directory**       Yes              It's the directory on the job's resource where the job will be executed.
50 **Result directory**     Yes              It's the directory in the user computer where the job's results have to be 
51                                           copied at the end of the job.
52 ======================== ================ ==============================================================================
53
54 The second table below describes the attributes of computation requirements.
55
56 ======================== ==============================================================================
57 **Attribute**            **Description**
58 ======================== ==============================================================================
59 **Maximum duration**     It's the maximum expected duration of the job. When a batch manager is used, this
60                          time is interpreted as a **walltime** and not as a **cputime**. If maximum
61                          duration is set to 0, the time will be set to the default value of the
62                          batch queue selected.
63 **Number of cpu**        It's the number of cpus/cores requested.
64 **Memory**               It's the amount of required memory. It is generally specified **per node**.
65                          With some batch mangers, it is possible to specify the required memory
66                          **per core** (only available with SLURM for now).
67 **Queue**                It's optional. It permits to choose a specific batch queue on the targeted cluster.
68                          If it is not defined, most of the batch systems will affect your job to the queue
69                          that fits with the other attributes requirements.
70 **Exclusive**            It indicates if the job can share nodes with other jobs or not.
71 ======================== ==============================================================================
72
73 Job's states
74 ++++++++++++
75
76 A job could have many states in the JOBMANAGER. The table below describes the normal states.
77
78 ======================== ==============================================================================
79 **State**                **Description**
80 ======================== ==============================================================================
81 **Created**              The job is correctly created and could be launched.
82 **In_Process**           It's a transient state between *Created* and *Queued*.
83 **Queued**               The job is queued into the resource's batch manager.
84 **Paused**               The job is paused. Currently the JOBMANAGER GUI does not allow to paused a 
85                          job.
86 **Running**              The job is running on the resource.
87 **Finished**             The job has run and it's finished.
88 ======================== ==============================================================================
89
90 The table below describes the error states.
91
92 ======================== ==============================================================================
93 **State**                **Description**
94 ======================== ==============================================================================
95 **Not Created**          This state means that the job cannot be created with it's current description.
96                          It's often a problem with the selected resource.
97 **Failed**               This state means that the execution of the job in the resource failed.
98 **Error**                This state is used when a job is loaded and that it cannot be followed. It
99                          mainly happens when a job was launched into a *ssh* resource. If the list is
100                          saved, an error will happen when the list is loaded (*ssh* resource cannot
101                          be followed).
102 ======================== ==============================================================================