Author: ghuck
Date: 2009-07-28 13:12:19 -0700 (Tue, 28 Jul 2009)
New Revision: 17598

Modified:
   csplugins/trunk/soc/ghuck/plugin/READ_ME
   csplugins/trunk/soc/ghuck/plugin/src/ForceDirected.java
   csplugins/trunk/soc/ghuck/plugin/src/gpuGraphDrawing/Makefile
   csplugins/trunk/soc/ghuck/plugin/src/gpuGraphDrawing/interface.cu
Log:
Much simpler "instalation" of plugin(only Linux 64 bits for now): 
Simply copy the JAR file to the plugin folder, and set the correct path of CUDA 
instalation folder in Cytoscape menu:
   Layouts->Settings->GpuLayouts(ForceDirected)




Modified: csplugins/trunk/soc/ghuck/plugin/READ_ME
===================================================================
--- csplugins/trunk/soc/ghuck/plugin/READ_ME    2009-07-28 17:28:51 UTC (rev 
17597)
+++ csplugins/trunk/soc/ghuck/plugin/READ_ME    2009-07-28 20:12:19 UTC (rev 
17598)
@@ -4,8 +4,8 @@
 
 2- Modify lines 14 and 16 of src/gpuGraphDrawing/Makefile, so that both CUDPP 
and CUDA variables point to the installation folders of CUDPP and CUDA.
 
-3- Modify lines 395 and 396 of src/GpuLayout.java, so that CY_PLUGIN_PATH 
points to your cytoscape plugin folder, and CUDA_LIB points to your cuda/lib 
folder.
+3- Run "ant copy_jar" command on the plugin folder. This will automatically 
put the plugin in the cytoscape plugin folder.
 
-4- Run "ant copy_jar" command on the plugin folder. This will automatically 
put the plugin in the cytoscape plugin folder.
 
 
+

Modified: csplugins/trunk/soc/ghuck/plugin/src/ForceDirected.java
===================================================================
--- csplugins/trunk/soc/ghuck/plugin/src/ForceDirected.java     2009-07-28 
17:28:51 UTC (rev 17597)
+++ csplugins/trunk/soc/ghuck/plugin/src/ForceDirected.java     2009-07-28 
20:12:19 UTC (rev 17598)
@@ -43,6 +43,7 @@
 import java.lang.reflect.Field;
 import java.lang.Math;
 import java.util.*;
+import java.util.Map;
 
 import cytoscape.CyNetwork;
 import cytoscape.Cytoscape;
@@ -60,12 +61,9 @@
 
 public class ForceDirected extends AbstractGraphPartition
 {
-    //private double UNIT_SIZE = 100.0;
     private double H_SIZE = 1000.0;
     private double V_SIZE = 1000.0;
     private String GPU_LIBRARY = "GpuLayout";
-    private String CY_PLUGIN_PATH = "/home/gerardo/Cytoscape_v2.6.2/plugins";
-    private String CUDA_LIB = "/usr/local/cuda/lib";
      
     // Default values for algorithm parameters 
     private int coarseGraphSize         = 50;
@@ -74,6 +72,8 @@
     private int edgeLen                 = 5;
     private int initialNoIterations     = 300;
 
+    private String CUDA_PATH = "/usr/local/cuda/lib";
+
     private LayoutProperties layoutProperties;
 
 
@@ -112,7 +112,10 @@
        layoutProperties.add(new Tunable("levelConvergence",        "Level 
Convergence"           , Tunable.INTEGER, new Integer(2)  ));
        layoutProperties.add(new Tunable("edgeLen",                 "Ideal Edge 
Length"           , Tunable.INTEGER, new Integer(5)  ));
        layoutProperties.add(new Tunable("initialNoIterations",     "Initial 
Number of Iterations", Tunable.INTEGER, new Integer(300)));
+
+       layoutProperties.add(new Tunable("CUDA_PATH", "CUDA instalation 
folder", Tunable.STRING , new String("/usr/local/cuda")));
        
+       
        // Initialize layout properties
        layoutProperties.initializeProperties();
        
@@ -173,19 +176,26 @@
        Tunable t5 = layoutProperties.get("initialNoIterations");
        if ((t5 != null) && (t5.valueChanged() || force))
            initialNoIterations = ((Integer) t5.getValue()).intValue();
+
+       // Get initialNoIterations
+       Tunable t6 = layoutProperties.get("CUDA_PATH");
+       if ((t6 != null) && (t6.valueChanged() || force))
+           CUDA_PATH =  t6.getValue().toString();
+
+
        
-         // Show message on screen    
-         /*String message = "Preferences updated\n" 
-               +  coarseGraphSize + "\n" 
+       // Show message on screen    
+       /*
+         String message = "Preferences updated\n" 
+         +  coarseGraphSize + "\n" 
          + interpolationIterations + "\n"  
          + levelConvergence + "\n"         
          + edgeLen + "\n"                  
-         + initialNoIterations; 
-         */
-       
-       // Use the CytoscapeDesktop as parent for a Swing dialog
-       //JOptionPane.showMessageDialog( Cytoscape.getDesktop(), message);
-       
+         + initialNoIterations + "\n"
+         + CUDA_PATH;
+         
+         JOptionPane.showMessageDialog( Cytoscape.getDesktop(), message);
+       */
     }
     
     /**
@@ -219,7 +229,6 @@
      * This function does the "heavy work", calling the native code
      */
     public void layoutPartion (LayoutPartition part) {
-       
 
        // Show message on the task monitor
        taskMonitor.setStatus("Initializing: Partition: " + 
part.getPartitionNumber());
@@ -293,17 +302,6 @@
        // Mark end of AdjMatIndex, so that you can now where ends AdjMatVals  
        AdjMatIndex[currentNodePosition] = position;
        
-       
-       //  Show message on screen with AdjMatIndex and AdjMatVals   
-       /*String message2 = "AdjMatIndex\n"; 
-       for (int i = 0; i < AdjMatIndex.length; i++)
-           message2 = message2 + " " +AdjMatIndex[i];
-       message2 = message2 + "\nAdhMatVals\n";
-       for (int i = 0; i < AdjMatVals.length; i++)
-         message2 = message2 + " " +AdjMatVals[i];         
-         JOptionPane.showMessageDialog( Cytoscape.getDesktop(), message2);
-       */
-              
        // Check whether it has been canceled by the user
        if (canceled)
            return;
@@ -323,14 +321,19 @@
            // Reset it to null so that whenever "System.loadLibrary" is 
called, it will be reconstructed with the changed value
            field.set(clazz, null);
            try {
+
+               Map<String, String> env = System.getenv();
+
+
                // Change the value and load the library.
-               System.setProperty("java.library.path", CY_PLUGIN_PATH + ":" + 
CUDA_LIB + ":" + orig_path);
+               System.setProperty("java.library.path", "./plugins" + ":" + 
CUDA_PATH + "/lib" + ":" + orig_path);
                System.loadLibrary("cudart");
                System.loadLibrary(GPU_LIBRARY);
            }
            catch (UnsatisfiedLinkError error){
-               String message = "Problem detected while loading Static Library 
with Native Code\nCannot Produce Layout\n"
-                   + error.getMessage();
+               String message = "Problem detected while loading Static Library 
with Native Code\nCannot Produce Layout\n"                  
+                   + error.getMessage() 
+                   + "\nPlease check that CUDA instalation folder is correctly 
set in the menu \"Layouts->Settings->GpuLayout(ForceDirected)\"";
                JOptionPane.showMessageDialog(Cytoscape.getDesktop(), message);
                
                // Revert back the changes
@@ -351,12 +354,7 @@
                    + exception.getMessage();
                JOptionPane.showMessageDialog(Cytoscape.getDesktop(), message4);
        }
-       
-       // Set H_SIZE and V_SIZE
-       //H_SIZE = 1000.0 + UNIT_SIZE * Math.log((double) numNodes);
-       //V_SIZE = 1000.0 + UNIT_SIZE * Math.log((double) numNodes);
 
-
        // Check whether it has been canceled by the user
        if (canceled)
            return;      

Modified: csplugins/trunk/soc/ghuck/plugin/src/gpuGraphDrawing/Makefile
===================================================================
--- csplugins/trunk/soc/ghuck/plugin/src/gpuGraphDrawing/Makefile       
2009-07-28 17:28:51 UTC (rev 17597)
+++ csplugins/trunk/soc/ghuck/plugin/src/gpuGraphDrawing/Makefile       
2009-07-28 20:12:19 UTC (rev 17598)
@@ -4,7 +4,7 @@
        rm -r ./GpuLayout/
        nvcc --shared --compiler-options '-fPIC' -o libGpuLayout.so $(INC) 
$(LIB) GpuLayout.cu -lglut -lcudart -lcudpp64
 
-       nvcc --compiler-options '-fPIC' -c -o GpuLayout.o $(INC) $(LIB) 
GpuLayout.cu -lglut -lcudart -lcudpp64
+       #nvcc --compiler-options '-fPIC' -c -o GpuLayout.o $(INC) $(LIB) 
GpuLayout.cu -lglut -lcudart -lcudpp64
 
        cp libGpuLayout.so ../../
 

Modified: csplugins/trunk/soc/ghuck/plugin/src/gpuGraphDrawing/interface.cu
===================================================================
--- csplugins/trunk/soc/ghuck/plugin/src/gpuGraphDrawing/interface.cu   
2009-07-28 17:28:51 UTC (rev 17597)
+++ csplugins/trunk/soc/ghuck/plugin/src/gpuGraphDrawing/interface.cu   
2009-07-28 20:12:19 UTC (rev 17598)
@@ -269,8 +269,6 @@
   // Initialize device, using macro defined in "cutil.h"
   CUT_DEVICE_INIT();
 
-  printf ("device initialized!\n");
-  
   /*    Initializations    */
 
   // Number of Nodes


--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"cytoscape-cvs" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to 
[email protected]
For more options, visit this group at 
http://groups.google.com/group/cytoscape-cvs?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to