skywalker5 / SNeCT_code

0 stars 0 forks source link

problem running demo #1

Open baj12 opened 6 years ago

baj12 commented 6 years ago

Hi, I wanted to test your program but get an error message:

SNeCT_code bernd$ ./SNeCT
please input proper arguments

SNeCT_code bernd$ ./SNeCT demo/config_demo.txt demo/pancan12_demo.tensor results
Reading input
Segmentation fault: 11

As you can see the program has compile successfully, debugging also doesn't really work (I have compiled with -g)

GNU gdb (GDB) 8.0.1
Copyright (C) 2017 Free Software Foundation, Inc.
License GPLv3+: GNU GPL version 3 or later <http://gnu.org/licenses/gpl.html>
This is free software: you are free to change and redistribute it.
There is NO WARRANTY, to the extent permitted by law.  Type "show copying"
and "show warranty" for details.
This GDB was configured as "x86_64-apple-darwin17.0.0".
Type "show configuration" for configuration details.
For bug reporting instructions, please see:
<http://www.gnu.org/software/gdb/bugs/>.
Find the GDB manual and other documentation resources online at:
<http://www.gnu.org/software/gdb/documentation/>.
For help, type "help".
Type "apropos word" to search for commands related to "word"...
Reading symbols from SNeCT...Reading symbols from programs/SNeCT_code/SNeCT.dSYM/Contents/Resources/DWARF/SNeCT...done.
done.
(gdb) r
Starting program: programs/SNeCT_code/SNeCT demo/config_demo.txt demo/pancan12_demo.tensor result
During startup program terminated with signal ?, Unknown signal.
(gdb) q

I am running on Mac - high sierra...

Thanks for any feedback and help.

skywalker5 commented 6 years ago

Hi, I apologize for your inconvenience. Your second attempt './SNeCT demo/config_demo.txt demo/pancan12_demo.tensor results' was right. However, then, you should change some texts in 'demo/config_demo.txt' before running. You should change 'gene_network_demo.matrix' into 'demo/gene_network_demo.matrix' to run correctly. This is because the file 'config_demo.txt' should include the relative path of gene network matrix file towards the current path. I would find a better way to input the file paths and fix it. Thank you.

baj12 commented 6 years ago

Hi, thanks for the quick responds. I am getting further, but I am still getting a core dump:

./SNeCT demo/config_demo.txt demo/pancan12_demo.tensor results
Reading input
Elapsed Time:   0.206631
Reading Done.
Norm : 293.478923
Initialize
Elapsed Time:   0.000630
CMTF START
Segmentation fault: 11

Any further suggestions?

skywalker5 commented 6 years ago

That is very strange. I am not sure but one possible reason is that your environment does not support parallelization. I suggest to change the 4th line of config_demo.txt from 2 to 1. This means the number of parallel cores you want to run.

baj12 commented 6 years ago

Yes, that helps as well ;). Now it seems to be running. Do you have any suggestion on how check what is going on? I explicitly checked that openMP is working by using a small sample program... Thx again.

skywalker5 commented 6 years ago

Sorry I have no idea right now, do you mean your openMP parallelization is correctly working in other programs?

baj12 commented 6 years ago

yes.. I used the following code:

#include <iostream>
#include <cmath> 
#include <vector>
#include <omp.h>
int main( int argc, char* argv[] ) 
{
     omp_set_num_threads( 8 ); 

     double pi = acos( -1.0 ); 

     std::cout << "Allocating memory ..." << std::endl; 
     std::vector<double> my_vector( 128000000, 0.0 ); 
     std::cout << "Done!" << std::endl << std::endl; 

     std::cout << "Entering main loop ... " << std::endl; 

     #pragma omp parallel for
     for( int i=0; i < my_vector.size(); i++ )
     {
          my_vector[i] = exp( -sin( i*i + pi*log(i+1) ) ); 
     }
     std::cout << "Done!" << std::endl; 

     return 0; 
}

and I can run it without any problem... I also checked that it actually uses 8 threads...

skywalker5 commented 6 years ago

Your openMP may not allow asynchronous update. I recommend you to try only using single core by editing the 4th line of 'config_demo.txt' from 2 to 1.