X-Git-Url: http://info.iut-bm.univ-fcomte.fr/pub/gitweb/mapping.git/blobdiff_plain/04237b062ba76603c6be49d9ba84121691aa4009..HEAD:/src/and/Mapping/Utils.java diff --git a/src/and/Mapping/Utils.java b/src/and/Mapping/Utils.java index bef5dd4..1cd073b 100644 --- a/src/and/Mapping/Utils.java +++ b/src/and/Mapping/Utils.java @@ -89,8 +89,8 @@ public class Utils n.setMemory( memory ) ; n.setNb_cores( nbCore ) ; n.setName( name ) ; - n.setCluster( names[1] ) ; - n.setSite( names[2] ) ; + n.setClusterName( names[1] ) ; + n.setSiteName( names[2] ) ; n.setIP( ip ) ; n.setMapped( false ) ; @@ -116,32 +116,30 @@ public class Utils for( int i = 0 ; i < _an.size() ; i++ ) { - /* Variables edition */ + /* Variables edition */ - String names[] = decodeG5Knames( _an.get( i ).getName() ) ; - - cluster = names[ 1 ] ; - site = names[ 2 ] ; + cluster = _an.get( i ).getClusterName() ; //names[ 1 ] ; + site = _an.get( i ).getSiteName() ; //names[ 2 ] ; /* Insertion of the node in its cluster */ - boolean trouve = false ; + boolean found = false ; for( int j = 0 ; j < clusters.size() ; j++ ) { - if( clusters.get( j ).getName().equals( cluster ) && clusters.get( j ).getSite().equals( site )) + if( clusters.get( j ).getName().equalsIgnoreCase( cluster ) + && clusters.get( j ).getSite().equalsIgnoreCase( site )) { _an.get( i ).setInCluster( true ) ; _an.get( i ).setMapped( false ) ; - _an.get( i ).setSite( clusters.get( j ).getSite() ) ; - _an.get( i ).setCluster( clusters.get( j ).getName() ) ; + _an.get( i ).setCluster( clusters.get( j ) ) ; clusters.get( j ).addGNode( _an.get( i ) ) ; - trouve = true ; + found = true ; break ; } } - if( ! trouve ) + if( ! found ) { Cluster cl = new Cluster() ; @@ -150,8 +148,7 @@ public class Utils _an.get( i ).setInCluster( true ) ; _an.get( i ).setMapped( false ) ; - _an.get( i ).setSite( site ) ; - _an.get( i ).setCluster( cluster ) ; + _an.get( i ).setCluster( cl ) ; cl.addGNode( _an.get( i ) ) ; @@ -172,7 +169,7 @@ public class Utils * @param _name The full name of the G5K node * @return The three parts of the name */ - protected static String[] decodeG5Knames( String _name ) + public static String[] decodeG5Knames( String _name ) { String temp = "" ; String tab[] = new String[ 5 ] ; @@ -182,12 +179,12 @@ public class Utils tab = temp.split( "!" ) ; - ret[0] = tab[ 0 ] ; - ret[2] = tab[ 1 ] ; + ret[0] = tab[ 0 ] ; // node name + ret[2] = tab[ 1 ] ; // site name tab = ret[0].split( "-" ) ; - ret[ 1 ] = tab[ 0 ] ; + ret[ 1 ] = tab[ 0 ] ; // cluster name return ret ; }