batsim.h 1.58 KB
Newer Older
1 2 3 4 5
#pragma once

#include <msg/msg.h>

/**
6
 * @brief Types of tasks exchanged between nodes.
7
 */
8 9
typedef enum
{
10 11 12 13 14 15 16 17 18 19
	FINALIZE				//! Server -> Node
	,LAUNCH_JOB				//! Server -> Node
	,JOB_SUBMITTED			//! Submitter -> Server
	,JOB_COMPLETED			//! Launcher/killer -> Server
	,SCHED_EVENT			//! SchedulerHandler -> Server
	,SCHED_READY			//! SchedulerHandler -> Server
	,LAUNCHER_INFORMATION	//! Node -> Launcher
	,KILLER_INFORMATION		//! Node -> Killer
	,SUBMITTER_HELLO		//! Submitter -> Server
	,SUBMITTER_BYE			//! Submitter -> Server
20 21 22
} e_task_type_t;

/*
23
 * @brief Data attached with the tasks used to communicate between MSG processes
24
 */
25 26
typedef struct s_task_data
{
27 28 29
	e_task_type_t type;	//! Type of task
	int job_id;			//! The job ID
	void *data;			//! Either NULL or points to something else based on type
30
} s_task_data_t;
31 32 33 34 35 36

/**
 * @brief Data structure used to launch a job
 */
typedef struct s_lauch_data
{
37 38 39 40 41 42
	int jobID;                       	//! The job identification number
	int reservedNodeCount;           	//! The number of reserved nodes
	int * reservedNodesIDs;          	//! The nodes on which the job will be run
	msg_process_t killerProcess;		//! The SG killer process
	struct s_kill_data * killerData; 	//! The data used by the killer
	xbt_dict_t dataToRelease;			//! The data used by the launcher which will need to be released (used when killing the job)
43 44 45 46 47 48 49
} s_launch_data_t;

/**
 * @brief Data structure used to kill a job
 */
typedef struct s_kill_data
{
50 51
	msg_process_t launcherProcess;	//! The SG launcher process
	s_launch_data_t * launcherData;	//! The data used by the launcher
52
} s_kill_data_t;