<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic If you aren't using mpi then in Intel® MPI Library</title>
    <link>https://community.intel.com/t5/Intel-MPI-Library/OpenMP-problem-with-Threads-Number/m-p/1011696#M3928</link>
    <description>&lt;P&gt;If you aren't using mpi then mpirun isn't useful, nor is this forum a good choice.&amp;nbsp;&lt;/P&gt;

&lt;P&gt;Besides environment variable, you have the possibilities of omp_set_num_threads function call and num_threads clause in omp parallel.&lt;/P&gt;

&lt;P&gt;&amp;nbsp;&lt;/P&gt;

&lt;P&gt;&amp;nbsp;&lt;/P&gt;

&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Mon, 13 Apr 2015 09:05:35 GMT</pubDate>
    <dc:creator>TimP</dc:creator>
    <dc:date>2015-04-13T09:05:35Z</dc:date>
    <item>
      <title>OpenMP problem with Threads Number</title>
      <link>https://community.intel.com/t5/Intel-MPI-Library/OpenMP-problem-with-Threads-Number/m-p/1011693#M3925</link>
      <description>&lt;P&gt;Hi,&lt;/P&gt;

&lt;P&gt;My program calls a function and it receives two files name that are build in for command. Its goal is read a number of mol2 files and create pdbqt files. Therefore, I create a loop in which each file mol2 file name is created pdbqt file. My part of the code is below:&lt;/P&gt;

&lt;PRE class="brush:cpp;"&gt;#pragma omp parallel shared(m,mol2_size) private(path_file_mol2, path_file_pdbqt, file_pdbqt, base_file_name)
{           	
		path_file_mol2 = (char*)malloc(sizeof(char)*MAX_PATH_FILE_NAME);
		path_file_pdbqt = (char*)malloc(sizeof(char)*MAX_PATH_FILE_NAME);
		file_pdbqt = (char*)malloc(sizeof(char)*MAX_FILE_NAME);
		base_file_name  = (char*)malloc(sizeof(char)*MAX_FILE_NAME);     		    	
		#pragma omp for 		
		for (m = 0; m &amp;lt; mol2_size; m++){
			//Obtaing base file name. This is file name without its extension
			set_base_file_name(base_file_name, all_mol2_files&lt;M&gt;.file_name, ex_mol2);
			strcpy(file_pdbqt, base_file_name);
			add_ext_file_name(file_pdbqt, ex_pdbqt);
			//mol2 file
			strcpy(path_file_mol2, param-&amp;gt;path_mol2);
			strcat(path_file_mol2, all_mol2_files&lt;M&gt;.file_name);
			//pdbqt files		
			strcpy(path_file_pdbqt, param-&amp;gt;path_compounds);
			strcat(path_file_pdbqt, file_pdbqt);
			call_prepare_ligand(param, path_file_mol2, path_file_pdbqt);

		}
		free(base_file_name);
		free(file_pdbqt);
		free(path_file_pdbqt);		
		free(path_file_mol2);		    		
}
&lt;/M&gt;&lt;/M&gt;&lt;/PRE&gt;

&lt;P&gt;I can not understand why my code is working fine when threads number is equal than number of files. In my test, I have 4 mol2 files. When I execute my program with&amp;nbsp;mpirun -np 4 /home/faccioli/workspace/drugdesign/virtualscreening/build/./prepare_ligand config.conf it works fine: 4 pdbq files are created. However, when I execute&amp;nbsp;&lt;SPAN style="font-size: 13.0080003738403px; line-height: 19.5120010375977px;"&gt;mpirun -np 2 /home/faccioli/workspace/drugdesign/virtualscreening/build/./prepare_ligand config.conf 2 pdbqt files are created.&amp;nbsp;&lt;/SPAN&gt;&lt;/P&gt;

&lt;P&gt;&lt;SPAN style="font-size: 13.0080003738403px; line-height: 19.5120010375977px;"&gt;I attached my entire code.&amp;nbsp;&lt;/SPAN&gt;&lt;/P&gt;

&lt;P&gt;&lt;SPAN style="font-size: 13.0080003738403px; line-height: 19.5120010375977px;"&gt;I appreciate any help.&lt;/SPAN&gt;&lt;/P&gt;

&lt;P&gt;&lt;SPAN style="font-size: 13.0080003738403px; line-height: 19.5120010375977px;"&gt;Best regards,&amp;nbsp;&lt;/SPAN&gt;&lt;/P&gt;</description>
      <pubDate>Mon, 06 Apr 2015 14:50:26 GMT</pubDate>
      <guid>https://community.intel.com/t5/Intel-MPI-Library/OpenMP-problem-with-Threads-Number/m-p/1011693#M3925</guid>
      <dc:creator>Rodrigo_Antonio_F_</dc:creator>
      <dc:date>2015-04-06T14:50:26Z</dc:date>
    </item>
    <item>
      <title>Are you running mpi thread</title>
      <link>https://community.intel.com/t5/Intel-MPI-Library/OpenMP-problem-with-Threads-Number/m-p/1011694#M3926</link>
      <description>&lt;P&gt;Are you running mpi thread funneled mode (openmp within each rank under mpi)? Your mpirun np parameter controls number of ranks while omp_num_threads must be set to number of threads per rank. &amp;nbsp;&lt;/P&gt;

&lt;P&gt;I hope you're not trying to make each thread of each rank open a file. &amp;nbsp;I'm on a PadFone without internet so can't examine your full example.&lt;/P&gt;

&lt;P&gt;&amp;nbsp;&lt;/P&gt;

&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Sat, 11 Apr 2015 11:51:46 GMT</pubDate>
      <guid>https://community.intel.com/t5/Intel-MPI-Library/OpenMP-problem-with-Threads-Number/m-p/1011694#M3926</guid>
      <dc:creator>TimP</dc:creator>
      <dc:date>2015-04-11T11:51:46Z</dc:date>
    </item>
    <item>
      <title>Hi,</title>
      <link>https://community.intel.com/t5/Intel-MPI-Library/OpenMP-problem-with-Threads-Number/m-p/1011695#M3927</link>
      <description>&lt;P&gt;Hi,&lt;/P&gt;

&lt;P&gt;Thanks for your attention.&lt;BR /&gt;
	&lt;BR /&gt;
	I have used OpenMP instead of MPI. In fact I will run it in shared memory.&amp;nbsp;&lt;BR /&gt;
	&lt;BR /&gt;
	I understood about mpirun program. Therefore, I have to set omp_num_threads using it as environment variable. I use Debian, export OMP_NUM_THREADS=number, where number means the number of threads that I want to run.&lt;BR /&gt;
	&lt;BR /&gt;
	Although I have looked, I could not figure out if it is possible to set omp_num_threads in run time. Is it possible?&lt;/P&gt;

&lt;P&gt;&lt;BR /&gt;
	Best regards,&lt;/P&gt;</description>
      <pubDate>Sun, 12 Apr 2015 19:11:57 GMT</pubDate>
      <guid>https://community.intel.com/t5/Intel-MPI-Library/OpenMP-problem-with-Threads-Number/m-p/1011695#M3927</guid>
      <dc:creator>Rodrigo_Antonio_F_</dc:creator>
      <dc:date>2015-04-12T19:11:57Z</dc:date>
    </item>
    <item>
      <title>If you aren't using mpi then</title>
      <link>https://community.intel.com/t5/Intel-MPI-Library/OpenMP-problem-with-Threads-Number/m-p/1011696#M3928</link>
      <description>&lt;P&gt;If you aren't using mpi then mpirun isn't useful, nor is this forum a good choice.&amp;nbsp;&lt;/P&gt;

&lt;P&gt;Besides environment variable, you have the possibilities of omp_set_num_threads function call and num_threads clause in omp parallel.&lt;/P&gt;

&lt;P&gt;&amp;nbsp;&lt;/P&gt;

&lt;P&gt;&amp;nbsp;&lt;/P&gt;

&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 13 Apr 2015 09:05:35 GMT</pubDate>
      <guid>https://community.intel.com/t5/Intel-MPI-Library/OpenMP-problem-with-Threads-Number/m-p/1011696#M3928</guid>
      <dc:creator>TimP</dc:creator>
      <dc:date>2015-04-13T09:05:35Z</dc:date>
    </item>
    <item>
      <title>Hi,</title>
      <link>https://community.intel.com/t5/Intel-MPI-Library/OpenMP-problem-with-Threads-Number/m-p/1011697#M3929</link>
      <description>&lt;P&gt;Hi,&lt;/P&gt;

&lt;P&gt;I appreciate your help.&lt;/P&gt;

&lt;P&gt;Best regards,&lt;/P&gt;</description>
      <pubDate>Mon, 13 Apr 2015 12:13:19 GMT</pubDate>
      <guid>https://community.intel.com/t5/Intel-MPI-Library/OpenMP-problem-with-Threads-Number/m-p/1011697#M3929</guid>
      <dc:creator>Rodrigo_Antonio_F_</dc:creator>
      <dc:date>2015-04-13T12:13:19Z</dc:date>
    </item>
  </channel>
</rss>

