Add an underscore prefix to partition so that they are identified as non-user
[charm.git] / src / arch / util / machine-common-core.c
index 9d1aa438918fbc11b124b9b5de334e79daa9ef4e..8266b230d5ffe63d55f5e3325ee22a00068acd11 100644 (file)
@@ -135,7 +135,7 @@ void CmiFreeNodeBroadcastAllFn(int size, char *msg);
 #endif
 
 // global state, equals local if running one replica
-PartitionInfo partitionInfo;
+PartitionInfo _partitionInfo;
 int _Cmi_mype_global;
 int _Cmi_numpes_global;
 int _Cmi_mynode_global;
@@ -697,23 +697,23 @@ if (  MSG_STATISTIC)
 
 // functions related to replica
 void CmiCreatePartitions(char **argv) {
-  partitionInfo.numPartitions = 1; 
-  CmiGetArgInt(argv,"+partitions", &partitionInfo.numPartitions);
+  _partitionInfo.numPartitions = 1; 
+  CmiGetArgInt(argv,"+partitions", &_partitionInfo.numPartitions);
 
   _Cmi_numnodes_global = _Cmi_numnodes;
   _Cmi_mynode_global = _Cmi_mynode;
   _Cmi_numpes_global = _Cmi_numnodes_global * _Cmi_mynodesize;
   //still need to set _Cmi_mype_global
 
-  CmiAssert(partitionInfo.numPartitions <= _Cmi_numnodes_global);
-  CmiAssert((_Cmi_numnodes_global % partitionInfo.numPartitions) == 0);
+  CmiAssert(_partitionInfo.numPartitions <= _Cmi_numnodes_global);
+  CmiAssert((_Cmi_numnodes_global % _partitionInfo.numPartitions) == 0);
   
   //simple partition, this will be made more complex in future
-  partitionInfo.partitionSize = _Cmi_numnodes_global / partitionInfo.numPartitions;
-  partitionInfo.myPartition = _Cmi_mynode_global / partitionInfo.partitionSize;
+  _partitionInfo.partitionSize = _Cmi_numnodes_global / _partitionInfo.numPartitions;
+  _partitionInfo.myPartition = _Cmi_mynode_global / _partitionInfo.partitionSize;
        
 
-  //CmiPrintf("in partition %d size %d\n",partitionInfo.myPartition, partitionInfo.partitionSize);
+  //CmiPrintf("in partition %d size %d\n",_partitionInfo.myPartition, _partitionInfo.partitionSize);
   //reset local variables
   _Cmi_mynode = CmiGetNodeLocal(_Cmi_mynode);
   _Cmi_numnodes = CmiPartitionSize();
@@ -721,11 +721,11 @@ void CmiCreatePartitions(char **argv) {
 }
 
 INLINE_KEYWORD int node_lToGTranslate(int node, int partition) {
-  return (partition*partitionInfo.partitionSize)+node;
+  return (partition*_partitionInfo.partitionSize)+node;
 }
 
 INLINE_KEYWORD int node_gToLTranslate(int node) {
-  return (node % partitionInfo.partitionSize);
+  return (node % _partitionInfo.partitionSize);
 }
 
 INLINE_KEYWORD int pe_lToGTranslate(int pe, int partition) {