Search Results

Search found 13889 results on 556 pages for 'results'.

Page 218/556 | < Previous Page | 214 215 216 217 218 219 220 221 222 223 224 225  | Next Page >

  • CUDA, more threads for same work = Longer run time despite better occupancy, Why?

    - by zenna
    I encountered a strange problem where increasing my occupancy by increasing the number of threads reduced performance. I created the following program to illustrate the problem: #include <stdio.h> #include <stdlib.h> #include <cuda_runtime.h> __global__ void less_threads(float * d_out) { int num_inliers; for (int j=0;j<800;++j) { //Do 12 computations num_inliers += threadIdx.x*1; num_inliers += threadIdx.x*2; num_inliers += threadIdx.x*3; num_inliers += threadIdx.x*4; num_inliers += threadIdx.x*5; num_inliers += threadIdx.x*6; num_inliers += threadIdx.x*7; num_inliers += threadIdx.x*8; num_inliers += threadIdx.x*9; num_inliers += threadIdx.x*10; num_inliers += threadIdx.x*11; num_inliers += threadIdx.x*12; } if (threadIdx.x == -1) d_out[blockIdx.x*blockDim.x+threadIdx.x] = num_inliers; } __global__ void more_threads(float *d_out) { int num_inliers; for (int j=0;j<800;++j) { // Do 4 computations num_inliers += threadIdx.x*1; num_inliers += threadIdx.x*2; num_inliers += threadIdx.x*3; num_inliers += threadIdx.x*4; } if (threadIdx.x == -1) d_out[blockIdx.x*blockDim.x+threadIdx.x] = num_inliers; } int main(int argc, char* argv[]) { float *d_out = NULL; cudaMalloc((void**)&d_out,sizeof(float)*25000); more_threads<<<780,128>>>(d_out); less_threads<<<780,32>>>(d_out); return 0; } Note both kernels should do the same amount of work in total, the (if threadIdx.x == -1 is a trick to stop the compiler optimising everything out and leaving an empty kernel). The work should be the same as more_threads is using 4 times as many threads but with each thread doing 4 times less work. Significant results form the profiler results are as followsL: more_threads: GPU runtime = 1474 us,reg per thread = 6,occupancy=1,branch=83746,divergent_branch = 26,instructions = 584065,gst request=1084552 less_threads: GPU runtime = 921 us,reg per thread = 14,occupancy=0.25,branch=20956,divergent_branch = 26,instructions = 312663,gst request=677381 As I said previously, the run time of the kernel using more threads is longer, this could be due to the increased number of instructions. Why are there more instructions? Why is there any branching, let alone divergent branching, considering there is no conditional code? Why are there any gst requests when there is no global memory access? What is going on here! Thanks

    Read the article

  • How to implement Scrum?

    - by Kaan
    We're trying to switch to Scrum as our development process but we're not sure how to implement it in the best way possible. We also don't want to pay for expensive software tools until we get scrum working and get positive results. How can we implement scrum using a whiteboard without asking people to write down their time on the board and then also input into our own time tracking software? What kind of methodologies do you use?

    Read the article

  • Java "compare cannot be resolved to a type" error

    - by King Triumph
    I'm getting a strange error when attempting to use a comparator with a binary search on an array. The error states that "compareArtist cannot be resolved to a type" and is thrown by Eclipse on this code: Comparator<Song> compare = new Song.compareArtist(); I've done some searching and found references to a possible bug with Eclipse, although I have tried the code on a different computer and the error persists. I've also found similar issues regarding the capitalization of the compare method, in this case compareArtist. I've seen examples where the first word in the method name is capitalized, although it was my understanding that method names are traditionally started with a lower case letter. I have experimented with changing the capitalization but nothing has changed. I have also found references to this error if the class doesn't import the correct package. I have imported java.util in both classes in question, which to my knowledge allows the use of the Comparator. I've experimented with writing the compareArtist method within the class that has the binary search call as well as in the "Song" class, which according to my homework assignment is where it should be. I've changed the constructor accordingly and the issue persists. Lastly, I've attempted to override the Comparator compare method by implementing Comparator in the Song class and creating my own method called "compare". This returns the same error. I've only moved to calling the comparator method something different than "compare" after finding several examples that do the same. Here is the relevant code for the class that calls the binary search that uses the comparator. This code also has a local version of the compareArtist method. While it is not being called currently, the code for this method is the same as the in the class Song, where I am trying to call it from. Thanks for any advice and insight. import java.io.*; import java.util.*; public class SearchByArtistPrefix { private Song[] songs; // keep a direct reference to the song array private Song[] searchResults; // holds the results of the search private ArrayList<Song> searchList = new ArrayList<Song>(); // hold results of search while being populated. Converted to searchResults array. public SearchByArtistPrefix(SongCollection sc) { songs = sc.getAllSongs(); } public int compareArtist (Song firstSong, Song secondSong) { return firstSong.getArtist().compareTo(secondSong.getArtist()); } public Song[] search(String artistPrefix) { String artistInput = artistPrefix; int searchLength = artistInput.length(); Song searchSong = new Song(artistInput, "", ""); Comparator<Song> compare = new Song.compareArtist(); int search = Arrays.binarySearch(songs, searchSong, compare);

    Read the article

  • READING WEBSITE CONTENTS JAVA

    - by Sahil Manchanda
    IM DEVELOPING AN ANDROID APPLICATION WHERE in a website i PROGRAMMATICALLY submit data into search box and retrieve results by JAVA. i get the data by using URLConnect JAVA. i get the source code ie html code...... Urlconnection a = .connect to host getinputstream read data i use these functions now if the site has content like: sahil 3/5 patel chowk 965955 since these details will be inside html tags i want to extract this information . any idea

    Read the article

  • How can I obtain a list of modified files within a 'changeset' range from team foundation server thr

    - by Colin W
    I'm trying to create a tool which will help my team perform code reviews on a more regular basis without it's usual massive overhead. At the moment the manual process involves using Team Foundation Sidekicks to identify the Changesets and then exporting that to excel to filter the results to find which items need to be reviewed (e.g. code files). I've heard mention of using a TFS API, but found very little help online possibly because I was asking google 'the wrong questions'.

    Read the article

  • Online interview quiz

    - by Deano
    I am currently interviewing for a developer role in my company and I have had a lot of poor candidates come in so far. One of the things we have discussed is providing an online test for the candidates to fill in. Has anyone ever used an online service like this? Even if the service charges a fee that is not a problem. I would prefer if the candidates quiz results were confidential.

    Read the article

  • Trying to write a loop that uses an OutputStream to write to a text file.

    - by Steve McLain
    I'm not a java programmer, I'm a VB programmer. I am doing this as part of an assignment, however, I'm not asking for help on something assignment related. I'd like to figure out how to get the OutputStreamWriter to work properly in this instance. I just want to capture the values I'm generating and place them into a text document. The file is generated, but only one entry exists, not the 40 I'm expecting. I could do this in a heartbeat with VB, but java feels very strange to me right now. Your help is appreciated. Thanks, Steve Here's the code: public static void main(String[] args){ long start, end; double result,difference; try {//OutputStream code assistance from http://tutorials.jenkov.com/java-io/outputstreamwriter.html OutputStream outputStream = new FileOutputStream("c:\\Temp\\output1.txt"); Writer out = new OutputStreamWriter(outputStream); for(int n=1; n<=20; n++){ //Calculate the Time for n^2. start = System.nanoTime(); //Add code to call method to calculate n^2 result = mN2(n); end = System.nanoTime(); difference = (end - start); //Output results to a file out.write("N^2 End time: " + end + " Difference: " + difference + "\n"); out.close(); } } catch (IOException e){ } try { OutputStream outputStream = new FileOutputStream("c:\\Temp\\output1.txt"); Writer out = new OutputStreamWriter(outputStream); for(int n=1; n<=20; n++){ //Calculate the Time for 2^n. start = System.nanoTime(); //Add code to call method to calculate 2^n result = m2N(n); end = System.nanoTime(); difference = (end - start); //Output results to a file out.write("N^2 End time: " + end + " Difference: " + difference + "\n"); out.close(); } } catch (IOException e){ } } //Calculate N^2 public static double mN2(double n) { n = n*n; return n; } //Calculate 2N public static double m2N (double n) { n = 2*n; return n; }

    Read the article

  • Python multiprocessing global variable updates not returned to parent

    - by user1459256
    I am trying to return values from subprocesses but these values are unfortunately unpicklable. So I used global variables in threads module with success but have not been able to retrieve updates done in subprocesses when using multiprocessing module. I hope I'm missing something. The results printed at the end are always the same as initial values given the vars dataDV03 and dataDV04. The subprocesses are updating these global variables but these global variables remain unchanged in the parent. import multiprocessing # NOT ABLE to get python to return values in passed variables. ants = ['DV03', 'DV04'] dataDV03 = ['', ''] dataDV04 = {'driver': '', 'status': ''} def getDV03CclDrivers(lib): # call global variable global dataDV03 dataDV03[1] = 1 dataDV03[0] = 0 # eval( 'CCL.' + lib + '.' + lib + '( "DV03" )' ) these are unpicklable instantiations def getDV04CclDrivers(lib, dataDV04): # pass global variable dataDV04['driver'] = 0 # eval( 'CCL.' + lib + '.' + lib + '( "DV04" )' ) if __name__ == "__main__": jobs = [] if 'DV03' in ants: j = multiprocessing.Process(target=getDV03CclDrivers, args=('LORR',)) jobs.append(j) if 'DV04' in ants: j = multiprocessing.Process(target=getDV04CclDrivers, args=('LORR', dataDV04)) jobs.append(j) for j in jobs: j.start() for j in jobs: j.join() print 'Results:\n' print 'DV03', dataDV03 print 'DV04', dataDV04 I cannot post to my question so will try to edit the original. Here is the object that is not picklable: In [1]: from CCL import LORR In [2]: lorr=LORR.LORR('DV20', None) In [3]: lorr Out[3]: <CCL.LORR.LORR instance at 0x94b188c> This is the error returned when I use a multiprocessing.Pool to return the instance back to the parent: Thread getCcl (('DV20', 'LORR'),) Process PoolWorker-1: Traceback (most recent call last): File "/alma/ACS-10.1/casa/lib/python2.6/multiprocessing/process.py", line 232, in _bootstrap self.run() File "/alma/ACS-10.1/casa/lib/python2.6/multiprocessing/process.py", line 88, in run self._target(*self._args, **self._kwargs) File "/alma/ACS-10.1/casa/lib/python2.6/multiprocessing/pool.py", line 71, in worker put((job, i, result)) File "/alma/ACS-10.1/casa/lib/python2.6/multiprocessing/queues.py", line 366, in put return send(obj) UnpickleableError: Cannot pickle <type 'thread.lock'> objects In [5]: dir(lorr) Out[5]: ['GET_AMBIENT_TEMPERATURE', 'GET_CAN_ERROR', 'GET_CAN_ERROR_COUNT', 'GET_CHANNEL_NUMBER', 'GET_COUNT_PER_C_OP', 'GET_COUNT_REMAINING_OP', 'GET_DCM_LOCKED', 'GET_EFC_125_MHZ', 'GET_EFC_COMB_LINE_PLL', 'GET_ERROR_CODE_LAST_CAN_ERROR', 'GET_INTERNAL_SLAVE_ERROR_CODE', 'GET_MAGNITUDE_CELSIUS_OP', 'GET_MAJOR_REV_LEVEL', 'GET_MINOR_REV_LEVEL', 'GET_MODULE_CODES_CDAY', 'GET_MODULE_CODES_CMONTH', 'GET_MODULE_CODES_DIG1', 'GET_MODULE_CODES_DIG2', 'GET_MODULE_CODES_DIG4', 'GET_MODULE_CODES_DIG6', 'GET_MODULE_CODES_SERIAL', 'GET_MODULE_CODES_VERSION_MAJOR', 'GET_MODULE_CODES_VERSION_MINOR', 'GET_MODULE_CODES_YEAR', 'GET_NODE_ADDRESS', 'GET_OPTICAL_POWER_OFF', 'GET_OUTPUT_125MHZ_LOCKED', 'GET_OUTPUT_2GHZ_LOCKED', 'GET_PATCH_LEVEL', 'GET_POWER_SUPPLY_12V_NOT_OK', 'GET_POWER_SUPPLY_15V_NOT_OK', 'GET_PROTOCOL_MAJOR_REV_LEVEL', 'GET_PROTOCOL_MINOR_REV_LEVEL', 'GET_PROTOCOL_PATCH_LEVEL', 'GET_PROTOCOL_REV_LEVEL', 'GET_PWR_125_MHZ', 'GET_PWR_25_MHZ', 'GET_PWR_2_GHZ', 'GET_READ_MODULE_CODES', 'GET_RX_OPT_PWR', 'GET_SERIAL_NUMBER', 'GET_SIGN_OP', 'GET_STATUS', 'GET_SW_REV_LEVEL', 'GET_TE_LENGTH', 'GET_TE_LONG_FLAG_SET', 'GET_TE_OFFSET_COUNTER', 'GET_TE_SHORT_FLAG_SET', 'GET_TRANS_NUM', 'GET_VDC_12', 'GET_VDC_15', 'GET_VDC_7', 'GET_VDC_MINUS_7', 'SET_CLEAR_FLAGS', 'SET_FPGA_LOGIC_RESET', 'SET_RESET_AMBSI', 'SET_RESET_DEVICE', 'SET_RESYNC_TE', 'STATUS', '_HardwareDevice__componentName', '_HardwareDevice__hw', '_HardwareDevice__stickyFlag', '_LORRBase__logger', '__del__', '__doc__', '__init__', '__module__', '_devices', 'clearDeviceCommunicationErrorAlarm', 'getControlList', 'getDeviceCommunicationErrorCounter', 'getErrorMessage', 'getHwState', 'getInternalSlaveCanErrorMsg', 'getLastCanErrorMsg', 'getMonitorList', 'hwConfigure', 'hwDiagnostic', 'hwInitialize', 'hwOperational', 'hwSimulation', 'hwStart', 'hwStop', 'inErrorState', 'isMonitoring', 'isSimulated'] In [6]:

    Read the article

  • HTML parser for GAE

    - by Richard
    Generally I use lxml for my HTML parsing needs, but that isn't available on Google App Engine. The obvious alternative is BeautifulSoup, but I find it chokes too easily on malformed HTML. Currently I am testing libxml2dom and have been getting better results. Which pure Python HTML parser have you found performs best? My priority is the ability to handle bad HTML over speed.

    Read the article

  • Realtime Twitter Replies?

    - by ejunker
    I have created Twitter bots for many geographic locations. I want to allow users to @-reply to the Twitter bot with commands and then have the bot respond with the results. I would like to have the bot reply to the user as quickly as possible (realtime). Apparently, Twitter used to have an XMPP/Jabber interface that would provide this type of realtime feed of replies but it was shut down. As I see it my options are to use one of the following: REST API This would involve polling every X minutes for each bot. The problem with this is that it is not realtime and each Twitter account would have to be polled. Search API The search API does allow specifying a "-to" parameter in the search and replies to all bots could be aggregated in a search such as "-to bot1 OR -to bot2...". Though if you have hundreds of bots then the search string would get very long and probably exceed the maximum length of a GET request. Streaming API The streaming API looks very promising as it provides realtime results. The API allows you to specify a follow and track parameters. follow is not useful as the bot does not know who will be sending it commands. track allows you to specify keywords to track. This could possibly work by creating a daemon process that connects to the Streaming API and tracks all references to the bot's names. Once again since there are lots of bots to track the length and complexity of the query may be an issue. Another idea would be to track a special hashtag such as #botcommand and then a user could send a command using this syntax @bot1 weather #botcommand. Then by using the Streaming API to track all references to #botcommand would give you a realtime stream of all the commands. Further parsing could then be done to determine which bot to send the command to. Third-party service Are there any third-party companies that have access to the Twitter firehouse and offer realtime data? I haven't investigated these, but here are a few that I have found: Gnip Tweet.IM excla.im TwitterSpy - seems to use polling, not realtime I'm leaning towards using the Streaming API. Is there a better way to get near realtime @-replies for many (hundreds) of Twitter accounts?

    Read the article

  • lightweight publish/subscribe framework in java

    - by mdma
    Is there a good lightweight framework for java that provides the publish/subscribe pattern? Some ideal features Support for generics Registration of multiple subscribers to a publisher API primarily interfaces and some useful implementations purely in-memory, persistence and transaction guarantees not required. I know about JMS but that is overkill for my need. The publish/subscribed data are the result of scans of a file system, with scan results being fed to another component for processing, which are then processed before being fed to another and so on.

    Read the article

  • Regex for capturing number in brackets

    - by neversaint
    I have a lines like this NF419andZNF773 (e=10^-92,). ZNF571 (e=2 10^-14,) What's the regex for extracting the results above so that it gives NF419andZNF773 - 10^-92 ZNF571 - 2 10^-14 I tried this but fail. $line =~ /(\w+)\s\(e=\s(.*),\)/; print "$1 - $2\n";

    Read the article

  • Instagram API how to get user ID?

    - by user1355300
    How can I get the user ID with the user name with instagram API without user authentication? If I try users/search, it returns multiple research results, so how can I be sure that I get the result of exact user name only? For example, following requests return multiple users having their usernames similiar to aliciakeys, I want to get only the data of the user with exact user name. https://api.instagram.com/v1/users/search?q=aliciakeys&access_token=232967857.f59def8.c44c9e739efb4c52ab858bc84f420d00

    Read the article

  • SQL Join Statement

    - by mouthpiec
    Hi I have the following SQL SELECT statement SELECT bar_id, bar_name, town_name, advert_text FROM bar, towns, baradverts WHERE town_id = town_id_fk AND bar_id = bar_id_fk My problem is that since not every bar has an advert in table "baradverts", these bars are not coming up in the results. In other words I need a NULL for those bars that do not have an advert string.

    Read the article

  • LINQ to SQL: ExecuteQuery not working when performing a parameterized query.

    - by ajbeaven
    I have a weird problem with ExecuteQuery in that it isn't working when performing a parameterized query. The following returns 1 record: db.ExecuteQuery<Member>(@"SELECT * FROM Member INNER JOIN aspnet_Users ON Member.user_id = aspnet_Users.UserId WHERE [aspnet_Users].[UserName] = 'Marina2'"); However, the parameterized version returns no results: db.ExecuteQuery<Member>(@"SELECT * FROM Member INNER JOIN aspnet_Users ON Member.user_id = aspnet_Users.UserId WHERE [aspnet_Users].[UserName] = '{0}'", "Marina2"); What am I doing wrong?

    Read the article

  • Coding without Grock. Is it wrong?

    - by OldCurmudgeon
    Should a professional programmer allow themselves to write code without completely understanding the requirements? In my 30+ years as a programmer I must have written many thousands of lines of code without completely understanding what is required of me at the time. In most cases the results were rubbish that should have been discarded. Every other industry that employs professionals has systems to root out such behavior. Ours does not. Is this right?

    Read the article

  • Regex matching wrong strings

    - by Joe Smalley
    I have this PHP/SQL query: $sql = sprintf("SELECT * FROM %sCubeCart_filemanager WHERE filepath REGEXP '%s[\\/\\\\][^\\/\\\\]+$' AND type = '%d' AND disabled = '0' ORDER BY filepath ASC %s", $this->_config['dbprefix'], str_replace(array('\\','/'),'.',$folder), $type, $limit); if '$folder' == 'iha9' it is finding results like 'iha91' and 'iha99' too. Something is wrong with the regular expression, but I don't know how they work, can anyone help?!

    Read the article

  • Sorting numbers in string format with Python

    - by prosseek
    I have a list that has some chapter numbers in string. When I sort the keys using keys function, it gives me wrong results. keys = ['1.1', '1.2', '2.1', '10.1'] keys.sort() print keys ['1.1', '1.2', '10.1', '2.1'] How can I use the sort function to get ['1.1', '1.2', '2.1', '10.1'] What if the array has something like this? ['1.1.1', '1.2.1', '10.1', '2.1'] - ['1.1.1','1.2.1','2.1','10.1']

    Read the article

  • C precision of double: compiler dependent?

    - by yCalleecharan
    Hi,on my 32-bit machine (with an Intel T7700 duo core), I have 15 precision digits for both double and long double types for the C language. I compared the parameters LDBL_DIG for long doubles and DBL_DIG for doubles and they are both 15. I got these answers using MVS2008. I was wondering if these results can be compiler dependent or do they just depend on my processor? Thanks a lot...

    Read the article

  • Find Month difference in php?

    - by Karthik
    Is there anyway to find the month difference in php? I have the input of from date 2003-10-17 and todate 2004-03-24. I need the results how many month is there within these two days. Say if 6 months, i need the output in months only. Thanks for guide me for day difference. I find the solution through mysql but i need in php. Anyone help me, Thanks in advance.

    Read the article

  • Accessing property file through batch script

    - by Farid
    Hi everyone, I'm trying to write a batch script, this script is responsible to launch a jar with one parameters. This parameter indicate to my jar wich property file to use in order to setup some configuration. Then the script will zip the results produced by the jar and send them to a location. But in order to set the name of the zip file I would need to be able to read the property file directly from the batch, is there a way to do so ? Thanks and regards, F

    Read the article

< Previous Page | 214 215 216 217 218 219 220 221 222 223 224 225  | Next Page >