[Pvfs2-cvs] commit by pcarns in pvfs2-1/src/io/description:
dist-twod-stripe.c
CVS commit program
cvs at parl.clemson.edu
Wed Jul 16 11:44:03 EDT 2008
Update of /projects/cvsroot/pvfs2-1/src/io/description
In directory parlweb1:/tmp/cvs-serv26072/src/io/description
Modified Files:
dist-twod-stripe.c
Log Message:
committing patch from Kyle Schochenmaier to allow twod_stripe distribution
to handle the condition of num_groups < num_servers
Index: dist-twod-stripe.c
===================================================================
RCS file: /projects/cvsroot/pvfs2-1/src/io/description/dist-twod-stripe.c,v
diff -p -u -r1.6 -r1.7
--- dist-twod-stripe.c 7 Jul 2008 14:25:27 -0000 1.6
+++ dist-twod-stripe.c 16 Jul 2008 15:44:03 -0000 1.7
@@ -71,13 +71,16 @@ static PVFS_offset logical_to_physical_o
num_groups = dparam->num_groups;
strip_size = dparam->strip_size;
- if(num_groups > server_ct || num_groups == 0 || server_ct == 0 )
+ if( num_groups == 0 || server_ct == 0 )
{
gossip_err("%s: Invalid num_groups/server_ct options: "
"gr:%d server:%d\n",
__func__, num_groups, server_ct);
}
+ if(num_groups > server_ct )
+ num_groups = server_ct;
+
/* size of all groups that are of equal size: all groups
* except when server_ct doesnt divide evenly into num_groups */
small_group_size = server_ct / num_groups;
@@ -190,7 +193,7 @@ static PVFS_offset physical_to_logical_o
PVFS_size global_stripes = 0;
uint32_t num_groups = dparam->num_groups;
- if(num_groups > server_ct || num_groups == 0 || server_ct == 0 )
+ if( num_groups == 0 || server_ct == 0 )
{
gossip_err(
"%s: Invalid num_groups/server_ct options: "
@@ -198,6 +201,9 @@ static PVFS_offset physical_to_logical_o
__func__,num_groups,server_ct);
}
+ if(num_groups > server_ct)
+ num_groups = server_ct;
+
/* if we are a server in the last group, make sure things are happy */
if(server_nr >= (num_groups-1)*(small_group_size))
{
@@ -334,7 +340,7 @@ static PVFS_offset next_mapped_offset(vo
return physical_to_logical_offset(params,fd,0);
}
- if(num_groups > server_ct || num_groups == 0 || server_ct == 0 )
+ if( num_groups == 0 || server_ct == 0 )
{
gossip_err("%s: Invalid num_groups/server_ct options: "
"gr:%d server:%d\n",
@@ -342,7 +348,8 @@ static PVFS_offset next_mapped_offset(vo
num_groups,
server_ct);
}
-
+ if(num_groups > server_ct)
+ num_groups = server_ct;
total_stripes += global_stripes * factor;
/* if we are a server in the last group, make sure things are happy */
More information about the Pvfs2-cvs
mailing list