I am trying to run LAMMPS compiled with the single-precision FFTW (2.1.5) libraries on the Cray XT3, however, when I do this I get 'nan' for the long-range kspace energy on the first step and the simulation fails (please see log file at the end of this email for simulation parameters and output). I am changing FFT_PRECISION to 1 in fft3d.h. Some things I have tried:
1. I have tried this with both the apoa1 benchmark system and my own protein system. In both cases when LAMMPS is compiled with double-precision fftw libraries it runs fine but with sfftw it fails.
2. I have tried compiling with both pgi (6.1.4) and gcc (4.1.2) compilers, and also with all gcc optimization flags turned off, and 'pair modify table 0' still with the same result.
3. I also tried this on my intel core2 desktop with fftw and gcc, again, same result.
P.S. The reason that I am interested in using single-precision, is that in order to use grid spacings of 1 angstrom, the de facto standard for PME in biosimulations, I need to use a tolerance of 1e-6 for pppm. However, this results in half of the calculation being devoted to the kspace calculation, and a significant portion of that is in the FFT:
I notice that generally LAMMPS takes pppm 1e-4 as the accuracy standard, but in this case that results in a grid that is spaced at over 2 angstroms along each coordinate direction. Can pppm use a grid spacing that is 2 to 2.5 times more sparse than PME and achieve similar accuracy? I plan to look into this more closely, but I thought I would mention it here since, at a pppm tolerance of 1e-4, the FFT doesn't take up much of the calculation, hence there would be little benefit to using the single precision fft.
I've never tried to run/build LAMMPS with single-precision FFTs
so can't help you there. I don't think its a good idea if
you want 1.0e-6 accuracy since single-precision only carries
7 or 8 digits of accuracy. So it seems like you'd be close to
the edge. Paul may want to comment on PPPM vs PME
accuracy. But the general rule-of-thumb is don't worry about
the grid spacing. Rather trust the accuracy criterion you
set. If you want 1.0e-4 then PPPM in LAMMPS will choose
an appropriate grid spacing, whatever it ends up to be.
Just thought of an issue with single-precision FFTs from LAMMPS.
The FFT package (fft3d.cpp) doesn't own the data, it just
provides an interface to the FFTW library. So the storage
of all the data is in LAMMPS and is still double precision,
including how it stores complex datums. So you would have
to change data storage in LAMMPS if you expect FFTs with
floats to work instead of doubles.
Thanks Steve. Your points are well-taken. Actually, the bigger picture is that I am trying to make an apples-to-apples comparison of LAMMPS to NAMD for biomolecular simulation, inasmuch as that is possible, and NAMD uses single-precision FFTs. So I am looking to compare performance for a given level of accuracy. NAMD does not report PME accuracy directly, but I believe that I will need close to 1e-6 accuracy to approach the accuracy of PME in NAMD with a 1 angstrom grid.
Incidentally, after I wrote my original email I discovered that if I use 'kspace_style ewald' instead of pppm then the single-precision FFT works. I will dig into the code as you suggest, but if anyone has experience or comments to share (on any of these matters) they are welcome.
Hispanic women are the fastest growing minority group in the U.S. and have the highest rates of sedentary behavior and postpartum diabetes after a diagnosis of GDM. This randomised trial uses a high-reach, low-cost strategy that can readily be translated into clinical practice in underserved and minority populations.
Type 2 diabetes is a global epidemic affecting approximately 21 million people in the U.S. [1]. The age at onset for type 2 diabetes has decreased [1], highlighting the importance of identifying high-risk groups early, in order to implement prevention efforts. One such high-risk group is women who develop glucose intolerance during pregnancy. Both gestational diabetes mellitus (GDM) and milder glucose intolerance in pregnancy identify women who are at high risk for type 2 diabetes [2, 3]. Indeed, a recent meta-analysis found that GDM confers a 7-fold risk for future type 2 diabetes [4] and up to one third of women with type 2 diabetes have previously been diagnosed with GDM [5].
The session will additionally include administration of diet and physical activity questionnaires that facilitate tailoring the intervention. The Diet Tailoring Questionnaire is a two-part survey consisting of a checklist of high-calorie and lower-calorie foods and beverages commonly consumed by the target population. Respondents are asked to indicate the frequency that they consume the various foods and rate their confidence (self-efficacy) in their ability to decrease high calorie and increase low calorie food consumption. The Exercise Tailoring Questionnaire consists of 3 measures: Stages of Change for Physical Activity [44], Processes of Change for Physical Activity [45], and Self-Efficacy for Physical Activity [44].
This session will be followed by a third trimester booster telephone counseling session which will review progress toward gestational weight gain management and reinforce preparation for postpartum weight loss. Print-based intervention materials, in Spanish or English depending upon participant preference and written at a 6th grade reading level, will be mailed.
At the outset of the Active Phase of the intervention, a weight-loss goal based on prepregnancy BMI will be set and participants will be encouraged to work toward this goal by focusing on a reduction of 1-2 pounds per week. The health educator will utilize a checklist of motivators for wanting to lose weight, specific to new mothers, to help women identify their own weight loss motivations and to reinforce engagement. Participants will be encouraged to weigh themselves at home daily and to chart their weight on a grid weekly.
To ensure retention and to control for contact time, the Health & Wellness (control) arm will receive mailed health materials and telephone booster calls on the same schedule as the Lifestyle Intervention arm. Mailed materials focus on non-exercise and non-dietary topics and include booklets from ACOG and the American Academy of Pediatrics in English or Spanish. These booklets represent high-quality, standard, low-cost, self-help material currently available to the public. In this way, we control for contact time, while keeping the content of the two interventions distinct. Hispanic control-arm participants in our prior studies reported that these materials were of interest and differential dropout did not occur between study arms [36, 48].
Sociodemographic factors will be collected via self-report at enrollment. Acculturation will be assessed via the Psychological Acculturation Scale [55], language preference, and generation in the U.S. Smoking will also be assessed via the biomarker cotinine. Postpartum factors will be collected via self-report at each postpartum assessment and will include: The Pittsburgh Sleep Quality Index (PSQI) [56], the Edinburgh Postpartum Depression Scale [57, 58], and the Infant Feeding Questionnaire [59].
Primary analyses will evaluate differences in the change from 6 weeks postpartum to 12 months postpartum between the groups (an intent to treat analysis) in postpartum weight loss (aim #1), biomarkers of insulin resistance (aim #2), and biomarkers of cardiovascular disease risk (aim #3). We will use mixed models with random subject effects, including a common mean at baseline for the treatment groups, a period effect, and an intervention by period interaction [60]. The mixed model analysis will enable inclusion of time varying covariates such as breastfeeding behaviors, depression, and sleep, which may vary between baseline and follow-up for individuals. Equivalence of treatment groups will be assessed by comparing distributions of the potential confounders across groups. In addition, we will investigate established risk factors for type 2 diabetes as potential confounders or effect modifiers. Important potential effect modifiers include prepregnancy BMI, and breastfeeding behaviors. Mixed model analyses will also be used to account for the repeated measures of exercise and diet and will be used to evaluate adoption and maintenance of behavior change (aim #4) in the Lifestyle Intervention group.
This trial is innovative in testing a prenatal and postpartum lifestyle intervention designed to reduce risk factors for type 2 diabetes and cardiovascular disease among high-risk Hispanic women. Changes in lifestyle risk factors (e.g., postpartum weight loss through reduction in energy intake and increased physical activity) among women who experienced abnormal glucose tolerance in pregnancy may reduce risk factors for type 2 diabetes and cardiovascular disease. Guidelines for the management of the elevated risk of diabetes among women with glucose abnormalities during pregnancy have lagged behind its recognition [62]. Women receive closer medical attention during the prenatal and postpartum periods than at other times in their adult lives, and are often highly motivated to improve their health to benefit themselves and their children. This postpartum lifestyle intervention capitalizes upon this teachable moment, and extends prenatal randomized trials conducted by our research team and others which utilized exercise and/or diet to reduce the risk of excessive gestational weight gain and gestational diabetes mellitus [36, 63].
Investigation of which types of programs benefit postpartum women and identification of women at particularly high-risk are needed to increase the effectiveness of any prevention efforts. The public health impact of such lifestyle modifications is likely to be greatest in ethnic groups, such as Hispanics, with consistently high rates of obesity, diabetes, and the highest rates of sedentary behavior. This randomised controlled trial uses a high-reach, low-cost strategy, which can readily be translated into clinical practice in underserved and minority populations.
7fc3f7cf58