Merge branch 'master' of git@git.gromacs.org:gromacs
authorSzilard Pall <pszilard@cbr.su.se>
Fri, 7 May 2010 13:52:00 +0000 (15:52 +0200)
committerSzilard Pall <pszilard@cbr.su.se>
Fri, 7 May 2010 13:52:00 +0000 (15:52 +0200)
Conflicts:
src/kernel/openmm_wrapper.cpp

1  2 
src/kernel/openmm_wrapper.cpp

index ba78c5b3f54ab0e62ebb15c6ddef20d7ae5b5420,39a6642687b94156a6d8ce33c016c56050560dac..4de2ce74734752ac887b5b0dbead880cf0fcdb00
@@@ -989,44 -905,32 +989,44 @@@ void* openmm_init(FILE *fplog, const ch
              }
          }
  
 -        /* For now this is just to double-check if OpenMM selected the GPU we wanted,
 -           but when we'll let OpenMM select the GPU automatically it will query the devideId.
 -         */
 -        int tmp;
 -        if (!from_string<int>(tmp, platform.getPropertyValue(*context, "CudaDevice"), std::dec))
 +        /* only for CUDA */
 +        if (isStringEqNCase(opt->getOptionValue("platform"), "CUDA"))
          {
 -            gmx_fatal(FARGS, "Internal error: couldn't determine the device selected by OpenMM");
 -            if (tmp != devId)
 +            /* For now this is just to double-check if OpenMM selected the GPU we wanted,
 +            but when we'll let OpenMM select the GPU automatically, it will query the devideId.
 +            */
 +            int tmp;
 +            if (!from_string<int>(tmp, platform.getPropertyValue(*context, "CudaDevice"), std::dec))
              {
 -                gmx_fatal(FARGS, "Internal error: OpenMM is using device #%d while initialized for device #%d",
 -                        tmp, devId);
 +                gmx_fatal(FARGS, "Internal error: couldn't determine the device selected by OpenMM");
 +                if (tmp != devId)
 +                {
 +                    gmx_fatal(FARGS, "Internal error: OpenMM is using device #%d"
 +                        "while initialized for device #%d", tmp, devId);
 +                }
              }
 -        }
 -
 -        /* check GPU compatibility */
 -        char gpuname[STRLEN];
 -        devId = atoi(opt->getOptionValue("deviceid").c_str());
 -        if (!is_supported_cuda_gpu(-1, gpuname))
 -        {
 -            if (!gmx_strcasecmp(opt->getOptionValue("force-device").c_str(), "yes"))
 +            
 +            /* check GPU compatibility */
 +            char gpuname[STRLEN];
 +            devId = atoi(opt->getOptionValue("deviceid").c_str());
 +            if (!is_supported_cuda_gpu(-1, gpuname))
              {
 -                sprintf(warn_buf, "Non-supported GPU selected (#%d, %s), forced continuing.\n"
 -                        "Note, that the simulation can be slow or it migth even crash.", 
 -                        devId, gpuname);
 -                fprintf(fplog, "%s", warn_buf);
 -                gmx_warning(warn_buf);
 +                if (!gmx_strcasecmp(opt->getOptionValue("force-device").c_str(), "yes"))
 +                {
 +                    sprintf(warn_buf, "Non-supported GPU selected (#%d, %s), forced continuing."
 +                            "Note, that the simulation can be slow or it migth even crash.", 
 +                            devId, gpuname);
 +                    fprintf(fplog, "%s\n", warn_buf);
 +                    gmx_warning(warn_buf);
 +                }
 +                else
 +                {
 +                    gmx_fatal(FARGS, "The selected GPU (#%d, %s) is not supported by Gromacs! "
 +                              "Most probably you have a low-end GPU which would not perform well, " 
 +                              "or new hardware that has not been tested yet with Gromacs-OpenMM. "
-                               "If you still want to try using the device, use the force=on option.", 
++                              "If you still want to try using the device, use the force-device=yes option.", 
 +                              devId, gpuname);
 +                }
              }
              else
              {