Plasma GitLab Archive
Projects Blog Knowledge

Pmr_task



/* $Id: pmr_task.x 359 2011-01-31 15:46:09Z gerd $ -*- c -*- */

/* The easy-going interface of task servers */

#ifndef PMR_TASK
#define PMR_TASK

typedef string longstring<>;
typedef longstring longstrings<>;

struct resource_config { 
    /* POSIX shared memory: */
    hyper *rc_shm_low;
    hyper *rc_shm_high;
    hyper *rc_shm_max;
    /* If rc_shm_max is NULL, it is tried to determine a default (for
       some OS only), which is then multiplied by rc_shm_max_p. If 
       rc_shm_low and rc_shm_high are NULL, these are
       determined by multiplying rc_shm_max with the following factors:
    */
    double rc_shm_low_p;
    double rc_shm_high_p;
    double rc_shm_max_p;
    
    /* Buffer memory: */
    hyper *rc_buf_low;
    hyper *rc_buf_high;
    hyper *rc_buf_max;
    /* If rc_buf_max is NULL, it is tried to determine a default (for
       some OS only), which is then multiplied by rc_buf_max_p. If 
       rc_buf_low and rc_buf_high are NULL, these are
       determined by multiplying rc_buf_max with the following factors:
    */
    double rc_buf_low_p;
    double rc_buf_high_p;
    double rc_buf_max_p;
};

program Mapred_task {
    version V1 {
	void null (void) = 0;

	longstring exec(int, longstring, longstring) = 1;
	/* let r = exec(req_id, jobconfig, t):
	   Executes the encoded task t and returns the encoded result r.
	*/

	/* TODO:
	   .- get_req_id : void -> int
	   .- status : int -> bool   (running/not running)
	*/

	void kill(int) = 2;
	/* Kill the started task with this req ID */

	void kill_all(void) = 3;
	/* Kill all started tasks */

	void configure(resource_config) = 4;
	/* configure(rc): see above */

	bool check_version(longstring) = 5;
	/* The string describes the expected version of the executable
	   running the task server. Returns whether the version is matched.
	   Actually, the string is a MD5 sum of the server executable.
	*/

	double job_capacity(longstring) = 6;
	/* job_capacity(job_id): Returns the load this job is allowed
	   to put onto this server. This is defined as:

	   number_of_cores / number_of_running_jobs

	   The number_of_running_jobs is the number of jobs currently
	   being executed, including the passed job_id. Returns a negative
	   value if the functionality is not available.

	   Note that the returned number is independent of the number
	   of running tasks. It is just the capacity the current job
	   may use at most. Also note that this number may change
	   during the runtime of the job (when other jobs are started).
	*/

    } = 1;
} = 0x80013001;
#endif

This web site is published by Informatikbüro Gerd Stolpmann
Powered by Caml