U
U
user.2019-02-12 16:19:57
PHP
user., 2019-02-12 16:19:57

How can I use the GPU in all calculations along with the CPU search in txt files?

Good afternoon,
tell me how can I use the power of my graphics card to search in text files? There are a lot of files, the search is required to be carried out as quickly as possible.

Answer the question

In order to leave comments, you need to log in

10 answer(s)
W
WQP, 2016-08-06
@3dben

We need a controller (PHP) that will accept a request (AJAX) and issue data (JSON). Suppose there is an ajax.php file and a function renderMapthat will plot points on the map
. Next, two handlers (JQUERY):
1) Loads a list of cities by passing ajax.php GET request.
Request: site.ru/ajax.php?type=get_cities
Result ["moscow","perm","samara"]
2) Loads the list of points for the map by passing ajax.php GET request.
Request: site.ru/ajax.php?type=get_marks&city=moscow
Result {"count":1,"marks":{"3758":"55.7146,37.6470"}}
Well, after the second request, call the callback to the renderMap
PS function For those who say "it was necessary to specify everything through the ID, etc." - yes, that's right, but it will be more difficult for a person to understand this than as I wrote above

A
Alexey Skobkin, 2016-08-06
@skobkin

It's simple: they want to see primitive work with the frontend and backend from you. They want to see how you load data on an event into the second list via AJAX and how you process all this in the backend.

S
Saboteur, 2019-02-12
@saboteur_kiev

Are you sure that the problem is in the CPU, and not in the speed of reading the file from the disk?
Especially considering that there are a lot of files?
The GPU is a rather specific thing, the meaning of using it for such an operation is not very visible.

A
Artem @Jump, 2019-02-12
curated by the

How can I use the GPU in all calculations along with the CPU search in txt files?
Of course you can use it.
Just what exactly is the GPU going to do???
The GPU can count hundreds of processors at the same time, they will click like nuts on floating point operations, and that's it. other than that, she can't do anything.
What exactly do you need to count?
You seem to have a search in files - there are practically no calculations there. There is nothing to count.
There are a lot of files, the search is required to be carried out as quickly as possible.
Means it is necessary to build an index.

A
Adamos, 2019-02-12
@Adamos

search is required to be carried out as quickly as possible

This is done by indexing the files (once) and searching the index, not the files. Yandex somehow even made a desktop application that implemented such a search. Although in Windows, starting with XP, theoretically there is a built-in.

P
pfg21, 2019-02-12
@pfg21

find/make a text search algorithm using the GPU and apply it in your tasks.
I'm not sure what you will find, because the GPU is focused on slightly different tasks (more mathematical).
but try.

V
vlarkanov, 2019-02-12
@vlarkanov

It seems to me, business rests against I/O, instead of percents. And to find out for sure, remove the load metrics of the processor, memory, percentage of disk usage (not volume, of course, but what is called busy in atop)

S
Sergey Karbivnichy, 2019-02-12
@hottabxp

Local search engine
- Just what you need.

S
SOTVM, 2019-02-12
@sotvm

Recoll

D
Dmitry Aleksandrov, 2019-02-12
@jamakasi666

The GPU can not be used for this task in any way. But you can do it very quickly if you have hands and a head and the following:
1) An extremely fast disk, even better if it is a ram disk in a very fast RAM
2) multi-core percent.
3) software in which extremely understanding people took into account all the plugs, context switches between cores, the number of calls to unnecessary system apis, found the fastest option for finding matches (regular or conditions) and many other subtleties.
In your case, plugging in 99% will already be just at the drive stage. it is unlikely to provide such a speed to utilize even an average percentage, and even with an average scall program.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question