Intel® MPI Library
Get help with building, analyzing, optimizing, and scaling high-performance computing (HPC) applications.

Problem: Sending more than two process

Rodrigo_Antonio_F_
533 Views

Hi,

I have faced with a problem when my program try to send structure data more than two process. I created data structure mpi_docking_t as below 

typedef struct s_docking{
	char receptor[MAX_FILE_NAME];
	char compound[MAX_FILE_NAME];
}docking_t;

/*************  mpi_docking_t ***************************/  
  const int nitems_dock=2;
  int blocklengths_dock[nitems_dock] = {MAX_PATH, MAX_PATH};
  MPI_Datatype types_dock[nitems_dock] = {MPI_CHAR, MPI_CHAR};  
  MPI_Aint offsets_dock[nitems_dock];

  offsets_dock[0] = offsetof(docking_t, receptor);
  offsets_dock[1] = offsetof(docking_t, compound);

  MPI_Type_create_struct(nitems_dock, blocklengths_dock, offsets_dock, types_dock, &mpi_docking_t);
  MPI_Type_commit(&mpi_docking_t); 
/*************  mpi_docking_t end ***************************/

i tried to send data based on this code:

  //Preparing buffer to be sent
  docking_t  *buff = NULL;
  int buffer_dock;
  buffer_dock = sizeof(docking_t)*number_dock*MPI_BSEND_OVERHEAD;
  buff = (docking_t *) malloc(buffer_dock);

    f_dock = open_file(argv[2], fREAD);
    //Ignoring first line of file
    fgets(line, MAX_LINE_FILE, f_dock);
    //Obtaining docking that will be executed in root
    for (num_line_ref = 0; num_line_ref < number_dock_root; num_line_ref++){
      fgets(line, MAX_LINE_FILE, f_dock);
      set_receptor_compound(docking_root[num_line_ref].receptor, docking_root[num_line_ref].compound, line);      
    }    
    MPI_Buffer_attach(buff, buffer_dock);
    num_line_ref = -1;    
    dest = 1;
    while (fgets(line, MAX_LINE_FILE, f_dock) != NULL){
      if (num_line_ref < number_dock){
        num_line_ref = num_line_ref + 1;
      }else{                
        MPI_Isend(v_docking, number_dock, mpi_docking_t, dest, tag_docking, MPI_COMM_WORLD, &request_dock);
        dest = dest + 1;
        num_line_ref = 0;
      }
      set_receptor_compound(v_docking[num_line_ref].receptor, v_docking[num_line_ref].compound, line);
    }
    //Sending to last rank because MPI_Send inside while command is not executed for the last rank 
    MPI_Isend(v_docking, number_dock, mpi_docking_t, dest, tag_docking, MPI_COMM_WORLD, &request_dock);    
    fclose(f_dock);

My receid code is:

    MPI_Irecv(v_docking, number_dock, mpi_docking_t, root,tag_docking, MPI_COMM_WORLD, &request_dock);
    MPI_Wait(&request_dock, &status);      

When I execute my program using line below, it works fine. 

faccioli@faccioli:~/Execute/MPI$ mpirun -np 2 /home/faccioli/workspace/drugdesign/virtualscreening/build/./vs_main config.conf overall_docking_list.txt
faccioli@faccioli:~/Execute/MPI$ 

However, when I increase the process number (-np > 2) I receive a memory error. I looked at internet and the book Using MPI by William Gropp, but no success to indentify a solution. I understood that I have to create a MPI derived data type. I couldn't understand how I do it.

My project is [1]. My main file is virtual_screening/src/vs_main.c.

I appreciate any help.

Thanks in advance.

[1] https://github.com/rodrigofaccioli/drugdesign

0 Kudos
5 Replies
Loc_N_Intel
Employee
533 Views

Hi Antonio,

I try to reproduce the problem you have. I can compile the problem but cannot run it since I don't know what parameters I should pass in the program. Would you like to post what parameters you are pass in, and what they look like? Thanks.

0 Kudos
Rodrigo_Antonio_F_
533 Views

Hi,

Thank you your attention.

I prepared a branch that contains test directory to run my project. This branch is [1].

The steps below are used to compile my project 

cd drugdesign/virtualscreening
mkdir build
cd build
cmake ../
make

You can run my project using the test directory (drugdesign/virtualscreening/teste_send_receive/) since you update your config.conf file. It contains the paths to run this project. Please, change it for your file system. Important. If you don't have installed Vina Auto dock program, please, you can comment call_vina function in vs_main.c file. 


Finally, you can run my program through mpirun -np 2 /home/faccioli/workspace/drugdesign/virtualscreening/build/./vs_main config.conf overall_docking_list.txt

[1] https://github.com/rodrigofaccioli/drugdesign/tree/send_receive_data

Best regards,

0 Kudos
Loc_N_Intel
Employee
533 Views

Hi Antonio,

Where do I get the two file config.conf and overall_docking_list.txt? Those files are necessary to pass in as arguments for the program vs_main, right?

What version of Intel MPI are you using? What Intel compiler are you using? Thank you.

0 Kudos
Rodrigo_Antonio_F_
533 Views

Hi,

Thanks all your attention.

These files are at drugdesign/virtualscreening/teste_send_receive .
It contains all files to pass in vs_main program. Please, you need to set your file system in config.conf file.

Nowadays, I'm not using intel neither mpi or compiler, because I have to develop a version using free compiler. After, I will use intel compiler.

My compiler is below:
$ mpicxx --version
c++ (Debian 4.7.2-5) 4.7.2
Copyright (C) 2012 Free Software Foundation, Inc.
This is free software; see the source for copying conditions.  There is NO
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.

Best regards,

 

0 Kudos
Loc_N_Intel
Employee
533 Views

Hi,

I just have Intel Compiler and Intel MPI library installed on my system. When I executed "cmake ../", I got the following error. It seems like cmake cannot find Intel MPI path. I also tried to set these MPI paths manually (MPI_C_LIBRARIES,...), but it still failed when running cmake:

C:\Users\Administrator\Desktop\DrugDesign\drugdesign-master\drugdesign-master\vi
rtualscreening\build>cmake ../
-- Building for: Visual Studio 11 2012
-- The C compiler identification is MSVC 17.0.50727.1
-- The CXX compiler identification is MSVC 17.0.50727.1
-- Check for working C compiler using: Visual Studio 11 2012
-- Check for working C compiler using: Visual Studio 11 2012 -- works
-- Detecting C compiler ABI info
-- Detecting C compiler ABI info - done
-- Check for working CXX compiler using: Visual Studio 11 2012
-- Check for working CXX compiler using: Visual Studio 11 2012 -- works
-- Detecting CXX compiler ABI info
-- Detecting CXX compiler ABI info - done
-- Detecting CXX compile features
-- Detecting CXX compile features - done
CMake Error at C:/Program Files (x86)/CMake/share/cmake-3.2/Modules/FindPackageH
andleStandardArgs.cmake:138 (message):
  Could NOT find MPI_C (missing: MPI_C_LIBRARIES)
Call Stack (most recent call first):
  C:/Program Files (x86)/CMake/share/cmake-3.2/Modules/FindPackageHandleStandard
Args.cmake:374 (_FPHSA_FAILURE_MESSAGE)
  C:/Program Files (x86)/CMake/share/cmake-3.2/Modules/FindMPI.cmake:616 (find_p
ackage_handle_standard_args)
  CMakeLists.txt:11 (find_package)


-- Configuring incomplete, errors occurred!
See also "C:/Users/Administrator/Desktop/DrugDesign/drugdesign-master/drugdesign
-master/virtualscreening/build/CMakeFiles/CMakeOutput.log".

 

0 Kudos
Reply