X-Git-Url: http://info.iut-bm.univ-fcomte.fr/pub/gitweb/simgrid.git/blobdiff_plain/97acefec7ab9e598ad07ac39c49dc6fab7fa0a46..fe657d473727f5f9e71ab147673d902bef1a54d4:/src/simdag/sd_workstation.c diff --git a/src/simdag/sd_workstation.c b/src/simdag/sd_workstation.c index f8bf3c05fa..d2a00e1a7a 100644 --- a/src/simdag/sd_workstation.c +++ b/src/simdag/sd_workstation.c @@ -1,3 +1,9 @@ +/* Copyright (c) 2006, 2007, 2008, 2009, 2010. The SimGrid Team. + * All rights reserved. */ + +/* This program is free software; you can redistribute it and/or modify it + * under the terms of the license (GNU LGPL) which comes with this package. */ + #include "private.h" #include "simdag/simdag.h" #include "xbt/dict.h" @@ -162,8 +168,7 @@ xbt_dict_t SD_workstation_get_properties(SD_workstation_t workstation) SD_CHECK_INIT_DONE(); xbt_assert0((workstation != NULL), "Invalid parameters"); - return (surf_workstation_model->get_properties - (workstation->surf_workstation)); + return surf_workstation_model->extension.workstation.get_properties(workstation->surf_workstation); } @@ -493,3 +498,18 @@ void __SD_workstation_destroy(void *workstation) } xbt_free(w); } + +/** + * \brief Returns the kind of the task currently running on a workstation + * Only call this with sequential access mode set + * \param workstation a workstation */ +SD_task_t SD_workstation_get_current_task(SD_workstation_t workstation) +{ + SD_CHECK_INIT_DONE(); + xbt_assert0(workstation != NULL, "Invalid parameter"); + xbt_assert0(workstation->access_mode == SD_WORKSTATION_SEQUENTIAL_ACCESS, + "Access mode must be set to SD_WORKSTATION_SEQUENTIAL_ACCESS" + " to use this function"); + + return (workstation->current_task); +}