From: velho Date: Wed, 14 Feb 2007 17:00:47 +0000 (+0000) Subject: Making a surf workstation model using csdp. How simple isn't it ? :) X-Git-Tag: v3.3~2208 X-Git-Url: http://info.iut-bm.univ-fcomte.fr/pub/gitweb/simgrid.git/commitdiff_plain/3ffba8ac7a4b5cb19a9feed264a11422ee0f202f Making a surf workstation model using csdp. How simple isn't it ? :) git-svn-id: svn+ssh://scm.gforge.inria.fr/svn/simgrid/simgrid/trunk@3151 48e7efb5-ca39-0410-a469-dd3cf9ba447f --- diff --git a/src/include/surf/surf.h b/src/include/surf/surf.h index 81f52993ce..824bdcece8 100644 --- a/src/include/surf/surf.h +++ b/src/include/surf/surf.h @@ -340,6 +340,7 @@ void surf_workstation_resource_init_CLM03(const char *filename); * \see surf_workstation_resource_init_CLM03() */ void surf_workstation_resource_init_KCCFLN05(const char *filename); +void surf_workstation_resource_init_KCCFLN05_proportionnal(const char *filename); /** \brief The network links * \ingroup SURF_resources diff --git a/src/surf/surf.c b/src/surf/surf.c index 83f661465f..f4eac311f0 100644 --- a/src/surf/surf.c +++ b/src/surf/surf.c @@ -11,6 +11,7 @@ XBT_LOG_NEW_DEFAULT_SUBCATEGORY(surf_kernel, surf, "Logging specific to SURF (kernel)"); +int use_sdp_solver=0; /* Additional declarations for Windows potability. */ @@ -139,7 +140,15 @@ double generic_maxmin_share_resources2(xbt_swag_t running_actions, double value = -1; #define VARIABLE(action) (*((lmm_variable_t*)(((char *) (action)) + (offset)))) - lmm_solve(sys); + if(!use_sdp_solver) + lmm_solve(sys); + else { +#ifdef HAVE_SDP + sdp_solve(sys); +#else + xbt_assert0(0, "No CSDP found! You cannot use this model!"); +#endif + } xbt_swag_foreach(action, running_actions) { value = lmm_variable_getvalue(VARIABLE(action)); diff --git a/src/surf/surf_private.h b/src/surf/surf_private.h index c77e66402f..9b27052744 100644 --- a/src/surf/surf_private.h +++ b/src/surf/surf_private.h @@ -44,6 +44,8 @@ typedef struct surf_resource_private { /* #define pub2priv(r) ((surf_resource_private_t) ((char *)(r) -(sizeof(struct surf_resource_private_part)))) */ /* #define priv2pub(r) ((void *) ((char *)(r) +(sizeof(struct surf_resource_private_part)))) */ +extern int use_sdp_solver; + double generic_maxmin_share_resources(xbt_swag_t running_actions, size_t offset); double generic_maxmin_share_resources2(xbt_swag_t running_actions, diff --git a/src/surf/workstation_KCCFLN05.c b/src/surf/workstation_KCCFLN05.c index 8695b1bc8d..2669c5830f 100644 --- a/src/surf/workstation_KCCFLN05.c +++ b/src/surf/workstation_KCCFLN05.c @@ -1042,3 +1042,15 @@ void surf_workstation_resource_init_KCCFLN05(const char *filename) xbt_dynar_push(resource_list, &surf_workstation_resource); } + +void surf_workstation_resource_init_KCCFLN05_proportionnal(const char *filename) +{ + xbt_assert0(!surf_cpu_resource, "CPU resource type already defined"); + xbt_assert0(!surf_network_resource, "network resource type already defined"); + resource_init_internal(); + parse_file(filename); + + surf_workstation_resource->common_public->name = "Workstation KCCFLN05 (proportionnal)"; + use_sdp_solver=1; + xbt_dynar_push(resource_list, &surf_workstation_resource); +}