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

#include <msg/msg.h>

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

/*
 * Data attached with the tasks sent and received
 */
typedef struct s_task_data {
23
	e_task_type_t type;                     // type of task
24
	int job_id;
25 26
	void *data;
	const char* src;           // used for logging
27 28 29 30 31 32 33
} s_task_data_t, *task_data_t;

/**
 * @brief Data structure used to launch a job
 */
typedef struct s_lauch_data
{
34 35 36 37 38 39 40
	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_bar_t * barrier;            	//! The barrier used to know when the process can read its full data (especially the killer process)
	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)
41 42 43 44 45 46 47
} s_launch_data_t;

/**
 * @brief Data structure used to kill a job
 */
typedef struct s_kill_data
{
48 49 50
	msg_bar_t * barrier;			//! The barrier used to know when the process can read its full data (especially the launcher process)
	msg_process_t launcherProcess;	//! The SG launcher process
	s_launch_data_t * launcherData;	//! The data used by the launcher
51
} s_kill_data_t;