75 #define aa_hit_t MPI_SHORT
77 #define h_hit_t MPI_DOUBLE
111 void composeOutput(HitTile_aa_t out,
int * outpos,
int * outsize, HitTile_aa_t lout,
int loutpos,
int loutsize,
int * gBegin,
int * gEnd);
244 #define h(i,j) (hit_tileElemAtNoStride(H,2,i,j))
249 #define xback(i,j) (hit_tileElemAtNoStride(xTraceback,2,i,j))
250 #define yback(i,j) (hit_tileElemAtNoStride(yTraceback,2,i,j))
280 int main(
int argc,
char *argv[]) {
321 layout =
hit_layout( plug_layBlocks, topo, shape );
339 ALL_SEQUENTIAL_BEGIN(seq1)
345 ALL_SEQUENTIAL_END(seq1)
437 printfroot(
"=== Iteration: %d/%d ===\n\n",iter,iterations);
543 #define allTimers(timer) hit_clockGetMinSeconds(timer),hit_clockGetAvgSeconds(timer),hit_clockGetMaxSeconds(timer)
553 printf(
"=== Result ===\n");
556 printf(
" Read protein: min: %f, avg: %f, max: %f \n",
allTimers(time_comp_read));
557 printf(
" Distribute: min: %f, avg: %f, max: %f \n",
allTimers(time_comp_distr));
558 printf(
" H matrix: min: %f, avg: %f, max: %f \n",
allTimers(time_comp_hmatrix));
559 printf(
" sync H mat: min: %f, avg: %f, max: %f \n",
allTimers(time_comp_syncH));
560 printf(
" Backtracking: min: %f, avg: %f, max: %f \n",
allTimers(time_comp_back));
561 printf(
" Sync Back: min: %f, avg: %f, max: %f \n",
allTimers(time_comp_syncB));
562 printf(
" Compose: min: %f, avg: %f, max: %f \n",
allTimers(time_comp_compose));
579 printf(
"\nInputset too big to print to stdout\n");
594 MPI_Type_free(&MPI_DOUBLE_3INT);
645 ALL_SEQUENTIAL_BEGIN(seq2)
648 printf(
"Local protein 1: ");
650 printf(
"Local protein 2: ");
653 ALL_SEQUENTIAL_END(seq2)
716 for (i=0;i<=
lsize[0];i++){
724 for (j=0;j<=
lsize[1];j++){
737 for(i=1; i<
lsize[0]+1; i++){
738 for(j=1; j<lsize[1]+1; j++){
747 h_t max = MAX4(diag,down,right,0,&idx);
754 }
else if ( idx == 1 ) {
757 }
else if ( idx == 2 ) {
790 ALL_SEQUENTIAL_BEGIN(seq3)
797 for (j=0;j<=
lsize[1];j++){
804 for (i=0;i<=
lsize[0];i++){
811 for (j=0;j<=
lsize[1];j++){
812 printf(
"%6.1f",(
double)
h(i,j));
818 ALL_SEQUENTIAL_END(seq3)
825 ALL_SEQUENTIAL_BEGIN(seq4)
832 for (j=0;j<=
lsize[1];j++){
839 for (i=0;i<=
lsize[0];i++){
846 for (j=0;j<=
lsize[1];j++){
853 ALL_SEQUENTIAL_END(seq4)
865 HitTile_double_3int Max, outMax;
934 if( i == -1 || j == -1 ){
938 }
else if(
h(i,j) > 0 && i == 0 ){
942 }
else if (
h(i,j) > 0 && j == 0 ){
967 while (i>0 && j>0 &&
h(i,j) > 0){
969 int movex = (i>
xback(i,j));
970 int movey = (j>
yback(i,j));
975 if (movex && movey) {
989 i=
xback(tempi,tempj);
990 j=
yback(tempi,tempj);
1014 ALL_SEQUENTIAL_BEGIN(seq5);
1030 ALL_SEQUENTIAL_END(seq5);
1118 #define MIN(a,b) (((a)<(b))?(a):(b))
1119 #define MAX(a,b) (((a)>(b))?(a):(b))
1123 void composeOutput(HitTile_aa_t out,
int * outpos,
int * outsize, HitTile_aa_t lout,
int loutpos,
int loutsize,
int * gBegin,
int * gEnd){
1126 HitTile_int hitdata;
1176 HitTile_int hitdataRecv;
1198 if(!(poutsize > 0))
continue;
1206 minBegin =
MIN(minBegin,pgBegin);
1207 maxEnd =
MAX(maxEnd,pgEnd);
1211 (*outpos) -= poutsize;
1212 (*outsize) += poutsize;
void phase_distribute_sequences()
#define hit_shape(nd,...)
#define hit_layShape(lay)
#define hit_tileNewType(baseType)
#define hit_clockSynchronizeAll()
#define hit_comSendSelect(lay, sendTo, tileP, selection, modeSelect, baseType)
#define hit_topDimCard(topo, i)
#define hit_tileElemAt(var, ndims,...)
void printProteinMatch(HitTile_aa_t p, int begin, int end)
#define hit_laySelfRanks(lay)
void readProtein(ProteinFile *fprotein, HitTile_aa_t *protein, int psize)
void debug_show_matrices()
void hit_comFree(HitCom issue)
void hit_comDo(HitCom *issue)
void openProtein(ProteinFile *fprotein, char *filename)
#define hit_clockContinue(c)
#define hit_tileDomainAlloc(newVarP, baseType, numDims,...)
#define hit_topology(name,...)
#define hit_layShapeOther(lay, ranks)
void hit_comEndSend(HitCom *issue)
void recv_Back(int dir, int *pos)
#define HIT_COM_ARRAYCOORDS
#define hit_laySelfRanksDim(lay, dim)
#define HIT_PAT_UNORDERED
void hit_patternAdd(HitPattern *pattern, HitCom comm)
void input_parameters(int argc, char *argv[])
void phase_compose_sequence()
#define hit_tileDimCard(var, dim)
#define hit_tileDomainShapeAlloc(newVarP, baseType, shape)
HitTile_trace_t yTraceback
#define hit_clockReset(c)
void initPAM(char *filename)
void hit_topFree(HitTopology topo)
HitRanks hit_layActiveIdRanks(HitLayout lay, int id)
void printProtein(HitTile_aa_t p, int offset, int psize)
void hit_patternFree(HitPattern *pattern)
void debug_show_backtracking()
void hit_comInit(int *pargc, char **pargv[])
void composeOutput(HitTile_aa_t out, int *outpos, int *outsize, HitTile_aa_t lout, int loutpos, int loutsize, int *gBegin, int *gEnd)
void distributeProtein(HitTile_aa_t protein, HitTile_aa_t lprotein, int dim)
void phase_send_hmatrix()
#define hit_shapeSigCard(shape, dim)
HitTile_trace_t xTraceback
void hit_layFree(HitLayout lay)
int main(int argc, char *argv[])
#define hit_comRecvSelect(lay, receiveFrom, tileP, selection, modeSelect, baseType)
void send_Back(int dir, int pos)
#define hit_layNeighbor(lay, dim, shift)
#define hit_comRecv(lay, receiveFrom, tileP, baseType)
#define hit_comReduce(lay, root, tilePSend, tilePRecv, baseType, operation)
#define hit_comTypeStruct(new_type, Nstruct, n,...)
HitShape hit_shapeDimExpand(HitShape shape, int dim, int position, int offset)
int hit_layNumActives(HitLayout lay)
void phase_recv_hmatrix()
#define hit_layout(name, topo,...)
#define hit_shapeSig(shape, dim)
#define HIT_COM_TILECOORDS
#define hit_tileFree(var)
#define hit_patternDo(pattern)
#define hit_clockGetSeconds(c)
void phase_read_sequences()
#define hit_clockReduce(lay, c)
#define hit_comSend(lay, sendTo, tileP, baseType)
#define hit_clockStart(c)
void phase_comp_hmatrix()
void hit_comStartSend(HitCom *issue)