2 * This file is part of the GROMACS molecular simulation package.
4 * Copyright (c) 1991-2000, University of Groningen, The Netherlands.
5 * Copyright (c) 2001-2004, The GROMACS development team.
6 * Copyright (c) 2013,2014, by the GROMACS development team, led by
7 * Mark Abraham, David van der Spoel, Berk Hess, and Erik Lindahl,
8 * and including many others, as listed in the AUTHORS file in the
9 * top-level source directory and at http://www.gromacs.org.
11 * GROMACS is free software; you can redistribute it and/or
12 * modify it under the terms of the GNU Lesser General Public License
13 * as published by the Free Software Foundation; either version 2.1
14 * of the License, or (at your option) any later version.
16 * GROMACS is distributed in the hope that it will be useful,
17 * but WITHOUT ANY WARRANTY; without even the implied warranty of
18 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
19 * Lesser General Public License for more details.
21 * You should have received a copy of the GNU Lesser General Public
22 * License along with GROMACS; if not, see
23 * http://www.gnu.org/licenses, or write to the Free Software Foundation,
24 * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
26 * If you want to redistribute modifications to GROMACS, please
27 * consider that scientific software is very special. Version
28 * control is crucial - bugs must be traceable. We will be happy to
29 * consider code for inclusion in the official distribution, but
30 * derived work must not be called official GROMACS. Details are found
31 * in the README & COPYING files - if they are missing, get the
32 * official version at http://www.gromacs.org.
34 * To help us fund GROMACS development, we humbly ask that you cite
35 * the research papers on the package. Check out http://www.gromacs.org.
37 /* This file is completely threadsafe - keep it that way! */
49 #include "gmx_fatal.h"
54 #define block_bc(cr, d) gmx_bcast( sizeof(d), &(d), (cr))
55 /* Probably the test for (nr) > 0 in the next macro is only needed
56 * on BlueGene(/L), where IBM's MPI_Bcast will segfault after
57 * dereferencing a null pointer, even when no data is to be transferred. */
58 #define nblock_bc(cr, nr, d) { if ((nr) > 0) {gmx_bcast((nr)*sizeof((d)[0]), (d), (cr)); }}
59 #define snew_bc(cr, d, nr) { if (!MASTER(cr)) {snew((d), (nr)); }}
60 /* Dirty macro with bAlloc not as an argument */
61 #define nblock_abc(cr, nr, d) { if (bAlloc) {snew((d), (nr)); } nblock_bc(cr, (nr), (d)); }
63 static void bc_string(const t_commrec *cr, t_symtab *symtab, char ***s)
69 handle = lookup_symtab(symtab, *s);
74 *s = get_symtab_handle(symtab, handle);
78 static void bc_strings(const t_commrec *cr, t_symtab *symtab, int nr, char ****nm)
88 for (i = 0; (i < nr); i++)
90 handle[i] = lookup_symtab(symtab, NM[i]);
93 nblock_bc(cr, nr, handle);
99 for (i = 0; (i < nr); i++)
101 (*nm)[i] = get_symtab_handle(symtab, handle[i]);
107 static void bc_strings_resinfo(const t_commrec *cr, t_symtab *symtab,
108 int nr, t_resinfo *resinfo)
116 for (i = 0; (i < nr); i++)
118 handle[i] = lookup_symtab(symtab, resinfo[i].name);
121 nblock_bc(cr, nr, handle);
125 for (i = 0; (i < nr); i++)
127 resinfo[i].name = get_symtab_handle(symtab, handle[i]);
133 static void bc_symtab(const t_commrec *cr, t_symtab *symtab)
138 block_bc(cr, symtab->nr);
140 snew_bc(cr, symtab->symbuf, 1);
141 symbuf = symtab->symbuf;
142 symbuf->bufsize = nr;
143 snew_bc(cr, symbuf->buf, nr);
144 for (i = 0; i < nr; i++)
148 len = strlen(symbuf->buf[i]) + 1;
151 snew_bc(cr, symbuf->buf[i], len);
152 nblock_bc(cr, len, symbuf->buf[i]);
156 static void bc_block(const t_commrec *cr, t_block *block)
158 block_bc(cr, block->nr);
159 snew_bc(cr, block->index, block->nr+1);
160 nblock_bc(cr, block->nr+1, block->index);
163 static void bc_blocka(const t_commrec *cr, t_blocka *block)
165 block_bc(cr, block->nr);
166 snew_bc(cr, block->index, block->nr+1);
167 nblock_bc(cr, block->nr+1, block->index);
168 block_bc(cr, block->nra);
171 snew_bc(cr, block->a, block->nra);
172 nblock_bc(cr, block->nra, block->a);
176 static void bc_grps(const t_commrec *cr, t_grps grps[])
180 for (i = 0; (i < egcNR); i++)
182 block_bc(cr, grps[i].nr);
183 snew_bc(cr, grps[i].nm_ind, grps[i].nr);
184 nblock_bc(cr, grps[i].nr, grps[i].nm_ind);
188 static void bc_atoms(const t_commrec *cr, t_symtab *symtab, t_atoms *atoms)
192 block_bc(cr, atoms->nr);
193 snew_bc(cr, atoms->atom, atoms->nr);
194 nblock_bc(cr, atoms->nr, atoms->atom);
195 bc_strings(cr, symtab, atoms->nr, &atoms->atomname);
196 block_bc(cr, atoms->nres);
197 snew_bc(cr, atoms->resinfo, atoms->nres);
198 nblock_bc(cr, atoms->nres, atoms->resinfo);
199 bc_strings_resinfo(cr, symtab, atoms->nres, atoms->resinfo);
200 /* QMMM requires atomtypes to be known on all nodes as well */
201 bc_strings(cr, symtab, atoms->nr, &atoms->atomtype);
202 bc_strings(cr, symtab, atoms->nr, &atoms->atomtypeB);
205 static void bc_groups(const t_commrec *cr, t_symtab *symtab,
206 int natoms, gmx_groups_t *groups)
211 bc_grps(cr, groups->grps);
212 block_bc(cr, groups->ngrpname);
213 bc_strings(cr, symtab, groups->ngrpname, &groups->grpname);
214 for (g = 0; g < egcNR; g++)
218 if (groups->grpnr[g])
230 groups->grpnr[g] = NULL;
234 snew_bc(cr, groups->grpnr[g], n);
235 nblock_bc(cr, n, groups->grpnr[g]);
240 fprintf(debug, "after bc_groups\n");
244 void bcast_state(const t_commrec *cr, t_state *state)
254 /* Broadcasts the state sizes and flags from the master to all nodes
255 * in cr->mpi_comm_mygroup. The arrays are not broadcasted. */
256 block_bc(cr, state->natoms);
257 block_bc(cr, state->ngtc);
258 block_bc(cr, state->nnhpres);
259 block_bc(cr, state->nhchainlength);
260 block_bc(cr, state->nrng);
261 block_bc(cr, state->nrngi);
262 block_bc(cr, state->flags);
263 if (state->lambda == NULL)
265 snew_bc(cr, state->lambda, efptNR)
270 /* We allocate dynamically in dd_partition_system. */
273 /* The code below is reachable only by TPI and NM, so it is not
274 tested by anything. */
276 nnht = (state->ngtc)*(state->nhchainlength);
277 nnhtp = (state->nnhpres)*(state->nhchainlength);
279 /* We still need to allocate the arrays in state for non-master
280 * ranks, which is done (implicitly via bAlloc) in the dirty,
281 * dirty nblock_abc macro. */
282 bAlloc = !MASTER(cr);
285 state->nalloc = state->natoms;
287 for (i = 0; i < estNR; i++)
289 if (state->flags & (1<<i))
293 case estLAMBDA: nblock_bc(cr, efptNR, state->lambda); break;
294 case estFEPSTATE: block_bc(cr, state->fep_state); break;
295 case estBOX: block_bc(cr, state->box); break;
296 case estBOX_REL: block_bc(cr, state->box_rel); break;
297 case estBOXV: block_bc(cr, state->boxv); break;
298 case estPRES_PREV: block_bc(cr, state->pres_prev); break;
299 case estSVIR_PREV: block_bc(cr, state->svir_prev); break;
300 case estFVIR_PREV: block_bc(cr, state->fvir_prev); break;
301 case estNH_XI: nblock_abc(cr, nnht, state->nosehoover_xi); break;
302 case estNH_VXI: nblock_abc(cr, nnht, state->nosehoover_vxi); break;
303 case estNHPRES_XI: nblock_abc(cr, nnhtp, state->nhpres_xi); break;
304 case estNHPRES_VXI: nblock_abc(cr, nnhtp, state->nhpres_vxi); break;
305 case estTC_INT: nblock_abc(cr, state->ngtc, state->therm_integral); break;
306 case estVETA: block_bc(cr, state->veta); break;
307 case estVOL0: block_bc(cr, state->vol0); break;
308 case estX: nblock_abc(cr, state->natoms, state->x); break;
309 case estV: nblock_abc(cr, state->natoms, state->v); break;
310 case estSDX: nblock_abc(cr, state->natoms, state->sd_X); break;
311 case estCGP: nblock_abc(cr, state->natoms, state->cg_p); break;
312 case estLD_RNG: if (state->nrngi == 1)
314 nblock_abc(cr, state->nrng, state->ld_rng);
317 case estLD_RNGI: if (state->nrngi == 1)
319 nblock_abc(cr, state->nrngi, state->ld_rngi);
322 case estDISRE_INITF: block_bc(cr, state->hist.disre_initf); break;
323 case estDISRE_RM3TAV:
324 block_bc(cr, state->hist.ndisrepairs);
325 nblock_abc(cr, state->hist.ndisrepairs, state->hist.disre_rm3tav);
327 case estORIRE_INITF: block_bc(cr, state->hist.orire_initf); break;
329 block_bc(cr, state->hist.norire_Dtav);
330 nblock_abc(cr, state->hist.norire_Dtav, state->hist.orire_Dtav);
334 "Communication is not implemented for %s in bcast_state",
341 static void bc_ilists(const t_commrec *cr, t_ilist *ilist)
345 /* Here we only communicate the non-zero length ilists */
348 for (ftype = 0; ftype < F_NRE; ftype++)
350 if (ilist[ftype].nr > 0)
353 block_bc(cr, ilist[ftype].nr);
354 nblock_bc(cr, ilist[ftype].nr, ilist[ftype].iatoms);
362 for (ftype = 0; ftype < F_NRE; ftype++)
371 block_bc(cr, ilist[ftype].nr);
372 snew_bc(cr, ilist[ftype].iatoms, ilist[ftype].nr);
373 nblock_bc(cr, ilist[ftype].nr, ilist[ftype].iatoms);
381 fprintf(debug, "after bc_ilists\n");
385 static void bc_cmap(const t_commrec *cr, gmx_cmap_t *cmap_grid)
387 int i, j, nelem, ngrid;
389 block_bc(cr, cmap_grid->ngrid);
390 block_bc(cr, cmap_grid->grid_spacing);
392 ngrid = cmap_grid->ngrid;
393 nelem = cmap_grid->grid_spacing * cmap_grid->grid_spacing;
397 snew_bc(cr, cmap_grid->cmapdata, ngrid);
399 for (i = 0; i < ngrid; i++)
401 snew_bc(cr, cmap_grid->cmapdata[i].cmap, 4*nelem);
402 nblock_bc(cr, 4*nelem, cmap_grid->cmapdata[i].cmap);
407 static void bc_ffparams(const t_commrec *cr, gmx_ffparams_t *ffp)
411 block_bc(cr, ffp->ntypes);
412 block_bc(cr, ffp->atnr);
413 snew_bc(cr, ffp->functype, ffp->ntypes);
414 snew_bc(cr, ffp->iparams, ffp->ntypes);
415 nblock_bc(cr, ffp->ntypes, ffp->functype);
416 nblock_bc(cr, ffp->ntypes, ffp->iparams);
417 block_bc(cr, ffp->reppow);
418 block_bc(cr, ffp->fudgeQQ);
419 bc_cmap(cr, &ffp->cmap_grid);
422 static void bc_grpopts(const t_commrec *cr, t_grpopts *g)
426 block_bc(cr, g->ngtc);
427 block_bc(cr, g->ngacc);
428 block_bc(cr, g->ngfrz);
429 block_bc(cr, g->ngener);
430 snew_bc(cr, g->nrdf, g->ngtc);
431 snew_bc(cr, g->tau_t, g->ngtc);
432 snew_bc(cr, g->ref_t, g->ngtc);
433 snew_bc(cr, g->acc, g->ngacc);
434 snew_bc(cr, g->nFreeze, g->ngfrz);
435 snew_bc(cr, g->egp_flags, g->ngener*g->ngener);
437 nblock_bc(cr, g->ngtc, g->nrdf);
438 nblock_bc(cr, g->ngtc, g->tau_t);
439 nblock_bc(cr, g->ngtc, g->ref_t);
440 nblock_bc(cr, g->ngacc, g->acc);
441 nblock_bc(cr, g->ngfrz, g->nFreeze);
442 nblock_bc(cr, g->ngener*g->ngener, g->egp_flags);
443 snew_bc(cr, g->annealing, g->ngtc);
444 snew_bc(cr, g->anneal_npoints, g->ngtc);
445 snew_bc(cr, g->anneal_time, g->ngtc);
446 snew_bc(cr, g->anneal_temp, g->ngtc);
447 nblock_bc(cr, g->ngtc, g->annealing);
448 nblock_bc(cr, g->ngtc, g->anneal_npoints);
449 for (i = 0; (i < g->ngtc); i++)
451 n = g->anneal_npoints[i];
454 snew_bc(cr, g->anneal_time[i], n);
455 snew_bc(cr, g->anneal_temp[i], n);
456 nblock_bc(cr, n, g->anneal_time[i]);
457 nblock_bc(cr, n, g->anneal_temp[i]);
461 /* QMMM stuff, see inputrec */
462 block_bc(cr, g->ngQM);
463 snew_bc(cr, g->QMmethod, g->ngQM);
464 snew_bc(cr, g->QMbasis, g->ngQM);
465 snew_bc(cr, g->QMcharge, g->ngQM);
466 snew_bc(cr, g->QMmult, g->ngQM);
467 snew_bc(cr, g->bSH, g->ngQM);
468 snew_bc(cr, g->CASorbitals, g->ngQM);
469 snew_bc(cr, g->CASelectrons, g->ngQM);
470 snew_bc(cr, g->SAon, g->ngQM);
471 snew_bc(cr, g->SAoff, g->ngQM);
472 snew_bc(cr, g->SAsteps, g->ngQM);
476 nblock_bc(cr, g->ngQM, g->QMmethod);
477 nblock_bc(cr, g->ngQM, g->QMbasis);
478 nblock_bc(cr, g->ngQM, g->QMcharge);
479 nblock_bc(cr, g->ngQM, g->QMmult);
480 nblock_bc(cr, g->ngQM, g->bSH);
481 nblock_bc(cr, g->ngQM, g->CASorbitals);
482 nblock_bc(cr, g->ngQM, g->CASelectrons);
483 nblock_bc(cr, g->ngQM, g->SAon);
484 nblock_bc(cr, g->ngQM, g->SAoff);
485 nblock_bc(cr, g->ngQM, g->SAsteps);
486 /* end of QMMM stuff */
490 static void bc_cosines(const t_commrec *cr, t_cosines *cs)
493 snew_bc(cr, cs->a, cs->n);
494 snew_bc(cr, cs->phi, cs->n);
497 nblock_bc(cr, cs->n, cs->a);
498 nblock_bc(cr, cs->n, cs->phi);
502 static void bc_pull_group(const t_commrec *cr, t_pull_group *pgrp)
507 snew_bc(cr, pgrp->ind, pgrp->nat);
508 nblock_bc(cr, pgrp->nat, pgrp->ind);
510 if (pgrp->nweight > 0)
512 snew_bc(cr, pgrp->weight, pgrp->nweight);
513 nblock_bc(cr, pgrp->nweight, pgrp->weight);
517 static void bc_pull(const t_commrec *cr, t_pull *pull)
522 snew_bc(cr, pull->group, pull->ngroup);
523 for (g = 0; g < pull->ngroup; g++)
525 bc_pull_group(cr, &pull->group[g]);
527 snew_bc(cr, pull->coord, pull->ncoord);
528 nblock_bc(cr, pull->ncoord, pull->coord);
531 static void bc_rotgrp(const t_commrec *cr, t_rotgrp *rotg)
536 snew_bc(cr, rotg->ind, rotg->nat);
537 nblock_bc(cr, rotg->nat, rotg->ind);
538 snew_bc(cr, rotg->x_ref, rotg->nat);
539 nblock_bc(cr, rotg->nat, rotg->x_ref);
543 static void bc_rot(const t_commrec *cr, t_rot *rot)
548 snew_bc(cr, rot->grp, rot->ngrp);
549 for (g = 0; g < rot->ngrp; g++)
551 bc_rotgrp(cr, &rot->grp[g]);
555 static void bc_adress(const t_commrec *cr, t_adress *adress)
557 block_bc(cr, *adress);
558 if (adress->n_tf_grps > 0)
560 snew_bc(cr, adress->tf_table_index, adress->n_tf_grps);
561 nblock_bc(cr, adress->n_tf_grps, adress->tf_table_index);
563 if (adress->n_energy_grps > 0)
565 snew_bc(cr, adress->group_explicit, adress->n_energy_grps);
566 nblock_bc(cr, adress->n_energy_grps, adress->group_explicit);
569 static void bc_fepvals(const t_commrec *cr, t_lambda *fep)
571 gmx_bool bAlloc = TRUE;
574 block_bc(cr, fep->nstdhdl);
575 block_bc(cr, fep->init_lambda);
576 block_bc(cr, fep->init_fep_state);
577 block_bc(cr, fep->delta_lambda);
578 block_bc(cr, fep->bPrintEnergy);
579 block_bc(cr, fep->n_lambda);
580 if (fep->n_lambda > 0)
582 snew_bc(cr, fep->all_lambda, efptNR);
583 nblock_bc(cr, efptNR, fep->all_lambda);
584 for (i = 0; i < efptNR; i++)
586 snew_bc(cr, fep->all_lambda[i], fep->n_lambda);
587 nblock_bc(cr, fep->n_lambda, fep->all_lambda[i]);
590 block_bc(cr, fep->sc_alpha);
591 block_bc(cr, fep->sc_power);
592 block_bc(cr, fep->sc_r_power);
593 block_bc(cr, fep->sc_sigma);
594 block_bc(cr, fep->sc_sigma_min);
595 block_bc(cr, fep->bScCoul);
596 nblock_bc(cr, efptNR, &(fep->separate_dvdl[0]));
597 block_bc(cr, fep->dhdl_derivatives);
598 block_bc(cr, fep->dh_hist_size);
599 block_bc(cr, fep->dh_hist_spacing);
602 fprintf(debug, "after bc_fepvals\n");
606 static void bc_expandedvals(const t_commrec *cr, t_expanded *expand, int n_lambda)
608 gmx_bool bAlloc = TRUE;
611 block_bc(cr, expand->nstexpanded);
612 block_bc(cr, expand->elamstats);
613 block_bc(cr, expand->elmcmove);
614 block_bc(cr, expand->elmceq);
615 block_bc(cr, expand->equil_n_at_lam);
616 block_bc(cr, expand->equil_wl_delta);
617 block_bc(cr, expand->equil_ratio);
618 block_bc(cr, expand->equil_steps);
619 block_bc(cr, expand->equil_samples);
620 block_bc(cr, expand->lmc_seed);
621 block_bc(cr, expand->minvar);
622 block_bc(cr, expand->minvar_const);
623 block_bc(cr, expand->c_range);
624 block_bc(cr, expand->bSymmetrizedTMatrix);
625 block_bc(cr, expand->nstTij);
626 block_bc(cr, expand->lmc_repeats);
627 block_bc(cr, expand->lmc_forced_nstart);
628 block_bc(cr, expand->gibbsdeltalam);
629 block_bc(cr, expand->wl_scale);
630 block_bc(cr, expand->wl_ratio);
631 block_bc(cr, expand->init_wl_delta);
632 block_bc(cr, expand->bInit_weights);
633 snew_bc(cr, expand->init_lambda_weights, n_lambda);
634 nblock_bc(cr, n_lambda, expand->init_lambda_weights);
635 block_bc(cr, expand->mc_temp);
638 fprintf(debug, "after bc_expandedvals\n");
642 static void bc_simtempvals(const t_commrec *cr, t_simtemp *simtemp, int n_lambda)
644 gmx_bool bAlloc = TRUE;
647 block_bc(cr, simtemp->simtemp_low);
648 block_bc(cr, simtemp->simtemp_high);
649 block_bc(cr, simtemp->eSimTempScale);
650 snew_bc(cr, simtemp->temperatures, n_lambda);
651 nblock_bc(cr, n_lambda, simtemp->temperatures);
654 fprintf(debug, "after bc_simtempvals\n");
659 static void bc_swapions(const t_commrec *cr, t_swapcoords *swap)
666 /* Broadcast ion group atom indices */
667 snew_bc(cr, swap->ind, swap->nat);
668 nblock_bc(cr, swap->nat, swap->ind);
670 /* Broadcast split groups atom indices */
671 for (i = 0; i < 2; i++)
673 snew_bc(cr, swap->ind_split[i], swap->nat_split[i]);
674 nblock_bc(cr, swap->nat_split[i], swap->ind_split[i]);
677 /* Broadcast solvent group atom indices */
678 snew_bc(cr, swap->ind_sol, swap->nat_sol);
679 nblock_bc(cr, swap->nat_sol, swap->ind_sol);
683 static void bc_inputrec(const t_commrec *cr, t_inputrec *inputrec)
685 gmx_bool bAlloc = TRUE;
688 block_bc(cr, *inputrec);
690 bc_grpopts(cr, &(inputrec->opts));
692 /* even if efep is efepNO, we need to initialize to make sure that
693 * n_lambda is set to zero */
695 snew_bc(cr, inputrec->fepvals, 1);
696 if (inputrec->efep != efepNO || inputrec->bSimTemp)
698 bc_fepvals(cr, inputrec->fepvals);
700 /* need to initialize this as well because of data checked for in the logic */
701 snew_bc(cr, inputrec->expandedvals, 1);
702 if (inputrec->bExpanded)
704 bc_expandedvals(cr, inputrec->expandedvals, inputrec->fepvals->n_lambda);
706 snew_bc(cr, inputrec->simtempvals, 1);
707 if (inputrec->bSimTemp)
709 bc_simtempvals(cr, inputrec->simtempvals, inputrec->fepvals->n_lambda);
711 if (inputrec->ePull != epullNO)
713 snew_bc(cr, inputrec->pull, 1);
714 bc_pull(cr, inputrec->pull);
718 snew_bc(cr, inputrec->rot, 1);
719 bc_rot(cr, inputrec->rot);
721 for (i = 0; (i < DIM); i++)
723 bc_cosines(cr, &(inputrec->ex[i]));
724 bc_cosines(cr, &(inputrec->et[i]));
726 if (inputrec->eSwapCoords != eswapNO)
728 snew_bc(cr, inputrec->swap, 1);
729 bc_swapions(cr, inputrec->swap);
731 if (inputrec->bAdress)
733 snew_bc(cr, inputrec->adress, 1);
734 bc_adress(cr, inputrec->adress);
738 static void bc_moltype(const t_commrec *cr, t_symtab *symtab,
739 gmx_moltype_t *moltype)
741 bc_string(cr, symtab, &moltype->name);
742 bc_atoms(cr, symtab, &moltype->atoms);
745 fprintf(debug, "after bc_atoms\n");
748 bc_ilists(cr, moltype->ilist);
749 bc_block(cr, &moltype->cgs);
750 bc_blocka(cr, &moltype->excls);
753 static void bc_molblock(const t_commrec *cr, gmx_molblock_t *molb)
755 gmx_bool bAlloc = TRUE;
757 block_bc(cr, molb->type);
758 block_bc(cr, molb->nmol);
759 block_bc(cr, molb->natoms_mol);
760 block_bc(cr, molb->nposres_xA);
761 if (molb->nposres_xA > 0)
763 snew_bc(cr, molb->posres_xA, molb->nposres_xA);
764 nblock_bc(cr, molb->nposres_xA*DIM, molb->posres_xA[0]);
766 block_bc(cr, molb->nposres_xB);
767 if (molb->nposres_xB > 0)
769 snew_bc(cr, molb->posres_xB, molb->nposres_xB);
770 nblock_bc(cr, molb->nposres_xB*DIM, molb->posres_xB[0]);
774 fprintf(debug, "after bc_molblock\n");
778 static void bc_atomtypes(const t_commrec *cr, t_atomtypes *atomtypes)
782 block_bc(cr, atomtypes->nr);
786 snew_bc(cr, atomtypes->radius, nr);
787 snew_bc(cr, atomtypes->vol, nr);
788 snew_bc(cr, atomtypes->surftens, nr);
789 snew_bc(cr, atomtypes->gb_radius, nr);
790 snew_bc(cr, atomtypes->S_hct, nr);
792 nblock_bc(cr, nr, atomtypes->radius);
793 nblock_bc(cr, nr, atomtypes->vol);
794 nblock_bc(cr, nr, atomtypes->surftens);
795 nblock_bc(cr, nr, atomtypes->gb_radius);
796 nblock_bc(cr, nr, atomtypes->S_hct);
800 void bcast_ir_mtop(const t_commrec *cr, t_inputrec *inputrec, gmx_mtop_t *mtop)
805 fprintf(debug, "in bc_data\n");
807 bc_inputrec(cr, inputrec);
810 fprintf(debug, "after bc_inputrec\n");
812 bc_symtab(cr, &mtop->symtab);
815 fprintf(debug, "after bc_symtab\n");
817 bc_string(cr, &mtop->symtab, &mtop->name);
820 fprintf(debug, "after bc_name\n");
823 bc_ffparams(cr, &mtop->ffparams);
825 block_bc(cr, mtop->nmoltype);
826 snew_bc(cr, mtop->moltype, mtop->nmoltype);
827 for (i = 0; i < mtop->nmoltype; i++)
829 bc_moltype(cr, &mtop->symtab, &mtop->moltype[i]);
832 block_bc(cr, mtop->nmolblock);
833 snew_bc(cr, mtop->molblock, mtop->nmolblock);
834 for (i = 0; i < mtop->nmolblock; i++)
836 bc_molblock(cr, &mtop->molblock[i]);
839 block_bc(cr, mtop->natoms);
841 bc_atomtypes(cr, &mtop->atomtypes);
843 bc_block(cr, &mtop->mols);
844 bc_groups(cr, &mtop->symtab, mtop->natoms, &mtop->groups);