batsim.h 1.27 KB
Newer Older
1 2 3 4 5 6 7
#pragma once

#include <msg/msg.h>

/**
 * Types of tasks exchanged between nodes.
 */
8 9
typedef enum
{
10 11 12 13 14 15 16
	ECHO,
	FINALIZE,
	LAUNCH_JOB,
	JOB_SUBMITTED,
	JOB_COMPLETED,
	KILL_JOB,
	SUSPEND_JOB,
17
	SCHED_EVENT,
18 19 20
	SCHED_READY,
	LAUNCHER_INFORMATION,
	KILLER_INFORMATION
21 22 23 24 25
} e_task_type_t;

/*
 * Data attached with the tasks sent and received
 */
26 27
typedef struct s_task_data
{
28
	e_task_type_t type;                     // type of task
29
	int job_id;
30 31
	void *data;
	const char* src;           // used for logging
32
} s_task_data_t;
33 34 35 36 37 38

/**
 * @brief Data structure used to launch a job
 */
typedef struct s_lauch_data
{
39 40 41 42 43 44
	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)
45 46 47 48 49 50 51
} s_launch_data_t;

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