File: mpifuncs.h

package info (click to toggle)
garli 2.1-9
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid, trixie
  • size: 5,888 kB
  • sloc: cpp: 34,419; sh: 11,026; makefile: 103
file content (82 lines) | stat: -rw-r--r-- 2,936 bytes parent folder | download | duplicates (5)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
// GARLI version 0.93 source code
// Copyright  2005 by Derrick J. Zwickl
// All rights reserved.
//
// This code may be used and modified for non-commercial purposes
// but redistribution in any form requires written permission.
// Please contact:
//
//  Derrick Zwickl
//	Integrative Biology, UT
//	1 University Station, C0930
//	Austin, TX  78712
//  email: garli.support@gmail.com
//
//	Note: In 2006  moving to NESCENT (The National
//	Evolutionary Synthesis Center) for a postdoc

#ifdef MPI_VERSION

#ifndef MPIFUNCS_H
#define MPIFUNCS_H

#include "configoptions.h"
#include "sequencedata.h"
#include "parameters.h"
#include "population.h"
#include "threaddcls.h"

int MPIMain(int arc, char** argv);

int StartProcs(const GeneralGamlConfig&, NucleotideData&);

int MasterMaster(MasterGamlConfig&, NucleotideData&);
int RemoteMaster(GeneralGamlConfig&, NucleotideData&);
int MasterFullDuplexExchange(Population& pop, const MasterGamlConfig& conf);
int RemoteFullDuplexExchange(Population& pop, const GeneralGamlConfig& conf);
int MasterShieldedMigrants(Population& pop, const MasterGamlConfig& conf);
int RemoteShieldedMigrants(Population& pop, const GeneralGamlConfig& conf);
int RemoteAlphaMaleReplication(Population& pop, const GeneralGamlConfig& conf);


int RemoteSubtreeWorker(Population& pop, const GeneralGamlConfig& conf);
int MasterAlphaMaleReplication(Population& pop, const MasterGamlConfig& conf);
int MasterHybrid(Population& pop, const MasterGamlConfig& conf);	
int MasterLastCall(Population& pop, int master_mem);

//int DoMasterSM(Population& pop, const GamlConfig& conf, int who, transferred_data_t results);
//int DoMasterAMR(Population& pop, const GamlConfig& conf, int who, transferred_data_t results);

int CalcMaxIndivs(const NucleotideData&, int);

// buf, size in bytes, from, tag, blocking
int RecvMPIMessage(char**, int*, int*, int*, bool block = true);
int RecvMPIMessage(char**, int*, int, int*, bool block = true);
int RecvMPIMessage(char**, int*, int*, int, bool block = true);
int RecvMPIMessage(char**, int*, int, int, bool block = true);
// buf, size, to, tag
int SendMPIMessage(char*, int, int, int);

int PollForResults(int nodes[]);
bool PollForResults(int n);

int GetResultsFromNode(int node_num, int* nindivs_, char** tree_strings_);
int SendResultsToNode(int node, int n, char* tree_strings);

int ReceiveParams(Parameters* params_, int node);
int ReceiveData(NucleotideData* data_, int node);

int debug_mpi(const char* fmt, ...);
int LogConfig(const GeneralGamlConfig&);
int LogParams(const Parameters& params);
int LogTreeStrings(const char* tree_strings);
int LogKappas(const double* kappa_probs, const int count);
int LogPis(const double* pis, const int count);
int TransLog(int count, int nindivs, int n, char* str_out, int m, char* str_in, int* to_send, int* to_replace, double* old_scores, double* new_scores);

int strlen2(char* p);
int CountTreeStrings(char* p);

#endif

#endif