reformat code and job array
This commit is contained in:
parent
a665ccd4fe
commit
9ff857db9f
64 changed files with 1497 additions and 2476 deletions
105
src/lib/xceapi.c
105
src/lib/xceapi.c
|
|
@ -3,8 +3,7 @@
|
|||
#include "utils.h"
|
||||
#include "xceapi.h"
|
||||
|
||||
int xce_hello(xce_ctx_t* ctx,
|
||||
char* msg)
|
||||
int xce_hello(xce_ctx_t* ctx, char* msg)
|
||||
{
|
||||
ioctx_t* ioctx;
|
||||
int rc, status;
|
||||
|
|
@ -66,25 +65,14 @@ int xce_shutdown(xce_ctx_t* ctx)
|
|||
return status;
|
||||
}
|
||||
|
||||
int xce_get(xce_ctx_t* ctx,
|
||||
int table,
|
||||
void*** data)
|
||||
int xce_get(xce_ctx_t* ctx, int table, void*** data)
|
||||
{
|
||||
ioctx_t* ioctx;
|
||||
int rc;
|
||||
int status;
|
||||
xce_match_t condition = {
|
||||
.type = MatchCondition_condition_matchall
|
||||
};
|
||||
xce_get_t get = {
|
||||
.table = table,
|
||||
.condition = &condition
|
||||
};
|
||||
dataset_t getreply = {
|
||||
.table = table,
|
||||
.nrows = 0,
|
||||
.rows = NULL
|
||||
};
|
||||
xce_match_t condition = { .type = MatchCondition_condition_matchall };
|
||||
xce_get_t get = { .table = table, .condition = &condition };
|
||||
dataset_t getreply = { .table = table, .nrows = 0, .rows = NULL };
|
||||
|
||||
if (ctx == NULL) {
|
||||
return -EINVAL;
|
||||
|
|
@ -122,18 +110,14 @@ int xce_get(xce_ctx_t* ctx,
|
|||
return rc;
|
||||
}
|
||||
|
||||
int xce_reslist(xce_ctx_t* ctx,
|
||||
xce_resource_t*** res)
|
||||
int xce_reslist(xce_ctx_t* ctx, xce_resource_t*** res)
|
||||
{
|
||||
int table = Data_data_resources;
|
||||
|
||||
return xce_get(ctx, table, (void***)res);
|
||||
}
|
||||
|
||||
int xce_resval(xce_ctx_t* ctx,
|
||||
char* host,
|
||||
char* res,
|
||||
xce_resval_t*** vals)
|
||||
int xce_resval(xce_ctx_t* ctx, char* host, char* res, xce_resval_t*** vals)
|
||||
{
|
||||
ioctx_t* ioctx;
|
||||
int rc;
|
||||
|
|
@ -196,9 +180,7 @@ int xce_resval(xce_ctx_t* ctx,
|
|||
return rc;
|
||||
}
|
||||
|
||||
int xce_join(xce_ctx_t* ctx,
|
||||
int role,
|
||||
hostattrs_t* attrs)
|
||||
int xce_join(xce_ctx_t* ctx, int role, hostattrs_t* attrs)
|
||||
{
|
||||
ioctx_t* ioctx;
|
||||
int rc, status;
|
||||
|
|
@ -228,22 +210,16 @@ int xce_join(xce_ctx_t* ctx,
|
|||
return status;
|
||||
}
|
||||
|
||||
int xce_workerlist(xce_ctx_t* ctx,
|
||||
xce_worker_t*** workers)
|
||||
int xce_workerlist(xce_ctx_t* ctx, xce_worker_t*** workers)
|
||||
{
|
||||
int table = Data_data_workers;
|
||||
|
||||
return xce_get(ctx, table, (void***)workers);
|
||||
}
|
||||
|
||||
int xce_free_workers(int nworkers,
|
||||
xce_worker_t* workers)
|
||||
{
|
||||
return 0;
|
||||
}
|
||||
int xce_free_workers(int nworkers, xce_worker_t* workers) { return 0; }
|
||||
|
||||
int xce_jobdispatch(xce_ctx_t* ctx,
|
||||
xce_job_dispatch_t* info)
|
||||
int xce_jobdispatch(xce_ctx_t* ctx, xce_job_dispatch_t* info)
|
||||
{
|
||||
ioctx_t* ioctx;
|
||||
int rc, status;
|
||||
|
|
@ -274,8 +250,7 @@ int xce_jobdispatch(xce_ctx_t* ctx,
|
|||
return status;
|
||||
}
|
||||
|
||||
int xce_notify(xce_ctx_t* ctx,
|
||||
xce_notify_data_t* data)
|
||||
int xce_notify(xce_ctx_t* ctx, xce_notify_data_t* data)
|
||||
{
|
||||
ioctx_t* ioctx;
|
||||
int rc;
|
||||
|
|
@ -298,9 +273,7 @@ int xce_notify(xce_ctx_t* ctx,
|
|||
return rc;
|
||||
}
|
||||
|
||||
int xce_jobsubmit(xce_ctx_t* ctx,
|
||||
xce_job_submit_t* submit,
|
||||
uint64_t* jobid)
|
||||
int xce_jobsubmit(xce_ctx_t* ctx, xce_job_submit_t* submit, uint64_t* jobid)
|
||||
{
|
||||
ioctx_t* ioctx;
|
||||
int rc, status;
|
||||
|
|
@ -334,9 +307,7 @@ int xce_jobsubmit(xce_ctx_t* ctx,
|
|||
return status;
|
||||
}
|
||||
|
||||
int xce_joblist_ex(xce_ctx_t* ctx,
|
||||
int sched,
|
||||
xce_job_t*** jobs)
|
||||
int xce_joblist_ex(xce_ctx_t* ctx, int sched, xce_job_t*** jobs)
|
||||
{
|
||||
int table;
|
||||
|
||||
|
|
@ -349,20 +320,17 @@ int xce_joblist_ex(xce_ctx_t* ctx,
|
|||
return xce_get(ctx, table, (void***)jobs);
|
||||
}
|
||||
|
||||
int xce_sched_joblist(xce_ctx_t* ctx,
|
||||
xce_job_t*** jobs)
|
||||
int xce_sched_joblist(xce_ctx_t* ctx, xce_job_t*** jobs)
|
||||
{
|
||||
return xce_joblist_ex(ctx, 1, jobs);
|
||||
}
|
||||
|
||||
int xce_joblist(xce_ctx_t* ctx,
|
||||
xce_job_t*** jobs)
|
||||
int xce_joblist(xce_ctx_t* ctx, xce_job_t*** jobs)
|
||||
{
|
||||
return xce_joblist_ex(ctx, 0, jobs);
|
||||
}
|
||||
|
||||
int xce_varlist(xce_ctx_t* ctx,
|
||||
xce_config_t*** vars)
|
||||
int xce_varlist(xce_ctx_t* ctx, xce_config_t*** vars)
|
||||
{
|
||||
#if 0
|
||||
int table = XCETables_conf;
|
||||
|
|
@ -372,8 +340,7 @@ int xce_varlist(xce_ctx_t* ctx,
|
|||
return 0;
|
||||
}
|
||||
|
||||
int xce_queuelist(xce_ctx_t* ctx,
|
||||
xce_queue_t*** queues)
|
||||
int xce_queuelist(xce_ctx_t* ctx, xce_queue_t*** queues)
|
||||
{
|
||||
#if 0
|
||||
int table = XCETables_queues;
|
||||
|
|
@ -384,8 +351,7 @@ int xce_queuelist(xce_ctx_t* ctx,
|
|||
#endif
|
||||
}
|
||||
|
||||
int xce_free_queues(int nqueues,
|
||||
xce_queue_t* queues)
|
||||
int xce_free_queues(int nqueues, xce_queue_t* queues)
|
||||
{
|
||||
int i;
|
||||
|
||||
|
|
@ -399,9 +365,7 @@ int xce_free_queues(int nqueues,
|
|||
return 0;
|
||||
}
|
||||
|
||||
int xce_grouplist(xce_ctx_t* ctx,
|
||||
int group_type,
|
||||
xce_group_t*** groups)
|
||||
int xce_grouplist(xce_ctx_t* ctx, int group_type, xce_group_t*** groups)
|
||||
{
|
||||
#if 0
|
||||
int table;
|
||||
|
|
@ -421,15 +385,13 @@ int xce_grouplist(xce_ctx_t* ctx,
|
|||
#endif
|
||||
}
|
||||
|
||||
int xce_free_groups(int ngroups,
|
||||
xce_group_t* groups)
|
||||
int xce_free_groups(int ngroups, xce_group_t* groups)
|
||||
{
|
||||
/* TODO */
|
||||
return 0;
|
||||
}
|
||||
|
||||
int xce_clusterconf(xce_ctx_t* ctx,
|
||||
xce_clusterconf_t** conf)
|
||||
int xce_clusterconf(xce_ctx_t* ctx, xce_clusterconf_t** conf)
|
||||
{
|
||||
ioctx_t* ioctx;
|
||||
int rc, status;
|
||||
|
|
@ -465,9 +427,7 @@ int xce_clusterconf(xce_ctx_t* ctx,
|
|||
return 0;
|
||||
}
|
||||
|
||||
int xce_update_resvals(xce_ctx_t* ctx,
|
||||
int count,
|
||||
xce_resval_t** vals)
|
||||
int xce_update_resvals(xce_ctx_t* ctx, int count, xce_resval_t** vals)
|
||||
{
|
||||
ioctx_t* ioctx;
|
||||
int rc;
|
||||
|
|
@ -512,14 +472,8 @@ int xce_update_resvals(xce_ctx_t* ctx,
|
|||
return status;
|
||||
}
|
||||
|
||||
int xce_update_jusage(xce_ctx_t* ctx,
|
||||
uint64_t jobid,
|
||||
int npids,
|
||||
int* pids,
|
||||
int ngids,
|
||||
int* pgids,
|
||||
int nusage,
|
||||
xce_rusage_t** usages)
|
||||
int xce_update_jusage(xce_ctx_t* ctx, uint64_t jobid, int npids, int* pids,
|
||||
int ngids, int* pgids, int nusage, xce_rusage_t** usages)
|
||||
{
|
||||
ioctx_t* ioctx;
|
||||
int rc;
|
||||
|
|
@ -567,8 +521,7 @@ int xce_update_jusage(xce_ctx_t* ctx,
|
|||
return status;
|
||||
}
|
||||
|
||||
int xce_jobctrl(xce_ctx_t* ctx,
|
||||
xce_jobctrl_t* ctrl)
|
||||
int xce_jobctrl(xce_ctx_t* ctx, xce_jobctrl_t* ctrl)
|
||||
{
|
||||
ioctx_t* ioctx;
|
||||
int rc;
|
||||
|
|
@ -600,8 +553,7 @@ int xce_jobctrl(xce_ctx_t* ctx,
|
|||
return status;
|
||||
}
|
||||
|
||||
int xce_queuectrl(xce_ctx_t* ctx,
|
||||
xce_queuectrl_t* ctrl)
|
||||
int xce_queuectrl(xce_ctx_t* ctx, xce_queuectrl_t* ctrl)
|
||||
{
|
||||
ioctx_t* ioctx;
|
||||
int rc;
|
||||
|
|
@ -633,8 +585,7 @@ int xce_queuectrl(xce_ctx_t* ctx,
|
|||
return status;
|
||||
}
|
||||
|
||||
int xce_runtask(xce_ctx_t* ctx,
|
||||
xce_taskrun_t* runinfo)
|
||||
int xce_runtask(xce_ctx_t* ctx, xce_taskrun_t* runinfo)
|
||||
{
|
||||
ioctx_t* ioctx;
|
||||
int rc;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue