ElfPSP_ParallelABC
Protein Structure Prediction using Parallel Artificial Bee Colony Optimization
Macros | Functions
solution_mpi.h File Reference

Routines for transmitting Solution objects to and from other nodes within an MPI environment. More...

#include <mpi/mpi.h>
#include <elf_tree_comm/elf_tree_comm.h>
#include "solution.h"

Go to the source code of this file.

Macros

#define SOLUTION_PARALLEL_INLINE   inline
 

Functions

SOLUTION_PARALLEL_INLINE void Solution_pack (Solution sol, int hpSize, void *buf, int maxSize, int *position, MPI_Comm comm)
 Packs a Solution in the given buffer. More...
 
SOLUTION_PARALLEL_INLINE Solution Solution_unpack (int hpSize, void *buf, int maxSize, int *position, MPI_Comm comm)
 Unpacks a Solution and returns it. More...
 
SOLUTION_PARALLEL_INLINE void Solution_calculate_fitness_master (Solution *sols, int nSols, int hpSize, MPI_Comm comm)
 Calculates the fitness for all solutions in the given vector, using all nodes in the MPI communicator registered in the HIVE (HIVE_COMM.comm).
 
SOLUTION_PARALLEL_INLINE void Solution_calculate_fitness_master_kill_slaves (int hpSize, MPI_Comm comm)
 Tells slaves to return Allocate buffer for MPI_Scatter / Gather.
 
SOLUTION_PARALLEL_INLINE void Solution_calculate_fitness_slave (const HPElem *hpChain, int hpSize, MPI_Comm comm)
 Procedure that the slave nodes should execute. More...
 

Detailed Description

Routines for transmitting Solution objects to and from other nodes within an MPI environment.

Function Documentation

◆ Solution_calculate_fitness_slave()

SOLUTION_PARALLEL_INLINE void Solution_calculate_fitness_slave ( const HPElem hpChain,
int  hpSize,
MPI_Comm  comm 
)

Procedure that the slave nodes should execute.

Consists of waiting for MovChains, calculating its fitness, and sending the fitness back to node 0. The fitness is sent back with the same MPI_TAG that was received with the MovChain. The slave will return once the first element of the MovChain received is equal 0xFF.

◆ Solution_pack()

SOLUTION_PARALLEL_INLINE void Solution_pack ( Solution  sol,
int  hpSize,
void *  buf,
int  maxSize,
int *  position,
MPI_Comm  comm 
)

Packs a Solution in the given buffer.

◆ Solution_unpack()

SOLUTION_PARALLEL_INLINE Solution Solution_unpack ( int  hpSize,
void *  buf,
int  maxSize,
int *  position,
MPI_Comm  comm 
)

Unpacks a Solution and returns it.